:root {
  color-scheme: light;
  --bg: #edf7fb;
  --panel: #ffffffd9;
  --ink: #263849;
  --muted: #5c7182;
  --blue: #4caaf0;
  --steel: #334760;
  --green: #55b86b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, #ffffff 0 13%, transparent 32%),
    linear-gradient(135deg, #f8fdff 0%, #e6f6ff 48%, #edf7e9 100%);
}

.shell {
  width: min(1680px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 14px 0 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 10px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-weight: 900;
}

h1 {
  margin: 0;
  font-size: clamp(25px, 3.4vw, 42px);
  line-height: 1;
}

.help {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #c7e9f7;
  border-radius: 999px;
  background: var(--panel);
  box-shadow: 0 12px 35px #79b8d71f;
  color: var(--muted);
  font-weight: 800;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px #55b86b25;
}

.game-frame {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid #9ec4d5;
  background: #fff;
  box-shadow: 0 30px 90px #21465f2b;
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1672 / 941;
  cursor: pointer;
  image-rendering: pixelated;
}

.tooltip,
.debug {
  position: absolute;
  padding: 9px 12px;
  border-radius: 13px;
  background: #ffffffeb;
  border: 1px solid #d7eaf2;
  color: var(--steel);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 12px 28px #335a7030;
}

.tooltip {
  left: 16px;
  bottom: 16px;
  pointer-events: none;
}

.debug {
  right: 16px;
  bottom: 16px;
  cursor: pointer;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.legend span {
  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffffb5;
  border: 1px solid #d7eaf2;
  color: var(--muted);
  font-size: 14px;
}

.legend b { color: var(--steel); }

@media (max-width: 760px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .help { border-radius: 18px; }
  .debug { display: none; }
}
