/* Summit Defender – shared styles. Menus add css/menus.css, the game adds css/game.css. */
:root {
  --gold: #FFC83D;
  --star: #FFD54A;
  --green: #3DAA4F;
  --blue: #3D7BD9;
  --purple: #8A5BD6;
  --red: #E5484D;
  --crystal: #8FE3FF;
  --rope: #E2C38A;
  --card: rgba(255, 255, 255, 0.07);
  --card-stroke: rgba(255, 255, 255, 0.12);
  --overlay-card: #1B241F;
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.7);
  --text-faint: rgba(255, 255, 255, 0.5);
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #10152F;
  color: var(--text);
  font-family: var(--font);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

#backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

[hidden] { display: none !important; }

button {
  font-family: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  touch-action: manipulation;
}
button:disabled { cursor: default; }

/* ---------- Buttons ---------- */
.btn-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 18px;
  border-radius: 20px;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(to bottom, var(--btn, var(--green)), color-mix(in srgb, var(--btn, var(--green)) 72%, transparent));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--btn, var(--green)) 35%, transparent);
  transition: transform 0.12s ease-out, filter 0.12s;
}
.btn-menu:hover { filter: brightness(1.08); }
.btn-menu:active { transform: scale(0.97); }
.btn-menu.grey { --btn: rgba(255, 255, 255, 0.18); box-shadow: none; }
.btn-menu.small { padding: 11px 14px; font-size: 17px; border-radius: 16px; }

.btn-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 32px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--btn, var(--blue));
  white-space: nowrap;
  overflow: hidden;
  transition: transform 0.1s, opacity 0.1s;
}
.btn-panel:active:not(:disabled) { transform: scale(0.97); opacity: 0.8; }
.btn-panel:disabled { opacity: 0.45; }

.btn-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 44px;
  min-width: 44px;
  padding: 0 10px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  transition: opacity 0.1s;
}
.btn-chip.active { background: var(--gold); color: #000; }
.btn-chip:active { opacity: 0.75; }

.btn-round {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
}

/* ---------- Cards and pills ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-stroke);
  border-radius: 18px;
  padding: 14px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Icons ---------- */
.icon-coin, .icon-crystal { display: inline-block; flex: none; vertical-align: middle; }
.star { color: var(--star); }
.star.off { color: rgba(255, 255, 255, 0.28); }

/* ---------- Banner (menus) ---------- */
#banner {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translate(-50%, -140%);
  max-width: min(92vw, 520px);
  padding: 10px 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.78);
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  z-index: 60;
  transition: transform 0.3s cubic-bezier(.2, 1.2, .4, 1);
  pointer-events: none;
}
#banner.show { transform: translate(-50%, 0); }

/* ---------- Overlays (modal cards) ---------- */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  animation: fadein 0.2s ease-out;
  overflow-y: auto;
  padding: 16px;
}
.overlay-card {
  width: 100%;
  max-width: 360px;
  margin: auto;
  padding: 24px;
  border-radius: 26px;
  background: var(--overlay-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.overlay-card h1 { margin: 0; font-size: 32px; font-weight: 900; line-height: 1.1; }
.overlay-card p { margin: 0; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }

button:focus { outline: none; }
button:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.7); outline-offset: 2px; }
