:root{
  --bg:#0b0b0d;
  --panel:#101014;
  --panel2:#0f0f13;
  --text:#f3f3f5;
  --muted:#b8b8c2;
  --line:#252531;
  --gold:#d4af37;
  --gold2:#f2d27a;
  --shadow: 0 16px 40px rgba(0,0,0,.45);
  --radius: 18px;
}

/* Premium wine glow effect */

.grid {
  box-shadow:
    0 0 0 1px rgba(212,175,55,.15),
    0 12px 40px rgba(0,0,0,.6),
    0 0 40px rgba(212,175,55,.12);
}

.cell:hover {
  transform: scale(1.06);
  transition: transform .12s ease;
}

.cell.found {
  animation: wineGlow .6s ease;
}

@keyframes wineGlow {
  0% { box-shadow: 0 0 0 rgba(212,175,55,0); }
  50% { box-shadow: 0 0 16px rgba(212,175,55,.8); }
  100% { box-shadow: 0 0 0 rgba(212,175,55,0); }
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:
    radial-gradient(900px 480px at 20% 10%, rgba(212,175,55,.13), transparent 60%),
    radial-gradient(900px 480px at 80% 20%, rgba(242,210,122,.08), transparent 60%),
    var(--bg);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue", Helvetica;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

.wrap{
  max-width:1100px;
  margin:0 auto;
  padding:18px 16px 40px;
}

.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 2px 14px;
}

.brand{display:flex; align-items:center; gap:12px}
.mark{
  width:44px; height:44px;
  border-radius:14px;
  display:grid; place-items:center;
  background: linear-gradient(180deg, rgba(212,175,55,.22), rgba(212,175,55,.06));
  border:1px solid rgba(212,175,55,.28);
  box-shadow: 0 10px 24px rgba(0,0,0,.35);
  font-weight:800;
  letter-spacing:.5px;
}
.brandtext .kicker{
  font-size:12px;
  color:var(--muted);
  letter-spacing:.12em;
  text-transform:uppercase;
}
.brandtext .title{
  font-size:16px;
  font-weight:700;
}

.pill{
  padding:10px 12px;
  border-radius:999px;
  border:1px solid rgba(212,175,55,.25);
  background: rgba(16,16,20,.72);
  color:var(--gold2);
  font-size:12px;
  letter-spacing:.06em;
  text-transform:uppercase;
  white-space:nowrap;
}

.main{
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:14px;
}

@media (max-width: 900px){
  .main{grid-template-columns:1fr}
}

.panel{
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent 30%), var(--panel);
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:14px;
}

.panelHead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding-bottom:10px;
  border-bottom:1px solid rgba(255,255,255,.06);
  margin-bottom:12px;
}

.panelTitle{font-weight:750; letter-spacing:.02em}
.panelMeta{display:flex; align-items:center; gap:10px; color:var(--muted); font-size:12px}
.dot{opacity:.35}
.meta{
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.06);
}

.gridShell {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 12px;
}

