/* Base compartilhada pelos jogos SIGMA: tokens, botões, HUD, cartões, modal, nome do aluno e avisos. */
:root {
  --bg: #0a0d12;
  --bg2: #10151d;
  --panel: #141b25;
  --line: #243041;
  --text: #e6edf3;
  --dim: #8b98a8;
  --yellow: #ffd400;
  --red: #ff3b30;
  --red2: #e5484d;
  --green: #2ecc71;
  --blue: #5ab0ff;
  --orange: #ff8a1f;
  --wire: #7d8da1;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Oswald', 'Impact', 'Arial Narrow', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(ellipse at top, #121a26 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

.hazard {
  height: 10px; border-radius: 3px; margin-bottom: 22px;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 14px, #111 14px 28px);
}

/* ---------------- botões ---------------- */
.act {
  background: #1b2430; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; text-align: left; font-weight: 600; font-size: 14px;
  transition: transform .08s, background .15s, border-color .15s;
}
.act:hover:not(:disabled) { background: #222d3b; border-color: #34465c; }
.act:active:not(:disabled) { transform: scale(.98); }
.act:disabled { opacity: .55; cursor: default; }
.act.done { border-color: rgba(46, 204, 113, .5); color: #9be7bd; }
.act.done::after { content: ' ✓'; }
.act.primary {
  background: var(--yellow); color: #111; border-color: var(--yellow); font-weight: 800;
  text-align: center; letter-spacing: .3px;
}
.act.primary:hover:not(:disabled) { background: #ffe14d; }
.act.warn { border-color: var(--orange); color: #ffc48a; }
.act.ghost { background: transparent; text-align: center; }
.act.big { font-size: 18px; padding: 16px 22px; font-family: var(--display); letter-spacing: 1px; }

/* ---------------- menu ---------------- */
.menu-wrap { max-width: 760px; margin: 0 auto; padding: 32px 16px 48px; }
.kicker { font-family: var(--mono); color: var(--yellow); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; margin: 0 0 6px; }
.logo { font-family: var(--display); font-size: clamp(46px, 11vw, 92px); line-height: .92; margin: 0 0 14px; display: flex; flex-direction: column; text-transform: uppercase; }
.logo .ou { font-size: .32em; color: var(--dim); font-family: var(--font); font-weight: 400; text-transform: none; margin: 4px 0 2px 4px; }
.tag { color: #c4cfdb; font-size: 17px; line-height: 1.5; margin: 0 0 22px; }
.name-box { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; max-width: 520px; }
.name-box span { font-family: var(--mono); font-size: 12px; color: var(--yellow); letter-spacing: 1.2px; text-transform: uppercase; }
.name-box input {
  font: inherit; font-size: 18px; color: var(--text); background: var(--panel); border: 2px solid var(--line);
  border-radius: 12px; padding: 13px 14px; outline: none; transition: border-color .15s;
}
.name-box input:focus { border-color: var(--yellow); }
.name-box input.err { border-color: var(--red); animation: nudge .35s; }
@keyframes nudge { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.name-err { color: #ff8b85; font-size: 14px; margin: -4px 0 12px; }
.who { font-family: var(--mono); font-size: 13px; color: #c4cfdb; margin: 4px 0 8px; }
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-t); position: absolute; left: 0; top: 0; width: 100%; overflow: hidden;
}
.glitch::before { color: var(--blue); animation: gl1 2.6s infinite steps(1); clip-path: inset(0 0 60% 0); }
.glitch::after { color: var(--yellow); animation: gl2 3.1s infinite steps(1); clip-path: inset(55% 0 0 0); }
@keyframes gl1 { 0%, 92%, 100% { transform: none; opacity: 0; } 93% { transform: translate(-4px, -1px); opacity: .8; } 96% { transform: translate(3px, 1px); opacity: .8; } }
@keyframes gl2 { 0%, 88%, 100% { transform: none; opacity: 0; } 89% { transform: translate(4px, 1px); opacity: .8; } 94% { transform: translate(-3px, 0); opacity: .8; } }

.rank { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 26px 0 12px; font-family: var(--mono); font-size: 13px; color: var(--dim); }
.rank .rank-name { color: var(--yellow); }
.foot { color: #5d6b7c; font-size: 12px; margin-top: 26px; }
.other-games { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; }
.other-games a { color: var(--yellow); text-decoration: none; font-size: 14px; }
.other-games a:hover { text-decoration: underline; }

.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* ---------------- HUD ---------------- */
.hud {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: rgba(10, 13, 18, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line);
}
.hud-title { flex: 1; font-family: var(--display); font-size: 18px; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.hud-stat { font-family: var(--mono); font-size: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; white-space: nowrap; }
.hud-btn { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; width: 36px; height: 34px; }

.sh-kind { font-family: var(--mono); font-size: 11px; color: var(--orange); letter-spacing: 1.2px; }

/* ---------------- modal / overlays ---------------- */
.modal, .overlay {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(5, 7, 10, .78); backdrop-filter: blur(3px); overflow-y: auto;
}
.card { background: var(--panel); border: 1px solid #2f4057; border-radius: 18px; padding: 22px; width: 100%; max-width: 520px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); margin: auto; }
.card h3 { margin: 4px 0 8px; }
.card p { color: #c4cfdb; line-height: 1.55; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.lesson { text-align: left; background: rgba(46, 204, 113, .08); border-left: 4px solid var(--green); border-radius: 0 10px 10px 0; padding: 10px 14px; }
.lesson b { color: #8fe3b4; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.lesson p { margin: 4px 0 0; }
.refs { text-align: left; font-size: 12.5px; color: var(--dim); margin-top: 12px; line-height: 1.6; }

body.shake .screen.active { animation: shake .09s linear 10; }
@keyframes shake { 25% { transform: translate(-8px, 4px); } 50% { transform: translate(7px, -5px); } 75% { transform: translate(-5px, -3px); } }

.toasts { position: fixed; top: 58px; left: 50%; transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; gap: 8px; width: min(560px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: #1b2430; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: rise .25s ease-out; transition: opacity .4s, transform .4s; }
.toast.out { opacity: 0; transform: translateY(-8px); }
.toast.infraction { background: #3a1214; border-color: var(--red); color: #ffd0cc; font-weight: 600; }
.toast.warn { background: #3a2410; border-color: var(--orange); color: #ffd3a6; }
.toast.radio { border-color: var(--blue); border-width: 2px; background: #13243a; font-size: 15px; }

/* ---------------- responsivo ---------------- */
@media (max-width: 900px) {
  .hud-title { font-size: 15px; }
  .hud-stat { font-size: 12px; padding: 4px 7px; }
}
@media (max-width: 420px) {
  .hud { gap: 6px; padding: 6px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .glitch::before, .glitch::after, body.shake .screen.active { animation: none; }
}
