:root {
  color-scheme: light;
  --ink: #203149;
  --muted: #5d6c89;
  --pink: #ff70b7;
  --coral: #ff8e65;
  --sun: #ffe26d;
  --mint: #55d7a2;
  --water: #54d9ff;
  --blue: #416dff;
  --paper: rgba(255, 255, 255, 0.84);
  --shadow: 0 18px 36px rgba(24, 62, 115, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  min-height: 100svh;
  overflow: hidden;
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Comic Sans MS", system-ui, sans-serif;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 226, 109, 0.72) 0 64px, transparent 66px),
    radial-gradient(circle at 86% 16%, rgba(255, 112, 183, 0.48) 0 84px, transparent 86px),
    linear-gradient(135deg, #6fe4ff 0%, #dffcff 34%, #fff2a3 66%, #ffa6cf 100%);
}

button,
a {
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

a {
  text-decoration: none;
}

.game-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: clamp(9px, 1.8vw, 14px);
  width: min(1220px, 100vw);
  height: 100svh;
  margin: 0 auto;
  padding: clamp(10px, 2vw, 18px);
}

.topbar {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) minmax(120px, auto);
  align-items: center;
  gap: 12px;
}

.eyebrow,
h1 {
  margin: 0;
}

.eyebrow {
  color: #1c6d93;
  font-size: clamp(0.72rem, 1.8vw, 0.9rem);
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2rem, 6.8vw, 4.6rem);
  line-height: 0.94;
  letter-spacing: 0;
  text-shadow: 0 4px 0 rgba(255, 255, 255, 0.56);
}

.status-pill {
  min-width: 120px;
  max-width: 230px;
  padding: 11px 12px;
  border: 4px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
  color: #2a3d5c;
  font-size: clamp(0.86rem, 2vw, 1.04rem);
  font-weight: 950;
  line-height: 1.08;
  text-align: center;
}

.hud {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 10px;
}

.hud-card {
  display: grid;
  align-content: center;
  min-height: 64px;
  padding: 8px 12px;
  border: 4px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow);
}

.hud-card span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hud-card strong {
  color: #203149;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  line-height: 1;
}

.stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 5px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.68) 0 2px, transparent 3px),
    linear-gradient(180deg, #55d9ff 0%, #9ff0ff 42%, #e9fbff 68%, #ffe6a5 100%);
  box-shadow: var(--shadow);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

canvas:active {
  cursor: grabbing;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(28, 80, 122, 0.16);
  backdrop-filter: blur(4px);
}

.overlay.hidden {
  display: none;
}

.panel {
  width: min(450px, 100%);
  padding: clamp(18px, 4vw, 28px);
  border: 5px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  text-align: center;
}

.badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #eafaff;
  color: #1c6d93;
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel h2 {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.6rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.panel p:not(.badge) {
  margin: 14px auto 18px;
  color: #52647f;
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  font-weight: 800;
  line-height: 1.28;
}

.primary-button,
.control-button {
  min-height: 58px;
  border: 4px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  color: #fff;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.16), 0 8px 0 rgba(32, 49, 73, 0.14);
  font-weight: 1000;
}

.primary-button {
  min-width: 190px;
  padding: 0 24px;
  background: linear-gradient(180deg, #ff70b7, #e33f8f);
}

.controls {
  display: grid;
  grid-template-columns: 88px minmax(150px, 1fr) 88px;
  gap: 10px;
}

.control-button {
  background: linear-gradient(180deg, #416dff, #2548ca);
  font-size: 1.05rem;
}

.arrow-button {
  font-size: 1.45rem;
}

.scoop-button {
  background: linear-gradient(180deg, #55d7a2, #19a86d);
}

.primary-button:hover,
.control-button:hover,
.primary-button:focus-visible,
.control-button:focus-visible {
  filter: saturate(1.1) brightness(1.04);
  outline: 4px solid #203149;
  outline-offset: 3px;
}

.primary-button:active,
.control-button:active,
.control-button.is-pressed {
  transform: translateY(3px);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.16), 0 5px 0 rgba(32, 49, 73, 0.14);
}

@media (max-width: 700px) {
  body {
    overflow: auto;
  }

  .game-shell {
    min-height: 100svh;
    height: auto;
    grid-template-rows: auto auto minmax(360px, 62svh) auto;
  }

  .topbar {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .status-pill {
    grid-column: 1 / -1;
    max-width: none;
  }

  .controls {
    grid-template-columns: 68px minmax(120px, 1fr) 68px;
  }
}

@media (max-width: 460px) {
  h1 {
    font-size: clamp(1.9rem, 11vw, 2.65rem);
  }

  .hud-card {
    min-height: 58px;
    padding: 8px 10px;
  }
}
