:root{
  --bg:#031226;
  --panel:#072033;
  --accent:#58d1ff;
  --muted:#9fb6c6;
  --primary:#28a7ff;
  --danger:#ff5b5b;
  --btn-h:48px;
  --radius:12px;
}
*{box-sizing:border-box}
html,body,#app{height:100%;margin:0;background:var(--bg);font-family:"Segoe UI",system-ui,-apple-system,Segoe,Roboto,"Helvetica Neue",Arial;}
.viewport{display:flex;align-items:stretch;justify-content:center;position:relative;overflow:hidden}
.overlay{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* make the intro more visible while still subtle */
  opacity: 0.9;
  pointer-events: none;
}
.screen{width:100%;height:100vh;display:flex;align-items:center;justify-content:center}
.center{align-items:center;justify-content:center;flex-direction:column}
.hidden{display:none}
.panel{background:linear-gradient(180deg,var(--panel),#052631);border-radius:16px;padding:16px;color:var(--muted);box-shadow:0 6px 18px rgba(0,0,0,0.6);width:320px;max-width:92%}
.logo{font-weight:900;font-size:28px;color:var(--accent);text-align:center;margin-bottom:8px}
.menu-panel .controls{display:flex;flex-direction:column;gap:10px}

/* help modal styling */
.help-modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(2,6,10,0.6);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1200;
}
.help-modal{
  width:min(92%,420px);
  background:linear-gradient(180deg,var(--panel),#052631);
  border-radius:14px;
  padding:16px;
  color:var(--muted);
  box-shadow:0 10px 30px rgba(0,0,0,0.6);
}
.help-modal h4{margin:0 0 8px 0;color:var(--accent)}
.help-modal p{margin:6px 0;color:var(--muted);line-height:1.3;font-size:14px}
.help-modal .help-row{display:flex;justify-content:flex-end;margin-top:12px;gap:8px}
.btn{height:var(--btn-h);border-radius:10px;border:0;background:#0b3b4b;color:white;padding:0 12px;font-weight:700;cursor:pointer}
.btn.primary{background:linear-gradient(90deg,var(--primary),#47d1ff)}
.btn.red{background:var(--danger)}
/* ensure stacked rows inside panels have breathing room so buttons don't overlap */
.panel .row{display:flex;gap:8px;justify-content:center;margin-top:12px}
.game-area{width:100%;height:100vh;background:linear-gradient(180deg,#00111a,#002433);display:block}
.hud{
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px; /* allow contents to span and place pause on right */
  color: white;
  font-weight: 700;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between; /* push pause to far right */
}

/* left-side grouping inside HUD */
.hud-left{
  display: flex;
  gap: 12px;
  align-items: center;
}
.touch-controls{
  position:absolute;
  bottom:18px; /* moved down closer to the bottom edge */
  left:50%;
  transform:translateX(-50%);
  display:flex;
  gap:14px;
  padding:8px;
  align-items:center;
  justify-content:center;
  width: min(86%, 420px);
  max-width:420px;
  /* a subtle, slightly elevated pill with soft glow */
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(4,18,26,0.08));
  border-radius:48px;
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow: 0 8px 28px rgba(2,10,14,0.55), inset 0 1px 0 rgba(255,255,255,0.02);
  backdrop-filter: blur(6px) saturate(1.05);
  padding-left:12px;
  padding-right:12px;
  touch-action: manipulation;
}

/* base circle control updated to look like modern tactile controls */
.circle{
  width:64px;
  height:64px;
  min-width:64px;
  min-height:64px;
  border-radius:50%;
  border:0;
  background: linear-gradient(180deg, #083839, #05323a);
  color:white;
  font-size:20px;
  font-weight:800;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 8px 18px rgba(2,12,16,0.6), inset 0 1px 0 rgba(255,255,255,0.03);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* primary fire button visual emphasis */
.circle.red{
  background: linear-gradient(180deg, #ff6b6b, #ff4b4b);
  box-shadow: 0 10px 24px rgba(255,91,91,0.22), inset 0 1px 0 rgba(255,255,255,0.06);
  width:74px;
  height:74px;
  min-width:74px;
  min-height:74px;
  font-size:22px;
}

/* pressed / active states for better tactile feedback */
.circle:active,
.circle.pressed{
  transform: translateY(2px) scale(0.98);
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  filter: brightness(0.98);
}

/* ensure touch targets meet accessibility size and spacing */
@media (max-width:420px){
  .circle{ width:60px; height:60px; min-width:60px; min-height:60px; font-size:18px; }
  .circle.red{ width:68px; height:68px; min-width:68px; min-height:68px; font-size:20px; }
  .touch-controls{ bottom:14px; gap:12px; padding:8px; }
}

 /* Alternate theme variables applied when .alt-theme is set on the root element.
    This provides a warmer, higher-contrast theme suitable as a visible change. */
:root.alt-theme{
  --bg:#0b1320;
  --panel:#162330;
  --accent:#ffd36b;
  --muted:#e8dcc8;
  --primary:#ffb86b;
  --danger:#ff7b7b;
}

:root.alt-theme .panel{
  background:linear-gradient(180deg,var(--panel),#0f2734);
}

/* Parental input styling (keeps panel styles consistent) */
#parentNameInput{
  color:var(--muted);
  caret-color:var(--accent);
  font-weight:700;
  /* better vertical sizing to match the Save button */
  height:36px;
  padding:8px 10px;
  border-radius:10px;
  box-sizing:border-box;
}
#parentNameInput::placeholder{ color: rgba(255,255,255,0.18); }

/* ensure the input + save area is aligned and doesn't allow the Save button to drop out */
#parental .panel > div {
  display:flex;
  gap:8px;
  align-items:center;
}

/* make the Save button smaller and visually match the input so it sits inside the container */
#saveNameBtn {
  height:36px;
  padding:6px 10px;
  font-size:14px;
  border-radius:10px;
  align-self:stretch;
}