:root {
  color-scheme: light;
  --ink: #10251c;
  --muted: #5c7368;
  --line: rgba(16, 37, 28, 0.16);
  --white: #ffffff;
  --grass-a: #0c8f51;
  --grass-b: #12b76a;
  --grass-c: #07663d;
  --gold: #ffc857;
  --coral: #ff6b4a;
  --sky: #bce8ff;
  --shadow: 0 24px 60px rgba(8, 57, 35, 0.22);
  font-family: ui-rounded, "Avenir Next", "Trebuchet MS", Verdana, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 200, 87, 0.48), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(188, 232, 255, 0.85), transparent 30%),
    linear-gradient(145deg, #eafff3 0%, #f7ffe9 46%, #d7f3ff 100%);
  overflow-x: hidden;
}

button {
  border: 0;
  font: inherit;
}

.game-shell {
  width: min(100%, 1040px);
  display: grid;
  gap: 14px;
}

.scorebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 32px rgba(22, 92, 61, 0.12);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-lockup img {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1;
  letter-spacing: 0;
  text-transform: lowercase;
}

.brand-lockup p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.9rem;
}

.match-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  gap: 8px;
}

.match-stats div {
  min-width: 74px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.match-stats span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.match-stats strong {
  display: block;
  margin-top: 2px;
  font-size: 1.35rem;
}

.field-panel {
  position: relative;
  min-height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.28));
  box-shadow: var(--shadow);
  overflow: hidden;
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 960 / 620;
  touch-action: none;
}

.start-card {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(88%, 390px);
  transform: translate(-50%, -50%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 54px rgba(4, 50, 28, 0.24);
  text-align: center;
  backdrop-filter: blur(16px);
}

.start-card.hidden {
  display: none;
}

.start-card h2 {
  font-size: clamp(2rem, 8vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-transform: lowercase;
}

.start-card p {
  margin: 12px auto 18px;
  max-width: 28ch;
  color: var(--muted);
  line-height: 1.45;
}

.start-card button,
.control-btn {
  min-height: 48px;
  border-radius: 8px;
  color: #062113;
  background: var(--gold);
  box-shadow: 0 10px 0 #d6951d, 0 18px 26px rgba(111, 74, 13, 0.2);
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.start-card button {
  min-width: 170px;
  padding: 0 18px;
}

.control-btn:hover,
.start-card button:hover {
  transform: translateY(-2px);
}

.control-btn:active,
.control-btn.pressed,
.start-card button:active {
  transform: translateY(5px);
  box-shadow: 0 5px 0 #d6951d, 0 10px 14px rgba(111, 74, 13, 0.2);
}

.toast {
  position: absolute;
  left: 50%;
  top: 22px;
  transform: translate(-50%, -16px);
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--white);
  background: #10251c;
  box-shadow: 0 14px 28px rgba(6, 33, 19, 0.28);
  font-size: 0.9rem;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 10px;
}

.control-btn {
  display: grid;
  place-items: center;
  padding: 0 16px;
  user-select: none;
}

.control-btn span {
  font-size: 1.5rem;
  line-height: 1;
}

.control-btn.shoot {
  color: var(--white);
  background: var(--coral);
  box-shadow: 0 10px 0 #be3e25, 0 18px 26px rgba(153, 55, 31, 0.2);
}

.control-btn.shoot:active,
.control-btn.shoot.pressed {
  box-shadow: 0 5px 0 #be3e25, 0 10px 14px rgba(153, 55, 31, 0.2);
}

@media (max-width: 680px) {
  body {
    padding: 10px;
    align-items: start;
  }

  .scorebar {
    display: grid;
  }

  .brand-lockup img {
    width: 44px;
    height: 44px;
  }

  .match-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .field-panel {
    min-height: 300px;
  }

  .controls {
    position: sticky;
    bottom: 10px;
    z-index: 3;
  }
}
