/* Gear: Ashfall. Designed on a fixed 1920x1080 stage that app.js scales to fit.
   --k grows text on small screens so it never renders under about 12 real px. */

@font-face { font-family: "Marcellus"; font-weight: 400; font-display: swap; src: url("assets/fonts/marcellus-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 400; font-display: swap; src: url("assets/fonts/alegreya-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url("assets/fonts/alegreya-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 500; font-display: swap; src: url("assets/fonts/alegreya-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Alegreya Sans"; font-weight: 700; font-display: swap; src: url("assets/fonts/alegreya-sans-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #151110;
  --ink: #f1e6d4;              /* bone */
  --ink-2: #d6c8b3;            /* secondary text, 9:1 on the panels */
  --ink-3: #b9a993;            /* quiet labels, 6.9:1 on the panels */
  --rule: rgba(241, 230, 212, .16);
  --glass: rgba(20, 15, 13, .8);
  --amber: #eba54e;            /* the one accent: active tab, active column, equipped */
  --amber-2: #b86f2a;
  --up: #a8dca0;
  --down: #f3a08c;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --k: 1;
  --edge: 48px;    /* one outer margin: wallet, tabs, context line, actions */
  --pitch: 176px;  /* one column pitch on both sides */
  --slot: 88px;    /* item slot */
  --row: 16px;     /* gap between slots in a column */
  --icon: calc(24px * var(--k));
  --cut: 12px;     /* chamfer of the slot frame */
  --display: "Marcellus", "Trajan Pro", Georgia, serif;
  --body: "Alegreya Sans", "Gill Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--body); font-weight: 500;
  font-variant-numeric: lining-nums;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
svg { display: block; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.viewport { position: fixed; inset: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); overflow: visible; }
.stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; }

/* ---------- hero: charcoal and smoke, the ronin centred ---------- */
.hero {
  position: absolute; inset: calc(-1 * var(--bleed-t, 0px)) calc(-1 * var(--bleed-r, 0px)) calc(-1 * var(--bleed-b, 0px)) calc(-1 * var(--bleed-l, 0px)); overflow: hidden;
  background: radial-gradient(ellipse 70% 80% at 50% 62%, #3a2820 0%, #221a16 45%, #131010 100%);
}
.hero__frame { position: absolute; left: 50%; top: 0; width: 1920px; height: 100%; margin-left: -960px; }
.is-wide .hero__frame { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%); }
.is-tall .hero__frame { top: auto; bottom: 0; height: 1080px; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 20%); mask-image: linear-gradient(180deg, transparent 0, #000 20%); }
/* taller than 16:9 on a desktop stage: the ronin grows from the bottom edge and fills the window */
.is-lift .hero__frame { top: auto; bottom: 0; width: calc(1920px * var(--art-f)); height: calc(1080px * var(--art-f)); margin-left: calc(-960px * var(--art-f)); -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 4%); mask-image: linear-gradient(180deg, transparent 0, #000 4%); }
/* a phone taller than 16:9: the ronin fills the window height from the bottom edge, no fade (see fit()) */
.is-tall.is-grow .hero__frame { top: auto; bottom: 0; width: calc(1920px * var(--art-f)); height: calc(1080px * var(--art-f)); margin-left: calc(-960px * var(--art-f)); -webkit-mask-image: none; mask-image: none; }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; animation: heroIn 1.1s var(--ease) both; }
.hero__shade { /* smoke over the side thirds keeps the columns calm; a floor of shadow under the context line and actions */
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(14,11,10,.72) 0, rgba(14,11,10,.36) 26%, rgba(14,11,10,0) 36%, rgba(14,11,10,0) 64%, rgba(14,11,10,.36) 74%, rgba(14,11,10,.72) 100%),
    linear-gradient(180deg, rgba(14,11,10,.66) 0, rgba(14,11,10,0) 18%, rgba(14,11,10,0) 80%, rgba(14,11,10,.7) 100%);
}
@keyframes heroIn { from { opacity: 0; transform: scale(1.03); } }

/* ash and embers: drifting specks, gone under reduced motion */
.ash { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ash i { position: absolute; top: -24px; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%; opacity: 0; animation: fall var(--d) linear var(--w) infinite; }
.ash i.ember { background: radial-gradient(circle, #ffd59a 0, #f08a35 45%, rgba(240,138,53,0) 70%); }
.ash i.flake { background: radial-gradient(circle, rgba(214,200,179,.7) 0, rgba(214,200,179,0) 70%); }
@keyframes fall {
  0% { opacity: 0; transform: translate(0, 0); }
  10% { opacity: var(--o); }
  85% { opacity: var(--o); }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--H, 1080px) + 48px)); }
}

/* ---------- wallet: two quiet readouts, not buttons ---------- */
.wallet { position: absolute; left: var(--edge); top: var(--edge); height: 56px; display: flex; align-items: center; gap: 32px; animation: fadeDown .6s var(--ease) .15s both; }
.purse { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: calc(24px * var(--k)); letter-spacing: .04em; font-variant-numeric: lining-nums tabular-nums; color: var(--ink); text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.purse svg { width: var(--icon); height: var(--icon); flex: none; }

/* ---------- tabs: one component, a bar marks the active one; the two halves flank the ronin's hat ---------- */
.tabs { position: absolute; left: 0; right: 0; top: var(--edge); display: flex; justify-content: center; pointer-events: none; animation: fadeDown .6s var(--ease) .1s both; }
/* two equal columns around a gap the width of the hat (scaled with the art on tall stages), so the gap stays on the
   ronin's axis whatever the labels measure and the crown rises between Map and Gear instead of behind them */
.tabs__list { display: inline-grid; grid-template-columns: 1fr calc(320px * var(--art-f, 1) + 64px) 1fr; }
.tabs__side { display: flex; gap: 8px; pointer-events: auto; }
.tabs__side--l { grid-column: 1; justify-content: flex-end; }
.tabs__side--r { grid-column: 3; justify-content: flex-start; }
.tab {
  position: relative; height: 56px; padding: 0 24px; display: flex; align-items: center;
  font-family: var(--display); font-size: calc(22px * var(--k)); letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink-3); border-radius: 4px; text-shadow: 0 1px 4px rgba(0,0,0,.6); text-indent: .16em; /* balances the trailing tracking under the active bar */
  transition: color .2s, background-color .2s;
}
.tab::after { /* the active bar; hidden on resting tabs */
  content: ""; position: absolute; left: 24px; right: 24px; bottom: 4px; height: 4px; border-radius: 2px;
  background: var(--amber); transform: scaleX(0); transition: transform .25s var(--ease);
}
.tab:hover { color: var(--ink); background-image: linear-gradient(rgba(241,230,212,.08), rgba(241,230,212,.08)); } /* hover tints with an image layer so the tab component keeps one background colour */
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab[aria-selected="true"]::before { /* a small ember diamond before the active label, a second non-colour marker */
  content: ""; position: absolute; left: 8px; top: 50%; width: 8px; height: 8px; margin-top: -4px; transform: rotate(45deg); background: var(--amber);
}

/* ---------- gear panel: two groups of columns mirrored about the centre ---------- */
.panel { position: absolute; inset: 0; pointer-events: none; }
.panel[hidden] { display: none; }
.panel > * { pointer-events: auto; }
.group { position: absolute; top: calc(288px + (100% - 1080px) / 2); display: flex; align-items: flex-start; }
.group--left { left: calc(50% - 700px); }
.group--right { left: calc(50% + 260px); }
.col { width: var(--pitch); display: flex; flex-direction: column; align-items: center; animation: colIn .5s var(--ease) both; animation-delay: calc(240ms + var(--i, 0) * 60ms); }
.col__head {
  position: relative; height: 32px; display: flex; align-items: center; margin-bottom: 24px;
  font-family: var(--display); font-weight: 400; font-size: calc(20px * var(--k)); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink-3); text-shadow: 0 1px 4px rgba(0,0,0,.7); transition: color .2s;
  text-indent: .14em; /* balances the trailing letter-spacing: label, active bar and slots share the column axis */
}
.col { position: relative; }
.col::before { /* active column marker: a short amber bar under the header */
  content: ""; position: absolute; left: 50%; top: 40px; width: 32px; height: 2px; margin-left: -16px; background: var(--amber); transform: scaleX(0); transition: transform .25s var(--ease);
}
.col.is-active .col__head { color: var(--ink); }
.col.is-active::before { transform: scaleX(1); }
.col__slots { display: grid; grid-template-columns: var(--slot); gap: var(--row); }

