:root {
  --amber: #f0a020;
}
* { -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; font-family: 'Inter', system-ui, -apple-system, sans-serif; }
#scene { display: block; }
#menu.flex, #connecting.flex, #shop-modal.flex, #gear-modal.flex, #lb-modal.flex,
#settings-modal.flex, #death-modal.flex, #action-prompt.flex,
#climb-ui.flex, #victory-modal.flex { display: flex !important; }

.climb-key.next { border-color: #34d399; background: rgba(52,211,153,0.22); box-shadow: 0 0 0 3px rgba(52,211,153,0.15); }
.climb-key.good { border-color: #34d399; background: rgba(52,211,153,0.4); }
.climb-key.bad { border-color: #f43f5e; background: rgba(244,63,94,0.4); }

/* Mountain mark logos */
.mtn-mark {
  width: 84px; height: 60px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(160deg,#e8f2ff 0 42%, #7fb2e8 42% 60%, #35507a 60% 100%);
  position: relative;
}
.mtn-mark::after {
  content:''; position:absolute; left:50%; top:0; width:0; height:0;
  border-left:22px solid transparent; border-right:22px solid transparent;
  border-bottom:26px solid #ffffff; transform: translateX(-50%);
}
.mtn-mark-sm {
  width: 40px; height: 30px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(160deg,#e8f2ff 0 45%, #7fb2e8 45% 62%, #35507a 62% 100%);
}

/* Menu background */
.menu-bg {
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(120,170,230,0.35), transparent 60%),
    linear-gradient(180deg, #16324f 0%, #0b1622 55%, #060d15 100%);
}
.menu-bg::after {
  content:''; position:absolute; inset:0;
  background:
    linear-gradient(120deg, transparent 55%, rgba(255,255,255,0.04) 55% 58%, transparent 58%),
    linear-gradient(200deg, transparent 60%, rgba(255,255,255,0.03) 60% 64%, transparent 64%);
}

.modal-scrim { background: rgba(3,8,14,0.72); backdrop-filter: blur(6px); }

/* Rail buttons */
.rail-btn {
  width: 46px; height: 46px; border-radius: 9999px;
  background: rgba(10,18,28,0.55);
  border: 2px solid var(--amber);
  color: #f6d9a6;
  display:flex; align-items:center; justify-content:center;
  backdrop-filter: blur(6px);
  transition: transform .12s, background .15s;
}
.rail-btn:hover { background: rgba(240,160,32,0.22); transform: translateX(2px); }
.rail-btn:active { transform: scale(0.94); }
.rail-btn.active { background: var(--amber); color:#1a1206; }
.rail-danger { border-color:#e06060; color:#f0b6b6; }
.rail-danger:hover { background: rgba(224,96,96,0.2); }

.mic-btn.live { background: #16a34a !important; border-color:#22c55e !important; }
.mic-btn.live i { color: #fff !important; }

/* Storm overlay */
#storm-overlay {
  background:
    radial-gradient(120% 100% at 50% 50%, transparent 30%, rgba(210,225,240,0.28) 75%, rgba(220,232,245,0.55) 100%);
}
#storm-overlay.snow::before {
  content:''; position:absolute; inset:0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, #fff, transparent),
    radial-gradient(2px 2px at 70% 60%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 40% 80%, #fff, transparent),
    radial-gradient(2px 2px at 85% 20%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 55% 45%, #fff, transparent);
  background-size: 300px 300px;
  opacity: .5;
  animation: snowfall 3s linear infinite;
}
@keyframes snowfall { from { background-position: 0 0,0 0,0 0,0 0,0 0; } to { background-position: -60px 300px,40px 300px,-30px 300px,60px 300px,-20px 300px; } }

.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.12);
  border-top-color: #38bdf8;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#toast.show { opacity: 1; }

/* Shop / gear cards */
.shop-card { background: rgba(255,255,255,0.035); border:1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 12px; }
.shop-card .buy { transition: background .15s; }
.pip { width: 8px; height: 8px; border-radius: 2px; background: rgba(255,255,255,0.14); }
.pip.on { background: var(--amber); }

.color-swatch { width: 30px; height: 30px; border-radius: 8px; border: 2px solid rgba(255,255,255,0.2); cursor:pointer; }
.color-swatch.sel { border-color:#fff; box-shadow: 0 0 0 2px rgba(255,255,255,0.35); }

/* scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 8px; }

input[type="range"] { accent-color: #38bdf8; }
input[type="checkbox"] { accent-color: #38bdf8; }

.nametag {
  position: absolute; transform: translate(-50%,-100%);
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.9);
  padding: 1px 7px; border-radius: 7px; background: rgba(0,0,0,0.4);
  white-space: nowrap; pointer-events: none; display:flex; align-items:center; gap:4px;
}
.nametag .vdot { width:7px; height:7px; border-radius:50%; background:#22c55e; display:none; }
.nametag.talking .vdot { display:inline-block; box-shadow:0 0 6px #22c55e; }

@media (max-width: 900px) {
  #stats-panel { width: 250px; transform: scale(0.78); transform-origin: bottom right; }
  .rail-btn { width: 40px; height: 40px; }
  .rail-btn svg { width: 18px; height: 18px; }
  /* climb panel sits above the joystick and stays reachable */
  #climb-ui { padding-bottom: 0.75rem; }
  #climb-ui > div { transform: scale(0.9); transform-origin: bottom center; }
  #objective > div { transform: scale(0.85); transform-origin: top center; }
  #action-prompt { right: 1rem; }
}
@media (max-width: 900px) and (orientation: portrait) {
  #joystick { bottom: 1.25rem; left: 1.25rem; width: 6.5rem; height: 6.5rem; }
  #btn-jump { bottom: 2rem; right: 1.25rem; width: 4rem; height: 4rem; font-size: 11px; }
}
/* avoid iOS rubber-banding / text selection while playing */
html, body { overscroll-behavior: none; touch-action: none; -webkit-user-select: none; user-select: none; }
