* {
  box-sizing: border-box;
}

:root {
  --bg-top: #20103a;
  --bg-bottom: #050816;
  --panel: rgba(10, 14, 31, 0.9);
  --panel-border: rgba(125, 211, 252, 0.24);
  --text-main: #f8fafc;
  --text-dim: #9fb3d9;
  --text-faint: #6b7da8;
  --accent: #38bdf8;
  --accent-warm: #fb7185;
  --accent-gold: #fbbf24;
  --button-bg: linear-gradient(180deg, #fb7185, #e11d48);
  --shadow: 0 14px 36px rgba(3, 7, 18, 0.42);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.18), transparent 30%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom) 62%);
  color: var(--text-main);
  font-family: "Trebuchet MS", "Arial Narrow", Arial, sans-serif;
}

.game-shell {
  width: min(100vw, 560px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 10px 10px 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
}

.hud {
  display: grid;
  gap: 6px;
}

.hud-primary,
.hud-meta {
  display: grid;
  gap: 6px;
}

.hud-primary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hud-meta {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.stat-chip,
.meta-chip,
.thumb-zone {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(21, 25, 47, 0.96), rgba(8, 12, 27, 0.94)),
    var(--panel);
  box-shadow: var(--shadow);
}

.stat-chip,
.meta-chip {
  padding: 8px 10px;
  display: grid;
  gap: 3px;
  align-content: center;
}

.label,
.control-label {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stat-chip strong,
.meta-chip strong {
  line-height: 1.1;
}

.stat-chip strong {
  font-size: 20px;
}

.meta-chip strong {
  font-size: 13px;
}

.effects-wrap strong {
  color: var(--accent-gold);
}

.status-wrap strong {
  color: var(--accent);
}

.playfield {
  min-height: 0;
  display: grid;
  align-items: center;
}

.playfield canvas {
  display: block;
  width: 100%;
  max-height: calc(100svh - 190px);
  aspect-ratio: 800 / 520;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.94)),
    #020617;
  box-shadow: var(--shadow);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.touch-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(122px, 0.85fr);
  gap: 8px;
}

.thumb-zone {
  padding: 9px;
  display: grid;
  gap: 8px;
}

.drag-lane {
  min-height: 62px;
  border: 1px dashed rgba(125, 211, 252, 0.55);
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(8, 47, 73, 0.66), rgba(30, 41, 59, 0.92)),
    radial-gradient(circle at center, rgba(56, 189, 248, 0.14), transparent 58%);
  display: grid;
  place-items: center;
  padding: 0 18px;
  text-align: center;
  color: #dbeafe;
  font-size: 14px;
  font-weight: 700;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.action-zone {
  align-content: start;
}

.action-button {
  min-height: 62px;
  border: 0;
  border-radius: 18px;
  background: var(--button-bg);
  color: #fff1f2;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(225, 29, 72, 0.34);
}

.action-button:hover,
.action-button:focus-visible {
  filter: brightness(1.08);
}

.control-note {
  margin: 0;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.35;
}

@media (min-width: 561px) {
  .game-shell {
    width: min(100vw, 760px);
  }

  .touch-controls {
    grid-template-columns: minmax(0, 1.9fr) minmax(170px, 0.8fr);
  }

  .playfield canvas {
    max-height: calc(100vh - 206px);
  }
}
