/* Scrapyard HUD. Builds on island.css for the canvas, pills, toasts, joystick, intro card. */
body.arena-page { background: #15171c; }
.hud-top { align-items: flex-start; }
.phase-pill {
  display: flex; flex-direction: column; align-items: center; pointer-events: none;
  background: rgba(21, 23, 28, .85); color: #fff; border-radius: 14px; padding: 6px 16px; min-width: 110px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .12);
}
.phase-pill b { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: #e9b949; }
.phase-pill span { font: 700 20px var(--sans); font-variant-numeric: tabular-nums; line-height: 1.1; min-height: 22px; }
.phase-pill span.hot { color: #ff6a5c; }

.kill-feed { position: fixed; right: 14px; top: calc(env(safe-area-inset-top) + 100px); z-index: 6; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; pointer-events: none; }
.kill-feed div { background: rgba(21, 23, 28, .82); color: #fff; font: 600 13px var(--sans); padding: 6px 10px; border-radius: 10px; animation: tin .3s var(--ease); }
.kill-feed div b { color: #e9b949; }
.kill-feed div.out { opacity: 0; transition: opacity .5s; }

.countdown { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; pointer-events: none; font: 800 140px var(--sans); color: #fff; text-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.countdown[hidden] { display: none; }
.countdown.go { color: #e9b949; }

/* ---------- Panels ---------- */
.panel {
  position: fixed; z-index: 8; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 12px); width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 140px);
  overflow-y: auto; overscroll-behavior: contain;
  background: rgba(21, 23, 28, .94); color: #fff; border-radius: 20px; padding: 16px; border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.panel[hidden] { display: none !important; }
@media (min-width: 900px) { .panel.builder { left: auto; right: 16px; transform: none; top: calc(env(safe-area-inset-top) + 64px); bottom: 16px; width: 440px; max-height: none; } }
.panel h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.panel-head span { color: #9aa0aa; font-size: 13px; }
.panel .btn { background: #e9b949; color: #15171c; }
.panel .btn.secondary { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .18); }
.panel .btn:disabled { opacity: .4; pointer-events: none; }
.link-btn { border: 0; background: none; padding: 4px 0; font: 600 13px var(--sans); color: #e9b949; }

.players { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.players li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .05); font-size: 15px; }
.players i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.players .tag { position: static; transform: none; font-size: 11px; background: rgba(233, 185, 73, .2); color: #e9b949; margin-left: auto; }
.players .tag.spec { background: rgba(255, 255, 255, .08); color: #9aa0aa; }
.players label { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 13px; color: #9aa0aa; }
.players input[type=checkbox] { width: 20px; height: 20px; accent-color: #e9b949; }
.leader-row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.leader-row select { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px; padding: 10px 12px; font: 600 14px var(--sans); }
.leader-row .btn { flex: 1; }
.lobby-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.waiting { color: #9aa0aa; font-size: 14px; margin: 0 0 12px; }

/* ---------- Builder ---------- */
.b-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.b-name { background: transparent; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .2); color: #fff; font: 400 26px var(--serif); width: 100%; padding: 2px 0; }
.b-name:focus { outline: none; border-color: #e9b949; }
.b-colors { display: flex; gap: 6px; margin-top: 8px; }
.b-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; }
.b-swatch.on { border-color: #fff; }
.b-timer { font: 800 26px var(--sans); color: #e9b949; font-variant-numeric: tabular-nums; }
.b-timer.hot { color: #ff6a5c; }
.b-budget { margin-top: 12px; font-size: 13px; color: #9aa0aa; }
.b-budget b { color: #fff; } .b-budget b.over { color: #ff6a5c; }
.b-bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; margin-bottom: 6px; }
.b-bar i { display: block; height: 100%; background: #e9b949; }
.b-bar i.over { background: #ff6a5c; }
.b-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.b-stat { background: rgba(255, 255, 255, .05); border-radius: 10px; padding: 6px 4px; text-align: center; }
.b-stat b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.b-stat span { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: #9aa0aa; }
.b-tabs { display: grid; grid-auto-flow: column; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, .06); }
.b-tabs button { border: 0; background: none; padding: 8px 0; border-radius: 8px; font: 600 13px var(--sans); color: #9aa0aa; }
.b-tabs button.on { background: #e9b949; color: #15171c; }
.b-list { margin-top: 10px; display: grid; gap: 6px; max-height: 38vh; overflow-y: auto; }
@media (min-width: 900px) { .b-list { max-height: none; flex: 1; } .panel.builder { display: flex; flex-direction: column; } }
.b-card, .b-mount { text-align: left; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04); color: #fff; border-radius: 12px; padding: 10px 12px; display: grid; gap: 3px; }
.b-card.on { border-color: #e9b949; background: rgba(233, 185, 73, .12); }
.b-card.no { opacity: .4; }
.b-card-top { display: flex; justify-content: space-between; }
.b-card-top em { font-style: normal; color: #e9b949; font-weight: 700; font-variant-numeric: tabular-nums; }
.b-blurb { font-size: 13px; color: #cfd3da; line-height: 1.35; }
.b-meta { font-size: 11px; color: #9aa0aa; }
.b-group { margin: 8px 0 0; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #9aa0aa; }
.b-pickhead { display: flex; justify-content: space-between; align-items: center; }
.b-mount { grid-template-columns: 78px 1fr auto; align-items: center; gap: 10px; }
.b-side { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #e9b949; }
.b-mount-main b { display: block; font-size: 15px; } .b-mount-main small { color: #9aa0aa; font-size: 11px; }
.b-mount em { font-style: normal; color: #e9b949; font-weight: 700; }
.b-note { margin: 6px 0 0; font-size: 12px; color: #9aa0aa; }
.b-foot { display: flex; gap: 8px; margin-top: 12px; }
.b-foot .btn:last-child { flex: 1; }
.b-err { margin: 8px 0 0; color: #ff6a5c; font-size: 13px; }

/* ---------- Fight HUD ---------- */
.fight[hidden] { display: none; }
.vitals { position: fixed; left: 14px; bottom: calc(env(safe-area-inset-bottom) + 16px); z-index: 6; width: min(46vw, 260px); pointer-events: none; }
.vital { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 8px; margin-bottom: 6px; }
.vital span { font: 700 10px var(--sans); letter-spacing: .12em; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.bar { height: 12px; border-radius: 6px; background: rgba(0, 0, 0, .45); overflow: hidden; border: 1px solid rgba(255, 255, 255, .2); }
.bar i { display: block; height: 100%; width: 100%; transition: width .15s; }
.bar.hp i { background: linear-gradient(90deg, #4fa36b, #7fd49a); }
.bar.hp i.low { background: linear-gradient(90deg, #e0634f, #ff8a7a); }
.bar.en i { background: linear-gradient(90deg, #3d8fd6, #7fd9ff); }
.comps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.comp { font: 600 10px var(--sans); color: #fff; background: rgba(0, 0, 0, .5); border-radius: 6px; padding: 3px 6px; border: 1px solid rgba(255, 255, 255, .15); position: relative; overflow: hidden; }
.comp i { position: absolute; left: 0; bottom: 0; height: 2px; background: #e9b949; }
.comp.dead { opacity: .35; text-decoration: line-through; }
.abilities { position: fixed; right: 14px; bottom: calc(env(safe-area-inset-bottom) + 16px); z-index: 6; display: flex; gap: 8px; }
.abil { width: 62px; height: 62px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); background: rgba(21, 23, 28, .8); color: #fff; font: 700 11px var(--sans); display: grid; place-items: center; position: relative; overflow: hidden; touch-action: manipulation; }
.abil b { font-size: 18px; } .abil small { font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.abil .cd { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); transform-origin: bottom; }
.abil.ready { border-color: #e9b949; box-shadow: 0 0 14px rgba(233, 185, 73, .5); }
.abil:active { transform: scale(.92); }
.alive { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 18px); z-index: 5; font: 700 12px var(--sans); letter-spacing: .1em; color: rgba(255, 255, 255, .8); text-transform: uppercase; pointer-events: none; }
.joy-l, .joy-r { pointer-events: none; }
.joy-r { border-color: rgba(233, 185, 73, .7); }
.joy-r i { background: rgba(233, 185, 73, .9); }

.spec { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 16px); z-index: 6; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 28px); }
.spec[hidden] { display: none; }
.spec button { border: 1px solid rgba(255, 255, 255, .2); background: rgba(21, 23, 28, .85); color: #fff; border-radius: 999px; padding: 8px 14px; font: 600 13px var(--sans); }
.spec button.on { background: #e9b949; color: #15171c; border-color: #e9b949; }
.proving-hud { position: fixed; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 64px); z-index: 6; display: flex; gap: 10px; align-items: center; background: rgba(21, 23, 28, .85); color: #fff; padding: 8px 8px 8px 14px; border-radius: 14px; font: 500 13px var(--sans); max-width: calc(100vw - 28px); }
.proving-hud[hidden] { display: none; }
.proving-hud .btn { min-height: 36px; padding: 0 12px; font-size: 13px; background: rgba(255, 255, 255, .1); color: #fff; }

/* Bot labels */
.botlabel { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); pointer-events: none; text-align: center; will-change: transform; }
.botlabel b { display: block; font: 700 11px var(--sans); color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); white-space: nowrap; }
.botlabel .lb { width: 54px; height: 6px; margin: 2px auto 0; border-radius: 3px; background: rgba(0, 0, 0, .5); overflow: hidden; border: 1px solid rgba(255, 255, 255, .25); }
.botlabel .lb i { display: block; height: 100%; background: #7fd49a; }
.botlabel.enemy .lb i { background: #ff8a7a; }
.dmgnum { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); font: 800 16px var(--sans); color: #fff; text-shadow: 0 2px 4px rgba(0, 0, 0, .7); pointer-events: none; animation: dmg .9s ease-out forwards; }
.dmgnum.mine { color: #ffd25a; }
.dmgnum.big { font-size: 24px; color: #ff6a5c; }
@keyframes dmg { 0% { opacity: 0; translate: 0 6px; scale: .7; } 15% { opacity: 1; scale: 1.1; } 100% { opacity: 0; translate: 0 -34px; } }

/* Results */
.results ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.results li { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); }
.results li:first-child { background: rgba(233, 185, 73, .18); }
.results li b { font-size: 16px; } .results li small { color: #9aa0aa; }
.results .place { font: 800 20px var(--sans); color: #e9b949; }

/* Sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; }
.sheet-wrap[hidden] { display: none; }
.sheet-back { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.sheet-card { position: relative; width: min(560px, 100%); max-height: 85vh; overflow-y: auto; background: #1b1d23; color: #fff; border-radius: 20px; padding: 22px; border: 1px solid rgba(255, 255, 255, .12); }
.sheet-x { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); color: #fff; }
.sheet-card h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 0 0 10px; }
.sheet-card h3 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #9aa0aa; margin: 18px 0 8px; }
.sheet-card p, .sheet-card li { color: #cfd3da; font-size: 14px; line-height: 1.5; }
.sheet-card table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sheet-card td, .sheet-card th { padding: 8px 6px; border-bottom: 1px solid rgba(255, 255, 255, .08); text-align: left; }
.sheet-card th { color: #9aa0aa; font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.sheet-card td.n { text-align: right; font-variant-numeric: tabular-nums; }

.arena-page .intro, .arena-page .nogl { background: linear-gradient(180deg, rgba(21, 23, 28, .55), rgba(21, 23, 28, .85)); }
.arena-page .card { background: #1b1d23; color: #fff; }
.arena-page .card .lede, .arena-page .card .small, .arena-page .card .kicker { color: #9aa0aa; }
.arena-page .card .btn { background: #e9b949; color: #15171c; }
.arena-page .chip { color: #fff; border-color: rgba(255, 255, 255, .25); }
.arena-page .who-form input { background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .2); }
