/* 
   PING NEON  CSS redesenhado
 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #04070e;
  --surface: rgba(8, 16, 28, .92);
  --surface2: rgba(6, 11, 20, .95);
  --border: rgba(36, 239, 255, .13);
  --border2: rgba(255, 255, 255, .06);
  --accent: #24efff;
  --accent-glow: rgba(36, 239, 255, .28);
  --accent2: #ff4f7f;
  --accent2-glow: rgba(255, 79, 127, .28);
  --text: #e8edf8;
  --muted: #6a7590;
  --font: 'Orbitron', 'Rajdhani', system-ui, sans-serif;
  --font-body: 'Rajdhani', system-ui, sans-serif;
  --radius: 10px;
}

html { font-size: 16px; }

body {
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(ellipse 70% 50% at 10% 15%, rgba(36,239,255,.09) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 85%, rgba(255,79,127,.10) 0%, transparent 60%),
    linear-gradient(160deg, #03060c 0%, #060810 55%, #0a050e 100%);
  overflow-x: hidden;
}

button, select { font: inherit; cursor: pointer; }

/*  Layout  */
.game-page {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(.75rem, 2vw, 1.5rem);
}

.arcade-shell {
  width: min(1280px, 100%);
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/*  Top bar  */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .75rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(36,239,255,.04), inset 0 1px 0 rgba(255,255,255,.03);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: .9rem;
}

.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  border: 1px solid var(--border2);
  border-radius: 7px;
  background: rgba(255,255,255,.03);
  text-decoration: none;
  transition: color .15s, border-color .15s, background .15s;
  flex-shrink: 0;
}
.back-link:hover { color: var(--accent); border-color: var(--accent); background: rgba(36,239,255,.07); }

.brand { display: flex; flex-direction: column; gap: 0; line-height: 1; }

.eyebrow {
  font-family: var(--font);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .25em;
  color: var(--accent);
  text-shadow: 0 0 14px var(--accent-glow);
  text-transform: uppercase;
}

h1 {
  font-family: var(--font);
  font-size: clamp(1.4rem, 3.5vw, 2.1rem);
  font-weight: 900;
  letter-spacing: .06em;
  color: #f0f4ff;
  text-shadow: 0 0 22px rgba(255,255,255,.14);
  line-height: 1;
}

.accent { color: var(--accent); text-shadow: 0 0 18px var(--accent-glow); }
.accent2 { color: var(--accent2); text-shadow: 0 0 18px var(--accent2-glow); }
.accent-text { color: var(--accent); }

.top-bar-right {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}

.select-group {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.sel-label {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ctrl-select {
  min-height: 36px;
  padding: 0 1.8rem 0 .75rem;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  background-color: rgba(10,18,30,.9);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 15px, calc(100% - 9px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  appearance: none;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.ctrl-select:focus, .ctrl-select:hover {
  outline: none;
  border-color: rgba(36,239,255,.55);
  box-shadow: 0 0 12px rgba(36,239,255,.1);
}
.ctrl-select option { background: #0a121e; }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  border: 1px solid var(--border2);
  border-radius: 7px;
  background: rgba(255,255,255,.03);
  transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: rgba(36,239,255,.07); }
.icon-btn.is-muted { color: var(--accent2); border-color: rgba(255,79,127,.4); }

/*  Scoreboard  */
.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.score-side {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.score-side.left-side { align-items: flex-start; }
.score-side.right-side { align-items: flex-end; }

.score-label {
  font-family: var(--font);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--muted);
  text-transform: uppercase;
}

.score-num {
  font-family: var(--font);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 28px var(--accent-glow);
  letter-spacing: -.01em;
  transition: transform .12s;
}

.score-num.accent2 {
  color: var(--accent2);
  text-shadow: 0 0 28px var(--accent2-glow);
}

/* Set wins pips */
.wins-pips {
  display: flex;
  gap: 5px;
  min-height: 10px;
}
.right-pips { justify-content: flex-end; }

.wins-pips .pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.right-pips .pip {
  background: var(--accent2);
  box-shadow: 0 0 8px var(--accent2-glow);
}

/* Score center */
.score-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  padding: 0 1.2rem;
  border-left: 1px solid var(--border2);
  border-right: 1px solid var(--border2);
}

.center-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .08rem;
}

.rally-label {
  font-family: var(--font);
  font-size: .52rem;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--muted);
  text-transform: uppercase;
}

.rally-num {
  font-family: var(--font);
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.divider-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border);
}

