/* WishDuel — standalone brand: deep night blue, gold star, cyan accent. */
:root {
  --bg: #081220;
  --panel: #0e2138;
  --panel2: #123152;
  --text: #eef4fb;
  --muted: #9db6cf;
  --gold: #ffd34d;
  --cyan: #37e0d8;
  --bad: #ff7a7a;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 560px; margin: 0 auto; padding: 0 16px 40px;
  overscroll-behavior: none;
}
.hidden { display: none !important; }
.center { text-align: center; }

#appbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 2px 6px; }
.logo { font-size: 22px; font-weight: 800; color: var(--gold); letter-spacing: .3px; }
.badge { background: var(--cyan); color: #04222a; font-weight: 700; font-size: 12px; padding: 3px 9px; border-radius: 999px; }

.banner { background: #4a2d05; border: 1px solid var(--gold); color: #ffe9a8; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }

h1 { font-size: 30px; line-height: 1.15; margin: 14px 0 8px; }
h2 { font-size: 17px; margin: 22px 0 8px; }
.sub { color: var(--muted); font-size: 15px; line-height: 1.45; }
.hint { color: var(--muted); font-size: 13px; }
.error { color: var(--bad); font-size: 14px; min-height: 18px; }
.chosen { background: var(--panel2); border: 1px solid var(--cyan); border-radius: 10px; padding: 9px 12px; font-size: 15px; }

button, .aslink {
  display: block; width: 100%; margin: 10px 0; padding: 13px 16px;
  font-size: 16px; font-weight: 700; text-align: center; text-decoration: none;
  color: var(--text); background: var(--panel2); border: 1px solid #26507e;
  border-radius: 12px; cursor: pointer;
}
button.primary, .aslink.primary { background: var(--gold); color: #231a00; border-color: var(--gold); }
button.big { font-size: 18px; padding: 15px 16px; }
button:disabled { opacity: .45; cursor: default; }

.joinrow { display: flex; gap: 10px; }
.joinrow input {
  flex: 1; min-width: 0; padding: 13px; font-size: 20px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 4px; text-align: center;
  background: var(--panel); color: var(--text); border: 1px solid #26507e; border-radius: 12px;
}
.joinrow button { width: auto; flex: 0 0 110px; margin: 0; }

.wish-group { margin: 10px 0 4px; font-weight: 700; color: var(--cyan); font-size: 14px; }
.wish-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.wish-chip {
  width: auto; margin: 0; padding: 9px 13px; font-size: 14px; font-weight: 600;
  border-radius: 999px; background: var(--panel); border: 1px solid #26507e;
}
.wish-chip.selected { background: var(--gold); color: #231a00; border-color: var(--gold); }

.code { color: var(--gold); letter-spacing: 5px; }
#qr-box { display: flex; justify-content: center; margin: 14px 0 4px; }
#qr-box canvas { background: #fff; padding: 10px; border-radius: 12px; }
.joinlink { text-align: center; color: var(--muted); font-size: 13px; word-break: break-all; }

#players { margin: 16px 0; }
.player-row {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--panel); border-radius: 10px; padding: 11px 14px; margin: 8px 0; font-size: 15px;
}
.player-row .st { color: var(--muted); font-size: 13px; }
.player-row .st.ready { color: var(--cyan); font-weight: 700; }

#hud { display: flex; justify-content: space-between; font-weight: 800; font-size: 17px; padding: 10px 2px 4px; }
#hud-timer { color: var(--gold); font-variant-numeric: tabular-nums; }

.deck-card { text-align: left; }
.deck-card .deck-name { font-size: 17px; font-weight: 800; display: block; }
.deck-card .deck-tag { color: var(--muted); font-size: 13px; font-weight: 400; display: block; margin-top: 3px; }
.deck-card .deck-badge { float: right; font-size: 12px; font-weight: 800; color: var(--cyan); }
.deck-card.selected { border-color: var(--gold); background: var(--panel2); box-shadow: 0 0 0 1px var(--gold); }
#dares-row { display: flex; gap: 10px; align-items: flex-start; background: var(--panel); border: 1px solid #26507e; border-radius: 12px; padding: 11px 14px; margin: 10px 0; font-size: 14px; cursor: pointer; }
#dares-row input { width: 20px; height: 20px; margin-top: 1px; flex: 0 0 auto; }
.locktag { color: var(--gold); font-weight: 700; font-size: 12px; }

#field {
  position: relative; width: 100%; height: 62vh; min-height: 340px; margin-top: 10px;
  background: radial-gradient(ellipse at 50% 40%, #10345c 0%, var(--panel) 70%);
  border: 1px solid #26507e; border-radius: 16px; overflow: hidden; touch-action: none;
}
#icon { position: absolute; width: 84px; height: 84px; margin: -42px 0 0 -42px; pointer-events: none; }
#star { fill: var(--gold); stroke: #b8860b; stroke-width: 2; }
#dwell-ring-bg, #opp-ring-bg { fill: none; stroke: rgba(255,255,255,.13); stroke-width: 5; }
#opp-ring-bg { stroke-width: 3.5; }
#dwell-ring {
  fill: none; stroke: var(--cyan); stroke-width: 5; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: center;
}
#opp-ring {
  fill: none; stroke: rgba(224,79,62,.85); stroke-width: 3.5; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: center;
}
#ghost {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border: 3px solid rgba(255,110,90,.8); background: rgba(255,110,90,.25);
  border-radius: 50%; pointer-events: none;
}
#clue-card {
  position: absolute; left: 50%; top: 66px; transform: translateX(-50%);
  background: rgba(4,16,30,.93); border: 1px solid var(--gold); color: var(--gold);
  padding: 12px 20px; border-radius: 14px; font-weight: 800; font-size: 19px;
  text-align: center; max-width: 88%; z-index: 5;
}
#cursor {
  position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border: 3px solid var(--cyan); border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 2px rgba(0,0,0,.35), inset 0 0 0 2px rgba(0,0,0,.2);
}
#cursor::after { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; background: var(--cyan); border-radius: 50%; }
#countdown {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 110px; font-weight: 900; color: var(--gold); text-shadow: 0 4px 24px rgba(0,0,0,.6);
}
#round-banner {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
  background: rgba(4, 16, 30, .88); border: 1px solid var(--cyan); color: var(--text);
  padding: 10px 18px; border-radius: 999px; font-weight: 800; font-size: 17px; white-space: nowrap;
}

.reveal { background: var(--panel); border: 1px solid var(--gold); border-radius: 14px; padding: 18px; margin: 18px 0; text-align: center; }
.reveal.suspense { animation: revealpulse .55s ease-in-out infinite alternate; }
@keyframes revealpulse { from { opacity: .45; } to { opacity: 1; } }
#reveal-wish { font-size: 26px; font-weight: 800; color: var(--gold); margin: 6px 0 2px; }
#reveal-dare { font-size: 17px; font-weight: 700; color: var(--cyan); margin: 12px 0 2px; }

#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: rgba(4,16,30,.94); border: 1px solid var(--cyan); color: var(--text);
  padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 50; max-width: 92vw; text-align: center;
}
