/* ===================== Root Colors & Fonts ===================== */
:root {
  --primary: #f5f5dc;
  --secondary: #336f99;
  --accent: #ffb929;
  --accent-soft: #c49e3f;
  --shadow: 4px 4px 0px #000;
  --input-bg: rgba(255, 255, 255, 0.5);
  --input-focus: rgba(212, 175, 55, 0.3);
  --font-arabic: 'Noto Kufi Arabic', 'Amiri', 'Scheherazade', 'Segoe UI', Tahoma, sans-serif;
  --font-latin: 'Segoe UI', Tahoma, sans-serif;
}

/* ===================== Reset ===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-arabic);
  border-radius: 10px 20px;
}

/* ===================== hide ===================== */
.hidden {
  display: none !important;
  height: 0;
}

.invisibile {
  visibility: hidden !important;
  height: 0 !important;
}

/* ===================== Body ===================== */
body {
  text-align: center;
  background: #2e5cb4;
  color: var(--primary);

  display: flex;
  justify-content: center;
  align-items: center;

  min-height: 100vh;
  width: 100%;

  font-size: 16px;
  line-height: 1.4;

  overflow-x: auto; 
}
body.splashStudio {
  background: #7d4304;
}
body.splashGame {
  background: #031162;
}
/* ===================== Headings ===================== */
h1,
h2,
h3 {
  font-weight: 200;
  letter-spacing: 2px;
  margin: 10px 0;
}

/* ===================== Inputs & Selects ===================== */
input,
select {
  width: 90%;
  max-width: 280px;
  padding: 10px;
  border: 2px solid var(--primary);
  outline: none;
  font-size: 14px;
  text-align: center;
  background: var(--input-bg);
  color: var(--primary);
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 5px var(--input-focus);
}

input::placeholder {
  color: #fff8; /* semi-bright white */
  opacity: 1;   /* ensure browser uses it */
}
option {
  color: var(--accent);
  background: var(--secondary);
}
/* ===================== Buttons ===================== */
button {
  padding: 8px 18px;
  border: none;
  background-color: var(--accent);
  color: var(--secondary);
  font-weight: 500;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  font-family: var(--font-arabic);
  white-space: nowrap;
  border-radius: 8px;
  
}

button:hover {
  background-color: var(--accent-soft);
  box-shadow: 2px 2px 0px var(--primary);
  transform: translate(-2px, -2px);
}

button:disabled {
  background-color: var(--accent-soft);
  opacity: 0.6;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}
.menuCard:has(i.fa-solid.fa-reply){
  position: absolute;
  left: 0;
  border-radius: 12px !important;
}
i.fa-solid.fa-reply{
  padding: 2px;
  font-size: 32px;
  background-color: var(--accent);
  color: var(--secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  font-family: var(--font-arabic);
  border-radius: 12px !important;
  font-family: "Font Awesome 6 Free" !important;

}
i.fa-solid.fa-reply:hover{
  background-color: var(--accent-soft);
  box-shadow: 2px 2px 0px var(--primary);
  transform: translate(-2px, -2px);
}
.splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #7d4304; /* or your theme color */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.splash img {
  max-width: 80%;
  max-height: 80%;
}

#splashGame{
  background-color: #031162;
}
/* ===================== Game Title ===================== */
/* Title on right, button on left */
#gameTitleAndReset {
  display: flex;
  justify-content: space-between; /* push items to edges */
  align-items: center; /* vertical alignment */
  width: 100%;
}

#menuBtn {
  font-size: 18px;
  padding: 0px 12px;
  background: var(--accent);
  color: var(--secondary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  height: 30px;
}

#menuBtn:hover {
  background: var(--accent-soft);
  transform: translate(-2px, -2px);
  box-shadow: 2px 2px 0 var(--primary);
}
#gameTitle,#menuGameTitle {
  color: var(--accent); /* #ffb929 */
  font-size: 28px;
  font-weight: 600;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5); /* subtle depth */
  text-align: right;
}

/* ===================== Top Left Controls ===================== */