.grid {
  width: min(96vw, 520px);
  aspect-ratio: 1 / 1;
  display: grid;
  gap: 6px;
  margin: 0 auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.cell{
  border-radius:12px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  display:grid;
  place-items:center;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
  font-size: clamp(16px, 4vw, 22px);
  color: rgba(243,243,245,.92);
  position:relative;
min-height: 32px;
  overflow:hidden;
}

.cell::after{
  content:"";
  position:absolute; inset:-1px;
  background: radial-gradient(120px 60px at 30% 20%, rgba(255,255,255,.08), transparent 60%);
  opacity:.55;
  pointer-events:none;
}

.cell.sel{
  outline:2px solid rgba(242,210,122,.45);
  background: rgba(212,175,55,.10);
}

.cell.found{
  border-color: rgba(212,175,55,.55);
  background: linear-gradient(180deg, rgba(212,175,55,.22), rgba(212,175,55,.08));
  color: var(--gold2);
}

.hintRow{padding-top:6px}
.hint{
  display:flex; align-items:flex-start; gap:10px;
  color:var(--muted);
  font-size:13px;
  line-height:1.35;
}
.hintDot{
  width:10px; height:10px;
  border-radius:99px;
  background: rgba(212,175,55,.8);
  margin-top:4px;
  box-shadow: 0 0 0 4px rgba(212,175,55,.12);
}

.words{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:2px;
}

.word{
  padding:10px 12px;
  border-radius:999px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  color: rgba(243,243,245,.92);
  font-weight:650;
  letter-spacing:.06em;
  text-transform:uppercase;
  font-size:12px;
}

.word.done{
  border-color: rgba(212,175,55,.5);
  background: rgba(212,175,55,.12);
  color: var(--gold2);
  text-decoration: line-through;
  opacity:.9;
}

.ctaRow{
  display:flex;
  gap:10px;
  margin-top:14px;
}

.btn{
  appearance:none;
  border:none;
  border-radius: 14px;
  padding:12px 14px;
  font-weight:750;
  letter-spacing:.02em;
  color: var(--text);
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  cursor:pointer;
  transition: transform .08s ease, background .2s ease, border-color .2s ease;
  user-select:none;
  -webkit-user-select:none;
}
.btn:active{ transform: translateY(1px) scale(.99); }
.btn:hover{ background: rgba(255,255,255,.08); }

.btn.gold{
  background: linear-gradient(180deg, rgba(242,210,122,.34), rgba(212,175,55,.22));
  border-color: rgba(212,175,55,.45);
  color: #fff;
}
.btn.ghost{
  background: transparent;
  border-color: rgba(212,175,55,.28);
  color: var(--gold2);
}

.btn.full{ width:100%; justify-content:center; display:flex; text-decoration:none; }

.foot{
  margin-top:14px;
  color: rgba(184,184,194,.9);
}
.footInner{
  display:flex;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  padding: 10px 4px 0;
}
.fineprint{font-size:12px; opacity:.9}

/* Modal */
.modalBack{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.68);
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
}
.modalBack.show{ display:flex; }
.modal{
  width:min(520px, 100%);
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent 30%), var(--panel2);
  border:1px solid rgba(212,175,55,.25);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0,0,0,.6);
  padding:18px;
}
.modalTop{ padding-bottom:10px; }
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius: 999px;
  background: rgba(212,175,55,.12);
  border:1px solid rgba(212,175,55,.30);
  color: var(--gold2);
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:11px;
}

.dailyBest{
  margin-top:6px;
  font-size:13px;
  color:#f5d37a;
  font-weight:600;
}

.challengeBanner{
  text-align:center;
  font-weight:600;
  letter-spacing:.05em;
  padding:10px;
  margin:10px 0 18px 0;
  border-radius:10px;
  border:1px solid rgba(255,215,0,.35);
  background:linear-gradient(90deg,#1a1a1a,#111);
  color:#f5d27a;
  font-size:14px;
}

.dailyBestName{
  color:#ffffff;
  font-weight:600;
}

.dailyBestTime{
  color:#ffd86b;
  font-weight:700;
}

.dailyBest {
  margin: 10px 0 12px 0;
  color: #f5d27a;
}

.dailyBestLabel {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 2px;
}

.dailyBestValue {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
}

.dailyBestName {
  color: #fff;
  font-weight: 600;
}

.dailyBestDash {
  opacity: .7;
}

.dailyBestTime {
  color: #ffd86b;
  font-weight: 700;
}

.win-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}

.win-popup.hidden {
  display: none;
}

.win-popup-card {
  position: relative;
  width: min(92vw, 460px);
  background: linear-gradient(180deg, rgba(20,20,24,0.98), rgba(10,10,14,0.98));
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  padding: 28px 24px 22px;
  color: #f4f1ea;
  text-align: center;
}

