/* Summit of the Deal — dark alpine theme */
:root {
  --sky-top: #0d1526;
  --sky-mid: #1b2b4d;
  --sky-low: #33528a;
  --ink: #eaf1ff;
  --ink-dim: #8fa6c9;
  --gold: #ffd978;
  --gold-deep: #f2b93f;
  --good: #9fe8b8;
  --bad: #ffb0a0;
  --panel: rgba(234, 241, 255, .09);
  --panel-border: rgba(234, 241, 255, .14);
  --tint-green: rgba(74, 160, 110, .28);
  --tint-yellow: rgba(216, 174, 60, .26);
  --tint-red: rgba(205, 84, 70, .30);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-low) 100%) fixed;
  color: var(--ink);
  min-height: 100vh;
}
.wrap { max-width: 480px; margin: 0 auto; padding: 16px 14px 92px; }
h1 { font-size: 15px; letter-spacing: 3px; text-transform: uppercase; text-align: center; font-weight: 600; opacity: .92; margin: 6px 0 14px; }
h2 { font-size: 14px; margin: 18px 0 8px; color: var(--gold); }
a { color: var(--gold); text-decoration: none; }
p { line-height: 1.5; }
.dim { color: var(--ink-dim); font-size: 12px; }
.small { font-size: 11px; }
.flash { background: rgba(255, 217, 120, .15); border: 1px solid rgba(255, 217, 120, .4); color: var(--gold); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.panel { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.btn {
  display: block; width: 100%; text-align: center; border: 0; cursor: pointer;
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: #1b2340; font-weight: 700; font-size: 14px; border-radius: 12px; padding: 13px;
  box-shadow: 0 4px 14px rgba(242, 185, 63, .35); font-family: inherit;
}
.btn.secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--panel-border); box-shadow: none; }
.btn.danger { background: linear-gradient(180deg, #ff8d7a, #e05b45); color: #2a0d08; box-shadow: none; }
.btn.inline { display: inline-block; width: auto; padding: 8px 14px; font-size: 12px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], textarea, select {
  width: 100%; background: rgba(234, 241, 255, .1); border: 1px solid var(--panel-border);
  border-radius: 10px; color: var(--ink); padding: 11px; font-size: 15px; font-family: inherit;
}
label { display: block; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-dim); margin: 12px 0 4px; }
form { margin: 0; }

/* Challenge chips */
.chips { display: flex; gap: 5px; margin: 10px 0; }
.chip { flex: 1; font-size: 9px; text-align: center; padding: 7px 2px; border-radius: 8px; background: rgba(234, 241, 255, .07); color: var(--ink-dim); }
.chip.done { background: rgba(120, 230, 160, .16); color: var(--good); }

/* Mountain */
.mountain { position: relative; height: 320px; margin: 4px 0 10px; }
.mountain svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.climber { position: absolute; transform: translate(-50%, -100%); font-size: 16px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); text-align: center; line-height: 1; }
.climber .tag { display: block; font-size: 8px; color: var(--ink-dim); white-space: nowrap; }
.climber.me { font-size: 20px; filter: drop-shadow(0 0 7px var(--gold)); }
.climber.me .tag { color: var(--gold); font-weight: 700; }
.grave { position: absolute; transform: translate(-50%, -100%); font-size: 13px; opacity: .9; }

