/* ==========================================================
   N75 — Página de jogo (River Raid)
   ========================================================== */
:root {
  --navy-900: #0b1622; --line: #22394f; --blue-500: #5289c0; --blue-300: #8fb5dc;
  --ink-100: #e8eff7; --ink-300: #a9bccf; --ink-500: #6f869c;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; min-height: 100svh; display: flex; flex-direction: column;
  background: radial-gradient(90% 50% at 50% 0%, #15304b 0%, transparent 70%), var(--navy-900);
  color: var(--ink-100); font-family: var(--font-display); -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--blue-300); outline-offset: 4px; border-radius: 6px; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem clamp(1.25rem, 4vw, 3rem); }
.top__home { display: inline-flex; line-height: 0; }
.top__home svg { height: 28px; width: auto; }
.top__back { font: 400 .8rem var(--font-mono); color: var(--ink-300); text-decoration: none; }
.top__back:hover { color: var(--ink-100); }
.logo-n { fill: #fff; } .logo-75 { fill: var(--blue-500); }

.wrap { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem) 3rem; }

.intro { padding: 1rem 0 1.25rem; }
.intro__cat { margin: 0; font: 400 .7rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--blue-500); }
.intro__title { margin: .4rem 0 0; font-size: clamp(1.8rem, 5vw, 2.8rem); letter-spacing: -.02em; line-height: 1.1; }
.intro__title span { color: var(--ink-300); font-weight: 400; font-size: .55em; margin-left: .4rem; }

