/* =========================
   FONTS
========================= */
@font-face {
  font-family: 'Inknut Antiqua';
  src: url('../fonts/InknutAntiqua-Regular.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Inknut Antiqua';
  src: url('../fonts/InknutAntiqua-Bold.ttf') format('truetype');
  font-weight: 700;
}
@font-face {
  font-family: 'Inknut Antiqua';
  src: url('../fonts/InknutAntiqua-ExtraBold.ttf') format('truetype');
  font-weight: 800;
}

/* =========================
   RESET
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* =========================
   BODY (KIOSK SAFE)
========================= */
body {
    width: 100vw;
    height: 100vh;
    background: #000;
    overflow: hidden;
    font-family: 'Inknut Antiqua', serif;
}

/* =========================
   SCREEN CONTROL
========================= */
.screen {
    width: 100%;
    height: 100%;
    position: relative;
    display: none;
}

.screen.active {
    display: block;
    animation: screenFade 0.8s ease;
}

/* =========================
   BACKGROUND IMAGE (NON-LOADING)
   ❌ no crop
   ✅ kiosk-safe
========================= */
.screen.with-bg {
    background-image: url('../image/bg-main.webp');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover; /* VERY IMPORTANT */
    background-color: #000;
}

/* =========================
   FADE ANIMATION
========================= */
@keyframes screenFade {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================
   TOP & BOTTOM LINES
========================= */
.top-line,
.bottom-line {
    position: absolute;
    left: 0;
    width: 100%;
    z-index: 10;
    pointer-events: none;
}

.top-line { top: 0; }
.bottom-line { bottom: 0; }

/* =========================
   LOADING SCREEN
========================= */
.loader-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, 80%);
    text-align: left;
}

/* =========================
   LOADING BAR
========================= */
.loader-boxes {
    display: flex;
    gap: 18px;
    border: 2px solid #3BFB9E;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 14px;
}

.loader-boxes span {
    width: 22px;
    height: 32px;
    background: #3BFB9E;
    opacity: 0.2;
    border-radius: 5px;
    animation: pulse 1.2s infinite ease-in-out;
}

/* Animation Delay */
.loader-boxes span:nth-child(1) { animation-delay: 0s; }
.loader-boxes span:nth-child(2) { animation-delay: 0.15s; }
.loader-boxes span:nth-child(3) { animation-delay: 0.3s; }
.loader-boxes span:nth-child(4) { animation-delay: 0.45s; }
.loader-boxes span:nth-child(5) { animation-delay: 0.6s; }
.loader-boxes span:nth-child(6) { animation-delay: 0.75s; }

/* =========================
   LOADING TEXT
========================= */
.loading-text {
    color: #ffffff;
    font-size: 14px;
    letter-spacing: 3px;
}

/* =========================
   LOADING ANIMATION
========================= */
@keyframes pulse {
    0% { opacity: 0.2; }
    50% { opacity: 1; }
    100% { opacity: 0.2; }
}

/* =========================
   INSTALL SCREEN
========================= */
.install-wrapper {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    text-align: center;
    animation: screenFade 0.8s ease;
}

/* 🔥 FIXED TITLE */
.install-text {
    font-size: 35px;
    line-height: 1.4;
    letter-spacing: 1.5px;
    color: #ffffff;
    font-weight: 400;
    text-shadow: 0 0 8px rgba(59, 251, 158, 0.35);
    max-width: 80%;
}

/* =========================
   NEON BUTTON
========================= */
.neon-btn {
    display: flex;
    font-size: 18px;
    border-radius: 12px;
    background-image: url(../image/button-back.webp);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-color: transparent;
    color: #000;
    border: none;
    cursor: pointer;
    font-weight: 700;
    min-width: 280px;
    min-height: 90px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    font-family: 'Inknut Antiqua', serif;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
/* .neon-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 0 20px rgba(59, 251, 158, 0.9);
} */
/* =========================
   PASSWORD SCREEN
========================= */

.bg-screen {
    background-image: url('../image/bg-main.webp');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover; /* VERY IMPORTANT */
}
.center-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    text-align: center;
}
#password-screen .center-box {
    width: 42%;
}   
.password-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    text-align: center;
    width: 42%;
}

/* Title */
.password-title {
    font-size: 32px;
    color: #ffffff;
    letter-spacing: 2px;
    text-shadow: 0 0 12px rgba(0,0,0,0.8);
}

/* Input */
.password-input {
    width: 100%;
    padding: 8px 25px;
    font-size: 22px;
    text-align: left;
    border-radius: 10px;
    border: 2px solid #3BFB9E;
    background: transparent;
    color: #fff;
    outline: none;
    letter-spacing: 6px;
    font-family: 'Inknut Antiqua', serif;
}

/* Error */
.error-text {
    color: #ff4d4d;
    font-size: 14px;
    letter-spacing: 1px;
    display: none;
}
.password-input::placeholder {
    color: #fff;
    letter-spacing: 1px;
}
.status-icon {
    width: 90px;
    margin-bottom: 20px;
}

