:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080d17;
  color: #f8fafc;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body {
  background: radial-gradient(circle at top, #17243d 0, #080d17 42rem);
  overscroll-behavior: none;
}
button { font: inherit; }

.original-player {
  width: min(100%, 920px);
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: .75rem;
}
.game-shell {
  min-height: calc(100vh - 2.4rem);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 1rem;
  background: rgba(9,16,29,.94);
  box-shadow: 0 24px 70px rgba(0,0,0,.42);
}
.game-toolbar {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: .8rem;
  align-items: center;
  padding: .9rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: rgba(17,28,47,.94);
}
.game-heading { min-width: 0; }
.game-heading h1 {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.75rem);
  line-height: 1.15;
}
.game-heading p {
  max-width: 640px;
  margin: .3rem 0 0;
  color: #9fb0c7;
  font-size: .86rem;
  line-height: 1.4;
}
.game-stats {
  display: flex;
  gap: .55rem;
  align-items: center;
}
.game-stats span {
  min-width: 78px;
  padding: .45rem .6rem;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: .6rem;
  background: rgba(7,14,27,.72);
  text-align: center;
  font-size: .84rem;
  font-weight: 850;
}
#gameScore { color: #70e1a1; }
#gameBest { color: #8ab4ff; }
.canvas-stage {
  position: relative;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #050b15;
}
#gameCanvas {
  display: block;
  width: min(100%, 800px);
  height: auto;
  max-height: calc(100vh - 12rem);
  aspect-ratio: 8 / 7;
  background: #08111f;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.game-message {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  z-index: 5;
  max-width: calc(100% - 2rem);
  transform: translateX(-50%);
  padding: .62rem .8rem;
  border: 1px solid rgba(248,207,114,.4);
  border-radius: .65rem;
  background: rgba(17,24,39,.94);
  color: #f8cf72;
  text-align: center;
  font-size: .88rem;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(0,0,0,.3);
}
.game-message[data-tone="success"] {
  border-color: rgba(112,225,161,.5);
  color: #b8f7d1;
}
.game-message[data-tone="warning"] {
  border-color: rgba(252,165,165,.55);
  color: #fecaca;
}
.game-controls {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .65rem;
  padding: .7rem 1rem;
  border-top: 1px solid rgba(255,255,255,.1);
  background: rgba(17,28,47,.9);
}
.game-controls button {
  min-height: 42px;
  padding: .55rem .9rem;
  border: 1px solid #334966;
  border-radius: .65rem;
  background: #17263e;
  color: #f8fafc;
  font-weight: 800;
  cursor: pointer;
}
.game-controls button:hover,
.game-controls button:focus-visible {
  border-color: #70e1a1;
  background: #21405a;
}
.game-controls button.primary {
  border-color: transparent;
  background: #70e1a1;
  color: #06130b;
}
.player-note {
  margin: .38rem 0 0;
  color: #94a3b8;
  font-size: .72rem;
  text-align: center;
}
.fatal-error {
  max-width: 680px;
  margin: 4rem auto;
  padding: 2rem;
  color: #f8fafc;
  font-family: system-ui;
}

@media (max-width: 640px) {
  .original-player { padding: 0; }
  .game-shell { min-height: calc(100vh - 1.5rem); border-radius: 0; border-left: 0; border-right: 0; }
  .game-toolbar { grid-template-columns: 1fr; padding: .7rem .8rem; }
  .game-heading p { font-size: .76rem; }
  .game-stats { justify-content: flex-start; }
  .game-stats span { min-width: 72px; padding: .36rem .5rem; }
  #gameCanvas { width: 100%; max-height: calc(100vh - 13rem); }
  .game-controls { min-height: 58px; padding: .55rem; }
  .game-controls button { min-height: 40px; }
  .player-note { font-size: .65rem; }
}
