:root {
  --bg-top: #0c5233;
  --bg-bottom: #031d14;
  --grass-a: #3cbf62;
  --grass-b: #2da252;
  --panel: rgba(5, 20, 23, 0.74);
  --panel-soft: rgba(255, 255, 255, 0.1);
  --text: #f8fff6;
  --muted: #bfe5d4;
  --accent: #ffd54a;
  --accent-2: #ff7f50;
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 213, 74, 0.18), transparent 22%),
    radial-gradient(circle at bottom right, rgba(255, 127, 80, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
  padding: 18px;
  min-height: 100vh;
}

.sidebar,
.main-stage {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-card,
.panel,
.canvas-card,
.stat-pill,
.menu-btn,
.modal-card,
.ghost-btn {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.brand-card,
.panel,
.canvas-card,
.modal-card {
  padding: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 800;
}

h1,
h2,
strong {
  font-family: "Baloo 2", cursive;
}

h1 {
  margin: 0 0 8px;
  font-size: 2.3rem;
  line-height: 0.92;
}

h2 {
  margin: 0;
  font-size: 1.5rem;
}

.brand-copy {
  margin: 0;
  color: var(--muted);
}

.menu-grid {
  display: grid;
  gap: 10px;
}

.menu-btn,
.small-btn,
.ghost-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.menu-btn {
  padding: 14px 16px;
  text-align: left;
  font-weight: 800;
}

.menu-btn:hover,
.small-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 213, 74, 0.55);
}

.menu-btn.active,
.small-btn.accent {
  background: linear-gradient(135deg, rgba(255, 213, 74, 0.22), rgba(255, 127, 80, 0.2));
  border-color: rgba(255, 213, 74, 0.7);
}

.panel.compact {
  min-height: 0;
}

.panel-head,
.topbar,
.hud-row,
.team-picker,
.picker-controls,
.result-actions {
  display: flex;
  align-items: center;
}

.panel-head,
.topbar,
.hud-row,
.team-picker,
.bottom-panels {
  justify-content: space-between;
}

.panel-head {
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head span,
.label,
#hintLabel,
.level-meta,
.team-meta,
.settings-list,
.controls-grid,
#resultCopy,
.brand-copy {
  font-size: 0.96rem;
}

.level-list,
.controls-grid,
.settings-list,
.collection-grid {
  display: grid;
  gap: 10px;
}

.level-item,
.team-card,
.stat-pill,
.small-btn,
.hud-box {
  border-radius: 18px;
}

.level-item {
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.level-item.locked {
  opacity: 0.55;
}

.level-item.completed {
  border-color: rgba(255, 213, 74, 0.5);
  background: rgba(255, 213, 74, 0.09);
}

.topbar {
  gap: 12px;
  flex-wrap: wrap;
}

.stat-pill,
.ghost-btn {
  padding: 10px 14px;
}

.stat-pill {
  min-width: 140px;
}

.stat-pill .label {
  display: block;
  color: var(--muted);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.06);
}

.canvas-card {
  position: relative;
}

.hud-row {
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.score-box,
.hud-center,
.hud-box {
  background: rgba(255, 255, 255, 0.06);
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.score-box,
.hud-center {
  min-width: 190px;
}

.score-box strong,
.hud-center strong {
  display: block;
  text-align: center;
  font-size: 1.9rem;
  line-height: 1;
}

.score-box span,
.hud-center span {
  display: block;
  text-align: center;
  color: var(--muted);
}

#gameCanvas {
  width: 100%;
  height: auto;
  border-radius: 22px;
  display: block;
  background: linear-gradient(180deg, #87d0ff 0%, #96d8ff 22%, #48c569 22%, #2da252 100%);
}

.bottom-panels {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.team-picker {
  gap: 14px;
  align-items: stretch;
}

.team-card {
  flex: 1;
  min-height: 174px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.team-swatch {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.team-card h3 {
  margin: 0 0 6px;
  font-size: 1.45rem;
}

.team-card p {
  margin: 0 0 8px;
  color: var(--muted);
}

.picker-controls {
  flex-direction: column;
  gap: 10px;
  justify-content: center;
}

.small-btn {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.07);
}

.controls-grid {
  grid-template-columns: 1fr 1fr;
}

.controls-grid p {
  margin: 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
}

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(3, 12, 12, 0.62);
  padding: 18px;
  z-index: 20;
}

.hidden {
  display: none !important;
}

.modal-card {
  width: min(940px, 96vw);
}

#resultModal {
  width: min(520px, 92vw);
  text-align: center;
}

.result-header h2 {
  margin: 0;
  font-size: 2.3rem;
}

#resultCopy {
  color: var(--muted);
  margin: 12px 0 18px;
}

.result-actions {
  gap: 12px;
  justify-content: center;
}

.collection-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.collection-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.collection-card.locked {
  opacity: 0.55;
}

.settings-list {
  grid-template-columns: 1fr;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .bottom-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .team-picker,
  .controls-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .picker-controls {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
