/* Generated by GitHub Copilot */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;900&display=swap');

:root {
  --bg:      #120821;
  --glass:   rgba(255,255,255,0.07);
  --glass2:  rgba(255,255,255,0.04);
  --border:  rgba(240,160,255,0.14);
  --pink:    #f472b6;
  --pink2:   #ec4899;
  --purple:  #c084fc;
  --purple2: #a855f7;
  --violet:  #818cf8;
  --green:   #34d399;
  --red:     #f87171;
  --text:    #fef0ff;
  --muted:   #c0aad4;
  --r:       16px;
  --glow-p:  0 0 24px rgba(168,85,247,0.35);
  --glow-k:  0 0 24px rgba(244,114,182,0.35);
}

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

body {
  min-height: 100dvh;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 70% 45% at 10% 0%,  rgba(168,85,247,.18) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 90% 100%, rgba(244,114,182,.13) 0%, transparent 55%);
  color: var(--text);
  font-family: Nunito, system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem 1rem 3rem;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 900;
  letter-spacing: -1.5px;
  background: linear-gradient(130deg, #f472b6 0%, #c084fc 45%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 14px rgba(244,114,182,.45));
  text-align: center;
  margin-bottom: .15rem;
}

h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--purple);
  letter-spacing: .2px;
  margin-bottom: .4rem;
}

.subtitle {
  text-align: center;
  font-size: .9rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 1.4rem;
  letter-spacing: .5px;
}

.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.4rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(120,40,200,.18);
  width: 100%;
  max-width: 480px;
  margin-bottom: 1rem;
}

input[type=text], input[type=number] {
  width: 100%;
  background: var(--glass2);
  border: 1.5px solid rgba(240,160,255,.22);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: .72rem 1rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(244,114,182,.2); }
input::placeholder { color: var(--muted); font-weight: 500; }

button {
  cursor: pointer;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  padding: .78rem 1.5rem;
  transition: transform .12s, box-shadow .2s, opacity .2s;
  letter-spacing: .2px;
}
button:hover:not(:disabled) { transform: translateY(-2px); }
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .35; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(130deg, #f472b6, #c084fc);
  color: #fff; width: 100%; margin-top: .9rem;
  font-size: 1.1rem; padding: 1rem;
  box-shadow: 0 4px 22px rgba(244,114,182,.38);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 30px rgba(244,114,182,.55); }