.win-popup-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.08);
  color: #f0c75e;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.win-popup-card h2 {
  margin: 0 0 14px;
  font-size: 2rem;
  line-height: 1.1;
}

.win-popup-copy {
  margin: 14px 0 20px;
  color: rgba(244, 241, 234, 0.8);
  font-size: 0.98rem;
}

.win-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.win-stat {
  padding: 14px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}

.win-stat .label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: rgba(244, 241, 234, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.win-stat .value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
}

.win-popup-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.win-btn {
  appearance: none;
  border: none;
  text-decoration: none;
  cursor: pointer;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.96rem;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.win-btn:hover {
  transform: translateY(-1px);
}

.win-btn.primary {
  background: linear-gradient(180deg, #c9a23a, #8d6a12);
  color: #111;
}

.win-btn.secondary {
  background: rgba(255,255,255,0.06);
  color: #f4f1ea;
  border: 1px solid rgba(255,255,255,0.1);
}

.win-popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: rgba(244, 241, 234, 0.75);
  font-size: 1.6rem;
  cursor: pointer;
}

@media (max-width: 560px) {
  .win-popup-card {
    padding: 24px 18px 18px;
  }

  .win-popup-card h2 {
    font-size: 1.6rem;
  }

  .win-stats {
    grid-template-columns: 1fr;
  }

  .win-popup-actions {
    flex-direction: column;
  }

  .win-btn {
    width: 100%;
  }
}

.popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
}

.popup.hidden {
  display:none;
}

.popup-card {
  background:#111;
  border:1px solid #c8a94a;
  border-radius:16px;
  padding:30px;
  text-align:center;
  max-width:380px;
  color:#fff;
}

.popup-card h2 {
  color:#c8a94a;
}

.popup-buttons {
  margin-top:20px;
  display:flex;
  gap:10px;
  justify-content:center;
}

.popup-buttons button,
.wine-guide-btn {
  background:#c8a94a;
  border:none;
  padding:10px 16px;
  border-radius:8px;
  font-weight:bold;
  cursor:pointer;
  text-decoration:none;
  color:#000;
}

/* Word discovery glow */

@keyframes wineGlow {
  0% {
    box-shadow: 0 0 0 rgba(212,175,55,0);
  }

  50% {
    box-shadow:
      0 0 10px rgba(212,175,55,0.9),
      0 0 20px rgba(212,175,55,0.6),
      0 0 35px rgba(212,175,55,0.4);
  }

  100% {
    box-shadow: 0 0 0 rgba(212,175,55,0);
  }
}

.word-found {
  animation: wineGlow 0.7s ease;
}

.fastest-today {
  animation: trophyGlow 3s infinite alternate;
}

@keyframes trophyGlow {
  from { text-shadow: 0 0 2px gold; }
  to { text-shadow: 0 0 10px gold; }
}

.leaderboard li {
  font-weight: 500;
  letter-spacing: .3px;
}

.leaderboard li:first-child {
  color: #f5d27a;
}

/* ===== Premium puzzle polish ===== */

#grid {
  display: grid;
  gap: 8px;
  user-select: none;
  touch-action: none;
}

.cell {
  min-width: 0;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #f3f1ea;
  font-weight: 700;
  line-height: 1;
  font-size: clamp(0.82rem, 1.4vw, 1.15rem);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition:
    transform 0.12s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.cell.sel {
  background: rgba(201, 162, 58, 0.16);
  border-color: rgba(201, 162, 58, 0.65);
  box-shadow: 0 0 0 1px rgba(201, 162, 58, 0.18) inset;
}

.cell.found {
  background: rgba(201, 162, 58, 0.22);
  border-color: rgba(201, 162, 58, 0.85);
  color: #f7e2a0;
  box-shadow:
    0 0 0 1px rgba(201, 162, 58, 0.18) inset,
    0 0 12px rgba(201, 162, 58, 0.18);
}

@keyframes wineGlow {
  0% {
    box-shadow: 0 0 0 rgba(212,175,55,0);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 10px rgba(212,175,55,0.9),
      0 0 20px rgba(212,175,55,0.6),
      0 0 35px rgba(212,175,55,0.35);
    transform: scale(1.04);
  }
  100% {
    box-shadow: 0 0 0 rgba(212,175,55,0);
    transform: scale(1);
  }
}

.cell.word-found {
  animation: wineGlow 0.7s ease;
}

#words {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.word {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(201, 162, 58, 0.28);
  background: rgba(255,255,255,0.02);
  color: #efe7d0;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-size: 0.95rem;
}