.menuDivider{
  height:2px;
  background:var(--primary);
  margin:25px 0;
  opacity:0.4;
}

.menuControls{
  grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
    min-height: 200px; /* or whatever looks nice */
  align-content: start; /* makes items start from top */
}

.smallCard{
  font-size: 1em;          /* 👈 KEEP consistent */

  min-height: 52px;        /* 👈 match buttons */
  padding: 0 12px;         /* 👈 horizontal only */

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;

  box-sizing: border-box;

}
.menuCard {
  cursor: pointer;
}

.menuCard:hover {
  cursor: pointer;
}
#playerCountSelect .menuCard {
  transition: color 0.2s ease;
}

/* hover (optional but very subtle) */
#playerCountSelect .menuCard:hover {
  color: var(--accent);
}

/* selected state */
#playerCountSelect .menuCard.selected {
  color: var(--accent);
}
/* ===== Burger Menu ===== */

#modeSelect, #newGameMenu, #gameLengthMenu, #playerSetup {
  background:var(--secondary);
  border:4px solid var(--accent);
  z-index:2000;
  position: absolute;
  width: 90%;
  max-width: 420px;

  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);

  padding: 20px;

  border-radius: 16px;

  box-sizing: border-box;
}
#quickPlayerNames{
  z-index:2000;
  position: absolute;
  width: 90%;
  max-width: 420px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  border-radius: 16px;
  box-sizing: border-box;
}
#modeSelect{
  margin-top: 2%;
}
#universalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 35, 60, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.universalBox {
  background: var(--secondary);
  border: 3px solid var(--primary);
  border-radius: 15px;
  padding: 30px 40px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh; /* Prevents overflow on small screens */
  display: flex;
  flex-direction: column;
  text-align: right;
  color: var(--primary);
  line-height: 1.5;
}

.universalBox h2 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--accent);
}

/* Scrollable area for long Privacy/Info text */
.universalContent {
  overflow-y: auto;
  flex-grow: 1;
  margin-bottom: 10px;
  padding-left: 10px; /* Space for scrollbar */
}

.universalContent ul {
  margin: 15px 0;
  padding-right: 20px;
  list-style-type: disc;
}

.universalBox button {
  align-self: center;
  margin-top: 10px;
  background: var(--accent);
  color: var(--secondary);
  border: none;
  padding: 10px 25px;
  cursor: pointer;
  border-radius: 10px;
  font-weight: bold;
}

.universalBox button:hover {
  background: var(--accent-soft);
}
#quickPlayerNamesHeader{
     display: grid;
    grid-template-columns: 90% 10%;
}
/* ===================== Round Setup Wizard ===================== */
#roundSetupGrid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  margin: 10px 0;
}

.roundRow>div {
  width: 100%;
  padding: 15px;
  background-color: var(--secondary);
  border: 2px solid var(--primary);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.roundRow>div:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0px var(--primary);
}

.roundRow label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--primary);
}
/* Softer input error styling */
.input-error {
  color: #ff9999; /* softer red for text */
  font-size: 0.9em;
  margin-top: 4px;
  min-height: 1.2em; /* reserve space to avoid layout jump */
  border: 2px solid #ff9999 !important; /* softer red border */
  box-shadow: 0 0 6px rgba(255, 153, 153, 0.5); /* gentle glow instead of harsh */
  background-color: rgba(255, 153, 153, 0.05); /* very subtle tint behind input */
  border-radius: 10px;
}

/* Optional: For error message text next to input */
.roundWordError {
  color: #ff9999; /* soft red text */
  font-weight: 600;
}
/* ===================== Buzzer ===================== */
#buzzerPanel {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin: 20px 0;
}

.buzzer {
  padding: 18px 24px;
  font-size: 1em;
  border: none;
  font-weight: 500;
  color: var(--secondary);
  background-color: var(--accent);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
}

.buzzer:active {
  transform: scale(0.9);
  box-shadow: 0 0 15px var(--accent);
}