/* ---------- slot: one component; equipped, owned, locked and selected each add a shape ---------- */
.slot { position: relative; width: var(--slot); height: var(--slot); border-radius: 0; transition: transform .2s var(--ease); }
.slot__frame, .slot__frame::after { position: absolute; clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut)); }
.slot__frame { inset: 0; background: rgba(214,200,179,.34); transition: background-color .2s; }
.slot__frame::after { content: ""; inset: 2px; background: radial-gradient(circle at 50% 46%, rgba(214,170,120,.26), rgba(214,170,120,0) 62%), linear-gradient(160deg, rgba(48,38,32,.92), rgba(22,17,15,.94)); }
.slot__art { position: absolute; left: 12.5%; top: 12.5%; width: 75%; height: 75%; color: var(--ink-2); pointer-events: none; }
.slot__art img, .slot__art svg { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 4px rgba(0,0,0,.45)); }
/* generated cut-outs: square items fill a little more of the slot; long weapons lie on the diagonal like the reference */
.slot__art img { position: absolute; left: -4%; top: -4%; width: 108%; height: 108%; filter: brightness(1.28) contrast(1.06) drop-shadow(0 4px 4px rgba(0,0,0,.5)); }
.slot__art img.is-long, .dlg__art img.is-long { left: 50%; top: 50%; width: auto; transform: translate(-50%, -50%) rotate(45deg); }
.slot__art img.is-long { height: 150%; filter: brightness(1.7) contrast(1.1) drop-shadow(0 0 3px rgba(0,0,0,.6)); }
.slot__badge { position: absolute; right: -8px; top: -8px; width: 32px; height: 32px; display: none; place-items: center; border-radius: 50%; }
.slot__badge svg { width: 24px; height: 24px; }
.slot:hover .slot__frame { background: rgba(241,230,212,.62); }