.word.done {
  color: #f5d27a;
  border-color: rgba(201, 162, 58, 0.7);
  background: rgba(201, 162, 58, 0.08);
  text-decoration: line-through;
}

#lbList > div {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

#lbList > div:last-child {
  border-bottom: none;
}

#lbSub {
  letter-spacing: 0.02em;
}

.fastest-today,
#fastestToday,
#fastestTodayName {
  text-shadow: 0 0 6px rgba(201, 162, 58, 0.12);
}

@media (max-width: 900px) {
  #grid {
    gap: 7px;
  }

  .cell {
    border-radius: 12px;
    font-size: clamp(0.76rem, 2.1vw, 1rem);
  }

  .word {
    padding: 9px 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 640px) {
  #grid {
    gap: 6px;
  }

  .cell {
    border-radius: 10px;
    font-size: clamp(0.7rem, 2.6vw, 0.92rem);
  }

  .word {
    padding: 8px 11px;
    font-size: 0.85rem;
  }
}

@media (max-width: 420px) {
  #grid {
    gap: 5px;
  }

  .cell {
    border-radius: 9px;
    font-size: 0.68rem;
  }
}

@media (max-width: 768px) {

  .puzzle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .word-list,
  .leaderboard {
    width: 100%;
    margin-top: 10px;
  }

}

.grid-cell {
  width: clamp(36px, 8vw, 48px);
  height: clamp(36px, 8vw, 48px);
  font-size: clamp(16px, 4vw, 22px);
}