.buzzer.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
#buzzer0{
  background-color: #ff4d4d;
}
#buzzer1{
  background-color: #ffcc00;
}
#buzzer2{
  background-color: #28a745;
}
/* ===================== Game Wrapper ===================== */
#gameWrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  padding: 24px;
  width: min(95vw, 1000px);
  max-height: 95vh;
  border-radius: 15px;
  overflow-y: auto;
}

@media (min-width: 900px) {
  #gameWrapper {
    width: 1000px;
  }
}

/* ======================== Game ========================== */
#game {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 5px;
}

#gameContents {
  display: flex;
  flex-direction: column;
}

#boardAndBtnContainer {
  display: flex;
  flex-direction: column;
  gap:10px;
}

.gameContents-keyboard {
  display: flex ;
  flex-direction: row;
} 

/* ======================== Game HUD ======================= */
#gameHud {
  display: grid;
  grid-template-columns: auto auto 1fr 1fr; /* score | skip btn | wallet | timer */
  align-items: center;
  column-gap: 20px;
}

#gameHud > div:nth-child(2) { /* container for skip button */
  display: flex;
  justify-content: center;
}

#skipBtn {
  background-color: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--secondary);
  white-space: nowrap;
  box-shadow: var(--shadow);
  font-family: var(--font-arabic);
  transition: background-color 0.3s ease;
}

#skipBtn:hover {
  background-color: var(--accent-soft);
}
@media (max-width: 600px) {
  #gameHud {
    flex-direction: column;
    align-items: center;
  }
  #game{
    margin: 0 auto;
  }
}

/* ===================== Category Banner ===================== */
.round-type {
  background-color: cornflowerblue;
  padding: 2px 4px;
  text-align: center;
}

#category {
  background-color: #bec9d1;
  color: #23365a;
  padding: 2px 4px;
  display: grid;
  grid-template-columns: 3fr 50px;
  border-radius: 15px;
}
#category span{
  font-weight: 500;
  background: #ffffff;
    color: #1f3f7a;
    border-radius: 12px;
    font-size: 20px;
}
.round-type span {
  font-weight: 100;
}

#roundGoal {
  background-color: darkgrey;
  opacity: 2;
  height: 30%;
}

/* ===================== Score Banner ===================== */
/* CSS for the pop animation */
#playerBanner {
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: scale(1);
  opacity: 1;
}

#playerBanner.pop {
  transform: scale(1.3); /* scale up */
  opacity: 1;
}
@keyframes popScale {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3); /* scale up */
  }
  100% {
    transform: scale(1);   /* scale back to normal */
  }
}
.score-banner {
  display: grid;
  grid-template-rows: auto auto;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  background-color: rgba(0,0,0,0.2);
  font-size: 16px;
  font-weight: 500;
  width: fit-content;
}

#playerName { margin: 0; }
#playerScore {
  margin: 0;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: #ffffff33;
  text-align: center;
}

#guessTimerContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 8px;
  background-color: rgba(0,0,0,0.2);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
}


/* ===================== Wheel & Pointer ===================== */
#wheelbox {
  position: fixed;
  inset: 0;
  background-color: rgba(32, 48, 74, 0.95);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  z-index: 1000;
  overflow: hidden;
  padding-top: 40px;
}

#wheelContainer {
  position: relative;
  margin: 20px auto;
  overflow: hidden;
}

#wheelCanvas {
  width: 100%;
  height: auto;
  border-radius: 50%;
  overflow: hidden;
}

#wheelPointer {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 30px;
  color: var(--accent);
  width: 0;
  height: 0;
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  border-top: 50px solid #ff4d4d;
}

#spinVowelContainer {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 2rem;
  gap: 5px;
  margin-bottom: 10px;
  width: 70%;
  margin: auto;
  justify-content:space-between ;
}

#spinVowelContainer button, #showGuessWordBtn {
  flex: 0 0 50px;     /* 👈 FIXED SIZE (controls square size) */
  width: 50px;
  height: 50px;       /* 👈 perfect square */

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 4px;
  box-sizing: border-box;

  white-space: nowrap;
  overflow: hidden;

  line-height: 1;
}
#cancelGuessBtn {
  aspect-ratio: 1 / 1;
  width: 50px;
  height: 50px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  margin: auto;

  font-size: 2em;
  line-height: 1;

  font-weight: 500;   /* 👈 match global buttons */

  white-space: nowrap;
  overflow: hidden;

  box-sizing: border-box;
  color: #b85555;
  
}