/* STATUS TEXT */
.status-text {
    font-size: 35px;
    color: #fff;
    letter-spacing: 1px;
}
div#error-screen .center-box {
    gap: 2px;
}

/* LOADER */
.spin-loader {
    width: 80px;
    animation: spin 1.2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.top-actions {
    position: absolute;
    top: 30px;
    right: 40px;
    display: flex;
    gap: 15px;
    z-index: 20;
    align-items: center;
}
.emergency-btn {
    display: flex;
    font-size: 18px;
    border-radius: 12px;
    background: url(../image/emergency-button.webp) no-repeat center;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-color: transparent;
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 700;
    min-width: 280px;
    min-height: 90px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    font-family: 'Inknut Antiqua', serif;
    justify-content: center;
    align-items: center;
}

.language-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid #3BFB9E;
    border-radius: 12px;
    padding: 40px 90px;
    width: 32%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: panelIn 0.4s ease;
    justify-content: center;
    align-items: center;
}

/* hidden state */
.language-panel.hidden {
    display: none;
}

/* =========================
   LANGUAGE BUTTONS
========================= */
.lang-btn {
    display: flex;
    font-size: 18px;
    border-radius: 12px;
    background-image: url(../image/button-back.webp);
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    color: #000;
    border: none;
    cursor: pointer;
    font-weight: 700;
    width: 218px;
    min-width: 218px;
    min-height: 58px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    font-family: 'Inknut Antiqua', serif;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    position: relative;
    gap: 15px;
}
.lang-btn img {
    width: 24px;
}
.lang-btn:hover {
    transform: scale(1.04);
}
.lang-btn .lang-check {
    height: 24px;
    width: 24px;
    display: none;
    pointer-events: none;
}

.lang-btn.selected .lang-check {
    display: block;
}

