/* ============================================================
   Chirandu Gaming Club — party UI
   ============================================================ */
:root {
  --bg: #07061a;
  --bg-2: #0e0b2b;
  --ink: #f6f4ff;
  --ink-2: rgba(246, 244, 255, .72);
  --ink-3: rgba(246, 244, 255, .48);
  --glass: rgba(255, 255, 255, .06);
  --glass-2: rgba(255, 255, 255, .10);
  --stroke: rgba(255, 255, 255, .12);
  --stroke-2: rgba(255, 255, 255, .22);
  --good: #34d399;
  --bad: #fb7185;
  --accent: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #f59e0b 100%);
  --glow: #a855f7;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, .6);
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 8px; }

/* ---------- Living background ---------- */
.aurora { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none;
  background: radial-gradient(1200px 800px at 50% -10%, #1c1452 0%, transparent 60%), var(--bg); }
.blob { position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%; filter: blur(90px); opacity: .45;
  mix-blend-mode: screen; animation: drift 26s ease-in-out infinite alternate; }
.blob.b1 { background: #7c3aed; top: -20vmax; left: -15vmax; }
.blob.b2 { background: #db2777; bottom: -25vmax; right: -15vmax; animation-duration: 32s; animation-delay: -8s; }
.blob.b3 { background: var(--glow); top: 30%; left: 40%; width: 35vmax; height: 35vmax; opacity: .28; animation-duration: 22s; animation-delay: -4s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1) rotate(0); }
  50% { transform: translate(8vmax, 6vmax) scale(1.15) rotate(30deg); }
  100% { transform: translate(-6vmax, 10vmax) scale(.9) rotate(-20deg); }
}
.grain { position: fixed; inset: -50%; z-index: -1; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 520px) { .wrap { padding: 0 16px; } }
main { padding-bottom: 80px; }

.nav { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  background: linear-gradient(to bottom, rgba(7, 6, 26, .78), rgba(7, 6, 26, .35)); border-bottom: 1px solid var(--stroke); }
.nav .wrap { display: flex; align-items: center; gap: 12px; height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.logo-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 1.15rem;
  background: var(--accent); box-shadow: 0 6px 24px -6px var(--glow); }
.logo small { display: block; font-family: var(--font-body); font-weight: 600; font-size: .62rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; }
.nav-links { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.nav-links a, .icon-btn { padding: 9px 14px; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--ink-2);
  border: 1px solid transparent; background: none; cursor: pointer; transition: .2s; }
.nav-links a:hover, .icon-btn:hover { color: var(--ink); background: var(--glass); border-color: var(--stroke); }
.nav-links a.active { color: var(--ink); background: var(--glass-2); border-color: var(--stroke); }
.icon-btn { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; font-size: 1.05rem; }
@media (max-width: 560px) { .logo-text { display: none; } .nav-links a { padding: 8px 12px; } }

/* ---------- Hero ---------- */
.hero { padding: clamp(48px, 9vw, 110px) 0 clamp(36px, 6vw, 64px); text-align: center; position: relative; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--stroke); font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.eyebrow .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); font-size: .7rem; }
.hero h1 { font-size: clamp(2.6rem, 8.5vw, 6.2rem); font-weight: 800; margin: 22px auto 18px; max-width: 13ch; }
.shine { background: linear-gradient(90deg, #f0abfc, #f472b6, #fbbf24, #34d399, #60a5fa, #c084fc, #f0abfc);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 8s linear infinite; }
@keyframes shine { to { background-position: 300% 0; } }
.hero p.lead { font-size: clamp(1.02rem, 2.2vw, 1.25rem); color: var(--ink-2); max-width: 46ch; margin: 0 auto; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.floaties span { position: absolute; font-size: clamp(1.8rem, 4vw, 3rem); animation: bob 6s ease-in-out infinite; filter: drop-shadow(0 10px 20px rgba(0,0,0,.4)); user-select: none; }
.floaties span:nth-child(1) { left: 6%; top: 18%; }
.floaties span:nth-child(2) { right: 8%; top: 14%; animation-delay: -2s; }
.floaties span:nth-child(3) { left: 12%; bottom: 8%; animation-delay: -4s; }
.floaties span:nth-child(4) { right: 12%; bottom: 4%; animation-delay: -1s; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-18px) rotate(8deg); } }
@media (max-width: 720px) { .floaties span:nth-child(n+3) { display: none; } .floaties span { top: 4% !important; opacity: .8; } }

.stats { display: flex; justify-content: center; gap: clamp(18px, 5vw, 56px); margin-top: 44px; flex-wrap: wrap; }
.stat b { display: block; font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.3rem); }
.stat span { color: var(--ink-3); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; }