#alfanoosLettersGrid {
  display: flex;
  flex-direction: row;
  gap: 4px;
  margin-bottom: 10px;
}
#wordGuess{
  width: clamp(220px, 40vw, 420px);
  max-width: 100%;
  font-size: 1em;
  padding: 8px 10px;
  box-sizing: border-box;
  height: 52px;
  border-radius: 8px;
}
/* ===================== Overlays ===================== */
#gameOverlay{
  position: fixed;
  display: block;
    width: 100vw;
    height: 100%;
  top: 0;
  left: 0;
  background-color: #2e5cb4;
  z-index: 99;
  pointer-events: none;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  overflow: clip !important;
}

.overlay-regular { background-image: url("../img/regular_bg.webp"); }
.overlay-hunt { background-image: url("../img/hunt_bg.webp"); }
.overlay-final { background-image: url("../img/final_bg.webp"); }
.overlay-alfanoos { background-image: url("../img/alfanoos_bg.webp"); }


/* ===================== Round Result Overlay ===================== */

#resultOverlay, #cardPreview {
  position: fixed;
  inset: 0;
  background: rgba(20, 35, 60, 0.9);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1500;
}

#cardPreview {
  height: 100%;
}
.resultBox {
  background: var(--secondary);
  border: 3px solid var(--primary);
  padding: 30px 40px;
  min-width: 300px;
  max-width: 450px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resultTitle {
  font-size: 1.4rem;
  letter-spacing: 2px;
}

.resultRow {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 6px 10px;
  background: rgba(0,0,0,0.2);
}

.resultRow span:last-child {
  font-weight: bold;
  color: var(--accent);
}

.resultNextBtn {
  margin-top: 10px;
  align-self: center;
}

/* ===================== Vowel Section ===================== */
#vowelSection {
  margin-top: 10px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid #ffe066;
  display: inline-block;
}

.vowel-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.vowel-btn {
  background: #d96868;
  color: #fff;
  border: none;
  padding: 12px 18px;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.vowel-btn:hover {
  transform: scale(1.1);
  background: #ff8787;
}

/* ===================== Guess Container ===================== */
#guessContainer{
  display: flex;
  height: 2rem;
}
#guessWordContainer{
  display: flex;
  gap: 2%;
  align-items: center;
}

/* ===================== Board current guess Highlight ===================== */
.reveal-highlight{
  position:relative;
  z-index:10;
  background:#4CAF50 !important;
  color:#4CAF50 !important;
  transform:scale(1.2);
  transition:all .2s;
}

/* ===================== Wrong guess Overlay ===================== */
#wrongGuessOverlay,
#rightGuessOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: red;
  z-index: 100;
  pointer-events: none;
}

#rightGuessOverlay{
  background-color: rgba(0, 255, 0, 0.2);
  color: green;
}

/* ===================== Cards & Wallet ===================== */
.score-banner {
  display: grid;
  grid-template-rows: auto auto;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 8px;
  background-color: rgba(0,0,0,0.2);
  font-size: 16px;
  font-weight: 500;
  width: fit-content;
}

#playerName { margin: 0; }
#playerScore {
  margin: 0;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: #ffffff33;
  text-align: center;
}

@media (max-width: 600px) {
  .playerWallet .card {
    position: relative;
    width: 50%;
    height: auto;
  }
}
.shubeekCard img{
  position: relative;
  width: 20%;
}

#cardPreview img{
  
    position: absolute;
    z-index: 999;
    width: 50%;
    height: auto;

}
/* ===================== Player Inputs & Round Wizard ===================== */
#quickPlayerNames,
#roundWizard {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;           /* 👈 important */
  margin-top: 15px;
}