/* =========================
   PANEL ANIMATION
========================= */
@keyframes panelIn {
    from {
        opacity: 0;
        transform: translate(-50%, -55%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}
/* =========================
   CHOOSE AVATAR POPUP
========================= */

.avatar-popup-wrapper {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
.avatar-popup-box {
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid #3BFB9E;
    border-radius: 16px;
    padding: 40px 50px;
    min-width: 420px;
    min-height: 260px;
    display: flex;
    flex-direction: column;     
    justify-content: center;
    align-items: center;
    gap: 22px;                
    animation: avatarFadeIn 0.35s ease;
    box-shadow: 0 0 35px rgba(59, 251, 158, 0.35);
    backdrop-filter: blur(6px);
}
.avatar-list {
    display: flex;
    gap: 24px;
}
.avatar-item {
    width: 90px;    
    height: 90px;
    border-radius: 50%;
    border: 3px solid #3BFB9E;
    background: #fff;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.avatar-item img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}
.avatar-item:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(59, 251, 158, 0.8);
}
.avatar-item.selected {
    border-color: #3BFB9E;
    box-shadow:
        0 0 12px rgba(59, 251, 158, 0.9),
        0 0 25px rgba(59, 251, 158, 0.7),
        inset 0 0 10px rgba(59, 251, 158, 0.6);
    background: #3BFB9E;
    transform: scale(1.12);
}
.avatar-title {
    font-size: 18px;
    line-height: 1.4;
    letter-spacing: 1.5px;
    color: #ffffff;
    font-weight: 400;
    text-shadow: 0 0 8px rgba(59, 251, 158, 0.35);
    max-width: 80%;
    margin: 20px auto 0px auto;
}
@keyframes avatarFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.avatar-title.hidden {
    display: none;
}
.avatar-confirm-btn {
    display: none;
    margin-top: 10px;
}
.avatar-confirm-btn.active {
    display: flex;
}
/* =========================
   GENERATE KIOSK ID
========================= */
#kiosk-id-screen .status-text {
    font-size: 32px;
    letter-spacing: 2px;
    margin-bottom: 25px;
    text-shadow: 0 0 12px rgba(59, 251, 158, 0.5);
}
/* =========================
   START GAME SCREEN
========================= */
.player-info {
    position: absolute;
    top: 40px;
    left: 2%;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 15;
}

.player-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 3px solid #3BFB9E;
    box-shadow: 0 0 12px rgba(59, 251, 158, 0.8);
    background-color: #3BFB9E;
}

.player-name {
    font-size: 16px;
    letter-spacing: 1.5px;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(59, 251, 158, 0.4);
}
.top-bar {
  position: absolute;
  top: 20px;
  left: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.player {
    position: absolute;
    top: 40px;
    left: 2%;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 15;
}
.question-box {
  position: absolute;
  top: 25%;
  left: 3%;
  /* transform: translate(-50%, -50%); */
  width: 85%;
  text-align: center;
}

#question-text {
  font-size: 28px;
  margin-bottom: 30px;
  animation: fadeSlide 0.6s ease;
}

.options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.option-btn {
  background: url('../image/option-back.webp') no-repeat center/cover;
  border: none;
  height: 60px;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
}

.option-btn:hover {
  transform: scale(1.04);
}

.option-btn.selected {
  box-shadow: 0 0 25px #3BFB9E;
  transform: scale(1.08);
}

.exit-btn {
  position: absolute;
  bottom: 30px;
  right: 40px;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* =========================
   QUESTION SCREEN ELEMENTS
========================= */

/* Circular Timer */
.timer-wrapper {
    width: 70px;
    height: 70px;
    border: 4px solid #3BFB9E;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
}

.timer-text {
    font-size: 24px;
    font-weight: 800;
    color: #3BFB9E;
}

/* Mission Badge (Slanted Design) */
.mission-badge {
    background: #3BFB9E;
    color: #000;
    padding: 8px 25px;
    font-weight: 800;
    font-size: 16px;
    clip-path: polygon(15% 0%, 100% 0%, 85% 100%, 0% 100%);
    text-transform: uppercase;
}

/* Question Styling */
.question-title {
    color: #ffffff;
    text-align: left;
    font-size: 26px;
    margin-bottom: 40px;
    line-height: 1.4;
    text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* Options Container */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    margin-top: 45px;
    width: 75%;
}

/* Option Button Styling */
.option-btn-custom {
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: end;
    gap: 22px;
    padding-left: 45px;
    cursor: pointer;
    min-height: 85px;
    width: 100%;
    font-family: 'Inknut Antiqua', serif;
    font-weight: 700;
    font-size: 15px;
    color: #000;
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    background-color: transparent;
}
.options-grid .option-btn-custom:nth-child(1) {
    background-image: url('/kiosk/image/0.webp');
}
.options-grid .option-btn-custom:nth-child(2) {
    background-image: url('/kiosk/image/1.webp');
}
.options-grid .option-btn-custom:nth-child(3) {
    background-image: url('/kiosk/image/2.webp');
}
.options-grid .option-btn-custom:nth-child(4) {
    background-image: url('/kiosk/image/3.webp');
}
.options-grid .option-btn-custom:nth-child(5) {
    background-image: url('/kiosk/image/4.webp');
}
.option-btn-custom:hover {
    transform: scale(1.03);
    filter: brightness(1.05);
}
.option-btn-custom.selected {
    transform: scale(1.08);
    /* box-shadow:
        0 0 15px rgba(59, 251, 158, 0.8),
        0 0 35px rgba(59, 251, 158, 0.6); */
}
.option-letter {
    background: #3BFB9E;
    color: #000;
    min-width: 70px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    border-radius: 0 35px 35px 0;
}
.option-label {
    flex: 1;
    text-align: center;
    font-size: 15px;
}
/* Small Exit Button */
.btn-exit-small {
    position: absolute;
    bottom: 40px;
    right: 40px;
}

/* =========================
   MISSION COMPLETE SCREEN
========================= */
.mission-status {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.mission-icon {
    width: 60px;
}
.mission-title {
    color: #ffffff;
    font-size: 30px;
    letter-spacing: 1.2px;
    text-shadow: 0 0 10px rgba(59, 251, 158, 0.5);
    font-weight: 500;
}

.mission-text {
    color: #ffffff;
    font-size: 30px;
    line-height: 50px;
    text-align: center;
    margin-bottom: 35px;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
    width: 50%;
}

.message-box{
    background: rgba(0, 0, 0, 0.65);
    border: 2px solid #3BFB9E;
    border-radius: 14px;
    padding: 75px 35px;
    max-width: 75%;
}
.message-box p{
    color:#fff;
    font-size:22px;
    line-height:1.6;
    text-align:center;
    letter-spacing:1px;
}
/* ================= EXIT CONFIRM POPUP ================= */

.exit-popup-wrapper {
    position: absolute;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80%;
    left: 50%;
    transform: translateX(-50%);
}

.exit-popup-box {
    background: rgba(0, 0, 0, 0.75);
    border: 2px solid #2cffb3;
    border-radius: 14px;
    padding: 40px 60px;
    text-align: center;
    width: 60%;
}

.exit-text {
    color: #ffffff;
    font-size: 22px;
    line-height: 1.5;
    margin-bottom: 30px;
}

.exit-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.neon-btn.danger {
    display: flex;
    font-size: 18px;
    border-radius: 12px;
    background: url(../image/emergency-button.webp) no-repeat center;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    background-color: transparent;
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 700;
    min-width: 280px;
    min-height: 90px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    font-family: 'Inknut Antiqua', serif;
    justify-content: center;
    align-items: center;
}
/* =========================
   EMERGENCY MESSAGE BOX
========================= */
.emergency-message-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    text-align: center;
}

/* Emergency text spacing */
.emergency-message-box .status-text {
    font-size: 26px;
    line-height: 1.5;
    text-align: center;
}

/* Loader animation already exists
.spin-loader { ... } */
/* Add this to your kiosk.css */
.language-confirm-btn {
    margin-top: 20px;
    display: none; /* Hidden by default */
}

.language-confirm-btn.active {
    display: block; /* Shows up when a language is clicked */
}

.bottom-right-action {
    position: absolute;
    right: 40px;
    bottom: 30px;
}