/* IRON PILGRIMS — light sand colosseum theme */
:root {
  --sand-0: #f5efe0;      /* page top */
  --sand-1: #ede3cc;      /* page bottom */
  --card: #faf6ec;
  --card-2: #f3ecda;
  --line: #d9c9a6;
  --line-soft: #e6dbc0;
  --ink: #3b2f21;
  --ink-soft: #6d5c44;
  --ink-faint: #96856a;
  --terra: #c96f4a;
  --terra-deep: #a03c2e;
  --laurel: #7a8450;
  --laurel-deep: #5c6639;
  --gold: #c9a227;
  --gold-deep: #a5821a;
  --bronze: #a9722c;
  --azure: #3d6c8e;
  --imperial: #6b4b8a;
  --stone: #8a8577;
  --danger: #a03c2e;
  --ok: #5c7a45;
  --hp: #b8503a;
  --stam: #7a8450;
  --xp: #c9a227;
  --fatigue: #7d8a99;
  --shadow: 0 2px 10px rgba(90, 70, 40, .10), 0 1px 3px rgba(90, 70, 40, .12);
  --shadow-lift: 0 8px 28px rgba(90, 70, 40, .16), 0 2px 6px rgba(90, 70, 40, .12);
  --serif: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 50% -140px, #fbf7ec 0%, transparent 60%),
    linear-gradient(var(--sand-0), var(--sand-1) 70%);
  background-attachment: fixed;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.45;
}
/* faint grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .5; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .26 0 0 0 .035 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#app { position: relative; z-index: 1; }

/* inline icons default to text-ish size; larger uses override explicitly */
svg { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; }
.logo .mark svg, .chip svg, .slot-icon svg { width: 100%; height: 100%; vertical-align: initial; }
.chest-art svg { width: 46px; height: 46px; }
.laurel-div svg { width: 20px; height: 20px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; letter-spacing: .02em; margin: 0 0 .4em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.12rem; }
a { color: var(--terra-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: #e8cba8; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(#fbf7ecdd, #f6efdfdd);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 #fff inset, 0 3px 14px rgba(90,70,40,.08);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--serif); }
.logo .mark { width: 34px; height: 34px; color: var(--laurel-deep); }
.logo .word { font-size: 1.18rem; letter-spacing: .14em; font-weight: 800; color: var(--ink); white-space: nowrap; }
.logo .word span { color: var(--terra-deep); margin-left: .34em; }

nav.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
nav.tabs a {
  padding: 8px 14px; border-radius: 9px; color: var(--ink-soft);
  font-weight: 600; font-size: .92rem; letter-spacing: .02em;
}
nav.tabs a:hover { background: #efe5cd; text-decoration: none; }
nav.tabs a.active {
  background: linear-gradient(#fff8ea, #f0e6ce);
  color: var(--terra-deep);
  box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(90,70,40,.12);
}
nav.tabs a .badge { margin-left: 6px; }

.wallet { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(#fffaf0, #f4ecd8);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px 4px 8px; font-weight: 700; font-size: .9rem;
  font-variant-numeric: tabular-nums; box-shadow: 0 1px 2px rgba(90,70,40,.10);
}
.chip svg { width: 17px; height: 17px; }
.chip.denarii { color: var(--bronze); }
.chip.laurels { color: var(--laurel-deep); }
.chip.scrap { color: var(--ink-soft); }
.chip .lbl { font-weight: 500; color: var(--ink-faint); font-size: .78rem; }

/* ---------- layout ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 22px 20px 80px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cols-4 { grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.right { margin-left: auto; }

.card {
  background: linear-gradient(#fdfaf2, var(--card) 12%);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  position: relative;
}
.card.tight { padding: 12px 14px; }
.card .card { box-shadow: none; background: var(--card-2); }

.sect { margin: 26px 0 12px; display: flex; align-items: center; gap: 14px; }
.sect h2 { margin: 0; white-space: nowrap; }
.sect::before, .sect::after {
  content: ""; height: 4px; flex: 1;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.sect::before { max-width: 42px; }
.sub { color: var(--ink-soft); font-size: .92rem; }
.faint { color: var(--ink-faint); font-size: .85rem; }

/* ---------- buttons ---------- */
button, .btn {
  font: inherit; cursor: pointer; border-radius: 10px;
  border: 1px solid #b98d63;
  background: linear-gradient(#e9b58c, #d78d5c 60%, #c97e4e);
  color: #4a2617; font-weight: 700; letter-spacing: .01em;
  padding: 8px 16px;
  box-shadow: 0 1px 0 #ffffff70 inset, 0 2px 5px rgba(120, 70, 30, .25);
  transition: transform .05s, box-shadow .15s, filter .15s;
}
button:hover:not(:disabled) { filter: brightness(1.05); box-shadow: 0 1px 0 #ffffff70 inset, 0 4px 10px rgba(120,70,30,.3); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.ghost {
  background: linear-gradient(#fbf6e9, #f0e7d0); color: var(--ink-soft); border-color: var(--line);
  box-shadow: 0 1px 0 #fff inset, 0 1px 3px rgba(90,70,40,.12);
}
button.laurel { background: linear-gradient(#a9b37b, #86915a 60%, #78834e); border-color: #6d7747; color: #22290f; }
button.danger { background: linear-gradient(#d17f6b, #b1503c 60%, #a03c2e); border-color: #8e3325; color: #fff2ea; }
button.gold { background: linear-gradient(#ecd27c, #d4af37 55%, #c9a227); border-color: #a5821a; color: #4a3a08; }
button.small { padding: 4px 10px; font-size: .84rem; border-radius: 8px; }
button.big { padding: 12px 22px; font-size: 1.05rem; border-radius: 12px; }

input, select {
  font: inherit; color: var(--ink);
  background: #fffdf6; border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 12px; outline: none;
}
input:focus, select:focus { border-color: var(--terra); box-shadow: 0 0 0 3px #c96f4a22; }
label { font-size: .85rem; color: var(--ink-soft); font-weight: 600; }

/* ---------- badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .75rem; font-weight: 700; letter-spacing: .03em;
  padding: 2px 8px; border-radius: 999px;
  background: #efe5cd; color: var(--ink-soft); border: 1px solid var(--line);
  vertical-align: middle;
}
.badge.red { background: #f6ded6; color: var(--terra-deep); border-color: #e4b8a8; }
.badge.green { background: #e7ecd7; color: var(--laurel-deep); border-color: #c6d0a4; }
.badge.gold { background: #f7ecc9; color: var(--gold-deep); border-color: #e2cd8a; }
.badge.blue { background: #dfe9f0; color: var(--azure); border-color: #b7cfdf; }
.badge.purple { background: #eae2f2; color: var(--imperial); border-color: #cfc0e0; }
.badge.stone { background: #eceae3; color: var(--stone); border-color: #d5d2c6; }

.stars { color: var(--gold-deep); letter-spacing: 2px; font-size: .9rem; }
.stars .off { color: #d8cba9; }

/* rarity */
.rar-common { --rar: var(--stone); }
.rar-uncommon { --rar: #5f7d4f; }
.rar-rare { --rar: var(--azure); }
.rar-epic { --rar: var(--imperial); }
.rar-legendary { --rar: var(--gold-deep); }
.rarity-text { color: var(--rar); font-weight: 700; }

/* ---------- bars ---------- */
.bar {
  height: 9px; border-radius: 999px; background: #e2d7bb;
  overflow: hidden; box-shadow: inset 0 1px 2px rgba(90,70,40,.22);
}
.bar > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--bc, var(--terra)), color-mix(in srgb, var(--bc, var(--terra)) 78%, #fff));
  transition: width .5s cubic-bezier(.2,.8,.3,1);
}
.bar.hp > i { --bc: var(--hp); }
.bar.stam > i { --bc: var(--stam); }
.bar.xp > i { --bc: var(--xp); }
.bar.fat > i { --bc: var(--fatigue); }
.bar.thin { height: 6px; }
.barrow { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--ink-soft); }
.barrow .bar { flex: 1; }
.barrow .num { min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- gladiator cards ---------- */
.glad-card { cursor: pointer; transition: transform .12s, box-shadow .2s; }
.glad-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.medal {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: #fff8ea;
  background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--mc, var(--terra)) 70%, #fff), var(--mc, var(--terra)) 62%);
  box-shadow: 0 0 0 3px #fff8ea, 0 0 0 4.5px var(--line), 0 2px 6px rgba(90,70,40,.3);
  flex: none;
}
.medal.big { width: 74px; height: 74px; font-size: 1.7rem; }
.medal.dead { filter: grayscale(1) brightness(.75); }
.medal.portrait { background: none; overflow: hidden; }
.medal.portrait svg { width: 100%; height: 100%; display: block; border-radius: 50%; vertical-align: initial; }

.attr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.attr {
  display: flex; justify-content: space-between; align-items: center; gap: 4px;
  background: var(--card-2); border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 4px 9px; font-size: .84rem;
}
.attr b { font-variant-numeric: tabular-nums; }
.attr .plus { color: var(--ok); font-weight: 800; }
.attr .minus { color: var(--danger); font-weight: 800; }
.attr button { padding: 0 7px; border-radius: 6px; font-size: .85rem; line-height: 1.35; }
.attr.capped b { color: var(--gold-deep); }

/* ---------- items ---------- */
.item-card {
  border-left: 4px solid var(--rar, var(--stone));
  position: relative;
}
.item-card.rar-legendary {
  background: linear-gradient(120deg, #fdfaf2, #faf3da 45%, #fdfaf2 70%);
}
.item-name { font-weight: 800; color: var(--rar, var(--ink)); font-size: .98rem; }
.item-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .82rem; color: var(--ink-soft); margin: 6px 0; }
.item-stats b { color: var(--ink); font-variant-numeric: tabular-nums; }
.affix { font-size: .8rem; color: var(--imperial); }
.slot-icon { width: 20px; height: 20px; color: var(--ink-faint); flex: none; }
.slot-icon.big { width: 30px; height: 30px; color: var(--rar, var(--ink-soft)); }
.item-card .slot-icon.big { filter: drop-shadow(0 1px 1px rgba(90,70,40,.25)); }

.gearbox {
  display: flex; align-items: center; gap: 10px;
  background: var(--card-2); border: 1px dashed var(--line);
  border-radius: 10px; padding: 8px 10px; min-height: 52px;
}
.gearbox.filled { border-style: solid; border-left: 4px solid var(--rar, var(--stone)); }
.gearbox .meta { flex: 1; min-width: 0; }
.gearbox .meta .nm { font-weight: 700; font-size: .88rem; color: var(--rar, var(--ink)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th {
  text-align: left; font-family: var(--serif); font-weight: 600; letter-spacing: .04em;
  color: var(--ink-soft); border-bottom: 2px solid var(--line); padding: 7px 10px;
}
table.data td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); font-variant-numeric: tabular-nums; }
table.data tr:last-child td { border-bottom: none; }
table.data tr.me td { background: #f7efd9; font-weight: 700; }
table.data tr:hover td { background: #f7f1e1; }

/* ---------- quests ---------- */
.quest { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line-soft); }
.quest:last-child { border-bottom: none; }
.quest .desc { flex: 1; }
.quest .rew { font-weight: 700; color: var(--bronze); white-space: nowrap; font-size: .88rem; }

/* ---------- chests ---------- */
.chest-card { text-align: center; overflow: hidden; }
.chest-art { font-size: 44px; margin: 6px 0 8px; filter: drop-shadow(0 3px 4px rgba(90,70,40,.3)); }
.chest-art img {
  width: 100%; max-width: 188px; aspect-ratio: 1; object-fit: cover;
  border-radius: 12px; border: 1px solid #7d5a2255;
  box-shadow: inset 0 0 24px rgba(0,0,0,.35), 0 3px 10px rgba(60,40,15,.35);
}
.pity { font-size: .78rem; color: var(--ink-faint); }

/* reveal */
@keyframes reveal-pop {
  0% { transform: scale(.3) rotate(-6deg); opacity: 0; }
  60% { transform: scale(1.08) rotate(1.5deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes shine-sweep {
  from { transform: translateX(-130%) skewX(-18deg); }
  to { transform: translateX(230%) skewX(-18deg); }
}
.reveal { animation: reveal-pop .55s cubic-bezier(.2, 1.4, .4, 1); }
.reveal.rar-epic, .reveal.rar-legendary { overflow: hidden; }
.reveal.rar-epic::after, .reveal.rar-legendary::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 45%;
  background: linear-gradient(90deg, transparent, #fff8, transparent);
  animation: shine-sweep 1.3s ease .3s 2;
}

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 100; background: rgba(59, 47, 33, .45);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  backdrop-filter: blur(3px);
}
.modal {
  background: linear-gradient(#fdfaf2, var(--card) 15%);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lift);
  max-width: 660px; width: 100%; max-height: 88vh; overflow: auto; padding: 20px 22px;
}
.modal:has(.arena-stage) { max-width: 920px; }
.modal h3 { display: flex; align-items: center; gap: 8px; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #453724; color: #f7f0e0; border-radius: 10px; padding: 10px 16px;
  box-shadow: var(--shadow-lift); font-size: .92rem; max-width: 380px;
  animation: reveal-pop .3s;
}
.toast.err { background: #7c2d20; }
.toast.gold { background: #7a6210; }

/* ---------- arena / replay ---------- */
.arena-stage {
  background:
    radial-gradient(ellipse 62% 52% at 50% 52%, #eeddb4 0%, #e6d2a4 58%, #d9c193 60%, transparent 61%),
    linear-gradient(#cbb98e, #bfa87a);
  background-size: cover; background-position: center 72%;
  border-radius: 16px; border: 1px solid #ab9268;
  box-shadow: inset 0 0 0 6px #b49a6b33, inset 0 10px 40px rgba(70,50,20,.25), var(--shadow);
  position: relative; overflow: hidden;
}
.arena-stage.photo {
  background-image: linear-gradient(rgba(244,226,186,.16), rgba(59,40,15,.14)), url("/img/arena.jpg");
}
.arena-stage.photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 62%, transparent 46%, rgba(45,30,10,.34));
}
canvas.arena { display: block; width: 100%; position: relative; }
.replay-hud { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.ticker {
  height: 168px; overflow-y: auto; font-size: .86rem;
  background: var(--card-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 8px 12px;
}
.ticker div { padding: 2px 0; border-bottom: 1px dotted var(--line-soft); }
.ticker .t { color: var(--ink-faint); font-variant-numeric: tabular-nums; margin-right: 6px; font-size: .78rem; }
.ticker .crit { color: var(--terra-deep); font-weight: 700; }
.ticker .good { color: var(--laurel-deep); }
.ticker .death { color: #7c2d20; font-weight: 800; }

.fighter-panel { display: flex; flex-direction: column; gap: 4px; }
.fighter-panel .nm { font-weight: 800; font-size: .95rem; display: flex; gap: 6px; align-items: center; }

.mode-card { text-align: left; transition: transform .12s, box-shadow .2s; cursor: pointer; }
.mode-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.mode-card h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.mode-card .risk { font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; font-weight: 800; }

/* versus banner */
.versus {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px;
  padding: 8px 4px;
}
.versus .vs { font-family: var(--serif); font-size: 1.6rem; color: var(--terra-deep); font-weight: 800; }
.versus .side { display: flex; gap: 10px; align-items: center; min-width: 0; }
.versus .side.right { flex-direction: row-reverse; text-align: right; }

/* ---------- auth screen ---------- */
.auth-bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    linear-gradient(rgba(30, 18, 6, .18) 0%, rgba(30, 18, 6, .34) 58%, var(--sand-0) 96%),
    url("/img/hero.jpg") center 30% / cover no-repeat,
    linear-gradient(#3a2c1c, var(--sand-0));
}
.auth-hero {
  max-width: 460px; margin: 9vh auto 0; position: relative; z-index: 1;
}
.auth-hero .card { padding: 28px; background: linear-gradient(#fdfaf2f2, #faf6ecf2 15%); backdrop-filter: blur(4px); }
.auth-title { text-align: center; margin-bottom: 18px; }
.auth-title .word {
  font-size: 2.3rem; letter-spacing: .12em; font-family: var(--serif); font-weight: 800;
  color: #fbf3e2; text-shadow: 0 2px 14px rgba(20, 10, 0, .65), 0 1px 2px rgba(20, 10, 0, .8);
  white-space: nowrap;
}
.auth-title .word span { color: #e8b287; }
.auth-title .tag {
  color: #f3e6cd; font-style: italic; font-family: var(--serif);
  text-shadow: 0 1px 8px rgba(20, 10, 0, .75), 0 1px 2px rgba(20, 10, 0, .7);
}
.auth-hero form { display: flex; flex-direction: column; gap: 10px; }

/* laurel divider */
.laurel-div { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--laurel); margin: 6px 0; }
.laurel-div::before, .laurel-div::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* events feed */
.feed div { padding: 6px 0; border-bottom: 1px dotted var(--line-soft); font-size: .88rem; }
.feed div:last-child { border: none; }
.feed .when { color: var(--ink-faint); font-size: .76rem; }

/* skeleton for potential stars etc */
.kv { display: flex; gap: 14px; flex-wrap: wrap; }
.kv > div { min-width: 90px; }
.kv .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); font-weight: 700; }
.kv .v { font-weight: 700; font-variant-numeric: tabular-nums; }

.tabbar-sub { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.tabbar-sub button { border-radius: 999px; }
.tabbar-sub button:not(.active) { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-soft); }
.tabbar-sub button.active { background: linear-gradient(#fff8ea, #f0e6ce); border-color: var(--line); color: var(--terra-deep); }

.empty { text-align: center; color: var(--ink-faint); padding: 26px; font-style: italic; font-family: var(--serif); }

.countdown { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-soft); }

/* announcement */
.announce {
  background: linear-gradient(90deg, #f7ecc9, #fdf6e0);
  border: 1px solid #e2cd8a; color: #6b5510;
  border-radius: 10px; padding: 9px 14px; margin-bottom: 14px; font-weight: 600;
  display: flex; gap: 8px; align-items: center;
}

/* ---------- new components (IA rework) ---------- */
.fight-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; font-size: .92rem;
}
.fight-cta svg { width: 16px; height: 16px; }
a.btnlike {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; padding: 5px 10px; border-radius: 8px;
  background: linear-gradient(#fbf6e9, #f0e7d0); border: 1px solid var(--line);
  color: var(--ink-soft); font-weight: 800; text-decoration: none;
}
a.btnlike:hover { text-decoration: none; filter: brightness(1.04); }

/* bottom navigation (mobile) */
.bottomnav { display: none; }

/* fighter picker */
.fighter-pick { display: flex; gap: 10px; flex-wrap: wrap; }
.fighter-pick .pick {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 12px 8px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--line-soft); background: var(--card-2);
  min-width: 96px; text-align: center; transition: transform .1s, box-shadow .15s;
}
.fighter-pick .pick:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.fighter-pick .pick.active {
  border-color: var(--terra); background: linear-gradient(#fff8ea, #f7ecd4);
  box-shadow: 0 0 0 2px #c96f4a33, var(--shadow);
}
.fighter-pick .pnm { font-weight: 800; font-size: .9rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* locked mode cards */
.lockedcard { opacity: .78; cursor: default; }
.lockedcard:hover { transform: none; box-shadow: var(--shadow); }
.locktag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 800;
  color: var(--ink-faint); margin: 2px 0 4px;
}

/* first steps */
.steps-card { border-left: 4px solid var(--gold); }
.steps { display: flex; flex-direction: column; gap: 4px; }
.step { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); }
.step:last-child { border-bottom: none; }
.step .n {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-2); border: 1.5px solid var(--line);
  font-weight: 800; font-size: .82rem; color: var(--ink-soft);
}
.step.done .n { background: #f7ecc9; border-color: var(--gold); color: var(--gold-deep); }
.step.claimed { opacity: .6; }
.step.claimed .n { background: #e7ecd7; border-color: var(--laurel); color: var(--laurel-deep); }
.step .d { flex: 1; font-weight: 600; }

/* what-now hint */
.whatnow {
  display: flex; align-items: center; gap: 10px; margin-top: 14px;
  background: linear-gradient(90deg, #f6efdb, #faf5e8);
  border: 1px dashed var(--line); border-radius: 10px; padding: 9px 12px; font-size: .92rem;
}

/* gear rack lines & fighter history lines */
.gearline { gap: 8px; padding: 4px 0; border-bottom: 1px dotted var(--line-soft); }
.gearline:last-child { border-bottom: none; }
.gearline .nm { font-weight: 600; font-size: .88rem; color: var(--rar, var(--ink)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.histline { gap: 8px; padding: 5px 0; border-bottom: 1px dotted var(--line-soft); font-size: .88rem; }
.histline:last-child { border-bottom: none; }
.histline .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* replay seek bar with event pips */
.seekbar { flex: 1; position: relative; padding: 6px 0; cursor: pointer; min-width: 120px; touch-action: none; }
.seekbar .pip {
  position: absolute; top: 50%; width: 5px; height: 5px; border-radius: 50%;
  transform: translate(-50%, -50%); background: var(--ink-faint); pointer-events: none;
}
.seekbar .pip.crit { background: var(--terra-deep); }
.seekbar .pip.death { background: #4a1006; width: 7px; height: 7px; }
.seekbar .pip.big { background: var(--imperial); }

@media (max-width: 760px) {
  .wrap { padding: 14px 12px 96px; }
  .topbar-inner { padding: 8px 12px; gap: 8px; }
  nav.tabs { display: none; }                     /* bottom nav takes over */
  .logo .word { font-size: 1rem; }
  .wallet { gap: 5px; }
  .chip { padding: 3px 9px 3px 7px; font-size: .82rem; }
  .chip .lbl { display: none; }
  .fight-cta span { display: none; }
  .versus .vs { font-size: 1.1rem; }
  .bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: linear-gradient(#fbf7ecf5, #f3ebd8f8);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -3px 14px rgba(90,70,40,.10);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
  }
  .bottomnav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 5px 2px 4px; border-radius: 10px; color: var(--ink-soft);
    font-size: .68rem; font-weight: 700; letter-spacing: .02em; text-decoration: none;
  }
  .bottomnav a .ic { position: relative; width: 22px; height: 22px; }
  .bottomnav a .ic svg { width: 22px; height: 22px; }
  .bottomnav a .ic .dot {
    position: absolute; top: -2px; right: -4px; width: 8px; height: 8px;
    border-radius: 50%; background: var(--gold); border: 1.5px solid #fff8ea;
  }
  .bottomnav a.active { color: var(--terra-deep); background: #f2e6cb; }
  #toasts { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); right: 10px; left: 10px; align-items: center; }
}
