/* ===============================
   GLOBAL
================================= */

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  margin: 0;
  padding: 0;
  background: #050816;
  color: #f9fafb;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.game-wrapper {
  width: 100%;
  max-width: 430px;
  background: #0b1120;
  border-radius: 18px;
  padding: 20px 18px 24px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

strong {
  color: #f9fafb;
}

/* ===============================
   HEADER
================================= */

.header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.title {
  font-size: 1.3rem;
  font-weight: 700;
}

/* Old badge removed from UI */
.badge {
  display: none !important;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.episodes-btn,
.settings-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.75rem;
  cursor: pointer;
}

/* ===============================
   EPISODE INFO
================================= */

.episode-info {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1d4ed8, #db2777);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.episode-number {
  font-size: 1rem;
  font-weight: 700;
}
.episode-language {
  font-size: 0.85rem;
}

.episode-type {
  margin-top: 6px;
  display: inline-block;
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.episode-type.normal {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #dbeafe;
}
.episode-type.cash {
  background: rgba(22, 163, 74, 0.2);
  border: 1px solid rgba(22, 163, 74, 0.5);
  color: #bbf7d0;
}
.episode-type.boss {
  background: rgba(234, 179, 8, 0.3);
  border: 1px solid rgba(234, 179, 8, 0.5);
  color: #fef08a;
}

/* ===============================
   CHALLENGE TEXT
================================= */

.challenge-text {
  margin-top: 12px;
  line-height: 1.4;
  opacity: 0.9;
  font-size: 0.9rem;
}

/* Yellow highlight for episode letters (RAIN, STAR, etc.) */
.episode-letters {
  color: #fde047;
  font-weight: 700;
}

/* ===============================
   ANSWER INPUT / STATUS / HINT
================================= */

#answerInput {
  width: 100%;
  padding: 12px 14px;
  margin-top: 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #020617;
  color: #fff;
  font-size: 1rem;
  caret-color: transparent; /* virtual keyboard only */
}

.status {
  margin-top: 1px;
  min-height: 18px;
  font-size: 0.99rem;
}
.status.ok {
  color: #bbf7d0;
}
.status.error {
  color: #fecaca;
}
.status.info {
  color: #cbd5e1;
}

.hint {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #9ca3af;
  min-height: 20px;
}

/* Cash timer text */
.cash-timer {
  margin-top: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #c7d2fe;
}
.cash-timer.red {
  color: #f87171;
}

/* ===============================
   WORD LISTS (Required / Extra)
================================= */

#foundWordsContainer {
  margin-top: 1px;
  padding: 15px;
  background: #101218;
  border-radius: 10px;
}

#foundWordsContainer h3 {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #ffd94a;
}

#requiredWordsList,
#extraWordsList {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

#requiredWordsList li,
#extraWordsList li {
  background: #1a1d25;
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: 6px;
  color: #ffffff;
  font-size: 15px;
}

/* Extra words show a single clean bullet */
#extraWordsList li::before {
  content: "";
  color: #f9fafb;
}

/* Required words: engine already prepends "✓ ", so no bullet here */

/* ===============================
   
    (WOW EDITION)
================================= */

.wallet {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed #475569;
  display: flex;
  justify-content: center;   /* center everything */
  align-items: center;
  gap: 18px;                 /* space between pill, button, pill */
  font-size: 0.9rem;
}


.wallet label {
  display: none; /* hide 'Cash:', 'DigiTokens:' text */
}

.wallet span {
  display: flex;
  align-items: center;
}

/* Gold cash pill (left) */
#walletBalance {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #1f1f1f;
  padding: 6px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 6px rgba(250, 204, 21, 0.5);
  min-width: 90px;
  text-align: center;
}

/* Purple DigiToken pill (right) */
#tokenBalance {
  background: radial-gradient(circle at 20% 0, #f9a8ff, #7e22ce);
  color: #fdf2ff;
  padding: 6px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid rgba(147, 51, 234, 0.7);
  box-shadow: 0 0 8px rgba(129, 140, 248, 0.6);
  min-width: 80px;
  text-align: center;
}

