:root {
  --ink: #102018;
  --muted: #5a6b62;
  --grass: #2b8c4a;
  --grass-dark: #176137;
  --lime: #c8ff64;
  --line: rgba(255, 255, 255, .72);
  --panel: rgba(255, 255, 255, .88);
  --orange: #f28a22;
  --black: #161616;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 0%, rgba(200, 255, 100, .34), transparent 32%),
    linear-gradient(155deg, #e9ffe9 0%, #b7ebc3 42%, #6fcf8f 100%);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  touch-action: none;
}

button {
  border: 0;
  font: inherit;
}

.game-shell {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  width: min(100vw, 520px);
  height: 100dvh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}

.scorebar {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 8px;
}

.scorebar div,
.scorebar button,
.status {
  border: 1px solid rgba(16, 32, 24, .1);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(16, 32, 24, .12);
  backdrop-filter: blur(14px);
}

.scorebar div {
  min-height: 62px;
  padding: 10px 14px;
}

.scorebar span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.scorebar strong {
  display: block;
  margin-top: 2px;
  font-size: clamp(24px, 8vw, 36px);
  line-height: 1;
}

.scorebar button {
  min-width: 78px;
  min-height: 62px;
  padding: 0 14px;
  color: white;
  font-weight: 800;
  background: #102018;
}

.field-wrap {
  position: relative;
  min-height: 0;
  border: 7px solid rgba(255, 255, 255, .82);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(16, 32, 24, .24);
  background: var(--grass);
}

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

canvas:active {
  cursor: grabbing;
}

.banner {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  gap: 4px;
  width: min(78%, 340px);
  padding: 18px 20px;
  border-radius: 20px;
  text-align: center;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 18px 50px rgba(16, 32, 24, .22);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.banner strong {
  font-size: clamp(28px, 9vw, 46px);
  line-height: .95;
}

.banner span {
  color: var(--muted);
  font-weight: 700;
}

.banner.hidden {
  opacity: 0;
  transform: translate(-50%, -44%) scale(.96);
}

.status {
  min-height: 48px;
  padding: 13px 16px;
  color: #23372d;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 420px) {
  .game-shell {
    gap: 8px;
    padding-inline: 8px;
  }

  .field-wrap {
    border-width: 5px;
    border-radius: 22px;
  }

  .scorebar div,
  .scorebar button {
    min-height: 56px;
    border-radius: 12px;
  }
}