.btn-secondary {
  background: linear-gradient(130deg, #a78bfa, #7c3aed);
  color: #fff; width: 100%; margin-top: .8rem;
  padding: .9rem; box-shadow: 0 4px 18px rgba(124,58,237,.3);
}
.btn-success {
  background: linear-gradient(130deg, #34d399, #059669);
  color: #fff; width: 100%; margin-top: .8rem;
  font-size: 1.1rem; padding: 1rem; box-shadow: 0 4px 18px rgba(52,211,153,.3);
}
.btn-sm {
  width: auto; padding: .45rem 1.1rem; font-size: .85rem;
  background: var(--glass2); border: 1.5px solid var(--border);
  color: var(--purple); border-radius: 8px; margin-top: .5rem;
}
.btn-sm:hover:not(:disabled) { background: rgba(192,132,252,.12); }

.player-list { list-style: none; }
.player-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .52rem .85rem;
  border-radius: 10px;
  margin-bottom: .38rem;
  background: var(--glass2);
  border: 1px solid var(--border);
  font-size: .95rem;
  font-weight: 700;
}
.player-list li.me     { border-left: 4px solid var(--pink); background: rgba(244,114,182,.07); }
.player-list li.rank-1 { color: #fbbf24; }
.player-list li.rank-2 { color: #e2e8f0; }
.player-list li.rank-3 { color: #fb923c; }

.badge {
  display: inline-block;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 800;
  padding: .18rem .65rem;
  letter-spacing: .3px;
}
.badge-host  { background: rgba(255,182,255,.1); color: var(--purple); border: 1px solid var(--border); }
.badge-score { background: linear-gradient(130deg, #f472b6, #ec4899); color: #fff; }

.room-code {
  font-size: 3.2rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: 8px;
  background: linear-gradient(130deg, #f472b6, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 10px rgba(244,114,182,.4));
}

.qr-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
#qr-box { border-radius: 14px; overflow: hidden; box-shadow: 0 4px 28px rgba(168,85,247,.35); margin: .6rem 0; }
#qr-box canvas, #qr-box img { border-radius: 14px; border: 5px solid #fff; display: block; }

.phase-label {
  text-align: center;
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--purple);
  margin-bottom: .6rem;
  opacity: .85;
}

.clue-img-wrap {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--glow-k);
  border: 3px solid var(--pink);
  margin-bottom: .75rem;
}
.clue-img-wrap img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

/* Board 3x3 */
.board-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
}
.board-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: rgba(192,132,252,.18);
  border: 3px solid transparent;
  transition: border-color .25s, transform .18s, box-shadow .25s;
  position: relative;
  overflow: hidden;
  cursor: default;
}
.board-cell.clickable        { cursor: pointer; }
.board-cell.clickable:hover  { transform: scale(1.05); border-color: var(--purple); box-shadow: var(--glow-p); }
.board-cell.selected         { border-color: var(--pink);  box-shadow: var(--glow-k); }
.board-cell.correct          { border-color: var(--green); box-shadow: 0 0 22px rgba(52,211,153,.6); }
.board-cell.dim              { opacity: .5; filter: grayscale(.4); }

.cell-badge {
  position: absolute; top: 5px; right: 5px;
  background: rgba(18,8,33,.85);
  color: var(--green);
  font-size: .75rem; font-weight: 900;
  border-radius: 99px; padding: .15rem .5rem; z-index: 2;
}

/* Chooser options 2x2 */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-top: .5rem;
}
.option-cell {
  aspect-ratio: 1;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  background-color: rgba(192,132,252,.18);
  border: 3px solid transparent;
  cursor: pointer;
  transition: border-color .2s, transform .18s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.option-cell:hover    { transform: scale(1.03); border-color: var(--purple); box-shadow: var(--glow-p); }
.option-cell.selected { border-color: var(--pink);  box-shadow: var(--glow-k); }

.opt-target-badge {
  position: absolute;
  bottom: 6px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(130deg, #f472b6, #c084fc);
  color: #fff; font-size: .7rem; font-weight: 900;
  border-radius: 99px; padding: .18rem .7rem;
  white-space: nowrap; z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}

.timer {
  font-size: 2rem; font-weight: 900; text-align: center;
  color: var(--purple); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 16px rgba(192,132,252,.5);
  margin-bottom: .4rem; min-height: 2.4rem;
}
.timer.urgent {
  color: var(--pink); text-shadow: var(--glow-k);
  animation: pulse .5s infinite alternate;
}
@keyframes pulse { from { opacity: 1; } to { opacity: .45; } }

.spinner {
  width: 34px; height: 34px;
  border: 4px solid rgba(240,160,255,.12); border-top-color: var(--pink);
  border-radius: 50%; animation: spin 1s linear infinite;
  margin: 1rem auto; box-shadow: 0 0 12px rgba(244,114,182,.3);
}
@keyframes spin { to { transform: rotate(360deg); } }

.dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 6px var(--green);
  margin-right: 6px; flex-shrink: 0;
}

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240,160,255,.25), transparent);
  margin: .9rem 0;
}

.guess-list { list-style: none; margin-top: .5rem; }
.guess-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .75rem; border-radius: 8px; margin-bottom: .3rem;
  font-size: .9rem; font-weight: 700;
  background: var(--glass2); border: 1px solid var(--border);
}
.guess-item.correct { border-left: 4px solid var(--green); background: rgba(52,211,153,.07); }
.guess-item.wrong   { border-left: 4px solid var(--red); opacity: .65; }
.guess-thumb {
  width: 36px; height: 36px; border-radius: 6px;
  background-size: cover; background-position: center;
  flex-shrink: 0; background-color: rgba(192,132,252,.18);
}

.gameover-title {
  font-size: 1.9rem; font-weight: 900; text-align: center;
  background: linear-gradient(130deg, #f472b6, #c084fc);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 1rem;
}

.text-center { text-align: center; }
.text-muted  { color: var(--muted); font-size: .88rem; }
.fw-bold     { font-weight: 800; }
.mt          { margin-top: .75rem; }
.mt-sm       { margin-top: .4rem; }

@media (max-width: 400px) {
  .card { padding: 1rem; }
  .room-code { font-size: 2.4rem; letter-spacing: 5px; }
  .board-grid { gap: 4px; }
  .options-grid { gap: 6px; }
}
