* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background: #dbe8d6;
  color: #102117;
}

body {
  position: relative;
}

canvas {
  display: block;
}

#gameCanvas {
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 60%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.16));
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 20, 15, 0.48);
  backdrop-filter: blur(8px);
  z-index: 3;
}

.overlay.hidden {
  display: none;
}

.menu-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  padding: 28px;
  border-radius: 22px;
  background: rgba(252, 255, 250, 0.96);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.18);
  overflow-y: auto;
}

.menu-primary-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  padding: 12px;
  border-radius: 17px;
  background: #edf5ef;
}

.menu-card .menu-primary-actions button { margin-top: 0; }

.menu-card h1 {
  margin: 0 0 8px;
  font-size: 40px;
  letter-spacing: 0.04em;
}

.menu-card h2 {
  margin: 12px 0 6px;
  font-size: 22px;
}

.subtitle,
.helper {
  margin: 0 0 14px;
  color: #4b6357;
}

.menu-card label {
  display: block;
  margin: 14px 0 6px;
  font-weight: 700;
}

.menu-card input,
.menu-card button {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 16px;
}

.menu-card input[type="text"],
.menu-card input[type="file"],
.menu-card input[type="range"],
.menu-card select {
  background: #eaf3e5;
}

.hidden-section,
.hidden {
  display: none;
}

.secondary-player {
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
  background: #edf5ef;
  border: 1px solid rgba(36, 69, 50, 0.08);
}

.menu-card input[type="color"] {
  height: 52px;
  padding: 6px;
  background: #eaf3e5;
}

.menu-card button {
  margin-top: 16px;
  background: #0e0f11;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

.menu-card button:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.secondary-button {
  background: #eef6ea !important;
  color: #102117 !important;
  border: 1px solid rgba(36, 69, 50, 0.12) !important;
}

.secondary-link {
  display: block;
  width: 100%;
  margin-top: 10px;
  border-radius: 14px;
  padding: 12px 14px;
  background: #eef6ea;
  color: #102117;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  border: 1px solid rgba(36, 69, 50, 0.12);
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}

.secondary-link:hover {
  opacity: 0.94;
  transform: translateY(-1px);
  background: #e3f0dc;
}

.instructions {
  margin-top: 14px;
  border-radius: 14px;
  background: #eef6ea;
  padding: 10px 12px;
}

.instructions summary {
  cursor: pointer;
  font-weight: 700;
}

.instructions-body {
  margin-top: 10px;
  color: #31483d;
  font-size: 14px;
  line-height: 1.4;
}

.instructions-body p {
  margin: 0 0 8px;
}

.hud {
  position: absolute;
  z-index: 2;
}

.hud-player-one {
  top: 14px;
  left: 14px;
}

.hud-player-two {
  top: 14px;
  left: calc(50% + 14px);
}

.hud-top-right {
  top: 14px;
  right: 14px;
}

.hud-bottom-right {
  right: 14px;
  bottom: 14px;
  width: 212px;
  height: 212px;
}

.hud-home-link {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #102117;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(19, 30, 23, 0.14);
  backdrop-filter: blur(10px);
}

.hud-home-link:hover {
  background: rgba(241, 248, 236, 0.96);
}

.reward-toast {
  position: absolute;
  top: 74px;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: min(420px, calc(100vw - 28px));
  padding: 12px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  color: #102117;
  text-align: center;
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(19, 30, 23, 0.18);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(124, 173, 100, 0.24);
  pointer-events: none;
}

.panel {
  min-width: 180px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 30px rgba(19, 30, 23, 0.14);
  backdrop-filter: blur(10px);
}

.status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(223, 243, 255, 0.92);
  color: #14436a;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.status-badge.hidden {
  display: none;
}

.status-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.88;
}

.leaderboard-panel h2 {
  margin: 10px 0 8px;
  font-size: 18px;
}

#leaderboard {
  margin: 0;
  padding-left: 20px;
}

#leaderboard li {
  margin: 4px 0;
}

.minimap-panel {
  padding: 8px;
  width: 196px;
  height: 196px;
  overflow: hidden;
}

#minimapCanvas {
  width: 180px;
  height: 180px;
  border-radius: 14px;
  background: rgba(211, 231, 204, 0.85);
}

.changelog-card {
  width: min(460px, 100%);
}

.changelog-copy {
  margin: 8px 0 0;
  color: #4b6357;
  line-height: 1.45;
}

.changelog-entry {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f1f8ee, #e8f3e4);
  color: #31483d;
  border: 1px solid rgba(36, 69, 50, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.changelog-entry strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  color: #102117;
}

.changelog-entry p {
  margin: 0;
  line-height: 1.45;
}

.changelog-entry.compact {
  opacity: 0.92;
}

.continue-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.continue-panel.hidden {
  display: none;
}

.continue-panel button {
  width: 100%;
  margin-top: 0;
}

@media (max-width: 768px) {
  .menu-card {
    padding: 22px;
  }

  .menu-card h1 {
    font-size: 32px;
  }

  .panel {
    min-width: 150px;
  }

  .hud-player-two {
    left: auto;
    right: 14px;
    top: 160px;
  }

  .hud-home-link {
    top: auto;
    bottom: 14px;
    left: 14px;
    transform: none;
  }

  #minimapCanvas {
    width: 140px;
    height: 140px;
  }

  .minimap-panel {
    width: 156px;
    height: 156px;
  }

  .hud-bottom-right {
    width: 172px;
    height: 172px;
  }
}
.calendar-widget-chooser { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding:10px; margin:4px 0 8px; border:1px solid var(--line,rgba(255,255,255,.12)); border-radius:12px; background:rgba(0,0,0,.16); }
.calendar-widget-chooser > span { grid-column:1/-1; padding:2px 4px 5px; font-size:11px; opacity:.72; }
.calendar-widget-chooser > button { min-height:34px!important; padding:7px 9px!important; border-radius:9px!important; font-size:12px; font-weight:750; }