#quickPlayerNames input,
#roundWizard input,
#roundWizard select {
  width: 90%;
  max-width: 320px;

  height: 52px;              /* 👈 match your button height */
  min-height: 52px;

  display: flex;             /* makes it behave like a button */
  align-items: center;
  justify-content: center;

  margin: 8px auto;

  padding: 0 12px;

  font-size: 1.1em;
  font-weight: 500;

  text-align: center;

  border: none;
  border-radius: 10px;

  background: rgba(255, 255, 255, 0.12);
  color: var(--primary);

  box-sizing: border-box;

  white-space: nowrap;
}

#roundWizard button {
  margin-top: 15px;
  width: 50%;
  max-width: 150px;
  font-size: 18px;
  background: var(--accent);
  color: var(--secondary);
}

#roundWizard button:hover {
  background: var(--accent-soft);
  transform: scale(1.05);
}

/* ===================== Media Queries ===================== */
@media (min-width: 1600px) {
  body {
    font-size: 22px;
  }

  button,
  input,
  select {
    font-size: 1.2em;
  }

  #roundSetupGrid .roundRow>div {
    padding: 20px;
  }
}

/* -------------------- Shubeek Section ------------------ */
#shubeekOverlay {
   position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
  background: rgba(0,0,0);
  align-self: center;
  overflow: clip;
}

#shubeekBg {
  max-width: 70%;
  height: auto;
  cursor: pointer;
  touch-action: none;
}

.prizeCard {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.prizeCard .cardFrame {
  background: #ffd700;
  border-radius: 20px;
  padding: 40px 60px;
  text-align: center;
  font-size: 2rem;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: scaleIn 0.5s ease-out forwards;
}

@keyframes scaleIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ===================== keyboard ===================== */
#keyboardContainer {
  display: grid;
  grid-template-columns: repeat(6, 40px); /* exactly 6 columns */
  gap: 4px;
  justify-content: center; /* center grid horizontally */
  margin: 10px auto;
}

.key {
  width: 40px;
  height: 40px;
  font-size: 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: #d96868;
  color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.key:hover { background: #c75f5f; }
.key:active { background: #b85555; }
.specialKey { background: #c75c5c; font-size: 16px; }
.key-selected {
  background: #4CAF50;
}
.key-disabled {
  background: #aaa !important;
  color: #aaa !important;
  cursor: not-allowed;
  opacity: 0.6;
}
/* =============== Responsiveness =================== */
@media (max-width: 600px) {
  button { font-size: 0.9rem; padding: 6px 12px; }
  #gameWrapper { padding: 16px; }
}

/* ===================== Alert ===================== */
#customAlert {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.alertBox {
  background: var(--secondary);
  border: 3px solid var(--primary);
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  min-width: 280px;
}

#alertButtons {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.alertBtn {
  padding: 6px 14px;
  border: 2px solid var(--primary);
  background: var(--accent);
  cursor: pointer;
  border-radius: 8px;
}

.alertBtn:hover {
  background: var(--accent-soft);
}
/* Toast notification style */
.toast {
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 15px 25px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: relative;
}
.toast.show {
    opacity: 1;
}
.toast button {
    padding: 5px 15px;
    border: none;
    background: var(--accent);
    color: #000;
    border-radius: 8px;
    cursor: pointer;
}
/* ===================== Landscape Mobile = Desktop ===================== */
@media (orientation: landscape) and (max-width: 1024px) {
  #gameWrapper { width: 1000px ; padding: 24px; }
  #gameContents{ display: flex; flex-direction: column; gap: 10px; }
  #keyboardContainer { display: grid; grid-template-columns: repeat(auto-fit, minmax(40px,1fr)); width: 50%}
}
@media (orientation: landscape) and (max-width: 1024px) {
  #gameWrapper {
    width: 95vw; /* scale to 95% of viewport width */
    max-width: 1000px; /* still cap for large screens */
    padding: 24px;
  }
  #gameContents {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  #keyboardContainer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
    width: 100%; /* take full width of wrapper */
  }
}
/* ===================== Full-Screen Game Layout ===================== */