.puzzle-grid {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.puzzle-grid {
  touch-action: none;
}

@media (max-width: 768px) {

  .puzzle-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .puzzle-grid {
    width: 100%;
    max-width: 420px;
    margin-bottom: 15px;
  }

  .word-list {
    width: 100%;
    margin-top: 10px;
  }

  .leaderboard {
    width: 100%;
    margin-top: 10px;
  }

}

details summary {
  list-style: none;
  cursor: pointer;
}

details summary::-webkit-details-marker {
  display: none;
}

@media (max-width: 768px) {
  .main {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
}

.btn {
  min-height: 42px;
}

.popup.hidden {
  display: none;
}

.popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(5, 7, 14, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.popupCard {
  width: min(92vw, 460px);
  background: linear-gradient(180deg, rgba(18,20,31,.98), rgba(11,13,22,.98));
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 24px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.popupEmoji {
  font-size: 34px;
  margin-bottom: 10px;
}

.popupTitle {
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}

.popupText {
  color: rgba(255,255,255,.82);
  font-size: 16px;
  line-height: 1.45;
  margin-bottom: 8px;
}

.popupActions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.confetti-piece {
  position: fixed;
  top: -16px;
  width: 8px;
  height: 14px;
  border-radius: 999px;
  z-index: 9998;
  pointer-events: none;
  animation: confettiFall linear forwards;
  filter: drop-shadow(0 0 6px rgba(212,175,55,.18));
}

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg) translateX(0);
    opacity: 0;
  }

  12% {
    opacity: 0.95;
  }

  100% {
    transform: translateY(110vh) rotate(240deg) translateX(18px);
    opacity: 0;
  }
}
.cell.tap-start {
  outline: 2px solid #d4af37;
  box-shadow: 0 0 14px rgba(212,175,55,.7);
}

.countdownOverlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(5, 7, 14, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.countdownOverlay.hidden {
  display: none;
}

.countdownCard {
  width: min(92vw, 420px);
  background: linear-gradient(180deg, rgba(18,20,31,.98), rgba(11,13,22,.98));
  border: 1px solid rgba(212,175,55,.35);
  border-radius: 24px;
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.countdownBrand {
  color: rgba(255,255,255,.72);
  font-size: 12px;
  letter-spacing: .18em;
  margin-bottom: 16px;
}

.countdownNumber {
  font-size: 72px;
  line-height: 1;
  font-weight: 800;
  color: #fff;
  margin-bottom: 14px;
}

.countdownText {
  color: rgba(255,255,255,.82);
  font-size: 16px;
  line-height: 1.4;
}


.countdownCard {
  width: min(92vw, 420px);
  background: linear-gradient(180deg, rgba(18,20,31,.98), rgba(11,13,22,.98));
  border: 1px solid rgba(212,175,55,.35);
  border-radius: 24px;
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.countdownBrand {
  color: rgba(255,255,255,.72);
  font-size: 12px;
  letter-spacing: .18em;
  margin-bottom: 16px;
}

.countdownNumber {
  font-size: 72px;
  line-height: 1;
  font-weight: 800;
  color: #fff;
  margin-bottom: 14px;
}

.countdownText {
  color: rgba(255,255,255,.82);
  font-size: 16px;
  line-height: 1.4;
}

.cell.tap-start {
  background: rgba(212,175,55,0.35);
  box-shadow: 0 0 10px rgba(212,175,55,0.7);
  animation: tapPulse 1.2s infinite;
}

@keyframes tapPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.progressWrap {
  margin-bottom: 14px;
}

.progressLabel {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.progressBar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}

#progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d4af37, #f5d27a);
  transition: width .35s ease;
}

.word-found {
  animation: wordGlow 0.7s ease;
}

@keyframes wordGlow {

  0% {
    box-shadow: 0 0 0 rgba(212,175,55,0);
    transform: scale(1);
  }

  40% {
    box-shadow: 0 0 14px rgba(212,175,55,0.9);
    transform: scale(1.08);
  }

  100% {
    box-shadow: 0 0 0 rgba(212,175,55,0);
    transform: scale(1);
  }

}

.hostScreen.hidden {
  display: none;
}

.hostScreen {
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 20% 10%, rgba(212,175,55,.13), transparent 60%),
    radial-gradient(900px 480px at 80% 20%, rgba(242,210,122,.08), transparent 60%),
    #0b0b0d;
  color: #fff;
  padding: 32px 24px;
}

.hostInner {
  max-width: 1100px;
  margin: 0 auto;
}

.hostKicker {
  text-align: center;
  color: rgba(255,255,255,.72);
  font-size: 14px;
  letter-spacing: .18em;
  margin-bottom: 18px;
}

.hostTitle {
  text-align: center;
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
}

.hostSub {
  text-align: center;
  font-size: clamp(16px, 2vw, 24px);
  color: #f5d27a;
  margin-bottom: 28px;
}

.hostBoard {
  border: 1px solid rgba(212,175,55,.24);
  border-radius: 24px;
  background: rgba(15,15,20,.92);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  padding: 26px;
}

.hostBoardTitle {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 18px;
  color: #f5d27a;
}

.hostLeaderboard {
  display: grid;
  gap: 14px;
}

#hostLeaderboard{
  transition: opacity .35s ease;
}

.hostRow {
  display: grid;
  grid-template-columns: 80px 1fr 140px;
  align-items: center;
  gap: 16px;
  padding: 18px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  font-size: clamp(18px, 2vw, 28px);
}

.hostRank {
  font-weight: 800;
  color: #f5d27a;
}

.hostName {
  font-weight: 700;
  color: #fff;
}

.hostTime {
  text-align: right;
  font-weight: 800;
  color: #f5d27a;
}

.hostEmpty {
  padding: 18px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  color: rgba(255,255,255,.78);
  font-size: 22px;
}

.hostRow {
  display: grid;
  grid-template-columns: 80px 1fr 140px;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: 18px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212,175,55,0.14);
  color: #fff;
}