/* Hide Calabash & BanHammer row (logic still active) */
.wallet .fun-reward {
  display: none !important;
}


/* ===============================
   MODAL BASE
================================= */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 22, 0.75);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  backdrop-filter: blur(4px);
}

.hidden {
  display: none !important;
}

.modal-content {
  background: #0b1120;
  padding: 24px 30px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  width: 85%;
  max-width: 360px;
  animation: popIn 0.3s ease-out;
}

@keyframes popIn {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-title {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.modal-btn {
  margin-top: 16px;
  padding: 10px 18px;
  background: #22c55e;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
}

.modal-btn.secondary {
  background: #111827;
  border: 1px solid #4b5563;
  color: #e5e7eb;
}

.modal-btn.small {
  margin-top: 14px;
  padding: 8px 14px;
  font-size: 0.8rem;
}

/* ===============================
   EPISODE LIST MODAL + SEASON
================================= */

.episode-list-shell {
  background: #0b1120;
  padding: 24px 20px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 90%;
  max-width: 380px;
  max-height: 90vh;
  overflow-y: auto;
}

.episode-list-header {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 6px;
}

/* Season selector button */
.season-selector-btn {
  background: #1e293b;
  border: 1px solid #475569;
  color: #f1f5f9;
  padding: 8px 14px;
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
}

.season-dropdown {
  position: absolute;
  top: 70px;
  left: 20px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  width: 160px;
  padding: 6px 0;
  z-index: 1000;
}

.season-option {
  padding: 10px 14px;
  color: #e2e8f0;
  cursor: pointer;
  font-size: 0.9rem;
}

.season-option:hover {
  background: #1e293b;
}

/* Centered episode layout */
.episode-center-list {
  width: 100%;
  text-align: center;
  padding: 10px 0;
}

.episode-block {
  margin: 20px 0;
}

.episode-block hr {
  border: 0;
  border-top: 1px solid #334155;
  margin: 18px 0;
}

.episode-number-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8fafc;
}

.episode-mode-status {
  font-size: 0.95rem;
  color: #cbd5e1;
  margin-top: 4px;
}

/* ===============================
   SETTINGS MODAL
================================= */

.settings-content {
  max-width: 360px;
  text-align: left;
}

.settings-subtitle {
  margin: 12px 0 6px;
  font-size: 0.9rem;
}

.settings-option {
  margin-top: 4px;
  font-size: 0.9rem;
}

/* ===============================
   VIRTUAL KEYBOARD
================================= */

.virtual-keyboard {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  align-items: center;
}

.vk-row {
  display: flex;
  gap: 6px;
  justify-content: center;
}

.vk-key {
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #f9fafb;
  color: #020617;
  font-weight: 600;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.6);
}

.vk-key.special,
.vk-key.submit-key {
  height: 38px;
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.85rem;
}

.vk-key.submit-key {
  background: #22c55e;
  border-color: #16a34a;
  color: #022c22;
  min-width: 130px;
  font-weight: 700;
}

.vk-key.glow {
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
  border-color: rgba(56, 189, 248, 1);
}

/* ===============================
   BUTTON ROW UNDER KEYBOARD
================================= */

.btn-row {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.btn-tertiary {
  background: #111827;
  border: 1px dashed #4b5563;
  color: #e2e8f0;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-secondary {
  background: #1e40af;
  border: 1px solid #3b82f6;
  color: #e2e8f0;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
}

/* ===============================
   EPISODE COMPLETE MODAL
================================= */

#episodeCompleteModal .modal-content {
  /* inherits base modal-content styles */
  max-width: 320px;
}

#episodeCompleteModal .modal-title {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: #fff;
}


/* ===============================
    POWER OFF OVERLAY
================================= */
.poweroff-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999; /* Above everything */
}

