:root {
  --brand: #DC204A;
  --brand-dark: #002D4F;
  --accent: #E2DDD4;
  --highlight: #FF5C7A;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #0a4370 0%, var(--brand-dark) 70%) fixed;
  color: #fff;
  font-family: "Segoe UI", "Helvetica Neue", Roboto, Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#app {
  display: flex;
  height: 100vh;
  height: 100dvh;
}

#stage {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#game {
  display: block;
  touch-action: none;
  box-shadow: 0 0 40px rgba(0, 0, 0, .5);
  border-radius: 6px;
}

/* ---------- side panels (wide screens only) ---------- */
.panel {
  width: clamp(240px, 24vw, 420px);
  padding: 4vh 2vw;
  display: flex;
  flex-direction: column;
  gap: 3vh;
  overflow: hidden;
}
.panel h2 {
  margin: 0 0 1vh;
  font-size: clamp(16px, 1.6vw, 28px);
  letter-spacing: .08em;
  color: var(--highlight);
  text-transform: uppercase;
}
.panel .brand {
  font-size: clamp(26px, 2.8vw, 48px);
  font-weight: 800;
  letter-spacing: .02em;
}
.panel .brand img {
  display: block;
  width: 100%;
  max-width: 300px;
  height: auto;
  margin-bottom: .6em;
}
.panel .brand small {
  display: block;
  font-size: .45em;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.panel p, .panel li {
  font-size: clamp(13px, 1.15vw, 20px);
  line-height: 1.45;
  color: #dfe6ec;
}
.panel ul { margin: 0; padding-left: 1.2em; }
.panel li { margin-bottom: .5em; }
.panel .keys { color: #9fb7c4; font-size: clamp(11px, .9vw, 16px); }

.scores { width: 100%; border-collapse: collapse; }
.scores td {
  padding: .35em .3em;
  font-size: clamp(13px, 1.15vw, 20px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  font-variant-numeric: tabular-nums;
}
.scores td.rank { color: #8fa9b8; width: 2.2em; }
.scores td.name { font-weight: 700; letter-spacing: .12em; }
.scores td.pts { text-align: right; font-weight: 700; }
.scores tr.fresh td { color: var(--highlight); }
.scores .empty { color: #6f8796; font-style: italic; }

@media (max-aspect-ratio: 5/4) {
  .panel { display: none; }
}

/* ---------- touch controls ---------- */
#touch {
  display: none;
  justify-content: center;
  padding: 8px 0 12px;
  touch-action: none;
}
@media (pointer: coarse) {
  #touch { display: flex; }
}
.pad {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  grid-template-rows: repeat(3, 52px);
  gap: 6px;
}
.pad button {
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  touch-action: none;
}
.pad button:active, .pad button.on { background: var(--brand); }
.b-up { grid-column: 2; grid-row: 1; }
.b-left { grid-column: 1; grid-row: 2; }
.b-ok { grid-column: 2; grid-row: 2; font-size: 15px !important; }
.b-right { grid-column: 3; grid-row: 2; }
.b-down { grid-column: 2; grid-row: 3; }