/*  Canvas / Stage  */
.stage-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 480px;
  max-height: calc(100vh - 280px);
  overflow: hidden;
  border: 1px solid rgba(36,239,255,.14);
  border-radius: var(--radius);
  background: #02050b;
  box-shadow:
    0 0 0 1px rgba(36,239,255,.04),
    0 0 50px rgba(36,239,255,.07),
    0 0 80px rgba(255,79,127,.06),
    inset 0 0 80px rgba(0,0,0,.4);
}

.pong-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 18% 30%, rgba(36,239,255,.09), transparent 35%),
    radial-gradient(circle at 82% 70%, rgba(255,79,127,.09), transparent 35%);
}

canvas {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/*  Overlays  */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 5, 10, .82);
  backdrop-filter: blur(4px);
}

.overlay.hidden { display: none; }

.overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  padding: 2.5rem 2rem;
  max-width: 520px;
  text-align: center;
}

.overlay-eyebrow {
  font-family: var(--font);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .28em;
  color: var(--accent);
  text-shadow: 0 0 14px var(--accent-glow);
  text-transform: uppercase;
}

.overlay-title {
  font-family: var(--font);
  font-size: clamp(2.2rem, 7vw, 4.2rem);
  font-weight: 900;
  letter-spacing: .04em;
  color: #f4f8ff;
  text-shadow: 0 0 30px rgba(255,255,255,.2), 0 0 60px rgba(36,239,255,.15);
  line-height: 1;
}

.overlay-desc {
  color: rgba(180, 195, 220, .82);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.6;
  max-width: 400px;
}

.play-btn {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  min-height: 50px;
  padding: 0 2rem;
  font-family: var(--font);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: #000;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  box-shadow: 0 0 24px var(--accent-glow), 0 0 48px rgba(36,239,255,.12);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px var(--accent-glow), 0 0 64px rgba(36,239,255,.18);
  filter: brightness(1.08);
}
.play-btn:active { transform: translateY(0); }

.play-icon { font-size: 1rem; }

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  padding: 0 1.4rem;
  font-family: var(--font);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color .15s, background .15s;
}
.ghost-btn:hover { border-color: rgba(36,239,255,.5); background: rgba(36,239,255,.06); }

.end-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  justify-content: center;
}

/*  Hints grid  */
.hint-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem .85rem;
  margin-top: .35rem;
}

.hint-item {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.hint-key {
  font-family: var(--font);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent);
  background: rgba(36,239,255,.08);
  border: 1px solid rgba(36,239,255,.22);
  border-radius: 5px;
  padding: .2rem .5rem;
  white-space: nowrap;
}

.hint-desc {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}

/*  Bottom hint  */
.bottom-hint {
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .04em;
}

/*  Responsive  */
@media (max-width: 860px) {
  .top-bar { flex-wrap: wrap; gap: .75rem; }
  .top-bar-right { width: 100%; }
  .select-group { flex: 1; }
  .ctrl-select { width: 100%; }
}

@media (max-width: 580px) {
  .game-page { padding: .5rem; }
  .scoreboard { padding: .7rem 1rem; }
  .score-num { font-size: 2.4rem; }
  .score-center { padding: 0 .75rem; }
  .stage-wrap { aspect-ratio: 4/5; min-height: 380px; max-height: none; }
  .hint-grid { grid-template-columns: 1fr; }
  .overlay-inner { padding: 1.5rem 1rem; }
  .sel-label { display: none; }
  h1 { font-size: 1.4rem; }
}
