:root {
  --pitch: #0b1f14;
  --ink: #e8f5e9;
  --gold: #f0c14a;
  --blue: #2f6bff;
  --red: #e23d3d;
  --mint: #2ecf9a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #app, .screen { width: 100%; height: 100%; }
body {
  font-family: "Nunito", system-ui, sans-serif;
  background: var(--pitch);
  color: var(--ink);
  overflow: hidden;
  user-select: none;
}
.hidden { display: none !important; }
.screen { position: absolute; inset: 0; }

#home { display: grid; place-items: center; padding: 24px; z-index: 5; }
.home-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 20, 14, 0.35), rgba(8, 20, 14, 0.78)),
    url("../assets/hero.jpg") center / cover no-repeat;
}
.home-card, .lobby-card, .results-card {
  position: relative;
  width: min(440px, 100%);
  background: rgba(10, 28, 20, 0.88);
  border: 2px solid rgba(240, 193, 74, 0.35);
  border-radius: 24px;
  padding: 28px 24px 20px;
  text-align: center;
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.mascot {
  width: 118px; height: 118px; object-fit: cover; border-radius: 50%;
  border: 3px solid var(--gold); margin: -78px auto 8px; background: #163226;
}
h1, h2 { font-family: "Bebas Neue", sans-serif; letter-spacing: 0.06em; }
h1 { font-size: clamp(3rem, 10vw, 4.4rem); color: #fff; }
.tag { color: #b7d4c2; margin: 0 0 10px; }
.live { font-size: 0.85rem; color: #7ea88c; margin-bottom: 14px; }
.field { display: grid; gap: 6px; text-align: left; font-size: 0.78rem; font-weight: 800; color: #8fb89c; }
input {
  width: 100%; border: 0; border-radius: 12px; padding: 12px 14px;
  font: 800 1.05rem "Nunito", sans-serif; color: #0b1f14;
  background: #e8f5e9; outline: none;
}
#code { text-align: center; letter-spacing: 0.28em; text-transform: uppercase; font-family: "Bebas Neue", sans-serif; font-size: 1.4rem; }
.actions { display: flex; gap: 10px; margin-top: 14px; }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 10px; }
.btn {
  flex: 1; border: 0; cursor: pointer; border-radius: 999px; padding: 12px 16px;
  font: 800 1rem "Bebas Neue", sans-serif; letter-spacing: 0.06em; color: #08140e;
  box-shadow: 0 6px 0 rgba(0,0,0,0.25);
}
.btn:active { transform: translateY(2px); box-shadow: 0 3px 0 rgba(0,0,0,0.25); }
.btn.gold { background: linear-gradient(#ffe08a, var(--gold)); }
.btn.mint { background: linear-gradient(#6aefc4, var(--mint)); }
.btn.red { background: linear-gradient(#ff7a7a, var(--red)); color: #fff; }
.btn.tiny { flex: 0; padding: 8px 12px; background: #1b3a2a; color: var(--gold); }
.hint { margin-top: 12px; font-size: 0.78rem; color: #7ea88c; }
.hint.faint { opacity: 0.8; }
.hint a { color: #f0c14a; }

#lobby { display: grid; place-items: center; z-index: 20; pointer-events: none; background: rgba(8,20,14,0.25); }
#lobby .lobby-card { pointer-events: auto; }
.kicker { font-size: 0.75rem; letter-spacing: 0.16em; font-weight: 800; color: #8fb89c; }
#lobby-code { font-size: 2.8rem; color: var(--gold); }
.code-row { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 6px 0 14px; }
.player-list { list-style: none; display: grid; gap: 8px; text-align: left; }
.player-list li {
  display: flex; align-items: center; gap: 10px; background: #12281c;
  border-radius: 12px; padding: 8px 12px; font-weight: 800;
}
.swatch { width: 14px; height: 14px; border-radius: 50%; }
.text-btn { margin-top: 12px; background: none; border: 0; color: #7ea88c; font: 800 0.9rem "Nunito", sans-serif; cursor: pointer; }

#game { z-index: 1; background: #062010; }
#c { display: block; width: 100%; height: 100%; }

.hud { position: absolute; top: 14px; left: 14px; right: 14px; pointer-events: none; }
.scoreboard {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: rgba(8, 22, 16, 0.82); border: 1px solid rgba(240,193,74,0.25);
  border-radius: 16px; padding: 8px 14px; max-width: 560px; margin: 0 auto;
}
.side { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.side.away { justify-content: flex-end; }
.side b { font-family: "Bebas Neue", sans-serif; font-size: 2rem; line-height: 1; }
.side.home b { color: #7aa2ff; }
.side.away b { color: #ff7a7a; }
.clock { font-family: "Bebas Neue", sans-serif; font-size: 1.6rem; color: var(--gold); padding: 0 12px; }
.power-wrap {
  width: min(240px, 60%); margin: 10px auto 0; display: flex; align-items: center; gap: 8px;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.12em; color: #cfe8d6;
}
.power { flex: 1; height: 8px; background: #1b3a2a; border-radius: 99px; overflow: hidden; }
.power i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffe08a, #e23d3d); }

.banner {
  position: absolute; top: 28%; left: 50%; transform: translateX(-50%);
  font-family: "Bebas Neue", sans-serif; font-size: clamp(3rem, 10vw, 6rem);
  color: #fff; text-shadow: 0 8px 0 rgba(0,0,0,0.25); letter-spacing: 0.08em;
  pointer-events: none;
}
.help {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: rgba(8,22,16,0.75); border-radius: 999px; padding: 6px 12px;
  font-size: 0.75rem; font-weight: 800; color: #b7d4c2; pointer-events: none;
}
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(6,20,12,0.45); z-index: 8; }

.touch { position: absolute; inset: 0; pointer-events: none; }
.stick {
  position: absolute; left: 24px; bottom: 24px; width: 120px; height: 120px;
  border-radius: 50%; background: rgba(255,255,255,0.12); pointer-events: auto; touch-action: none;
}
.stick i { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%; background: #fff; }
#kick, #sprint {
  position: absolute; right: 24px; border: 0; border-radius: 50%; color: #08140e;
  font: 800 0.85rem "Bebas Neue", sans-serif; pointer-events: auto;
}
#kick { bottom: 28px; width: 88px; height: 88px; background: var(--gold); }
#sprint { bottom: 128px; width: 64px; height: 64px; background: var(--mint); }

@media (max-width: 700px) {
  .help { display: none; }
  .side span { display: none; }
}
@media (pointer: coarse) { .help { display: none; } }