.hostRowNew {
  animation: hostRowReveal 1.2s ease;
}

.hostRank {
  font-size: 28px;
  font-weight: 800;
  color: #f5d27a;
}

.hostName {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hostTime {
  font-size: 28px;
  font-weight: 800;
  text-align: right;
  color: #f5d27a;
}

.hostEmpty {
  padding: 24px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.82);
  font-size: 22px;
}

@keyframes hostRowReveal {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    box-shadow: 0 0 0 rgba(212,175,55,0);
  }
  45% {
    opacity: 1;
    transform: translateY(0) scale(1.01);
    box-shadow: 0 0 28px rgba(212,175,55,0.28);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 rgba(212,175,55,0);
  }
}

.hostSpotlight{
  position:fixed;
  top:28px;
  left:50%;
  transform:translateX(-50%);
  background:#111;
  color:#f5d27a;
  padding:18px 36px;
  border-radius:20px;
  font-size:32px;
  font-weight:700;
  letter-spacing:.02em;
  border:1px solid rgba(212,175,55,.35);
  box-shadow:0 0 40px rgba(212,175,55,.25);
  z-index:9999;
  opacity:0;
}

.hostSpotlight.show{
  animation:spotlightReveal 4s ease forwards;
}

@keyframes spotlightReveal{
  0%{opacity:0; transform:translate(-50%,-20px);}
  12%{opacity:1; transform:translate(-50%,0);}
  80%{opacity:1;}
  100%{opacity:0; transform:translate(-50%,-10px);}
}

/* ===== FINAL MOBILE PUZZLE LOCK ===== */

/* keep the puzzle panel from squeezing the board oddly */
.panel {
  overflow: hidden;
}

.gridShell {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8px 0;
}

/* use the real grid element from your HTML */
#grid {
  width: min(100%, 520px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  display: grid;
  gap: 6px;
  box-sizing: border-box;
  touch-action: none;
}

/* stable tile sizing */
#grid .cell {
  aspect-ratio: 1 / 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  font-size: clamp(13px, 3.6vw, 18px);
  line-height: 1;
}

/* mobile layout polish */
@media (max-width: 640px) {
  .wrap {
    padding-left: 10px;
    padding-right: 10px;
  }

  .panel {
    padding: 12px;
  }

  .panelHead {
    align-items: flex-start;
    gap: 8px;
  }

  .panelMeta {
    flex-wrap: wrap;
    gap: 8px;
  }

  .gridShell {
    padding: 6px 0;
  }

  #grid {
    width: min(100%, 420px);
    gap: 5px;
  }

  #grid .cell {
    border-radius: 9px;
    font-size: clamp(12px, 3.8vw, 16px);
  }
}

@media (max-width: 420px) {
  #grid {
    width: min(100%, 390px);
    gap: 4px;
  }

  #grid .cell {
    font-size: 12px;
    border-radius: 8px;
  }
}

.hidden {
  display: none !important;
  pointer-events: none !important;
}

#countdownOverlay.hidden,
#hostScreen.hidden,
#modalBack[aria-hidden="true"],
.modalBack[aria-hidden="true"] {
  display: none !important;
  pointer-events: none !important;
}

#countdownOverlay,
#hostScreen,
.modalBack {
  pointer-events: auto;
}

.grid,
.cell {
  pointer-events: auto;
}
.modal h2{ margin:10px 0 6px; font-size:20px; }
.modalText{ margin:0; color: var(--muted); }
.modalActions{ display:grid; gap:10px; margin-top:14px; }
.modalNote{ margin:12px 0 0; color: rgba(184,184,194,.9); font-size:12px; line-height:1.35; }