@import url('https://fonts.googleapis.com/css2?family=Anton&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Archivo+Narrow:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Lilita+One&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English+SC&display=swap');

:root{
  --bg:#f0f4f8;
  --text:#2c3e50;
  --card:#ffffff;
  --muted:#6b7280;
  --accent:#00b0a9;
  --accent2:#2ecc71;
  --danger:#e74c3c;
  --dark:#34495e;

  /* tiles */
  --tile-blue:#34afe6; /* NYT-ish blue for unearned squares */
}

*{ box-sizing:border-box; }

html,body{
  margin:0;
  padding:0;
  height:100%;
}

body{
  font-family:'Archivo Narrow',sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.4;
}

#mainContainer{
  max-width:760px;
  margin:0 auto;
  padding:12px;
  min-height:100vh;
}

/* wildcat title - Anton font like original */
h1{
  margin:6px 0 10px;
  font-size:3rem;
  font-weight:900;
  text-align:center;
  font-family:'Anton',sans-serif;
  color:#ffffff;
  text-shadow:
    2px 2px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000,
    3px 3px 0 #444,
    4px 4px 0 #666,
    5px 5px 0 #888,
    6px 6px 8px rgba(0,0,0,0.6);
  letter-spacing:2px;
  text-transform:lowercase;
}

/* Cards / inputs / buttons */

.card{
  background:var(--card);
  border-radius:10px;
  padding:10px;
  margin:8px 0;
  box-shadow:0 4px 12px rgba(0,0,0,.06);
}

.lbl{
  font-weight:700;
  font-size:.9rem;
  margin-bottom:4px;
  margin-top:8px;
  display:block;
  font-family:'Archivo Narrow',sans-serif;
}

.txt{
  width:100%;
  padding:12px 15px;
  border:2px solid #000;
  border-radius:8px;
  font-size:.95rem;
  font-family:'Archivo Narrow',sans-serif;
  background-color:#f9f9f9;
  box-shadow:0 2px 4px rgba(0,0,0,0.1);
  transition:all 0.3s ease;
}

.txt:focus{
  outline:none;
  border-color:var(--accent);
  background-color:#fff;
}

.row{
  display:flex;
  gap:8px;
  margin:10px 0;
  flex-wrap:wrap;
}