/* ---------- Buttons ---------- */
.btn { --b: var(--accent); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 26px; min-height: 52px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 700; font-size: 1rem;
  background: var(--b); color: #160b23; box-shadow: 0 12px 34px -12px var(--glow), inset 0 1px 0 rgba(255,255,255,.45);
  transition: transform .18s cubic-bezier(.3,.7,.4,1.5), box-shadow .2s, filter .2s; user-select: none; white-space: nowrap; }
.btn:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 18px 40px -12px var(--glow), inset 0 1px 0 rgba(255,255,255,.45); }
.btn:active { transform: translateY(1px) scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-ghost { background: var(--glass); color: var(--ink); border: 1px solid var(--stroke-2); box-shadow: none; backdrop-filter: blur(10px); }
.btn-ghost:hover { background: var(--glass-2); box-shadow: none; }
.btn-good { --b: linear-gradient(135deg, #34d399, #10b981); --glow: #10b981; }
.btn-bad { --b: linear-gradient(135deg, #fb7185, #e11d48); --glow: #e11d48; color: #fff; }
.btn-lg { padding: 18px 34px; min-height: 62px; font-size: 1.12rem; }
.btn-xl { padding: 22px 44px; min-height: 72px; font-size: 1.3rem; }
.btn-sm { padding: 9px 16px; min-height: 40px; font-size: .9rem; }
.btn-block { width: 100%; }

/* ---------- Game cards (home) ---------- */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 8px 0 22px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.section-head p { color: var(--ink-3); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 20px; perspective: 1200px; }
.gcard { position: relative; border-radius: var(--radius); padding: 1px; background: linear-gradient(160deg, var(--stroke-2), transparent 40%, var(--stroke));
  transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s; will-change: transform; }
.gcard:hover { box-shadow: 0 30px 70px -28px var(--glow); }
.gcard-in { position: relative; height: 100%; border-radius: calc(var(--radius) - 1px); overflow: hidden; background: linear-gradient(180deg, rgba(20, 16, 52, .92), rgba(12, 10, 34, .96)); display: flex; flex-direction: column; }
.gcard-art { position: relative; height: 150px; background: var(--accent); display: grid; place-items: center; overflow: hidden; }
.gcard-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.45), transparent 50%), linear-gradient(to bottom, transparent 55%, rgba(12,10,34,.96)); }
.gcard-art .emoji { font-size: 4.6rem; position: relative; z-index: 1; filter: drop-shadow(0 14px 18px rgba(0,0,0,.35)); transition: transform .5s cubic-bezier(.3,.7,.4,1.5); transform: translateZ(40px); }
.gcard:hover .emoji { transform: translateZ(40px) scale(1.15) rotate(-8deg); }
.gcard-art .rings { position: absolute; inset: 0; background: repeating-radial-gradient(circle at 50% 120%, rgba(255,255,255,.14) 0 2px, transparent 2px 22px); }
.gcard-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.gcard-body h3 { font-size: 1.45rem; }
.gcard-body p { color: var(--ink-2); font-size: .95rem; flex: 1; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { padding: 5px 11px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--glass); border: 1px solid var(--stroke); color: var(--ink-2); }
.gcard-cta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-weight: 700; }
.gcard-cta .arrow { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #160b23; transition: transform .3s; }
.gcard:hover .arrow { transform: translateX(4px) rotate(-45deg); }

/* ---------- Panels / stage ---------- */
.panel { background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03)); border: 1px solid var(--stroke); border-radius: var(--radius);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 36px); }
.game-head { display: flex; align-items: center; gap: 16px; padding: clamp(22px, 4vw, 40px) 0 22px; }
.game-icon { width: 64px; height: 64px; flex: none; border-radius: 20px; background: var(--accent); display: grid; place-items: center; font-size: 2rem; box-shadow: 0 14px 36px -10px var(--glow); }
.game-head h1 { font-size: clamp(1.9rem, 5.5vw, 3rem); }
.game-head p { color: var(--ink-2); margin-top: 4px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-weight: 600; font-size: .9rem; margin-top: 18px; }
.back:hover { color: var(--ink); }
.stage { max-width: 820px; margin: 0 auto; }
.screen { display: none; animation: rise .45s cubic-bezier(.2,.8,.2,1); }
.screen.on { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.center { justify-content: center; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .split.stack-sm { grid-template-columns: 1fr; } }
.label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .16em; color: var(--ink-3); margin-bottom: 10px; display: block; }
.muted { color: var(--ink-3); }
.big-q { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 5vw, 2.7rem); line-height: 1.15; letter-spacing: -.02em; }
.huge { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.6rem, 11vw, 5.6rem); line-height: 1; letter-spacing: -.035em; overflow-wrap: anywhere; }
.grad-text { background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hr { height: 1px; background: var(--stroke); margin: 6px 0; border: 0; }

/* ---------- Form bits ---------- */
.input { width: 100%; min-height: 52px; padding: 14px 18px; border-radius: var(--radius-sm); background: rgba(0,0,0,.25); border: 1px solid var(--stroke-2);
  color: var(--ink); font: inherit; font-size: 1rem; transition: .2s; }
.input:focus { outline: none; border-color: var(--glow); box-shadow: 0 0 0 4px color-mix(in srgb, var(--glow) 30%, transparent); }
.input::placeholder { color: var(--ink-3); }
.add-row { display: flex; gap: 10px; }
.add-row .input { flex: 1; min-width: 0; }
.seg { display: inline-flex; padding: 5px; border-radius: 999px; background: rgba(0,0,0,.3); border: 1px solid var(--stroke); flex-wrap: wrap; gap: 4px; }
.seg button { border: 0; background: none; padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: .92rem; color: var(--ink-2); cursor: pointer; transition: .2s; }
.seg button.on { background: var(--accent); color: #160b23; box-shadow: 0 6px 18px -6px var(--glow); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--stroke);
  font-weight: 600; font-size: .95rem; animation: pop .3s cubic-bezier(.3,.7,.4,1.5); }
.chip .x { width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(255,255,255,.1); cursor: pointer; display: grid; place-items: center; font-size: .8rem; color: var(--ink-2); }
.chip .x:hover { background: var(--bad); color: #fff; }
.chip.toggle { cursor: pointer; padding: 9px 16px; user-select: none; transition: .2s; }
.chip.toggle:not(.on) { opacity: .45; background: transparent; }
.chip.toggle.on { border-color: var(--stroke-2); background: color-mix(in srgb, var(--glow) 22%, transparent); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: #160b23; flex: none; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.empty { padding: 18px; border-radius: var(--radius-sm); border: 1px dashed var(--stroke-2); color: var(--ink-3); text-align: center; font-size: .95rem; }

/* ---------- Prompt card ---------- */
.pcard { position: relative; border-radius: 28px; padding: clamp(28px, 6vw, 56px) clamp(22px, 5vw, 48px); min-height: 260px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 16px;
  background: linear-gradient(160deg, rgba(255,255,255,.12), rgba(255,255,255,.03)); border: 1px solid var(--stroke-2); overflow: hidden; box-shadow: 0 40px 90px -40px var(--glow); }
.pcard::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 2px; background: var(--accent); opacity: .7;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.pcard .tag { padding: 6px 14px; border-radius: 999px; background: var(--accent); color: #160b23; font-weight: 800; font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; }
.flip-in { animation: flipIn .6s cubic-bezier(.2,.8,.2,1); }
@keyframes flipIn { from { transform: perspective(900px) rotateY(-90deg) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.slam { animation: slam .5s cubic-bezier(.3,.7,.4,1.5); }
@keyframes slam { from { transform: scale(1.6); opacity: 0; } to { transform: none; opacity: 1; } }
.shake { animation: shake .5s; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px) rotate(-1deg); } 40%, 60% { transform: translateX(8px) rotate(1deg); } }

/* ---------- Timer ring ---------- */
.ring { position: relative; width: 120px; height: 120px; margin: 0 auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: rgba(255,255,255,.1); }
.ring .bar { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.ring .num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 2.3rem; }
.ring.danger .num { color: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.15); } }

/* ---------- Scoreboard ---------- */
.board { display: flex; flex-direction: column; gap: 10px; }
.board-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--stroke); }
.board-row .rank { font-family: var(--font-display); font-weight: 800; width: 30px; color: var(--ink-3); }
.board-row .name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row .pts { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; }
.board-row.first { background: linear-gradient(90deg, rgba(251,191,36,.22), rgba(251,191,36,.04)); border-color: rgba(251,191,36,.5); }
.board-row.first .rank { color: #fbbf24; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.team-score { padding: 16px; border-radius: var(--radius-sm); background: var(--glass); border: 1px solid var(--stroke); text-align: center; transition: .3s; }
.team-score.active { border-color: var(--glow); box-shadow: 0 0 0 3px color-mix(in srgb, var(--glow) 35%, transparent); background: color-mix(in srgb, var(--glow) 14%, transparent); }
.team-score .n { font-weight: 700; color: var(--ink-2); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-score .s { font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; line-height: 1.1; }

/* ---------- Toast & misc ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 140%); z-index: 100; padding: 13px 20px; border-radius: 999px;
  background: rgba(20, 16, 52, .95); border: 1px solid var(--stroke-2); font-weight: 600; box-shadow: var(--shadow); transition: transform .4s cubic-bezier(.3,.7,.4,1.3); max-width: calc(100% - 32px); }
.toast.on { transform: translate(-50%, 0); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
.footer { padding: 40px 0 50px; text-align: center; color: var(--ink-3); font-size: .88rem; border-top: 1px solid var(--stroke); margin-top: 40px; }
.kbd { display: inline-block; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--stroke-2); font-size: .78rem; font-family: ui-monospace, monospace; color: var(--ink-2); }
.hide-sm { } @media (max-width: 560px) { .hide-sm { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