.slot.is-equipped .slot__frame { background: var(--amber); }
.slot.is-equipped .slot__frame::after { inset: 3px; background: radial-gradient(circle at 50% 46%, rgba(235,165,78,.34), rgba(235,165,78,0) 62%), linear-gradient(160deg, rgba(86,56,32,.94), rgba(30,21,16,.95)); }
.slot.is-equipped .slot__art { color: var(--ink); }
.slot.is-equipped .slot__badge--check { display: grid; background: var(--amber); color: #2a1a0e; box-shadow: 0 0 0 3px #1a1412; }

.slot.is-locked .slot__frame { background: rgba(214,200,179,.22); }
.slot.is-locked .slot__frame::after { background: repeating-linear-gradient(135deg, rgba(241,230,212,.07) 0 4px, transparent 4px 12px), linear-gradient(160deg, rgba(30,24,21,.94), rgba(16,13,12,.96)); }
.slot.is-locked .slot__art { opacity: .32; filter: grayscale(1); }
.slot.is-locked::after { content: ""; position: absolute; inset: 10px; border: 2px dashed rgba(241,230,212,.3); pointer-events: none; }
.slot.is-locked .slot__badge--lock { display: grid; background: #3a302a; color: var(--ink); box-shadow: 0 0 0 3px #1a1412; }

.slot[aria-current="true"] { transform: scale(1.09); z-index: 2; }
.slot[aria-current="true"] .slot__frame { background: var(--ink); }
.slot[aria-current="true"] .slot__frame::after { inset: 4px; }
.slot[aria-current="true"]::before { /* ember glow under the selection */
  content: ""; position: absolute; inset: -16px; border-radius: 50%; background: radial-gradient(circle, rgba(235,165,78,.32), rgba(235,165,78,0) 70%); z-index: -1;
}
.slot:focus-visible { outline-offset: 8px; }

/* ---------- item card: opens beside the group, never over it ---------- */
.card {
  position: absolute; z-index: 20; left: 592px; top: 288px; width: 448px;
  background: rgba(20,15,13,.9); color: var(--ink); border-radius: 4px;
  box-shadow: inset 0 2px 0 var(--amber), inset 0 0 0 1px var(--rule), 0 32px 64px -24px rgba(0,0,0,.85);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: top .2s var(--ease), left .2s var(--ease);
}
.card.is-pop { animation: pop .24s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
/* header: kind left, state right on one row; when both do not fit, the state takes its own row under the kind.
   Words never split: the kind wraps only between words, the state (icon and word) never shrinks or wraps. */
.card__head {
  min-height: 56px; padding: 16px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: 16px; row-gap: 4px;
  border-bottom: 1px solid var(--rule); font-family: var(--display); font-size: calc(20px * var(--k)); line-height: 1.2; letter-spacing: .12em; text-transform: uppercase;
}
.card__kind { flex: 0 1 auto; min-width: 0; white-space: normal; overflow-wrap: normal; word-break: normal; color: var(--ink-3); } /* quieter than the state */
.card__state { flex: none; display: flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--ink); }
.card__state svg { width: var(--icon); height: var(--icon); flex: none; }
.card__state.is-equipped { color: var(--amber); }
.card__state.is-locked { color: var(--ink-2); }
/* body: one rhythm. 24 px on every side (the bottom matches the top), 16 px between sections, 4 px inside the title block */
.card__main { padding: 24px; display: grid; gap: 16px; }
.card__title { display: grid; gap: 4px; }
.card__name { font-family: var(--display); font-weight: 400; font-size: calc(40px * var(--k)); line-height: 1.1; letter-spacing: .02em; }
.card__type { font-size: calc(20px * var(--k)); line-height: 1.3; letter-spacing: .02em; color: var(--ink-3); }
.card__stats { display: grid; gap: 4px; }
.card__stats[hidden] { display: none; }
.card__stats li { min-height: 40px; display: grid; grid-template-columns: 1fr 96px 32px; align-items: center; gap: 12px; border-bottom: 1px solid rgba(241,230,212,.1); font-size: calc(24px * var(--k)); }
.card__stats.is-compare li { grid-template-columns: 1fr 96px 32px 72px; }
.meter { height: 8px; border-radius: 4px; background: rgba(241,230,212,.14); overflow: hidden; }
.meter i { display: block; height: 100%; width: calc(var(--v) * 10%); background: linear-gradient(90deg, var(--amber-2), var(--amber)); }
.card__stats b { font-family: var(--display); font-weight: 400; text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.delta { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-variant-numeric: lining-nums tabular-nums; }
.delta svg { width: var(--icon); height: var(--icon); flex: none; }
.delta--up { color: var(--up); }
.delta--down { color: var(--down); }
.card__perk { font-size: calc(24px * var(--k)); line-height: 1.3; }
.card__perk b { font-family: var(--display); font-weight: 400; color: var(--amber); letter-spacing: .06em; }
.card__lore { font-style: italic; font-weight: 400; font-size: calc(24px * var(--k)); line-height: 1.3; color: var(--ink-2); }
.card__lore:empty, .card__perk:empty { display: none; }

/* ---------- other tabs: a quiet placeholder page ---------- */
.other { position: absolute; left: 50%; top: 50%; width: 720px; margin-left: -360px; transform: translateY(-50%); padding: 48px; display: grid; justify-items: center; text-align: center; background: var(--glass); border-radius: 4px; box-shadow: inset 0 0 0 1px var(--rule); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: rise .35s var(--ease) both; }
.other__kicker { font-family: var(--display); font-size: calc(20px * var(--k)); letter-spacing: .16em; text-transform: uppercase; color: var(--amber); }
.other__title { margin-top: 12px; font-family: var(--display); font-weight: 400; font-size: calc(48px * var(--k)); letter-spacing: .06em; }
.other__text { margin: 16px 0 32px; font-size: calc(24px * var(--k)); line-height: 1.4; color: var(--ink-2); }
.other .btn { margin: 0; } /* centred by the grid, not by auto margins */

/* ---------- bottom line: context sentence left, three text buttons right ---------- */
.foot { position: absolute; left: var(--edge); right: var(--edge); bottom: var(--edge); display: flex; align-items: flex-end; justify-content: space-between; gap: 48px; pointer-events: none; animation: fadeUp .6s var(--ease) .3s both; }
.foot > * { pointer-events: auto; }
.context { min-height: 56px; min-width: 0; max-width: 960px; padding: 12px 24px; display: flex; align-items: center; background: var(--glass); border-radius: 4px; box-shadow: inset 4px 0 0 var(--amber-2); font-size: calc(24px * var(--k)); line-height: 1.3; color: var(--ink); }
.actions { display: flex; gap: 8px; flex: none; }
.hint {
  position: relative; height: 56px; padding: 0 24px; display: flex; align-items: center;
  font-family: var(--display); font-size: calc(22px * var(--k)); letter-spacing: .14em; text-indent: .14em; text-transform: uppercase; white-space: nowrap;
  background: var(--glass); color: var(--ink); border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(241,230,212,.22);
  transition: background-color .2s, color .2s;
}
.hint:hover { background-image: linear-gradient(rgba(241,230,212,.1), rgba(241,230,212,.1)); color: #fff; }
.hint[hidden] { display: none; }

/* ---------- dialogs ---------- */
.dialog { position: absolute; inset: calc(-1 * var(--bleed-t, 0px)) calc(-1 * var(--bleed-r, 0px)) calc(-1 * var(--bleed-b, 0px)) calc(-1 * var(--bleed-l, 0px)); z-index: 40; background: rgba(10,8,7,.66); display: grid; place-items: center; animation: fade .2s var(--ease); }
.dialog[hidden] { display: none; }
.dialog.is-closing { animation: fadeOut .16s var(--ease) forwards; }
.dlg { width: 1040px; display: grid; grid-template-columns: 320px 1fr; background: #1c1613; border-radius: 4px; box-shadow: inset 0 2px 0 var(--amber), inset 0 0 0 1px var(--rule), 0 40px 90px -30px rgba(0,0,0,.9); animation: rise .24s var(--ease); }
.is-closing .dlg { animation: sink .16s var(--ease) forwards; }
.dlg { position: relative; }
.dlg::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--amber); border-radius: 4px 4px 0 0; z-index: 1; pointer-events: none; }
.dlg--small { width: 720px; grid-template-columns: 1fr; }
.dlg__art { position: relative; background: radial-gradient(circle at 50% 45%, rgba(235,165,78,.18), rgba(235,165,78,0) 70%), #15110f; color: var(--ink-2); display: grid; place-items: center; border-radius: 4px 0 0 4px; }
.dlg__art img, .dlg__art svg { width: 224px; height: 224px; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0,0,0,.5)); }
.dlg__art img.is-long { position: absolute; height: 320px; filter: brightness(1.5) drop-shadow(0 8px 10px rgba(0,0,0,.5)); }
.dlg__body { padding: 40px; }
.dlg__kind { font-family: var(--display); font-size: calc(20px * var(--k)); letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }
.dlg__name { margin-top: 8px; font-family: var(--display); font-weight: 400; font-size: calc(40px * var(--k)); line-height: 1.1; letter-spacing: .02em; }
.dlg--small .dlg__name { margin-top: 0; }
.dlg__type { margin-top: 4px; font-size: calc(24px * var(--k)); color: var(--ink-2); }
.dlg__text { margin-top: 16px; font-size: calc(26px * var(--k)); line-height: 1.35; color: var(--ink-2); }
.compare { margin-top: 24px; width: 100%; border-collapse: collapse; font-size: calc(24px * var(--k)); }
.compare[hidden] { display: none; }
.compare th { font-family: var(--display); font-weight: 400; font-size: calc(20px * var(--k)); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); text-align: right; padding: 0 0 8px; border-bottom: 1px solid var(--rule); }
.compare th:first-child, .compare td:first-child { text-align: left; }
.compare td { padding: 8px 0; text-align: right; border-bottom: 1px solid rgba(241,230,212,.08); font-variant-numeric: lining-nums tabular-nums; }
.dlg__perk { margin-top: 24px; font-size: calc(24px * var(--k)); line-height: 1.35; }
.dlg__perk b { font-family: var(--display); font-weight: 400; color: var(--amber); letter-spacing: .06em; }
.dlg__lore { margin-top: 12px; font-style: italic; font-weight: 400; font-size: calc(24px * var(--k)); line-height: 1.35; color: var(--ink-2); }
.dlg__foot { margin-top: 32px; display: flex; justify-content: flex-end; gap: 16px; }
.btn {
  position: relative; min-width: 200px; height: 64px; padding: 0 32px; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: calc(22px * var(--k)); letter-spacing: .14em; text-indent: .14em; text-transform: uppercase; white-space: nowrap;
  border-radius: 4px; color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1px rgba(241,230,212,.4); transition: background-color .2s;
}
.btn:hover { background: rgba(241,230,212,.08); }
.btn--solid { background: var(--amber); color: #23160c; box-shadow: none; }
.btn--solid:hover { background: #f4bb6c; }
.btn[hidden] { display: none; }

/* ---------- leaving ---------- */
.world { position: absolute; inset: calc(-1 * var(--bleed-t, 0px)) calc(-1 * var(--bleed-r, 0px)) calc(-1 * var(--bleed-b, 0px)) calc(-1 * var(--bleed-l, 0px)); z-index: 50; display: grid; place-items: center; background: radial-gradient(ellipse at 50% 70%, rgba(80,40,22,.96), rgba(16,12,11,.98) 70%); text-align: center; animation: fade .5s var(--ease); }
.world[hidden] { display: none; }
.world__inner { display: flex; flex-direction: column; align-items: center; }
.world__kicker { font-family: var(--display); font-size: calc(22px * var(--k)); letter-spacing: .24em; text-transform: uppercase; color: var(--amber); }
.world__title { margin-top: 16px; font-family: var(--display); font-weight: 400; font-size: calc(72px * var(--k)); letter-spacing: .04em; }
.world__text { margin: 24px auto 48px; max-width: 760px; font-size: calc(28px * var(--k)); line-height: 1.4; color: var(--ink-2); }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes sink { to { opacity: 0; transform: translateY(12px); } }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-12px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } }
@keyframes colIn { from { opacity: 0; transform: translateY(16px); } }
.other { animation-name: riseCentered; }
@keyframes riseCentered { from { opacity: 0; transform: translateY(calc(-50% + 12px)); } }

/* ---------- taller than 16:9: tabs and foot keep the window edges, the columns move down (offset set in fit()) ---------- */
/* the wallet leaves the top-left corner (storefront cards put their badge there) and stacks over the context line */
.is-lift .wallet { top: auto; bottom: calc(var(--edge) + 56px + 16px); animation-name: fadeUp; }
.is-lift .group { top: calc(288px + var(--lift-c)); }

/* ---------- compact phones: every control reaches --tap (45 real px) ---------- */
.compact { --slot: var(--tap); --row: 16px; --cut: 16px; }
.compact .wallet { height: var(--tap); }
/* a narrow phone stage where the left tabs reach the purse (placeWallet): the purse joins the bottom row */
.wallet-low .wallet { top: auto; bottom: var(--edge); animation-name: fadeUp; }
.wallet-low .foot { left: calc(var(--edge) + var(--wallet-w, 0px) + 24px); }
.compact .tabs__side { gap: 0; }
.compact .tab { height: var(--tap); min-width: calc(var(--tap) + 16px); justify-content: center; padding: 0 20px; }
.compact .tab::after { left: 20px; right: 20px; bottom: 16px; }
.compact .tab[aria-selected="true"]::before { left: 4px; }
.compact .group { top: calc(var(--edge) + var(--tap) + 24px); }
.compact .group--left { left: 96px; }
.compact .group--right { left: auto; right: 96px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.compact .col { width: auto; min-width: calc(var(--slot) + 48px); padding: 0 16px; }
.compact .col__head { letter-spacing: .08em; text-indent: .08em; color: var(--ink-2); }
.compact .col.is-active .col__head { color: var(--ink); }
.compact .col--wide .col__slots { grid-template-columns: repeat(2, var(--slot)); }
.compact .col__head { height: calc(32px * var(--k)); margin-bottom: 16px; }
.compact .col::before { top: calc(32px * var(--k) + 4px); }
.compact .slot__badge { width: 48px; height: 48px; right: -12px; top: -12px; }
.compact .slot__badge svg { width: 40px; height: 40px; }
.compact .card { width: 680px; }
.compact .card__lore { display: none; }
.compact .card__stats li { grid-template-columns: 1fr 120px 56px; min-height: 56px; }
.compact .card__stats.is-compare li { grid-template-columns: 1fr 120px 56px 112px; }
.compact .card.is-tight .card__main { padding: 16px 24px; gap: 8px; }
.compact .card.is-tight .card__type { display: none; } /* the head row already names the kind; DETAILS shows the full type */
.compact .card.is-tight .card__stats li { min-height: 40px; }
.compact .foot { align-items: flex-end; }
.compact .context { min-height: var(--tap); max-width: none; padding: 8px 24px; }
.compact .hint { height: var(--tap); }
.compact .btn { height: var(--tap); }
.compact .dlg { width: 1500px; grid-template-columns: 360px 1fr; }
.compact .dlg--small { width: 1100px; grid-template-columns: 1fr; }
.compact .dlg__body { padding: 32px 40px; }
.compact .dlg__lore { display: none; }
.compact .compare { margin-top: 16px; }
.compact .dlg__perk { margin-top: 16px; }
.compact .dlg__foot { margin-top: 24px; }
.compact .other { width: 1200px; margin-left: -600px; }
.context.is-news { color: var(--amber); }

/* the entrance plays once: after it, a change of the motion setting or a re-layout does not replay it */
.is-settled :is(.hero__img, .wallet, .tabs, .col, .foot) { animation: none; }

/* ---------- portrait phones: ask to rotate ---------- */
.rotate { display: none; }
@media (orientation: portrait) and (max-width: 900px) {
  .viewport { display: none; }
  .rotate { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 32px; text-align: center; color: var(--ink); background: radial-gradient(ellipse at 50% 70%, #3a2820, #131010 70%); }
  .rotate svg { width: 72px; height: 72px; color: var(--amber); }
  .rotate p { font-size: 20px; font-weight: 500; max-width: 260px; line-height: 1.4; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .ash { display: none; }
}