#powerOffIcon {
  width: 120px; /* adjust size as needed */
  margin-bottom: 20px;
}

.poweroff-content {
  background: rgba(20, 20, 20, 0.9);
  padding: 40px 28px;
  border-radius: 12px;
  text-align: center;
  width: 90%;
  max-width: 380px;
  color: #fff;
}

.poweroff-content .modal-title {
  font-size: 28px;
  margin-bottom: 10px;
  font-weight: 700;
}

.poweroff-content p {
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 25px;
  color: #ccc;
}

.poweroff-content .modal-btn {
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 600;
  background: #ffffff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.poweroff-content .modal-btn:hover {
  opacity: 0.85;
}




/* ===============================
   CONFETTI
================================= */

#confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2000;
}

.confetti {
  position: absolute;
  width: 8px;
  height: 14px;
  background-color: hsl(var(--hue), 80%, 60%);
  top: -20px;
  opacity: 0.9;
  animation: fall 1.6s linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotateZ(360deg);
  }
}

/* ============================================================
   WORD BOSS — FIXED SCROLL AREA
   Combined Required + Extra Words
============================================================ */

/* Outer container stays fixed — UI never shifts */
#foundWordsContainer {
  max-height: 300px;
  overflow: hidden;
}

/* Inner scrollable area */
.word-scroll-box {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
  margin-top: 10px;
}

/* Premium Minimal Neon Scrollbar (Option A) */
.word-scroll-box::-webkit-scrollbar {
  width: 6px;
}

.word-scroll-box::-webkit-scrollbar-thumb {
  background: #60a5fa; /* neon blue */
  border-radius: 20px;
  box-shadow: 0 0 6px rgba(96,165,250,0.6);
}

.word-scroll-box::-webkit-scrollbar-track {
  background: transparent;
}



/* ============================================================
   All about switch off Button
============================================================ */
.switch-off-btn {
  background: #111827;
  border: 1px dashed #4b5563;
  color: #e2e8f0;
  padding: 8px 16px;
  border-radius: 10px;   /* rectangle with slightly rounded corners */
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.switch-off-btn:hover {
  background: #1f2937;
}

/* ============================================================
   Footer Copyright Label
============================================================ */
.footer-copyright-label {
    /* Change display to block to occupy full width */
    display: block; 
    
    /* Set left and right margins to auto to center the block element */
    margin-left: auto;
    margin-right: auto;

    /* >>> THIS ADDS SPACE ABOVE THE TEXT <<< */
    margin-top: 20px; 
    
    /* Text-align center is still helpful for ensuring the text is centered within the block's width */
    text-align: center; 

    /* Other styles remain the same */
    font-family: sans-serif; 
    font-size: 14px; 
    font-weight: normal; 
    color: #f9a8ff; 
    padding: 5px 0;
}

/* ============================================================
   URL LABEL
============================================================ */
.url-label {
    /* Change display to block to occupy full width */
    display: block; 
    
    /* Set left and right margins to auto to center the block element */
    margin-left: auto;
    margin-right: auto;

    /* >>> THIS ADDS SPACE ABOVE THE TEXT <<< */
    margin-top: 1px; 
    
    /* Text-align center is still helpful for ensuring the text is centered within the block's width */
    text-align: center; 

    /* Other styles remain the same */
    font-family: sans-serif; 
    font-size: 14px; 
    font-weight: normal; 
    color: #aaaaaa; 
    padding: 5px 0;
}

/* ============================================================
   URL LINK
============================================================ */
.url-link {
    text-decoration: none; /* Removes the default underline */
    color: inherit;      /* Inherits text color from parent or default */
    cursor: pointer;     /* Ensures the cursor changes to a hand pointer */
    display: block;      /* Makes the link a block element to fill the div's space */
}

.url-label:hover {
    /* Add hover effects for user feedback, e.g., background change */
    background-color: #1a1a1a; 
}