/* Strain colors */
.strain-tight { background: var(--tint-green); }
.strain-stretched { background: var(--tint-yellow); }
.strain-fraying { background: var(--tint-red); }
.strain-dot-tight { color: #7ed6a2; }
.strain-dot-stretched { color: #e8c35a; }
.strain-dot-fraying { color: #f08a78; }

/* Basecamp team rows */
.teamrow { border: 1px solid var(--panel-border); border-radius: 12px; padding: 10px 10px 6px; margin-bottom: 8px; }
.teamrow .ropewrap { position: relative; height: 28px; margin-top: 4px; }
.teamrow .bar { position: absolute; bottom: 4px; left: 0; right: 0; height: 7px; border-radius: 4px; background: rgba(255,255,255,.14); }
.teamrow .fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #7fb2ff, var(--gold)); }
.teamrow .mark { position: absolute; bottom: 8px; font-size: 15px; transform: translateX(-50%); filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.teamrow .crownmark { position: relative; }
.teamrow .crownmark::after { content: '👑'; position: absolute; top: -9px; right: -7px; font-size: 9px; }

/* Trade-up chain */
.chainline { border-left: 2px dashed rgba(255, 217, 120, .4); margin-left: 10px; padding-left: 14px; }
.chainline .step { margin-bottom: 14px; }
.chainline img { width: 100%; border-radius: 10px; display: block; margin: 4px 0; }
.steplabel { color: var(--gold); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }

/* Vote */
.votecard { margin-bottom: 10px; }
.votecard img { width: 100%; border-radius: 10px; display: block; margin-bottom: 6px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { background: rgba(234,241,255,.14); border: 0; color: var(--ink); border-radius: 8px; padding: 5px 14px; font-size: 16px; cursor: pointer; }
.stepper .stars { color: var(--gold); font-weight: 700; min-width: 42px; text-align: center; }

/* Feed */
.feed { list-style: none; padding: 0; margin: 0; }
.feed li { padding: 7px 0; border-bottom: 1px solid rgba(234,241,255,.08); font-size: 12.5px; line-height: 1.45; }
.feed li:last-child { border-bottom: 0; }

/* Avatar grid */
.avgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin: 10px 0; }
.avgrid button { background: rgba(234,241,255,.1); border: 1px solid transparent; border-radius: 11px; font-size: 24px; padding: 7px 0; cursor: pointer; }
.avgrid button.sel { border-color: var(--gold); background: rgba(255,217,120,.2); }
.avgrid button:disabled { opacity: .25; cursor: not-allowed; }

/* Duel banner */
.duel { display: flex; justify-content: space-around; align-items: center; font-size: 11px; color: var(--ink-dim); }
.duel b { color: var(--gold); font-size: 14px; display: block; text-align: center; }

/* Bottom nav */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around;
  background: rgba(10, 17, 32, .96); border-top: 1px solid rgba(234,241,255,.12);
  padding: 8px 0 max(10px, env(safe-area-inset-bottom)); backdrop-filter: blur(8px);
}
.bottomnav a { color: var(--ink-dim); font-size: 17px; text-align: center; line-height: 1.1; }
.bottomnav a span { display: block; font-size: 8.5px; letter-spacing: .5px; }
.bottomnav a.active { color: var(--gold); }

/* Cut-the-rope drama */
.cutbox { background: linear-gradient(180deg, #1a0d12, #36151f); border: 1px solid rgba(255, 176, 160, .3); border-radius: 12px; padding: 14px; }
.cutbox h2 { color: var(--bad); }

table.grid { width: 100%; border-collapse: collapse; font-size: 11px; }
table.grid th, table.grid td { padding: 5px 4px; text-align: left; border-bottom: 1px solid rgba(234,241,255,.1); }
table.grid th { color: var(--ink-dim); font-weight: 500; text-transform: uppercase; font-size: 9px; letter-spacing: 1px; }

/* ── Back links ─────────────────────────────────────────────────────── */
.backlink { display: inline-block; color: var(--ink-dim); font-size: 13px; padding: 4px 0 8px; }
.backlink:active { color: var(--gold); }

/* ── Team mini-mountain ─────────────────────────────────────────────── */
.teammountain { position: relative; height: 260px; margin: 2px 0 12px; }
.teammountain svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tm-climber { position: absolute; transform: translate(-50%, -100%); font-size: 24px; text-align: center; line-height: 1.05; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.tm-climber.me { font-size: 30px; filter: drop-shadow(0 0 8px var(--gold)); }
.tm-climber .tag { display: block; font-size: 9.5px; color: #2a3550; font-weight: 600; text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.tm-climber.me .tag { color: #1b2340; }

/* ── Bottom nav v2: bigger, clearer ─────────────────────────────────── */
.bottomnav {
  padding: 10px 0 max(14px, env(safe-area-inset-bottom));
  background: rgba(8, 13, 26, .98);
  border-top: 1px solid rgba(255, 217, 120, .25);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .45);
}
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative; padding-top: 4px; }
.bottomnav a svg { width: 26px; height: 26px; }
.bottomnav a span { font-size: 10.5px; letter-spacing: .4px; font-weight: 600; }
.bottomnav a.active::before { content: ''; position: absolute; top: -10px; width: 44px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