/* Ensure html and body fill viewport */
html, body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #2e5cb4;
}
body.infoPage {
  display: block;
 
}
/* ===================== Game Wrapper ===================== */
#gameWrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(10px);
    width: 95vw;
    height: 95vh;
    padding: 12px;
    border-radius: 15px;
    overflow-y: auto;
}

/* Landscape Mobile Full-Screen */
@media (orientation: landscape) and (max-width: 1024px) {
    body {
        justify-content: flex-start;
        align-items: stretch;
    }

    #gameWrapper {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        padding: 12px;
        border-radius: 0;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
}

/* ===================== Inner Containers ===================== */
#gameContents,
#boardAndBtnContainer,
#keyboardContainer,
#vowelSection{
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

/* ===================== Board / Wheel / Cards ===================== */
#wheelContainer,
#shubeekBg {
    width: 90%;
    max-width: 600px; /* optional cap */
    height: auto;
    margin: 0 auto;
    display: block;
}
#shubeekBg {
    max-width: unset; /* optional cap */

}
#cardPreview img {
min-height: 350px;
    min-width: 250px;
    width: auto;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 250 / 350;
}
/* Wheel canvas responsive */
#wheelCanvas {
    width: 100%;
    height: auto;
    border-radius: 50%;
}
#wheelContainer{
  margin: auto;
}
/* ===================== Keyboard ===================== */


/* ===================== Menu Cards / Buttons ===================== */
#spinVowelContainer button, #showGuessWordBtn {
    flex: 1 1 120px; /* flexible, min 120px */
    max-width: 100%;
    text-align: center;
}
#guessWordBtn{
  visibility: hidden !important;
  display: none !important;
}
/* ===================== Overlays ===================== */
#infoOverlay,
#resultOverlay,
#customAlert {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    overflow: hidden;
}

/* Overlay content responsive */
.infoBox, .resultBox, .alertBox, .prizeCard .cardFrame {
    width: 90%;
    max-width: 500px;
    height: auto;
    padding: 20px;
    box-sizing: border-box;
}

/* ===================== Vowel Section ===================== */
.vowel-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.vowel-btn {
    flex: 1 1 60px;
    min-width: 50px;
    font-size: 1.2rem;
}

/* ===================== Misc ===================== */


#spinVowelContainer {
    flex-wrap: wrap;
}

/* Optional: reduce padding for landscape mobile */
@media (orientation: landscape) and (max-width: 1024px) {
    #gameWrapper { padding: 8px; }
}
/* ======================== Game ========================== */
.game-view{
  margin: auto;
}
#game {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 2px;
}

#gameContents {
  display: flex;
  flex-direction: column; /* default: stacked */
  gap: 12px;
  width: 100%;
  align-items: center;
}

/* when keyboard is visible on wide screens */
.gameContents-keyboard {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

/* board area */
#boardAndBtnContainer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* keyboard area */
#keyboardContainer {
  display: grid;
  grid-template-columns: repeat(6, 40px); /* always 6 columns */
  grid-auto-rows: 40px;                   /* consistent row height */
  gap: 4px;
  justify-content: center;
  align-content: start;
  margin: 10px auto;
  flex: 0 0 auto;                         /* don't stretch weirdly */
}

/* keyboard keys */
.key {
  width: 40px;
  height: 40px;
  font-size: 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  background: #d96868;
  color: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.key:hover { background: #c75f5f; }
.key:active { background: #b85555; }

.specialKey { background: #c75c5c; font-size: 16px; }
.key-selected { background: #4CAF50; }
.key-disabled {
  background: #aaa !important;
  color: #aaa !important;
  cursor: not-allowed;
  opacity: 0.6;
}

/* tight screens: force keyboard below board */
@media (max-width: 699px) {
  #gameContents,
  .gameContents-keyboard {
    flex-direction: column;
    align-items: center;
  }

  #keyboardContainer {
    margin-top: 10px;
  }
}
@media (orientation: landscape) and (max-width: 1024px) {
  #keyboardContainer {
    grid-template-columns: repeat(6, 40px);
    width: auto;
  }
}
#gameContents {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: stretch;
}

.gameContents-keyboard {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  width: 100%;
}

#keyboardContainer {
  display: grid;
  grid-template-columns: repeat(6, 40px);
  grid-auto-rows: 40px;
  gap: 4px;
  width: max-content;
  flex: 0 0 auto;
  align-content: start;
  justify-content: center;
  margin: 0;
}

#boardAndBtnContainer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  
  min-width: 0;
  margin-left: 5%;
}