/* Buttons */
.btn{
  flex:1;
  padding:12px 12px;
  border:0;
  border-radius:4px;
  background:var(--accent);
  color:#f8f8f8;
  font-weight:bold;
  cursor:pointer;
  font-family:'Archivo Narrow',sans-serif;
  font-size:18px;
  text-transform:uppercase;
  transition:background-color 0.3s;
  line-height:1.2;
}
.btn:hover{ background-color:#008f8a; }
.btn.primary{ background:var(--accent); }
.btn.primary:hover{ background:#008f8a; }
.btn.dark,.btn.secondary{ background:var(--dark); }
.btn.green{ background:#4CAF50; }
.btn.green:hover{ background:#45a049; }
.btn.start{ background:#8b5cf6; }
.btn.start:hover{ background:#7c3aed; }
.btn:disabled{
  opacity:.6;
  cursor:not-allowed;
  background-color:#d3d3d3;
  color:#808080;
}
.btn.wide{
  width:100%;
  max-width:360px;
  margin:8px auto;
  display:block;
}

/* Generic muted text + lobby helpers */

.muted{ color:var(--muted); font-size:.85rem; }

.section-title{
  font-size:1.05rem;
  font-weight:900;
  margin:4px 0 6px;
  font-family:'Archivo Narrow',sans-serif;
}

.divider{ border:0; border-top:1px solid #e5e7eb; margin:10px 0; }
.lobby-help{ margin-top:4px; font-family:'Archivo Narrow',sans-serif; }

/* JOIN SCREEN */

.join-hero{ text-align:center; padding:20px 12px 12px; }
.join-icon{ width:72px; height:72px; color:var(--accent); margin:0 auto 16px; stroke-width:1.5; }
.join-title{ font-size:1.5rem; font-weight:900; margin:0 0 8px; color:var(--text); font-family:'Archivo Narrow',sans-serif; }
.join-subtitle{ font-size:.95rem; color:var(--muted); margin:0 0 20px; font-family:'Archivo Narrow',sans-serif; }

/* WAITING ROOM */

.waiting-hero{ text-align:center; padding:20px 12px 12px; }
.waiting-icon{
  width:72px; height:72px; color:#8b5cf6; margin:0 auto 16px; stroke-width:1.5;
  animation: spin 3s linear infinite;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.waiting-title{ font-size:1.4rem; font-weight:900; margin:0 0 8px; color:var(--text); font-family:'Archivo Narrow',sans-serif; }
.waiting-subtitle{ font-size:.95rem; color:var(--muted); margin:0 0 20px; font-family:'Archivo Narrow',sans-serif; }

.text-link{ color:var(--accent); text-decoration:none; font-weight:700; }
.text-link:hover{ text-decoration:underline; }

/* Share / lobby */

.share-row{ display:flex; gap:8px; margin-top:8px; }
.share .muted{ color:var(--muted); font-size:.9rem; margin-top:6px; }

.lobby-status{
  margin-top:8px; padding:8px; background:#f0f9ff; border-radius:6px; text-align:center;
  font-weight:700; color:#0369a1; font-family:'Archivo Narrow',sans-serif;
}

.lobby-list{ display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; margin-bottom:12px; }

.lobby-pill{
  background:#eef2ff; color:#3730a3; border-radius:999px; padding:6px 10px; font-weight:700;
  font-size:.9rem; font-family:'Archivo Narrow',sans-serif;
}

.pill-host{
  margin-left:6px; padding:2px 6px; border-radius:999px; background:#4ade80; color:#064e3b;
  font-size:.7rem; text-transform:uppercase; letter-spacing:.04em;
}

/* Question / image */

.question{
  text-align:center;
  margin:10px 0 4px;
  font-size:1.4rem;
  font-weight:700;
  font-family:'Archivo Narrow',sans-serif;
}

.image-frame{
  width:200px; height:200px; margin:4px auto 6px;
  background-image:url('circularframeformookie.png'); background-size:cover;
  display:flex; align-items:center; justify-content:center; position:relative; flex-shrink:0;
}

.player-image{ width:62%; height:62%; object-fit:cover; border-radius:50%; }

/* Traffic light */

.traffic-light{
  width:60px; height:24px; margin:4px auto 8px; background:#111827;
  border-radius:999px; display:flex; justify-content:space-around; align-items:center;
  padding:4px 6px; box-shadow:0 4px 10px rgba(0,0,0,.25);
}
.light{ width:14px; height:14px; border-radius:50%; opacity:0.2; transition:opacity .2s ease, transform .2s ease, box-shadow .2s ease; }
.light.red{ background:#ef4444; } .light.yellow{ background:#facc15; } .light.green{ background:#22c55e; }
.light.active{ opacity:1; }
@keyframes breatheRed{
  0%,100%{ transform:scale(1); box-shadow:0 0 0 0 rgba(239,68,68,0.6); }
  50%{ transform:scale(1.25); box-shadow:0 0 18px 4px rgba(239,68,68,0.9); }
}
.light.red.active{ animation:breatheRed 1s ease-in-out infinite; }
.light.yellow.active{ box-shadow:0 0 14px 3px rgba(250,204,21,0.7); }
.light.green.active{ box-shadow:0 0 14px 3px rgba(34,197,94,0.7); }

/* Scoreboard – stacked column */

.scoreboard-grid{
  display:flex;
  flex-direction:column;
  gap:10px;
  max-width:520px;
  margin:10px auto 12px;
}

/* Remove the white “card” behind each player row */
.player-card{
  background:transparent;
  border-radius:0;
  padding:0;
  box-shadow:none;
  text-align:center;
  overflow:visible;
  transition:none;
}

/* Ensure any legacy row glow is dead */
.player-card.correct-answer{
  animation:none !important;
  box-shadow:none !important;
}

/* kill any prior ::before halo on the wheel */
.player-card .wheel::before{
  content:none !important;
  display:none !important;
}

/* Name-only subtle green glow when correct */
.player-card.correct-answer .player-name{
  text-shadow:
    0 0 8px rgba(34,197,94,.55),
    0 0 14px rgba(34,197,94,.35);
}

.player-name{
  font-weight:900;
  margin:0 0 7px;
  font-size:1rem;
  font-family:'Archivo Narrow',sans-serif;
}
.player-name.eliminated{ color:#b91c1c; text-decoration:line-through; }

/* Tiles row */
.wheel{
  display:flex;
  justify-content:center;
  gap:8px;
  flex-wrap:nowrap;
  width:100%;
}

/* Tiles */
.tile{
  width:33px;
  height:33px;
  background:var(--tile-blue);  /* blue blocks for unearned letters */
  color:transparent;
  border-radius:6px;            /* slightly rounded corners */
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:1.6rem;
  font-family:'Anton',sans-serif; /* back face doesn't show anyway */
  transform-style:preserve-3d;
  transition:transform .6s;
  position:relative;
  flex-shrink:0;
}

/* when earned, flip to white face with serif letter */
.tile.earned{ transform:rotateY(180deg); }

.tile::after{
  content:attr(data-letter);
  position:absolute;
  inset:0;
  background:#ffffff;              /* white square when earned */
  color:#111;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:6px;
  backface-visibility:hidden;
  transform:rotateY(180deg);
  font-size:1.6rem;
  font-family:'IM Fell English SC', Georgia, serif; /* clean serif like your ref */
  font-weight:700;
}

/* Bottom CTA */

.bottom-guess-cta{ max-width:520px; margin:0 auto 10px; padding:0 8px; }

/* Input / suggestions (used inside modal) */

.input-area{
  display:flex; flex-direction:column; align-items:center; gap:6px; margin:8px 0 16px;
}
.input-area input{
  width:100%; max-width:360px; padding:15px 20px; border:2px solid #000; border-radius:8px;
  font-size:18px; font-family:'Archivo Narrow',sans-serif; background-color:#f9f9f9;
  box-shadow:0 2px 4px rgba(0,0,0,0.1); transition:all 0.3s ease;
}
.input-area input:focus{ outline:none; border-color:var(--accent); background-color:#fff; }

.suggestions{
  width:100%; max-width:360px;
  max-height:40dvh;              /* mobile-friendly */
  overflow:auto; background:#fff;
  border:1px solid #ddd; border-top:none; border-radius:0 0 6px 6px; display:none; z-index:5;
  font-family:'Archivo Narrow',sans-serif;
}
.suggestion-item{ padding:8px; cursor:pointer; font-size:.9rem; }
.suggestion-item:hover{ background:#f0f0f0; }

/* Toast */

#feedbackMessage{
  position:fixed; left:50%; top:12px; transform:translateX(-50%);
  background:#111827; color:#ffffff; padding:8px 12px; border-radius:8px;
  opacity:0; transition:opacity .25s; pointer-events:none; z-index:20; font-size:.9rem;
  font-family:'Archivo Narrow',sans-serif;
}
#feedbackMessage.show{ opacity:1; }

/* Game Over Screen */

#gameOverScreen{
  position:fixed; inset:0; background:rgba(0,0,0,0.85);
  display:none; flex-direction:column; align-items:center; justify-content:center;
  z-index:9999; padding:20px;
}
#gameOverScreen.show{ display:flex; }

#eliminatedMessage{
  position:fixed; bottom:20px; left:50%; transform:translateX(-50%);
  background:rgba(17,24,39,0.95); color:#ffffff; padding:16px 24px; border-radius:12px;
  box-shadow:0 8px 24px rgba(0,0,0,0.4); z-index:100; text-align:center; max-width:90%;
  width:auto; display:none;
}
#eliminatedMessage.show{ display:block; animation:slideUpFade 0.4s ease-out; }
@keyframes slideUpFade{
  from{ opacity:0; transform:translateX(-50%) translateY(20px); }
  to{ opacity:1; transform:translateX(-50%) translateY(0); }
}
.eliminated-title{
  font-family:'Anton',sans-serif; font-size:1.5rem; font-weight:900; color:#ef4444;
  margin:0 0 8px; text-transform:uppercase; letter-spacing:1px;
}
.eliminated-subtitle{
  font-family:'Archivo Narrow',sans-serif; font-size:1rem; color:#d1d5db; margin:0; line-height:1.4;
}

.winner-text{
  font-family:'Anton',sans-serif; font-size:clamp(80px, 15vw, 200px); font-weight:900; line-height:1;
  background:linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
  -webkit-background-clip:text; -webkit-text-fill-color:transparent;
  text-shadow:4px 4px 0 #228B22, 8px 8px 20px rgba(0,0,0,.5);
  margin-bottom:30px; animation:winnerPulse 2s ease-in-out infinite;
}
.loser-text{
  font-family:'Anton',sans-serif; font-size:clamp(60px, 12vw, 160px); font-weight:900; line-height:1;
  color:#ffffff; text-shadow:3px 3px 0 #b91c1c, 6px 6px 15px rgba(0,0,0,.5); margin-bottom:30px;
}
@keyframes winnerPulse{
  0%,100%{ transform:scale(1); filter:brightness(1); }
  50%{ transform:scale(1.05); filter:brightness(1.2); }
}

.play-again-section{
  background:var(--card); border-radius:12px; padding:20px 30px; box-shadow:0 8px 24px rgba(0,0,0,0.3);
  text-align:center; max-width:400px;
}
.play-again-title{ font-family:'Archivo Narrow',sans-serif; font-weight:900; font-size:1.3rem; margin:0 0 15px; color:var(--text); }
.play-again-status{ font-family:'Archivo Narrow',sans-serif; font-size:.95rem; color:var(--muted); margin-bottom:15px; }
.ready-pills{ display:flex; gap:6px; flex-wrap:wrap; justify-content:center; margin-bottom:15px; }
.ready-pill{
  background:#eef2ff; color:#3730a3; border-radius:999px; padding:6px 10px; font-weight:700;
  font-size:.85rem; font-family:'Archivo Narrow',sans-serif;
}
.ready-pill.ready{ background:#dcfce7; color:#166534; }
#playAgainBtn{ margin:0; }

/* Guess Modal (keyboard-safe) */

.guess-modal{
  position:fixed; inset:0; height:100dvh;
  display:none; align-items:flex-start; justify-content:center;
  padding:clamp(10px,10dvh,80px) 18px 18px;
  background:rgba(15,23,42,0.92);
  z-index:10000;
}
.guess-modal.show{ display:flex; }

.guess-modal-inner{
  width:100%; max-width:520px;
  max-height:calc(100dvh - 32px);
  overflow:auto;
  background:#f9fafb; border-radius:14px; padding:16px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow:0 12px 30px rgba(0,0,0,0.45); position:relative;
}
.guess-modal-title{
  margin:2px 0 6px; font-family:'Archivo Narrow',sans-serif; font-size:1.25rem; font-weight:900; text-align:center;
}
.guess-modal-subtitle{
  margin:0 0 10px; font-family:'Archivo Narrow',sans-serif; font-size:.95rem; color:var(--muted); text-align:center;
}
.guess-modal-close{
  position:absolute; right:10px; top:8px; border:0; background:none; font-size:24px; line-height:1; cursor:pointer; color:#6b7280;
}
.guess-modal-close:hover{ color:#111827; }

/* Modal secondary button */
.modal-cancel{
  margin-top:6px; border:0; background:none; color:var(--muted);
  font-family:'Archivo Narrow',sans-serif; font-size:.9rem; cursor:pointer; text-decoration:underline;
}
.modal-cancel:hover{ color:var(--text); }

/* Larger screens */
@media (min-width:768px){
  h1{ font-size:3.4rem; }
  .question{ font-size:1.7rem; }
  .image-frame{ width:230px; height:230px; }
  .tile{ width:36px; height:36px; font-size:1.8rem; }
  .tile::after{ font-size:1.8rem; }
}

/* Mobile - static layout like mookie */
@media (max-width:767px){
  html, body{ height:100%; overflow:hidden; position:fixed; width:100%; }
  #mainContainer{ padding:6px 8px; height:100%; display:flex; flex-direction:column; overflow:hidden; }
  h1{ font-size:1.75rem; margin:3px 0 4px; flex-shrink:0; }

  #gameArea{ display:flex; flex-direction:column; height:100%; overflow:hidden; }

  .question{
    text-align:center; font-size:clamp(1.6rem, 5.5vw, 2.1rem); font-weight:800;
    margin:4px 0 2px; letter-spacing:0.03em; flex-shrink:0;
  }
  .image-frame{ width:135px; height:135px; margin:2px auto 4px; flex-shrink:0; }
  .traffic-light{ margin:2px auto 5px; width:52px; height:20px; flex-shrink:0; }
  .light{ width:12px; height:12px; }

  .scoreboard-grid{ gap:6px; margin:6px auto 4px; padding:0 4px; flex-shrink:0; }

  .player-name{
    font-size:.86rem; margin-bottom:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }

  .wheel{ gap:4px; }

  .tile{ width:27px; height:27px; font-size:1.2rem; }
  .tile::after{ font-size:1.2rem; }

  .bottom-guess-cta{ margin-top:auto; padding-bottom:6px; }
  .btn.wide{ padding:12px; font-size:18px; margin-bottom:0; }
  .suggestions{ max-height:40dvh; }
}