/* tela 16:9 */
.screen {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border: 1px solid #2a4560; border-radius: 14px; overflow: hidden; background: #000;
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.screen__game { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.screen__start {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem;
  border: 0; cursor: pointer; color: var(--ink-100);
  background: radial-gradient(60% 60% at 50% 50%, rgba(21,48,75,.92), rgba(11,22,34,.97));
  font: 500 1rem var(--font-mono);
}
.screen__start small { font: 400 .72rem var(--font-mono); color: var(--ink-500); }
.screen__play {
  display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%;
  background: var(--blue-500); color: var(--navy-900); font-size: 1.6rem; padding-left: 5px;
  box-shadow: 0 0 0 10px rgba(82,137,192,.18); transition: transform .25s;
}
.screen__start:hover .screen__play { transform: scale(1.08); }
.screen.is-on .screen__start { display: none; }
.touch-note strong { color: var(--ink-100); }

.touch-note { display: none; margin: 1rem 0 0; padding: .8rem 1rem; border: 1px dashed #2f4f6d; border-radius: 10px; font-size: .88rem; color: var(--ink-300); }
@media (hover: none) { .touch-note { display: block; } }

.info { display: grid; gap: 2rem; margin-top: 2rem; }
@media (min-width: 800px) { .info { grid-template-columns: 1fr 1.3fr; } }
.info h2 { margin: 0 0 .8rem; font: 500 .72rem var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--blue-300); }
.info p { margin: 0 0 .8rem; color: var(--ink-300); line-height: 1.6; font-size: .95rem; }
.info .credit { font-size: .8rem; color: var(--ink-500); }
.keys { margin: 0; display: grid; gap: .5rem; }
.keys div { display: flex; gap: .8rem; align-items: baseline; }
.keys dt { min-width: 7.5rem; font: 500 .75rem var(--font-mono); padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 6px; text-align: center; }
.keys dd { margin: 0; color: var(--ink-300); font-size: .9rem; }

.foot { display: flex; gap: .6rem; justify-content: center; padding: 1.25rem; font: 400 .72rem var(--font-mono); color: var(--ink-500); }
.foot a { text-decoration: none; }

/* ==========================================================
   Palco: jogo + controles de toque + tela cheia
   ========================================================== */
.stage { position: relative; }

.stage__bar { display: flex; justify-content: flex-end; margin-top: .6rem; }
.stage__full {
  font: 500 .75rem var(--font-mono); color: var(--ink-300);
  background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: .45rem .75rem; cursor: pointer;
}
.stage__full:hover { color: var(--ink-100); border-color: var(--blue-500); }
.stage__exit, .stage__rotate { display: none; }

/* controles de toque: escondidos no desktop */
.pad { display: none; }

@media (hover: none) and (pointer: coarse) {
  .stage.is-on .pad {
    display: flex; justify-content: space-between; align-items: center;
    gap: 1rem; margin-top: 1rem;
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  }
}


.pad__btn, .pad__small {
  touch-action: none;
  border: 1px solid rgba(143,181,220,.35);
  background: rgba(17,32,47,.72);
  color: var(--ink-100);
  font: 500 1.1rem/1 var(--font-mono);
  border-radius: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .08s, transform .08s;
}
.pad__btn.is-down, .pad__small.is-down { background: var(--blue-500); color: var(--navy-900); transform: scale(.94); }

.pad__acts { display: flex; align-items: center; gap: .6rem; }

/* ---------- Joystick virtual ---------- */
.stick {
  --r: 60px;                          /* raio da base */
  position: relative;
  width: calc(var(--r) * 2 + 16px);
  height: calc(var(--r) * 2 + 16px);
  touch-action: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
.stick__base {
  position: absolute;
  left: 50%; top: 50%;
  width: calc(var(--r) * 2); height: calc(var(--r) * 2);
  margin: calc(var(--r) * -1) 0 0 calc(var(--r) * -1);
  border-radius: 50%;
  border: 1.5px solid rgba(143,181,220,.4);
  background: radial-gradient(circle, rgba(82,137,192,.18) 0%, rgba(11,22,34,.45) 70%);
  pointer-events: none;
  transition: opacity .2s;
}
.stick__knob {
  position: absolute; left: 50%; top: 50%;
  width: 54px; height: 54px; margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #a9c7e6, var(--blue-500) 70%);
  box-shadow: 0 6px 18px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.35);
  transform: translate(var(--kx, 0px), var(--ky, 0px));
  transition: transform .12s ease-out;
}
.stick.is-active .stick__knob { transition: none; }
.stick.is-active .stick__base { border-color: var(--blue-300); }
.pad__small { width: 44px; height: 44px; font-size: .8rem; border-radius: 50%; color: var(--ink-300); }
.pad__fire {
  width: 96px; height: 96px; border-radius: 50%;
  background: rgba(82,137,192,.35); border-color: var(--blue-500);
  font: 700 .85rem/1 var(--font-mono); letter-spacing: .08em;
}

/* ---------- Tela cheia (nativa ou simulada) ---------- */
.stage.is-full {
  position: fixed; inset: 0; z-index: 100;
  width: 100vw; height: 100vh; height: 100dvh;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  margin: 0;
}
.stage.is-full .screen {
  width: min(100vw, calc(100dvh * 16 / 9));
  height: auto;
  border: 0; border-radius: 0; box-shadow: none;
}
.stage.is-full .stage__bar { position: absolute; top: .6rem; right: .6rem; margin: 0; z-index: 3; }
.stage.is-full .stage__full { display: none; }
.stage.is-full .stage__exit {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.45); color: #fff; font-size: 1rem; cursor: pointer;
}
/* controles sobrepostos nas laterais do jogo */
.stage.is-full .pad {
  position: absolute; inset: auto 0 0 0; z-index: 2;
  margin: 0; padding: 0 max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-right));
  pointer-events: none;
}
.stage.is-full .pad > * { pointer-events: auto; }
.stage.is-full .pad { inset: 0; align-items: flex-end; }
.stage.is-full .stick {
  position: absolute; left: 0; top: 64px; bottom: 0;
  width: 48%; height: auto;
}
/* posição de descanso da base: canto inferior esquerdo */
.stage.is-full .stick__base {
  left: calc(var(--r) + max(1.25rem, env(safe-area-inset-left)));
  top: auto; bottom: max(1.25rem, env(safe-area-inset-bottom));
  margin: 0 0 0 calc(var(--r) * -1);
  opacity: .75;
}
.stage.is-full .stick.is-active .stick__base { opacity: 1; }
.stage.is-full .pad__acts {
  position: absolute;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
}
.stage.is-full .pad__btn, .stage.is-full .pad__small { background: rgba(11,22,34,.45); }
.stage.is-full .pad__fire { background: rgba(82,137,192,.38); }

/* em pé, em tela cheia: pede para girar */
@media (orientation: portrait) {
  .stage.is-full .stage__rotate {
    display: block; position: absolute; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 3;
    margin: 0; padding: .5rem .9rem; border-radius: 999px;
    background: rgba(11,22,34,.85); border: 1px solid var(--line);
    font: 500 .78rem var(--font-mono); color: var(--ink-100); white-space: nowrap;
  }
}

/* telas estreitas (celular em pé): controles menores para caber */
@media (max-width: 440px) {
  .stick { --r: 52px; }
  .pad__small { width: 38px; height: 38px; }
  .pad__fire { width: 80px; height: 80px; }
  .pad__acts { gap: .4rem; }
}