@media (max-width: 699px) {
  #gameContents,
  .gameContents-keyboard {
    flex-direction: column !important;
    align-items: center;
  }

  #keyboardContainer {
    margin-top: 10px;
  }
}
  #gameContents.gameContents-keyboard #boardAndBtnContainer {
    width: 50%;
  }
  #gameContents.gameContents-keyboard{
    flex-direction: row;
  }
  #vowelCard{
    justify-content: flex-start;
    display: grid;
  }
  #shubeekCard img,
  #vowelCard img{
    width: 70px;
    height: auto;
  }
  #vowelCard button {
  font-size: clamp(10px, 2.5vw, 14px);
  padding: 2px 4px;
  width: 70px;
}
#boardScaleWrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  transition: transform 0.25s ease;
  transform-origin: center;
}

#board {
  width: max-content;
  max-width: 500px;
  background-color: #5a2e13;
    border: 2px solid var(--accent);
}
  /* ===================== Ad Break ===================== */

#finalReadyOverlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 35, 60, 0.9);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1500;
}

.finalReadyBox {
  background: var(--secondary);
  border: 3px solid var(--primary);
  padding: 30px 40px;
  min-width: 300px;
  max-width: 450px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.finalReadyTitle {
  color: var(--accent);
  letter-spacing: 2px;
}

.finalReadyText {
  color: var(--primary);
}

#adContainer {
  background: rgba(0,0,0,0.2);
  border: 2px dashed var(--accent);
  padding: 20px;
  min-height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.adPlaceholder {
  color: var(--accent);
  font-size: 18px;
}
.finalReadyTitle::before{
  content:"🏮 ";
}

/* cards shared */
.modeCard,
.roundCard {
  padding: 14px;
  margin: 10px 0;
  border: 1px solid var(--accent);
  box-shadow: var(--shadow);
  text-align: right;
  transition: 0.25s;
}

/* mode */
.modeCard {
  background: rgba(255,185,41,0.15);
}

.modeCard:hover {
  transform: translateY(-3px);
}

/* rounds */
.roundCard {
  background: linear-gradient(135deg, #1e3c72, var(--secondary));
}

.roundCard strong {
  display: block;
  color: var(--accent);
  margin-bottom: 5px;
}

.modeCard small {
  display: block;
  margin-top: 6px;
  font-size: 0.8em;
  opacity: 0.8;
}
 /* tutorials */
 .tutorial {
  position: fixed;
  inset: 0;
  background: inherit;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

.tutorialContent {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#tutorialImage {
  max-width: 95vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 10px;
}

.tutorialControls {
  margin-top: 15px;
  display: flex;
  gap: 12px;
}

#tutSkip{
  left: 10%;
    position: absolute;
    align-self: flex-end;
    z-index: 999;
    top: 15%;
}
/* tutorial animation */
.first-glow {
  animation: glowPulse 1.5s infinite;
  border-radius: 8px; /* match your button */
}

@keyframes glowPulse {
  0% {
    box-shadow: 0 0 0px rgba(255, 200, 0, 0.0);
  }
  50% {
    box-shadow: 0 0 12px rgba(79, 190, 10, 0.8);
  }
  100% {
    box-shadow: 0 0 0px rgba(255, 200, 0, 0.0);
  }
}

#trainingOverlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;

  background: rgba(0, 0, 0, 0.65);

  -webkit-mask: none;
  mask: none;

  transition: clip-path 0.25s ease;
}

#trainingHint {
  position: fixed;
  z-index: 1000;

  max-width: 220px;
  padding: 10px 12px;

  background: rgba(20, 20, 20, 0.9);
  color: white;

  border-radius: 8px;
  font-size: 14px;

  pointer-events: none;

  transition: all 0.2s ease;
}