/* css/fonts.css */
@font-face { font-family: "FrizQuadrata"; src: url("../assets/fonts/frizqt.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Morpheus"; src: url("../assets/fonts/morpheus.woff2") format("woff2"); font-display: swap; }

/* css/main.css */
:root {
  --bg: #0b0a08; --panel: #17130e; --panel-2: #211b13; --edge: #4a3b26; --edge-hi: #8a6d3b;
  --text: #e8dcc0; --muted: #a39578; --gold: #ffd100; --red: #e0443a; --green: #3fd65a; --blue: #4aa8ff;
  --q-common: #ffffff; --q-uncommon: #1eff00; --q-rare: #0070dd; --q-epic: #a335ee; --q-legendary: #ff8000;
  --font-head: "Morpheus", "FrizQuadrata", Georgia, serif; --font-body: "FrizQuadrata", Georgia, serif;
  --cell: 48px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 15px; }
body { min-height: 100vh; min-height: 100dvh; -webkit-tap-highlight-color: transparent; touch-action: manipulation; display: flex; flex-direction: column; overflow-x: hidden;
  background: radial-gradient(ellipse at 50% -10%, #2a2015 0%, var(--bg) 60%) fixed; }
#app { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 12px 16px 24px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-bottom: max(24px, env(safe-area-inset-bottom)); }
a { color: var(--gold); }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--font-head); font-weight: normal; color: var(--gold); margin: 0; letter-spacing: .02em; text-shadow: 0 2px 0 #000; }

.btn { background: linear-gradient(#8b1a10, #5a0f08); border: 1px solid #c9a24a; border-radius: 4px; padding: 8px 16px;
  color: var(--gold); text-shadow: 0 1px 0 #000; box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 0 #000; min-height: 40px; }
@media (hover: hover) { .btn:hover:not(:disabled) { filter: brightness(1.2); } }
.btn:active:not(:disabled) { transform: scale(.96); filter: brightness(.92); }
.btn:disabled { filter: grayscale(1) brightness(.6); cursor: default; }
.btn.small { padding: 4px 10px; min-height: 32px; font-size: 13px; }
.btn.ghost { background: var(--panel-2); border-color: var(--edge); color: var(--text); }
.btn.big { font-size: 20px; padding: 12px 28px; font-family: var(--font-head); }
.panel { background: linear-gradient(180deg, #1c1710, #120f0a 70%); border: 1px solid var(--edge); border-radius: 7px; padding: 14px; position: relative;
  box-shadow: inset 0 0 0 1px #000, inset 0 1px 0 rgba(255,220,150,.07), 0 6px 18px rgba(0,0,0,.55); }
.panel::before { content: ""; position: absolute; inset: 3px; border: 1px solid rgba(138,109,59,.18); border-radius: 5px; pointer-events: none; }
.panel h3 { font-size: 18px; margin-bottom: 8px; }
.muted { color: var(--muted); }
.q-common { color: var(--q-common); } .q-uncommon { color: var(--q-uncommon); } .q-rare { color: var(--q-rare); }
.q-epic { color: var(--q-epic); } .q-legendary { color: var(--q-legendary); }


.hearts { color: var(--red); letter-spacing: 1px; text-shadow: 0 0 6px rgba(224,68,58,.5); }
.hearts .gone { color: #4a2420; text-shadow: none; }
.gold { color: var(--gold); }

.side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.panel-head h3 { margin: 0; }
.panel-head .muted { font-size: 12px; margin-left: auto; }

/* vendor */
.shop-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: stretch; }
.storage { min-height: 110px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; align-items: flex-start; padding: 10px;
  border: 1px dashed var(--edge); border-radius: 5px; background: rgba(0,0,0,.3); }
.storage > .muted { font-size: 13px; font-style: italic; margin: auto; }
.storage.drop-hot, .sellzone.drop-hot { border-color: var(--gold); background: rgba(255,209,0,.06); }
.sellzone { border: 1px dashed #6a2a20; border-radius: 5px; padding: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; color: #c98a80; font-size: 13px; }
.sellzone.drop-hot { color: var(--gold); }
.fight-row { display: flex; gap: 12px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.fight-row .btn.big { min-width: 180px; font-size: 24px; box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 0 18px rgba(200,40,20,.35), 0 3px 0 #000; }
.history { display: flex; gap: 4px; flex-wrap: wrap; margin-right: auto; }
.history i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1px solid #000; box-shadow: inset 0 1px 1px rgba(255,255,255,.35); }
.history .w { background: var(--green); } .history .l { background: var(--red); } .history .d { background: var(--muted); }
.selbar { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-height: 40px; margin-top: 10px; font-size: 13px; }
.selbar > .muted { font-size: 12px; }
.statline { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.statline span { font-size: 12px; padding: 3px 8px; border-radius: 10px; background: rgba(0,0,0,.4); border: 1px solid #2c2318; color: var(--muted); }
.statline b { color: var(--text); font-weight: normal; }

/* tooltip (WoW style) */
.tooltip { position: fixed; z-index: 50; max-width: 290px; pointer-events: none; padding: 8px 10px; font-size: 13px; line-height: 1.4;
  background: rgba(8, 10, 24, .95); border: 1px solid #8a8a9a; border-radius: 4px; box-shadow: 0 0 0 1px #000, 0 6px 18px rgba(0,0,0,.6); }
.tooltip .tt-name { font-size: 15px; }
.tooltip .tt-sub { color: #fff; opacity: .85; }
.tooltip .tt-line { color: #1eff00; }
.tooltip .tt-bonus { color: #66c8ff; }
.tooltip .tt-flavor { color: #ffd100; font-style: italic; }
.tooltip .tt-sell { color: #fff; margin-top: 4px; }

.toast { position: fixed; left: 50%; bottom: calc(56px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: rgba(0,0,0,.85);
  color: #ff5a4a; border: 1px solid #6a2a20; padding: 8px 14px; border-radius: 4px; font-size: 14px; }

.end { text-align: center; padding-top: 30px; }
.end h1 { font-size: clamp(44px, 10vw, 80px); }
.end .rec { font-size: 20px; margin: 10px 0 20px; }

.fcp { text-align: center; font-size: 12px; color: #8f8369; padding: 10px 16px 14px; }
.fcp a { color: #9c8a5c; }

@media (max-width: 860px) {
  .board-wrap { padding: 4px; }
  .panel { padding: 10px; }
  #app { padding: 10px 16px 20px; }
}
.end .panel > div { padding: 6px 4px; border-bottom: 1px solid #2c2318; font-size: 14px; }
.end .panel > div:last-child { border-bottom: 0; }
.end h1 { text-shadow: 0 0 30px rgba(255,170,0,.3), 0 3px 0 #000; }

/* rich item card tooltip */
.tooltip.tt-card { --qc: var(--q-common); max-width: 340px; min-width: 250px; padding: 12px 14px 10px; font-size: 14px; line-height: 1.45; color: #e8dcc0; border: 0; border-radius: 6px;
  background: radial-gradient(ellipse at 50% 0%, rgba(60,70,110,.35), transparent 60%), linear-gradient(180deg, #141a2c, #0b0e18 70%);
  box-shadow: 0 0 0 1px #000, 0 0 0 2px #6a5530, 0 0 0 3px #000, inset 0 0 0 1px color-mix(in srgb, var(--qc) 45%, transparent), inset 0 0 22px color-mix(in srgb, var(--qc) 18%, transparent), 0 14px 30px rgba(0,0,0,.8); }
.tooltip.tt-card.r-uncommon { --qc: var(--q-uncommon); } .tooltip.tt-card.r-rare { --qc: var(--q-rare); } .tooltip.tt-card.r-epic { --qc: var(--q-epic); } .tooltip.tt-card.r-legendary { --qc: var(--q-legendary); }
.tooltip.tt-card::before, .tooltip.tt-card::after { content: "❖"; position: absolute; top: 3px; font-size: 11px; color: #c9a24a; text-shadow: 0 0 4px #000; }
.tooltip.tt-card::before { left: 5px; } .tooltip.tt-card::after { right: 5px; }
.tt-head { text-align: center; padding-bottom: 6px; margin-bottom: 8px; border-bottom: 1px solid rgba(201,162,74,.35); }
.tt-card .tt-name { font-family: var(--font-head); font-size: 21px; line-height: 1.15; text-shadow: 0 2px 0 #000, 0 0 10px color-mix(in srgb, var(--qc) 50%, transparent); }
.tt-class { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.tt-weapon { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 8px; padding: 6px 4px; border-radius: 4px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(201,162,74,.2); }
.tt-weapon > div { display: flex; flex-direction: column; align-items: center; }
.tt-weapon span { font-size: 10px; color: #a8987a; text-transform: uppercase; letter-spacing: .04em; }
.tt-big { font-size: 17px; color: #fff; font-family: var(--font-head); }
.tt-sect { padding: 6px 0; border-top: 1px solid rgba(201,162,74,.22); }
.tt-sect:first-of-type, .tt-weapon + .tt-sect { border-top: 0; padding-top: 0; }
.tt-card .tt-line { color: #efe4c8; margin: 2px 0; }
.tt-trig { color: #ffd34a; font-weight: 600; }
.tt-num { color: #ffe27a; font-weight: 700; }
.tt-kw { color: #ffd34a; white-space: nowrap; }
.tt-ico, .chip-ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; border-radius: 3px; box-shadow: 0 0 0 1px #000; } /* real WoW status icons (tooltip + status chips) */
.tt-sect.bonus .tt-line { color: #7ad0ff; }
.tt-sect.gloss { font-size: 12.5px; color: #b8ac90; }
.tt-gl { margin: 2px 0; }
.tt-card .tt-flavor { color: #ffd100; font-style: italic; font-size: 13px; padding: 4px 0 2px; text-align: center; opacity: .9; }
.tt-foot { display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-top: 6px; padding-top: 7px; border-top: 1px solid rgba(201,162,74,.35); font-size: 13px; }
.tt-rar { display: flex; align-items: center; gap: 5px; font-weight: 600; }
.tt-rar .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor, 0 0 0 1px #000; }
.tt-type { color: #cfc2a2; }
.tt-card .tt-sell { color: #fff; margin: 0; display: flex; align-items: center; gap: 4px; }
.tt-card .coin { display: inline-block; width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffe27a, #d9a014 60%, #9a6a00); box-shadow: 0 0 0 1px #5a3a00; }


@media (pointer: coarse) { .btn.small { min-height: 44px; } }

/* css/title.css */
/* Title / home: one framed, illustrated menu. Grid: [pack+stats | logo + hero + banners | sidebar], class panel across the bottom.
   Parts: js/ui/titleParts.js, js/ui/classPreview.js. Backdrop = Classic loading-screen art (assets/ui/title-bg-stratholme.webp). */
#app[data-screen="title"] { padding-bottom: 12px; max-width: 1700px; --chrome: 176px; }
@media (min-width: 1300px) { #app[data-screen="title"] { --chrome: 138px; } }
body:has(#app[data-screen="title"]) .set-gear { display: none; }   /* Settings lives in the sidebar */

.title { position: relative; height: calc(100dvh - var(--chrome)); min-height: 560px; text-align: left; overflow: hidden;
  display: grid; grid-template-columns: 310px minmax(0, 1fr) 118px; grid-template-rows: auto 1fr auto; gap: 8px 14px; padding: 8px 10px 8px 12px;
  border: 22px solid transparent; border-image: url(../assets/ui/frame-wood.png) 64 / 22px stretch; border-radius: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 35%, rgba(30,10,0,.72) 100%), linear-gradient(rgba(25,10,0,.18), rgba(25,10,0,.38)), url(../assets/ui/title-bg-stratholme.webp) center / cover #1a0f06;
  background-clip: padding-box; box-shadow: 0 10px 40px rgba(0,0,0,.7); }

.ts-cap { display: block; font-family: var(--font-head); font-weight: normal; font-size: 15px; letter-spacing: .06em; color: var(--gold); text-shadow: 0 2px 0 #000, 0 0 6px #000; margin-bottom: 4px; }

/* logo */
.ts-logo { grid-column: 2; grid-row: 1; z-index: 3; align-self: start; display: flex; align-items: center; justify-content: center; gap: 14px; pointer-events: none; }
.ts-logo h1 { display: flex; flex-direction: column; align-items: center; margin: 0; line-height: .86; font-size: clamp(34px, 4.6vw, 62px); letter-spacing: .03em; color: #ffd100;
  text-shadow: 0 3px 0 #5a2a00, 0 -1px 0 #fff2a8, 0 0 22px rgba(255,150,0,.55), 0 5px 10px #000; }
.ts-logo h1 span:last-child { font-size: .8em; }
.ts-emblem { width: clamp(34px, 3.6vw, 52px); height: clamp(34px, 3.6vw, 52px); border-radius: 6px; box-shadow: 0 0 0 2px #000, 0 0 0 4px #c9a24a, 0 0 18px rgba(255,170,0,.5); }
.ts-emblem.l { transform: rotate(-8deg); } .ts-emblem.r { transform: rotate(8deg); }

/* starter pack: leather satchel hugging the (cropped) board exactly */
.ts-pack { grid-column: 1; grid-row: 1; align-self: start; justify-self: start; z-index: 2; max-width: 100%; }
.ts-satchel { display: inline-block; max-width: 100%; padding: 12px; overflow: hidden; border-radius: 12px; border: 2px solid #1a0d04; background: linear-gradient(145deg, #7a4a24, #4a2a12 55%, #6a3d1c);
  box-shadow: inset 0 0 0 2px #b07a3c, inset 0 0 14px rgba(0,0,0,.6), 0 6px 14px rgba(0,0,0,.65); }
.ts-satchel .board { display: block; background-color: rgba(10,6,3,.35); border-radius: 6px; }

/* stats parchment */
.ts-stats { grid-column: 1; grid-row: 2; align-self: end; z-index: 2; width: 100%; max-width: 280px; padding: 8px 12px; border: 22px solid transparent; border-image: url(../assets/ui/frame-wood.png) 64 / 22px stretch; border-radius: 0; position: relative; color: #3a2410; }
.ts-stats::before { content: ""; position: absolute; inset: -4px; z-index: -1; background: url(../assets/ui/questbg-parchment.png) center / 100% 100%; }
.ts-statname { display: block; font-family: var(--font-head); font-size: 24px; font-weight: normal; color: var(--cc); text-shadow: 0 1px 0 #000, 0 0 2px #000, 1px 1px 0 #000, -1px -1px 0 #000; line-height: 1.1; }
.ts-blurb { margin: 2px 0 6px; font-size: 12px; line-height: 1.3; color: #4a3218; }
.ts-stat { display: flex; justify-content: space-between; font-size: 14px; border-top: 1px solid rgba(90,58,24,.35); padding: 2px 0; }
.ts-stat b { color: #2a1604; }

/* centre: 3D hero (left) + banners/start (right) */
.ts-mid { grid-column: 2; grid-row: 1 / 3; position: relative; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding-top: 92px; z-index: 1; }
.ts-hero { position: relative; min-height: 0; }
.ts-hero::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: 1%; height: 8%; border-radius: 50%; pointer-events: none; background: radial-gradient(ellipse, color-mix(in srgb, var(--cc, #888) 65%, transparent), transparent 70%); }
.ts-hero > * { position: absolute; inset: 0; width: 100%; height: 100%; }
.ts-menu { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; min-width: 0; padding-top: 6px; }

/* red cloth banner + plaque */
.ts-cont { display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(240px, 100%); }
.ts-banner { position: relative; width: 100%; padding: 14px 10px 30px; border: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--gold);
  background: linear-gradient(90deg, rgba(0,0,0,.35), transparent 18%, transparent 82%, rgba(0,0,0,.35)), linear-gradient(180deg, #a8241a, #7a130c 70%, #5a0c07);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 16px), 0 100%); transition: filter .15s; }
.ts-banner::before { content: ""; position: absolute; inset: 0 0 auto; height: 8px; background: url(../assets/ui/wood-edge-top.png) left top / auto 100% repeat-x; }
.ts-banner::after { content: ""; position: absolute; inset: 8px 6px 18px; border: 1px solid rgba(255,209,0,.55); pointer-events: none; }
@media (hover: hover) { .ts-banner:hover { filter: brightness(1.18); } }
.ts-banner:focus-visible { outline: 2px solid #ffd100; outline-offset: 3px; }
.bn-title { font-family: var(--font-head); font-size: 22px; text-shadow: 0 2px 0 #000; line-height: 1.1; margin-top: 6px; }
.bn-class { font-size: 14px; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.bn-stats { display: flex; gap: 12px; margin-top: 2px; }
.bn-stat { display: inline-flex; align-items: center; gap: 4px; font-size: 16px; text-shadow: 0 1px 0 #000; }
.bn-stat img { width: 24px; height: 24px; border-radius: 4px; box-shadow: 0 0 0 1px #000, 0 0 0 2px #c9a24a; display: block; }
.ts-plaque { padding: 3px 16px; border: 2px solid #1a0d04; border-radius: 3px; font-size: 12px; color: #e8d9a8; text-shadow: 0 1px 0 #000;
  background: linear-gradient(#6a4220, #3e2410); box-shadow: inset 0 0 0 1px #b07a3c, 0 3px 5px rgba(0,0,0,.6); }
@media (hover: hover) { .ts-plaque:hover { filter: brightness(1.25); color: #fff; } }

/* START button: WoW 128-redbutton art (same pre-composited 88x64 set as the shop Fight button, 28px caps via border-image) */
.cp-start { box-sizing: border-box; width: min(300px, 100%); height: 64px; min-height: 64px; padding: 0 4px; border-style: solid; border-width: 0 28px; border-color: transparent; border-radius: 0; box-shadow: none; background: none;
  border-image: url(../assets/ui/fightbtn-n.png) 0 28 fill / 0 28px / 0 stretch;
  font-family: var(--font-head); font-size: 24px; line-height: 1; letter-spacing: .02em; color: #ffd100; text-shadow: 0 2px 0 #000, 0 0 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.7)); transition: filter .15s; }
@media (hover: hover) { .cp-start:hover:not(:disabled) { filter: brightness(1.18) drop-shadow(0 0 8px rgba(255,200,70,.5)) drop-shadow(0 3px 3px rgba(0,0,0,.7)); } }
.cp-start:active:not(:disabled) { border-image-source: url(../assets/ui/fightbtn-p.png); filter: brightness(.9) drop-shadow(0 1px 2px rgba(0,0,0,.7)); padding-top: 3px; }
.cp-start:focus-visible { outline: 2px solid #ffd100; outline-offset: 3px; }
.cp-start:disabled { border-image-source: url(../assets/ui/fightbtn-d.png); color: #9a8a60; filter: none; cursor: default; }

/* bottom carved panel: Choose Class + Loadout */
.ts-bottom { grid-column: 1 / 3; grid-row: 3; z-index: 2; display: flex; gap: 14px; align-items: stretch; padding: 8px 14px; border-radius: 8px; border: 2px solid #1a0d04;
  background: linear-gradient(180deg, rgba(58,36,18,.94), rgba(30,18,8,.96)); box-shadow: inset 0 0 0 1px #b07a3c, inset 0 0 18px rgba(0,0,0,.65), 0 6px 14px rgba(0,0,0,.6); }
.ts-classes { flex: 1; min-width: 0; }
.ts-cards { display: flex; align-items: flex-start; gap: 6px; flex-wrap: nowrap; }
.class-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 2px; background: none; border: 0; min-width: 0; flex: 1 1 0; max-width: 76px; }
.class-card .portrait { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--cc); transition: box-shadow .15s, transform .15s; }
.class-card .portrait img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); display: block; }
.class-card .cc-name { font-size: 11px; color: #cdbf9c; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 0 #000; }
@media (hover: hover) { .class-card:hover .portrait { transform: scale(1.06); } }
.class-card:focus-visible { outline: 1px dashed var(--gold); outline-offset: 2px; }
.class-card.picked .portrait { box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--gold), 0 0 18px 4px color-mix(in srgb, var(--gold) 60%, transparent); transform: scale(1.1); }
.class-card.picked .cc-name { color: var(--gold); }
.ts-die { flex: none; width: 46px; height: 46px; margin: 7px 0 0 6px; border-radius: 8px; border: 2px solid #1a0d04; font-size: 28px; line-height: 1; color: #ffd100; text-shadow: 0 2px 0 #000;
  background: linear-gradient(#7a4a24, #4a2a12); box-shadow: inset 0 0 0 1px #b07a3c, 0 3px 5px rgba(0,0,0,.6); }
@media (hover: hover) { .ts-die:hover { filter: brightness(1.25); } } .ts-die:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ts-loadout { flex: 0 0 270px; border-left: 1px solid rgba(176,122,60,.5); padding-left: 14px; min-width: 0; }
.ts-kit { display: flex; gap: 9px; align-items: center; padding: 6px 8px; border-radius: 6px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(176,122,60,.5); }
.ts-kit::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--gold); background: radial-gradient(var(--gold) 38%, transparent 42%); }
.ts-kit img { width: 36px; height: 36px; flex: none; border-radius: 5px; box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--cc, #c9a24a); }
.ts-kit b { display: block; color: var(--gold); font-weight: normal; font-size: 14px; }
.ts-kit span { display: block; color: #cdbf9c; font-size: 11.5px; line-height: 1.3; }

/* right wooden sidebar */
.ts-side { grid-column: 3; grid-row: 1 / 4; z-index: 2; display: flex; flex-direction: column; gap: 8px; align-items: stretch; justify-content: flex-start; align-self: stretch; padding: 10px 8px; border-radius: 8px; border: 2px solid #1a0d04;
  background: linear-gradient(90deg, #5a3718, #6e4520 50%, #4a2c12); box-shadow: inset 0 0 0 1px #b07a3c, inset 0 0 16px rgba(0,0,0,.55), 0 6px 14px rgba(0,0,0,.6); }
.sb-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 6px; border: 1px solid transparent; background: rgba(0,0,0,.22); color: #f1dfae; font-size: 12px; text-align: center; text-decoration: none; text-shadow: 0 1px 0 #000; }
@media (hover: hover) { .sb-btn:hover { background: rgba(255,200,70,.18); border-color: #c9a24a; color: #fff; } }
.sb-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.sb-ico { width: 40px; height: 40px; border-radius: 6px; overflow: hidden; display: grid; place-items: center; box-shadow: 0 0 0 1px #000, 0 0 0 2px #c9a24a; background: #1a0f06; }
.sb-ico img { width: 100%; height: 100%; display: block; }
.sb-gear { font-size: 26px; color: var(--gold); }
.ts-ver { margin-top: auto; text-align: center; color: rgba(232,220,192,.6); font-size: 11px; }

/* how-to popover */
.how { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(720px, 92%); display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 12px; background: #120e09; border: 1px solid var(--edge-hi); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.8); z-index: 50; text-align: left; }
.how[hidden] { display: none; }
.how .step { display: flex; gap: 10px; }
.how .art { width: 36px; height: 36px; flex: none; border-radius: 5px; overflow: hidden; box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--edge-hi); }
.how .art img { width: 100%; height: 100%; display: block; }
.how b { color: var(--gold); font-family: var(--font-head); font-size: 17px; font-weight: normal; }
.how p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; }

@media (min-width: 861px) and (max-height: 899px) { .ts-blurb { display: none; } .ts-statname { font-size: 22px; } }
@media (max-width: 1080px) { .title { grid-template-columns: 250px minmax(0, 1fr) 100px; } .ts-loadout { flex-basis: 210px; } .class-card .portrait { width: 44px; height: 44px; } }
@media (max-width: 860px) {
  .title { height: auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 6px 4px 10px; border-width: 14px; border-image-width: 14px; }
  .ts-logo { order: 1; } .ts-mid { order: 2; display: flex; flex-direction: column-reverse; padding-top: 0; gap: 6px; } .ts-bottom { order: 3; flex-direction: column; }
  .ts-pack { order: 4; } .ts-stats { order: 5; max-width: none; } .ts-side { order: 6; flex-direction: row; align-self: stretch; } .sb-btn { flex: 1; }
  .ts-hero { height: 190px; flex: none; }
  .ts-cards { flex-wrap: wrap; justify-content: center; } .class-card { flex: 0 0 18%; max-width: none; } .class-card .portrait { width: 40px; height: 40px; }
  .ts-loadout { flex: none; border-left: 0; padding-left: 0; border-top: 1px solid rgba(176,122,60,.5); padding-top: 6px; }
  .ts-ver { margin: 0 0 0 auto; align-self: center; }
  .how { grid-template-columns: 1fr; position: fixed; }
}
@media (max-width: 640px) { .cp-start { font-size: 20px; } }
.ts-banner:active, .ts-plaque:active, .ts-die:active, .sb-btn:active { filter: brightness(.9); transform: scale(.96); }
.class-card:active .portrait { transform: scale(.96); }
@media (pointer: coarse) { .cp-start { filter: drop-shadow(0 2px 2px rgba(0,0,0,.7)); } .class-card.picked .portrait { box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--gold), 0 0 10px 2px color-mix(in srgb, var(--gold) 60%, transparent); } }

/* 11-11 playthrough: the Daily / mode plaques were 25px tall on phones. */
@media (pointer: coarse) { .ts-plaque { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; } }

/* css/board.css */
.board-wrap { position: relative; padding: 10px; border-radius: 6px; width: max-content; max-width: 100%;
  background: radial-gradient(ellipse at 50% 40%, #1d1710, #0a0806 75%); box-shadow: inset 0 0 0 1px #000, inset 0 0 30px rgba(0,0,0,.8), 0 0 0 1px var(--edge); }
.board { position: relative; width: calc(var(--cell) * 9); height: calc(var(--cell) * 7); touch-action: none;
  background-image: none; }
/* no lattice on the empty board (only bag cells are slots); dots show only while a bag is dragged (drag.js body.drag-bag) */
body.drag-bag .board { background-image: radial-gradient(circle at center, rgba(201,162,74,.18) 1.2px, transparent 1.6px); background-size: var(--cell) var(--cell); }

.piece { position: absolute; pointer-events: none; }
.piece .cell { position: absolute; pointer-events: auto; touch-action: none; cursor: grab; }
.piece .frame { position: absolute; pointer-events: none; border-radius: 5px; }

/* bags: stitched leather with sunken WoW-style slots */
.piece.bag { z-index: 1; }
/* per-bag skins: boardView sets --bag-a/b/c (leather), --bag-trim, --bag-stitch, --bag-glow and a .pat-* class */
.piece.bag { --bag-a: #5a3d22; --bag-b: #3a2714; --bag-c: #2e1f10; --bag-trim: #8a6d3b; --bag-stitch: rgba(230,190,120,.28); --bag-glow: transparent; --pat: none; --pat-size: auto; }
.piece.bag.pat-studs { --pat: radial-gradient(circle at 5px 5px, #e4dccb 0 1.6px, #0008 2.3px, transparent 2.8px), radial-gradient(circle at calc(100% - 5px) 5px, #e4dccb 0 1.6px, #0008 2.3px, transparent 2.8px), radial-gradient(circle at 5px calc(100% - 5px), #e4dccb 0 1.6px, #0008 2.3px, transparent 2.8px), radial-gradient(circle at calc(100% - 5px) calc(100% - 5px), #e4dccb 0 1.6px, #0008 2.3px, transparent 2.8px); }
.piece.bag.pat-weave { --pat: repeating-linear-gradient(45deg, rgba(255,255,255,.09) 0 1px, transparent 1px 4px), repeating-linear-gradient(-45deg, rgba(0,0,0,.28) 0 1px, transparent 1px 4px); }
.piece.bag.pat-cloth { --pat: repeating-linear-gradient(0deg, rgba(255,255,255,.12) 0 1px, transparent 1px 3px), repeating-linear-gradient(90deg, rgba(0,0,0,.14) 0 1px, transparent 1px 3px); }
.piece.bag.pat-hide { --pat: radial-gradient(rgba(0,0,0,.35) 1px, transparent 1.6px) 0 0 / 7px 7px, radial-gradient(rgba(255,255,255,.1) 1px, transparent 1.6px) 3px 4px / 9px 9px; }
.piece.bag.pat-fletch { --pat: repeating-linear-gradient(115deg, rgba(235,215,170,.2) 0 2px, transparent 2px 9px), repeating-linear-gradient(65deg, rgba(0,0,0,.3) 0 1px, transparent 1px 9px); }
.piece.bag .cell { background: var(--pat), linear-gradient(160deg, var(--bag-a), var(--bag-b) 85%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bag-trim) 70%, transparent), inset 0 0 8px rgba(0,0,0,.35); }
.piece.bag { filter: drop-shadow(0 0 6px var(--bag-glow)); }
.piece.bag.loose { filter: none; }
.piece.bag .emblem { position: absolute; pointer-events: none; z-index: 0; border-radius: 3px; object-fit: cover; opacity: 1;
  box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--bag-trim), 0 1px 4px #000; }
.piece.bag.glows .frame { box-shadow: 0 0 0 2px #1a0f06, 0 0 0 3px var(--bag-trim), 0 0 12px var(--bag-glow), 0 6px 14px rgba(0,0,0,.7); }
.piece.bag .cell::before { content: ""; position: absolute; inset: 13%; border-radius: 4px;
  background: radial-gradient(ellipse at 50% 35%, color-mix(in srgb, var(--bag-b) 55%, #0a0806), color-mix(in srgb, var(--bag-c) 40%, #030202)); box-shadow: inset 0 2px 4px #000, 0 1px 0 var(--bag-stitch), inset 0 0 0 1px rgba(0,0,0,.9); }
.piece.bag .frame { box-shadow: 0 0 0 2px #1a0f06, 0 0 0 4px var(--bag-trim), 0 6px 14px rgba(0,0,0,.7); z-index: -1; }
.piece.bag .frame::after { content: ""; position: absolute; inset: 1px; border: 1px dashed var(--bag-stitch); border-radius: 4px; }
.piece.bag .cell.fill { box-shadow: 0 0 0 1px var(--bag-trim), inset 0 0 8px rgba(0,0,0,.35); }
.piece .icon { position: absolute; pointer-events: none; object-fit: cover; }
.piece.bag .icon.badge { border-radius: 4px; border: 1px solid #000; box-shadow: 0 0 0 1px #c9a24a, 0 2px 4px #000; z-index: 3; }

/* items without a sprite (fallback only): one framed tile, rarity edge, icon centered; sprites live in sprites.css */
.piece.item { z-index: 2; }
.piece.item .frame { background: #0c0a08; overflow: hidden;
  box-shadow: inset 0 0 0 1px #000, inset 0 0 0 2px var(--qc), inset 0 0 12px color-mix(in srgb, var(--qc) 35%, transparent), 0 2px 5px rgba(0,0,0,.8); }
/* soft rarity glow behind the icon so tall items read as one object, not a dark card */
.piece.item .frame::after { content: ""; position: absolute; inset: 0; border-radius: 5px; box-shadow: inset 0 0 0 1px #000, inset 0 0 0 2px var(--qc);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--qc) 30%, transparent), transparent),
  linear-gradient(180deg, rgba(255,255,255,.08), transparent 40%); }
.piece.item.long .frame::after { background: radial-gradient(closest-side, transparent 55%, rgba(0,0,0,.45)),
  linear-gradient(180deg, rgba(255,255,255,.10), transparent 35%); }
.piece.item.long .icon { box-shadow: 0 0 0 1px #000, 0 0 0 2px color-mix(in srgb, var(--qc) 70%, #000), 0 4px 10px rgba(0,0,0,.9); }
/* loose bags (shop shelf, storage): the bag's icon sits over its slots so it reads as a buyable bag */
.piece.bag.loose .icon.badge { z-index: 3; box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--qc), 0 0 10px color-mix(in srgb, var(--qc) 50%, transparent), 0 3px 6px #000; }
.piece.bag.loose .cell::before { opacity: .7; }
/* bags with a sprite (sprites.js bagSpriteLayer): the bag itself fills its bbox UNDER the cells; the cells are
   translucent slots with a thin trim edge, so a bag reads as a bag with slots, not a framed box. Glow follows the bag's alpha. */
.piece.bag.has-sprite, .piece.bag.has-sprite.loose { filter: none; }
.piece.bag .bag-sprite { position: absolute; pointer-events: none; z-index: 0; line-height: 0; }
.piece.bag .bag-sprite .sprite { display: block; width: 100%; height: 100%; object-fit: fill; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 0 2px rgba(0,0,0,.8)) drop-shadow(0 4px 6px rgba(0,0,0,.55)); }
.piece.bag.has-sprite.glows .bag-sprite .sprite { filter: drop-shadow(0 0 2px var(--bag-glow)) drop-shadow(0 0 7px color-mix(in srgb, var(--bag-glow) 55%, transparent)) drop-shadow(0 4px 6px rgba(0,0,0,.55)); }
@media (hover: hover) { .piece.bag.has-sprite:has(.cell:hover) .bag-sprite .sprite { filter: drop-shadow(0 0 2px var(--gold)) drop-shadow(0 0 9px color-mix(in srgb, var(--gold) 55%, transparent)) drop-shadow(0 4px 6px rgba(0,0,0,.55)); } }
.piece.bag.has-sprite .cell { background: none; box-shadow: none; z-index: 1; }   /* wells paint OVER the bag sprite (z 0) */
/* slot wells (owner 11-04: "still reads as a tile grid"): no edge, no rounded square - only a faint feathered hollow
   in the bag's leather where an item can go, so the bag reads as one bag. While an ITEM is dragged (drag.js body.drag-active
   without drag-bag) the empty wells deepen and pick up a thin warm rim so the player can aim. */
/* owner 11-04 Ready Check: the slots must read at 1920 - a deeper hollow with a thin lit rim, still rounded (not a tile grid) */
.piece.bag.has-sprite .cell::before { inset: 8%; border-radius: 22%;
  background: radial-gradient(closest-side, rgba(4,3,2,.6), rgba(4,3,2,.44) 70%, rgba(4,3,2,.24) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,214,150,.24), inset 0 2px 6px rgba(0,0,0,.6), 0 0 0 1px rgba(0,0,0,.35);
  transition: background .15s ease-out, box-shadow .15s ease-out; }
body.drag-active:not(.drag-bag) .piece.bag.has-sprite:not(.dragging) .cell::before { inset: 7%; border-radius: 22%;
  background: radial-gradient(closest-side, rgba(6,4,2,.5), rgba(6,4,2,.3) 70%, rgba(6,4,2,.08) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,214,150,.18), inset 0 1px 6px rgba(0,0,0,.55); }
.piece.bag.has-sprite.loose .cell::before { opacity: .45; }
.piece.item .cell.fill { background: #15110c; box-shadow: inset 0 0 0 2px var(--qc); border-radius: 3px; }
.piece.item .icon { z-index: 1; border-radius: 4px; box-shadow: 0 0 0 1px #000, 0 3px 6px rgba(0,0,0,.8); }
@media (hover: hover) { .piece.item:hover .frame, .piece.item.selected .frame { filter: brightness(1.18); } }

.piece .star { position: absolute; width: var(--cell); height: var(--cell); display: none; align-items: center; justify-content: center;
  color: rgba(255, 209, 0, .5); font-size: calc(var(--cell) * .36); pointer-events: none; text-shadow: 0 0 4px #000; z-index: 4; }
.piece.item .star { display: flex; }
.piece.item:not(.dragging) .star:not(.on) { color: rgba(255, 209, 0, .3); }
.piece .star.on { color: var(--gold); text-shadow: 0 0 8px var(--gold), 0 0 2px #000; animation: twinkle 1.6s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(1.18); } }
.piece .buffed { position: absolute; right: 3px; top: 2px; font-size: 10px; color: #8fd6ff; text-shadow: 0 0 3px #000, 0 0 2px #000; pointer-events: none; z-index: 4;
  background: rgba(0,30,60,.7); border-radius: 3px; padding: 0 3px; line-height: 14px; }
.piece.selected .frame, .piece.selected .cell.fill { box-shadow: inset 0 0 0 2px var(--gold), 0 0 0 1px var(--gold), 0 0 14px rgba(255,209,0,.6); }
.piece.selected .frame::after { box-shadow: inset 0 0 0 2px var(--gold); }

.piece.dragging { z-index: 40; opacity: .95; position: fixed; filter: drop-shadow(0 10px 14px rgba(0,0,0,.8)); }
.piece.dragging .cell { pointer-events: none; }
.piece.ghost-src { opacity: .25; }
.preview { position: absolute; width: var(--cell); height: var(--cell); pointer-events: none; z-index: 30; border-radius: 4px; }
.preview.ok { background: rgba(63, 214, 90, .22); box-shadow: inset 0 0 0 2px rgba(63,214,90,.85); }
.preview.bad { background: rgba(224, 68, 58, .22); box-shadow: inset 0 0 0 2px rgba(224,68,58,.85); }
.piece.flash .frame, .piece.flash .cell.fill { animation: flash .32s ease-out; }
@keyframes flash { 0% { filter: brightness(1.9); } 100% { filter: none; } }

/* storage pieces are bodies in the bin (storage-bin.css): absolutely placed by transform */
.storage .piece { position: absolute; }
.board.cropped .star:not(.on) { display: none; }

/* custom-drawn items: frameless art spanning the whole shape, rarity as a soft glow */
.piece.item.has-art .art { position: absolute; pointer-events: none; z-index: 1; line-height: 0;
  filter: drop-shadow(0 4px 3px rgba(0,0,0,.75)) drop-shadow(0 0 5px color-mix(in srgb, var(--qc) 55%, transparent)); }
.piece.item.has-art .cell { border-radius: 4px; }
@media (hover: hover) { .piece.item.has-art:hover .art { filter: drop-shadow(0 4px 3px rgba(0,0,0,.75)) drop-shadow(0 0 8px var(--qc)) brightness(1.12); } }
.piece.item.has-art.selected .art { filter: drop-shadow(0 4px 3px rgba(0,0,0,.75)) drop-shadow(0 0 3px var(--gold)) drop-shadow(0 0 10px var(--gold)); }
.piece.item.has-art.selected .cell { box-shadow: inset 0 0 0 1px rgba(255,209,0,.35); }
.piece.has-art.flash .art { animation: flash .32s ease-out; }

/* pick-up / put-down feel */
.piece.dragging { transition: transform .09s ease-out; }
.piece.dragging .art, .piece.dragging .frame, .piece.dragging .icon { filter: drop-shadow(0 18px 14px rgba(0,0,0,.65)) drop-shadow(0 0 6px color-mix(in srgb, var(--qc) 60%, transparent)); }
.preview.swap { background: rgba(255, 196, 40, .22); box-shadow: inset 0 0 0 2px rgba(255,196,40,.9); }
.piece.land { animation: land .28s ease-out; }
@keyframes land { 0% { transform: translateY(-4px); filter: brightness(1.5); } 100% { transform: none; filter: none; } }
.piece.swap { animation: swapin .25s ease-out; }
@keyframes swapin { 0% { opacity: .3; } 100% { opacity: 1; } }
.piece.bounce { animation: bounce .3s ease-out; }
@keyframes bounce { 0% { transform: translateY(-6px); opacity: .6; } 100% { transform: none; opacity: 1; } }
.slot .art.art-svg { box-shadow: none; width: auto; height: 66px; display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.7)) drop-shadow(0 0 5px color-mix(in srgb, var(--qc) 60%, transparent)); }
.slot .art.art-svg svg { display: block; }
@media (hover: hover) { .piece.bag:has(.cell:hover) .frame { box-shadow: 0 0 0 2px #1a0f06, 0 0 0 3px var(--gold), 0 0 14px rgba(255,209,0,.45), 0 6px 14px rgba(0,0,0,.7); } }

/* weapon sockets: dark empty sockets, gem icons when filled */
.piece .sockets { position: absolute; z-index: 3; display: flex; gap: 2px; pointer-events: none; }
.piece .sock { display: block; width: 13px; height: 13px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #3a3a48, #0a0a10); box-shadow: 0 0 0 1.5px #c9a24a, 0 1px 2px #000; }
.piece img.sock.full { object-fit: cover; box-shadow: 0 0 0 1.5px #ffd34a, 0 0 6px #ffd34a; }
/* a star that has the right item on it lights up */
.piece .star.on { color: #ffe27a; opacity: 1; text-shadow: 0 0 6px #ffd34a, 0 0 14px #ffb000; animation: staron 1.4s ease-in-out infinite; z-index: 4; }
@keyframes staron { 50% { text-shadow: 0 0 10px #ffe27a, 0 0 22px #ffb000; transform: scale(1.25); } }
/* sockets ON the item: hollow silver rings over the art; filled = round gem */
.piece .sock { position: absolute; z-index: 5; display: block; pointer-events: none; border-radius: 50%; box-sizing: border-box;
  background: radial-gradient(circle, rgba(20,20,28,.35) 0 48%, transparent 50%);
  border: 2.5px solid rgba(235,238,245,.9); box-shadow: 0 0 0 1px rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.6); }
.piece .sock::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; border: 1.5px solid rgba(235,238,245,.55); }
.piece img.sock.full { object-fit: cover; border-color: #ffe27a; box-shadow: 0 0 0 1px #000, 0 0 8px rgba(255,211,74,.9); }

/* non-rect items: one continuous rounded outline (SVG path from the cell mask), rarity edge + glow, art clipped to the shape */
.piece.item .frame.shape { background: none; box-shadow: none; overflow: visible; border-radius: 0; filter: drop-shadow(0 2px 3px rgba(0,0,0,.8)); }
.piece.item .frame.shape::before, .piece.item .frame.shape::after { content: none; }
.piece.item .frame.shape .shape-svg { display: block; overflow: visible; }
.piece.item .shape-glow { fill: color-mix(in srgb, var(--qc) 6%, transparent); }
.piece.item .shape-inglow { fill: none; stroke: var(--qc); stroke-width: 7px; opacity: .32; }
.piece.item.shaped .icon { box-shadow: 0 0 0 1px #000, 0 0 0 2px color-mix(in srgb, var(--qc) 70%, #000), 0 3px 8px rgba(0,0,0,.9); }
@media (hover: hover) { .piece.item.shaped:hover .frame.shape { filter: brightness(1.18) drop-shadow(0 2px 3px rgba(0,0,0,.8)); } }
.piece.item.shaped.selected .frame.shape { box-shadow: none; filter: drop-shadow(0 0 5px var(--gold)) drop-shadow(0 0 2px var(--gold)); }
.piece.item.shaped.selected .shape-edge { stroke: var(--gold); }
.piece.item.shaped.flash .frame.shape { animation: flash .32s ease-out; }
.piece.item .shape-rim { fill: none; stroke: #000; stroke-width: 4px; }
.piece.item .shape-edge { fill: none; stroke: var(--qc); stroke-width: 3px; }

/* drop settle: short spring when the piece lands in its cell (drag.js reveals it after the ghost glides in) */
.piece.settle { animation: settle .3s cubic-bezier(.2,1.5,.4,1); }
@keyframes settle { 0% { transform: scale(1.1); filter: brightness(1.35); } 55% { transform: scale(.97); } 100% { transform: none; filter: none; } }
.piece.dragging { transition: none; opacity: 1; filter: drop-shadow(0 14px 12px rgba(0,0,0,.6)); }
@media (prefers-reduced-motion: reduce) { .piece.settle { animation: none; } }


/* touch / pressed equivalents of the hover-only highlights above (synergy lane) */
.piece.bag.has-sprite.selected .bag-sprite .sprite, .piece.bag.has-sprite:has(.cell:active) .bag-sprite .sprite { filter: drop-shadow(0 0 2px var(--gold)) drop-shadow(0 0 9px color-mix(in srgb, var(--gold) 55%, transparent)); }
.piece.item:active .frame { filter: brightness(1.18); }
.piece.item.has-art:active .art, .piece.item.has-art.selected .art { filter: drop-shadow(0 4px 3px rgba(0,0,0,.75)) drop-shadow(0 0 8px var(--qc)) brightness(1.12); }
.piece.bag.selected .frame, .piece.bag:has(.cell:active) .frame { box-shadow: 0 0 0 2px #1a0f06, 0 0 0 3px var(--gold), 0 0 14px rgba(255,209,0,.45), 0 6px 14px rgba(0,0,0,.7); }
.piece.item.shaped:active .frame.shape, .piece.item.shaped.selected .frame.shape { filter: brightness(1.18) drop-shadow(0 2px 3px rgba(0,0,0,.8)); }

/* css/sprites.css */
/* item sprites (js/ui/sprites.js): one frameless image per item filling its shape. The rarity is a glow that follows
   the image's alpha (drop-shadow), never a stroke, fill or rectangle; common items get a soft dark shadow only. */
.piece.item.has-sprite .frame { display: none; }
.piece.item.has-sprite .cell { border-radius: 4px; }
.piece.item.has-sprite {
  --glow: drop-shadow(0 0 2px var(--qc)) drop-shadow(0 0 6px color-mix(in srgb, var(--qc) 55%, transparent));
  --glow-hi: drop-shadow(0 0 3px var(--qc)) drop-shadow(0 0 10px color-mix(in srgb, var(--qc) 75%, transparent));
  --ground: drop-shadow(0 0 3px rgba(0,0,0,.7)); }
.piece.item.has-sprite.q-common {
  --glow: drop-shadow(0 0 2px rgba(0,0,0,.85)) drop-shadow(0 0 5px rgba(0,0,0,.45));
  --glow-hi: drop-shadow(0 0 2px rgba(255,255,255,.55)) drop-shadow(0 0 7px rgba(255,255,255,.22)); }
.piece.item.has-sprite .sprite-holder { position: absolute; pointer-events: none; z-index: 1; line-height: 0; }
.piece.item.has-sprite .sprite { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none;
  filter: var(--ground) var(--glow); }
@media (hover: hover) { .piece.item.has-sprite:hover .sprite { filter: var(--ground) var(--glow-hi) brightness(1.1); } }
.piece.item.has-sprite.selected .sprite { filter: var(--ground) drop-shadow(0 0 2px var(--gold)) drop-shadow(0 0 9px color-mix(in srgb, var(--gold) 70%, transparent)); }
.piece.item.has-sprite.selected .cell { box-shadow: none; }
.piece.item.has-sprite.flash .sprite-holder { animation: flash .32s ease-out; }
.piece.item.has-sprite.dragging .sprite { filter: drop-shadow(0 0 10px rgba(0,0,0,.6)) var(--glow-hi); }
.piece.item.has-sprite:active .sprite { filter: var(--ground) var(--glow) brightness(.92); }
@media (pointer: coarse) {
  .piece.item.has-sprite { --glow: drop-shadow(0 0 4px var(--qc)); --glow-hi: drop-shadow(0 0 6px var(--qc)); }
  .piece.item.has-sprite.q-common { --glow: drop-shadow(0 0 3px rgba(0,0,0,.8)); --glow-hi: drop-shadow(0 0 3px rgba(255,255,255,.5)); }
}

/* css/battle.css */
.battle-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; padding: 8px 12px;
  background: linear-gradient(#1d1710, #120e09); border: 1px solid var(--edge); border-radius: 6px; }
.battle-top h2 { font-size: 26px; margin-right: auto; }
.battle-top .clock { font-size: 18px; color: var(--gold); min-width: 64px; text-align: right; font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,.45); border: 1px solid #2c2318; border-radius: 14px; padding: 3px 10px; }
.arena { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.vs { align-self: center; font-family: var(--font-body); font-weight: bold; letter-spacing: .08em; font-size: 30px; color: var(--gold); text-shadow: 0 0 12px rgba(255,140,0,.6), 0 2px 0 #000; }
.fighter { position: relative; display: flex; flex-direction: column; align-items: stretch; }
.fighter .board-wrap { align-self: center; margin: auto 0; padding: 14px; }
.fighter .who + .floaters + .bar { margin-top: 0; }
.board.cropped { background-image: none; }
.fighter .who { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.portrait { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; flex: none;
  box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--edge-hi), 0 0 12px color-mix(in srgb, var(--cc) 50%, transparent); }
.portrait img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.15); }
.fighter .id { display: flex; flex-direction: column; line-height: 1.1; }
.fighter .id b { font-family: var(--font-head); font-size: 22px; font-weight: normal; text-shadow: 0 2px 0 #000; }
.fighter .id .muted { font-size: 13px; }
.bar { position: relative; height: 26px; background: linear-gradient(#2a0805, #140302); border: 1px solid #000; border-radius: 4px; overflow: hidden; margin-bottom: 4px;
  box-shadow: 0 0 0 1px #4a3b26; }
.bar .fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(#4fe05a, #1f9a2a 55%, #127a1d); transition: width .12s linear;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }
.bar .blk { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(45deg, rgba(170,200,255,.55) 0 6px, rgba(120,160,240,.4) 6px 12px); transition: width .12s linear; }
.bar span { position: relative; display: block; text-align: center; font-size: 14px; line-height: 26px; text-shadow: 1px 1px 0 #000, 0 0 3px #000; }
.bar.stam { height: 7px; background: #0d0b08; box-shadow: 0 0 0 1px #2c2318; }
.bar.stam .fill { background: linear-gradient(#ffd34a, #c98a00); box-shadow: none; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; margin-left: auto; justify-content: flex-end; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 10px; border: 1px solid #000; background: rgba(0,0,0,.6); box-shadow: 0 0 0 1px #2c2318; }
.chip.block { color: #a9c4ff; } .chip.poison { color: #7dff6b; } .chip.regen { color: #4aff9e; }
.chip.burn { color: #ff7a3a; } .chip.curse { color: #c58bff; } .chip.seal { color: #ffe9a0; } .chip.shards { color: #d58cff; } .chip.pulse, .chip.totem { color: #7fd3ff; }
.chip.empower { color: #ff9a4a; } .chip.haste { color: #ffe36b; } .chip.thorns { color: #e0a070; }
.floaters { position: absolute; left: 0; right: 0; top: 70px; height: 0; pointer-events: none; z-index: 20; }
.floater { position: absolute; left: 50%; font-size: 22px; font-family: var(--font-head); text-shadow: 2px 2px 0 #000, 0 0 6px #000;
  animation: floatup 1s ease-out forwards; white-space: nowrap; }
.floater.dmg { color: #ff5a4a; } .floater.crit { color: #ffcc33; font-size: 32px; } .floater.heal { color: #4aff6b; } .floater.miss { color: #ccc; font-size: 16px; }
@keyframes floatup { 0% { transform: translate(-50%, 0) scale(.7); opacity: 0; } 15% { transform: translate(-50%, -6px) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -56px) scale(1); opacity: 0; } }

.banner { text-align: center; margin: 18px auto 6px; padding: 14px 20px 18px; max-width: 560px; border-radius: 8px;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,209,0,.12), transparent 70%); animation: pop .35s ease-out; }
.banner h1 { font-size: clamp(42px, 9vw, 72px); }
.banner p { margin: 4px 0 14px; }
.banner.win h1 { color: var(--gold); text-shadow: 0 0 24px rgba(255,170,0,.5), 0 3px 0 #000; }
.banner.loss { background: radial-gradient(ellipse at 50% 0%, rgba(224,68,58,.14), transparent 70%); }
.banner.loss h1 { color: var(--red); } .banner.draw { background: radial-gradient(ellipse at 50% 0%, rgba(214,170,80,.16), transparent 70%); }
.banner.draw h1 { color: #e6c46a; text-shadow: 0 0 20px rgba(230,196,106,.4), 0 3px 0 #000; letter-spacing: .08em; }
.banner.draw h1::before, .banner.draw h1::after { content: "="; margin: 0 .35em; opacity: .55; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }

.log-panel { margin-top: 14px; }
.combat-log { max-height: 190px; overflow-y: auto; font-size: 13px; line-height: 1.55; padding-right: 4px; scrollbar-width: thin; scrollbar-color: #4a3b26 transparent; }
.combat-log .ll { padding: 1px 6px; border-radius: 3px; }
.combat-log .ll:first-child { background: rgba(255,209,0,.06); }
.combat-log .ll i { font-style: normal; color: #6f6551; display: inline-block; width: 40px; font-variant-numeric: tabular-nums; }
.combat-log .ll.a { color: #b9d8ff; } .combat-log .ll.b { color: #ffb4a8; } .combat-log .ll.sys { color: var(--gold); }
.combat-log .ll.crit { font-weight: bold; }

@media (max-width: 760px) {
  .arena { grid-template-columns: 1fr; }
  .vs { justify-self: center; font-size: 22px; }
  .fighter .board-wrap { padding: 4px; }
}

/* hero stage: the class toon stands beside its backpack; floaters pop over the hero */
.fight-body { display: flex; align-items: flex-end; gap: 10px; justify-content: center; }
.fighter:nth-child(3) .fight-body { flex-direction: row-reverse; }
.stage { position: relative; width: 120px; height: 190px; flex: none; }
.stage .floaters { top: 20px; }
.hero { position: absolute; inset: 0; transform-origin: 50% 100%; animation: idle 2.4s ease-in-out infinite; }
.hero svg { overflow: visible; }
.hero .glow { animation: glowp 1.8s ease-in-out infinite; }
@keyframes idle { 50% { transform: translateY(-3px) scaleY(1.015); } }
@keyframes glowp { 50% { opacity: .55; } }
/* attack lunge + hit knock are model3d rig nudges driven by js/ui/fx (both sides alike); fight FX styles live in css/fx.css */
.floater.dmg, .floater.crit { animation-name: popup; }
@keyframes popup { 0% { transform: translate(-50%, 10px) scale(.6); opacity: 0; } 15% { transform: translate(-50%, -6px) scale(1.35); opacity: 1; }
  30% { transform: translate(-50%, -10px) scale(1); } 100% { transform: translate(-50%, -60px) scale(1); opacity: 0; } }
@media (max-width: 760px) { .stage { width: 74px; height: 118px; } }
.stage .floater { font-size: 30px; } .stage .floater.crit { font-size: 40px; }

/* battlefield layout: backpacks on top, heroes in the bottom corners, status cards between them, log in a drop-down */
.battlefield { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; gap: 10px; min-height: 640px; padding: 12px 16px 0; border-radius: 8px; overflow: hidden;
  background:
    linear-gradient(180deg, transparent 62%, rgba(0,0,0,.3) 62.3%, transparent 63%),
    radial-gradient(ellipse at 50% 120%, #3a5a22 0 30%, transparent 31%),
    linear-gradient(180deg, #2a3446 0%, #3d4a5a 40%, #4a5a3a 62%, #2e3a1c 100%);
  box-shadow: inset 0 0 0 3px #1a0f06, inset 0 0 0 6px #5a3d22, inset 0 0 0 7px #000, inset 0 0 90px rgba(0,0,0,.6); }
.bf-top { display: flex; justify-content: center; align-items: flex-start; gap: 14px; position: relative; z-index: 5; }
.bf-ctrl { display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-radius: 0 0 8px 8px; margin-top: -12px; color: #3a2410;
  background: linear-gradient(#ead6ae, #cdb282); box-shadow: inset 0 0 0 2px #8a6d3b, 0 4px 8px rgba(0,0,0,.6); }
.bf-ctrl b { font-family: var(--font-head); font-size: 18px; }
.bf-ctrl .clock { font-size: 18px; min-width: 52px; text-align: center; color: #3a2410; background: none; box-shadow: none; }
.log-btn { position: absolute; left: calc(50% + 170px); top: 0; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 10px; border: 0; cursor: pointer;
  font-size: 12px; color: #3a2410; border-radius: 4px; background: linear-gradient(#ead6ae, #cdb282); box-shadow: inset 0 0 0 2px #8a6d3b, 0 3px 6px rgba(0,0,0,.6); transform: rotate(-3deg); }
.log-btn .book { font-size: 20px; }
.log-btn.open { transform: rotate(0); box-shadow: inset 0 0 0 2px var(--gold), 0 3px 6px rgba(0,0,0,.6); }
.log-drop { position: absolute; z-index: 30; left: 50%; top: 64px; transform: translateX(-50%); width: min(560px, 92%); max-height: 320px; overflow: auto; padding: 12px;
  border-radius: 6px; background: linear-gradient(#1c1710, #120f0a); box-shadow: 0 0 0 1px var(--edge), 0 12px 30px rgba(0,0,0,.8); }
.log-drop[hidden] { display: none; }
.bf-boards { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.bf-boards .board-wrap { background: none; box-shadow: none; padding: 0; }
.bf-ground { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-bottom: 10px; }
.bf-ground .stage { width: 170px; height: 260px; }
.bf-status { display: flex; gap: 0; align-self: flex-end; filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); }
.status-card { width: 250px; padding: 0 12px 12px; color: #3a2410; background: linear-gradient(#ead6ae, #c9ad7a); box-shadow: inset 0 0 0 2px #8a6d3b; }
.status-card:first-child { border-radius: 6px 0 0 6px; } .status-card:last-child { border-radius: 0 6px 6px 0; border-left: 1px solid #8a6d3b; }
.status-name { display: flex; align-items: center; gap: 8px; margin: 0 -12px 8px; padding: 6px 12px; color: #fff; font-family: var(--font-head); font-size: 18px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--cc) 75%, #000), color-mix(in srgb, var(--cc) 45%, #000)); text-shadow: 0 2px 0 #000; }
.status-name img { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #000; }
.status-name span { margin-left: auto; font-size: 12px; opacity: .85; font-family: inherit; }
.srow2 { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; margin: 5px 0; font-size: 13px; }
.srow2 .bar { margin: 0; height: 18px; }
.srow2 .chips { display: flex; flex-wrap: wrap; gap: 4px; min-height: 22px; }
.srow2.buffs { background: linear-gradient(90deg, rgba(90,160,60,.25), transparent); border-radius: 3px; padding: 2px 4px; }
.srow2.debuffs { background: linear-gradient(90deg, rgba(190,50,40,.25), transparent); border-radius: 3px; padding: 2px 4px; }
.bf-result { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 20; text-align: center; }
.bf-result:empty { display: none; }
@media (max-width: 900px) {
  .battlefield { min-height: 0; padding: 10px 8px 0; }
  .bf-boards { flex-direction: column; align-items: center; }
  .bf-ground .stage { width: 70px; height: 112px; }
  .bf-status { flex: 1; min-width: 0; }
  .status-card { width: auto; flex: 1; min-width: 0; padding: 0 6px 8px; }
  .srow2 { grid-template-columns: 1fr; gap: 2px; }
  .log-btn { position: static; }
  .bf-top { flex-wrap: wrap; }
}
.srow2 .bar span { color: #fff; font-size: 12px; line-height: 18px; text-shadow: 0 1px 0 #000, 0 0 3px #000; }   /* owner 11-06: the 26px line sat low in the 18px bar */

/* hero life: aura pulse, class particles, rays */
.hero-svg .aura { animation: aurap 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes aurap { 50% { opacity: .55; transform: scale(1.08); } }
.hero-svg .mote { transform-box: fill-box; transform-origin: center; opacity: 0; animation: rise 2.6s ease-out infinite; }
.hero-svg .mote.arcane { animation-duration: 3s; }
.hero-svg .mote.drip { animation: drip 3s ease-in infinite; }
@keyframes rise { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx, 0), -150px) scale(1.2) rotate(180deg); } }
@keyframes drip { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: .95; } 100% { opacity: 0; transform: translateY(110px) scaleY(1.4); } }
.hero-svg .smoke { transform-box: fill-box; transform-origin: center; animation: smoke 3.6s ease-out infinite; }
@keyframes smoke { 0% { opacity: 0; transform: scale(.6); } 30% { opacity: .55; } 100% { opacity: 0; transform: translateY(-40px) scale(1.6); } }
.hero-svg .rays { transform-box: view-box; transform-origin: 100px 150px; animation: spin 24s linear infinite; }
.hero-svg .runes { transform-box: fill-box; transform-origin: center; animation: spin 10s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bf-ground .stage { width: 200px; height: 310px; }
@media (prefers-reduced-motion: reduce) { .hero-svg .mote, .hero-svg .smoke, .hero-svg .rays, .hero-svg .runes, .hero-svg .aura { animation: none; } }

/* WoW 3D bodies (js/ui/model3d.js): the canvas replaces the SVG once the GLB loads */
.m3d { position: absolute; inset: 0; }
.m3d > svg { width: 100%; height: 100%; }
.m3d-canvas { width: 100%; height: 100%; display: block; }
.m3d.live::before { content: ''; position: absolute; left: 18%; right: 18%; bottom: 4%; height: 7%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0,0,0,.55), rgba(0,0,0,0)); pointer-events: none; }
.hero:has(.m3d.live), .me:has(.m3d.live), .merchant:has(.m3d.live) { animation: none; }
.me, .merchant { position: relative; }
.bf-ground .stage .hero { overflow: visible; }
.npc3d.live::before { display: none; } /* npc bodies draw their own floor shadow in WebGL */
@keyframes hop { 0% { transform: translateY(0); } 35% { transform: translateY(-10px); } 100% { transform: translateY(0); } }

/* stamina: segmented gold bar (one notch per point), numeric readout, spend pulse, empty flash */
.srow2 .bar.stam { height: 16px; overflow: visible; background: #0d0b08; box-shadow: 0 0 0 1px #2c2318; }
.bar.stam .fill { transition: width .08s linear; border-radius: 3px; }
.bar.stam .segs { position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / var(--segs) - 1px), rgba(0,0,0,.75) calc(100% / var(--segs) - 1px) calc(100% / var(--segs))); }
.srow2 .bar.stam span { position: relative; font-size: 11px; line-height: 16px; color: #fff3c4; }
.bar.stam .spend { position: absolute; right: -4px; top: -15px; font-style: normal; font-weight: bold; font-size: 12px; color: #ffd34a; text-shadow: 0 1px 0 #000, 0 0 4px #000; opacity: 0; }
.bar.stam.spent .spend { animation: stamspend .6s ease-out; }
.bar.stam.spent .fill { filter: brightness(1.5); }
@keyframes stamspend { 0% { opacity: 1; transform: translateY(4px); } 100% { opacity: 0; transform: translateY(-8px); } }
.bar.stam.low .fill { background: linear-gradient(#ff9a4a, #b54a00); }
.bar.stam.empty { animation: stamempty .5s ease-out; }
@keyframes stamempty { 0%, 60% { box-shadow: 0 0 0 2px #e0443a, 0 0 12px #e0443a; } 100% { box-shadow: 0 0 0 1px #2c2318; } }

/* weapons on the battle boards: stamina cost badge; tired = waiting for stamina */
.piece .stam-cost { position: absolute; left: 2px; bottom: 2px; z-index: 6; pointer-events: none; font-size: 10px; font-weight: bold; line-height: 13px;
  padding: 0 3px; border-radius: 3px; color: #ffe27a; background: rgba(20,14,4,.85); box-shadow: 0 0 0 1px #8a6200; }
.piece.tired .frame, .piece.tired .icon, .piece.tired .cell.fill { filter: saturate(.2) brightness(.55); }
.piece.tired .stam-cost { color: #fff; background: #a3241c; box-shadow: 0 0 0 1px #ff6a5a, 0 0 8px #e0443a; animation: tiredpulse .8s ease-in-out infinite; }
@keyframes tiredpulse { 50% { transform: scale(1.2); } }

/* combat log: the acting item's icon, hover for its tooltip */
.combat-log .log-ico { width: 20px; height: 20px; vertical-align: -5px; margin-right: 6px; border-radius: 3px; cursor: help;
  box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--qc); }
@media (hover: hover) { .combat-log .log-ico:hover { filter: brightness(1.25); } }

/* zone backdrop: Blizzard loading-screen art under a tinted vignette so boards, heroes and status cards stay readable */
.battlefield.zoned { background:
    radial-gradient(ellipse at 50% 45%, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--zone-tint) 70%, transparent) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,.6) 100%),
    var(--zone-bg) center / cover no-repeat, #1a1a1a; }
.zone-banner { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 6; padding: 1px 14px 2px; pointer-events: none;
  font: 600 12px/1.4 Georgia, 'Times New Roman', serif; letter-spacing: .12em; text-transform: uppercase; color: #f1d58a; white-space: nowrap;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.62) 20%, rgba(0,0,0,.62) 80%, transparent); text-shadow: 0 1px 2px #000; }
.battlefield.zoned { padding-top: 30px; }

/* css/fx.css */
/* Fight FX overlay (js/ui/fx). One .fx-layer inside .battlefield; transient pooled .fx-node, persistent .fx-held.
   Only transform / opacity / filter animate. Shake goes on .bf-ground or .stage, NEVER on .hero (the :has(.m3d.live) trap).
   PERF: no mix-blend-mode on any fx node (a blend over the WebGL hero canvas re-reads the backdrop every frame), glows are
   static box-shadows rasterised once on the node's own layer, never animated; the layer is its own paint/layout island. */
.fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; contain: strict; }
.fx-node, .fx-held { position: absolute; left: 0; top: 0; pointer-events: none; will-change: transform, opacity; transform-origin: 50% 50%;
  backface-visibility: hidden; }

/* school tokens: --fx-c is the colour a primitive tints with */
.fx-layer [data-school] { --fx-c: #ffd27a; }
.fx-layer [data-school="fire"] { --fx-c: #ff7a1a; }
.fx-layer [data-school="frost"] { --fx-c: #7ab8ff; }
.fx-layer [data-school="shadow"] { --fx-c: #9a4cff; }
.fx-layer [data-school="holy"] { --fx-c: #ffe58a; }
.fx-layer [data-school="nature"] { --fx-c: #5fe36a; }
.fx-layer [data-school="magic"] { --fx-c: #c58bff; }
.fx-layer [data-school="poison"] { --fx-c: #8fe03a; }

/* real WoW spell icon in a round mask; static school glow on full, flat on lite */
.fx-glyph { width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; overflow: hidden;
  box-shadow: 0 0 10px 2px var(--fx-c, #ffd27a), inset 0 0 6px rgba(0,0,0,.6); }
.fx-glyph.lite { box-shadow: 0 0 0 1px #000; }
.fx-glyph img { width: 100%; height: 100%; display: block; border-radius: 50%; }
.fx-clone { filter: drop-shadow(0 6px 6px rgba(0,0,0,.55)); }
.fx-clone > * { width: 100%; height: 100%; }
.fx-trail { height: 4px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--fx-c, #dfe6ef)); opacity: .8; }
.fx-ring { width: 80px; height: 26px; margin: -13px 0 0 -40px; border-radius: 50%; border: 2px solid var(--fx-c, #9fd0ff);
  box-shadow: 0 0 10px var(--fx-c, #9fd0ff); }
.fx-beam { height: 10px; margin-top: -5px; transform-origin: 0 50%; border-radius: 5px;
  background: linear-gradient(90deg, transparent, var(--fx-c, #ff3b3b) 30%, #fff 50%, var(--fx-c, #ff3b3b) 70%, transparent); }
.fx-pillar { width: 46px; margin-left: -23px; border-radius: 23px 23px 4px 4px;
  background: linear-gradient(transparent, color-mix(in srgb, var(--fx-c, #ffe58a) 70%, transparent) 40%, color-mix(in srgb, var(--fx-c, #ffe58a) 45%, #fff3) 90%); }
.fx-orbit { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.fx-aura { border-radius: 50%; }
.fx-counter { font-family: var(--font-head); font-size: 26px; color: #ffd34a; text-shadow: 2px 2px 0 #000, 0 0 8px #000; white-space: nowrap; }
.fx-vignette { inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .4s ease-out;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(60, 0, 0, .9) 100%); }

/* board piece states the glow / lift primitives toggle */
.piece.fx-spent { opacity: .35; }
.piece.fx-charge .sprite-holder, .piece.fx-charge .icon { filter: brightness(1.6) drop-shadow(0 0 6px var(--fx-c, #ffd27a)); }
.piece.fx-droop .sprite-holder, .piece.fx-droop .icon { transform: rotate(-8deg); filter: grayscale(.8) brightness(.7); }

/* shake: the primitive sets --fx-px and restarts the class on .bf-ground or a .stage */
.bf-ground.fx-shake, .stage.fx-shake { animation: fx-shake .3s ease-out; }
@keyframes fx-shake { 20% { transform: translate(calc(var(--fx-px, 4px) * -1), 1px); } 45% { transform: translate(var(--fx-px, 4px), -1px); }
  70% { transform: translate(calc(var(--fx-px, 4px) * -.4), 0); } 100% { transform: none; } }

/* impact-timed floaters added by the director */
.floater.blocked { color: #b9c3cf; font-size: 20px; }
.floater.heal.clutch { color: #fff2b0; font-size: 40px; text-shadow: 0 0 10px #ffd34a, 2px 2px 0 #000; }

/* settings: Fight effects row (+ the tier the fight is running at right now) */
.set-row.set-fx .set-fx-now { grid-column: 1 / -1; font-size: 12px; color: #b9a983; }
.set-row.set-fx .set-fx-now b { color: #f3e6c4; font-weight: 600; }
.set-row.set-fx select { grid-area: r; justify-self: start; min-width: 120px; padding: 3px 8px; background: #1c160e; color: #f3e6c4;
  border: 1px solid #4a3b26; border-radius: 4px; font: inherit; }

@media (prefers-reduced-motion: reduce) {
  .bf-ground.fx-shake, .stage.fx-shake { animation: none; }
  .fx-orbit, .fx-aura { animation: none !important; }
}

/* css/shop-scene.css */
/* Shop = a goblin trading-post room: backpack + hero + crate on the left, wall shelves + sell chest + merchant on the right. */
.scene { position: relative; display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 10px 22px;
  padding: 14px 18px 0; border-radius: 8px; min-height: 640px; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0,0,0,0) 78%, rgba(0,0,0,.35) 78.4%, transparent 79%),
    repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 2px, transparent 2px 120px),
    radial-gradient(ellipse at 60% 30%, #4a3520, #2a1d10 70%, #1a1209);
  box-shadow: inset 0 0 0 3px #1a0f06, inset 0 0 0 6px #5a3d22, inset 0 0 0 7px #000, inset 0 0 80px rgba(0,0,0,.7), 0 8px 24px rgba(0,0,0,.7); }
/* floorboards */
.scene::after { content: ""; position: absolute; left: 7px; right: 7px; bottom: 7px; height: 64px; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(90deg, #4a2f18 0 90px, #3a2410 90px 92px), linear-gradient(#2a1a0c, #1a1006); opacity: .9; }
.scene > * { position: relative; z-index: 1; }

.scene-top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scene .sign { font-family: var(--font-head); font-size: 20px; color: #3a2410; padding: 5px 22px; border-radius: 4px;
  background: linear-gradient(#e8d2a8, #c9ad7a); box-shadow: inset 0 0 0 2px #8a6d3b, inset 0 0 0 3px #f6e6c4, 0 3px 0 #000, 0 4px 8px rgba(0,0,0,.6); }
.top-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fight-sign { font-family: var(--font-head); font-size: 30px; line-height: 1; color: #fff3d0; padding: 10px 34px 12px; border: 0; cursor: pointer; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-shadow: 0 2px 0 #000, 0 0 10px rgba(255,90,40,.6);
  background: radial-gradient(ellipse at 50% 30%, #c8321c, #7a1608); box-shadow: inset 0 0 0 2px #e0b84a, inset 0 0 0 4px #4a0c04, 0 4px 0 #000, 0 0 24px rgba(220,60,20,.45);
  transition: transform .12s; }
.fight-sign small { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: #f0d090; font-family: var(--font-body, inherit); }
.fight-sign:active { transform: scale(.97); }

.scene-left { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.scene-left .board-wrap { background: none; box-shadow: none; padding: 0; }
.scene-left .selbar { min-height: 30px; }
.scene-floor { display: flex; align-items: flex-end; gap: 10px; margin-top: auto; padding-bottom: 14px; }

/* character stats: a parchment card */
.stats-card { width: 190px; flex: none; padding: 10px 12px; border-radius: 4px; color: #3a2410; font-size: 13px;
  background: linear-gradient(#ead6ae, #cdb282); box-shadow: inset 0 0 0 2px #8a6d3b, inset 0 0 18px rgba(120,80,30,.35), 0 4px 10px rgba(0,0,0,.6); }
.stats-card h4 { margin: 0 0 6px; text-align: center; font-family: var(--font-head); font-size: 16px; color: #3a2410; }
.srow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 4px; border-radius: 3px; }
.srow b { display: flex; align-items: center; gap: 4px; color: #2a1608; }
.srow.s-gold { background: linear-gradient(90deg, rgba(240,190,40,.45), transparent); }
.srow.s-hp { background: linear-gradient(90deg, rgba(220,70,50,.4), transparent); }
.srow-sep { height: 1px; margin: 5px 0; background: rgba(90,60,20,.4); }
.stats-card .hearts { color: #c0281c; } .stats-card .hearts .gone { color: rgba(60,30,10,.25); }

.me { width: 118px; height: 186px; flex: none; animation: idle 2.6s ease-in-out infinite; transform-origin: 50% 100%; }

/* storage crate */
/* a floor-level bin: fixed height, items lie in a pile (storage-bin.css places them); wider than the old flex crate */
.storage.crate { position: relative; flex: 2 1 240px; min-width: 200px; height: 150px; padding: 0; border: 0; border-radius: 3px;
  background:
    linear-gradient(rgba(0,0,0,.5), rgba(0,0,0,.3)),
    repeating-linear-gradient(0deg, #6b4423 0 34px, #5a381c 34px 36px, #000 36px 37px),
    linear-gradient(90deg, #7a4e28, #5e3b1d);
  box-shadow: inset 0 0 0 6px #3e2610, inset 0 0 0 8px #8a5a2e, inset 0 0 0 9px #000, inset 0 12px 24px rgba(0,0,0,.8), 0 6px 14px rgba(0,0,0,.6); }
.storage.crate::before, .storage.crate::after { content: ""; position: absolute; top: 6px; bottom: 6px; width: 11px; pointer-events: none;
  background: linear-gradient(90deg, #4a2d14, #8a5a2e, #4a2d14); box-shadow: inset 0 0 0 1px #000; }
.storage.crate::before { left: 6px; } .storage.crate::after { right: 6px; }
.crate-label { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; pointer-events: none;
  font-family: var(--font-head); letter-spacing: .18em; text-transform: uppercase; font-size: 14px; color: rgba(230,200,150,.45); text-shadow: 0 1px 0 #000; }
.storage.crate.drop-hot { background-color: transparent; box-shadow: inset 0 0 0 6px #3e2610, inset 0 0 0 8px var(--gold), inset 0 0 0 9px #000, inset 0 12px 24px rgba(0,0,0,.8), 0 0 18px rgba(255,209,0,.4); }

/* wall shelves */
.scene-right { display: flex; flex-direction: column; min-width: 0; }
.reroll-tag { align-self: flex-start; margin-left: 8%; display: flex; flex-direction: column; align-items: center; gap: 0; cursor: pointer;
  border: 0; padding: 4px 12px 5px; font-size: 13px; color: #3a2410; border-radius: 3px; transform: rotate(-4deg); position: relative;
  background: linear-gradient(#ead6ae, #cdb282); box-shadow: inset 0 0 0 2px #8a6d3b, 0 3px 6px rgba(0,0,0,.6); transition: transform .12s; }
.reroll-tag::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 2px; height: 22px; background: #c9a24a; }
.reroll-tag b { display: flex; align-items: center; gap: 4px; font-size: 18px; font-family: var(--font-head); }
.reroll-tag:disabled { opacity: .5; cursor: not-allowed; }
.shelves { display: flex; flex-direction: column; gap: 6px; padding: 6px 0 0; }
.shelf { position: relative; display: flex; align-items: flex-end; justify-content: space-around; gap: 10px; min-height: 120px; padding: 0 16px 14px; }
.shelf::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; border-radius: 2px;
  background: linear-gradient(#8a5a2e, #5a381c 60%, #3a2410); box-shadow: 0 1px 0 #000, 0 8px 10px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,220,160,.25); }
.shelf::before { content: ""; position: absolute; left: 8%; right: 8%; bottom: -12px; height: 12px;
  background: linear-gradient(90deg, #3a2410 0 10px, transparent 10px calc(100% - 10px), #3a2410 calc(100% - 10px)); }

.ware { --qc: var(--q-common); position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 8px; }
.ware.r-uncommon { --qc: var(--q-uncommon); } .ware.r-rare { --qc: var(--q-rare); } .ware.r-epic { --qc: var(--q-epic); } .ware.r-legendary { --qc: var(--q-legendary); }
.ware-art { cursor: pointer; line-height: 0; transition: transform .14s; transform-origin: 50% 100%;
  filter: drop-shadow(0 4px 3px rgba(0,0,0,.7)) drop-shadow(0 0 7px color-mix(in srgb, var(--qc) 65%, transparent)); }
.ware.poor .ware-art { cursor: not-allowed; }
.ware-icon img { width: 100%; height: 100%; display: block; border-radius: 6px; box-shadow: 0 0 0 1px #000; }
.ware-foot { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ware .lock { border: 0; background: none; cursor: pointer; font-size: 12px; padding: 0; opacity: .5; }
.ware.locked .lock { opacity: 1; }
.ware.locked .ware-art { filter: drop-shadow(0 4px 3px rgba(0,0,0,.7)) drop-shadow(0 0 3px var(--gold)) drop-shadow(0 0 9px var(--gold)); }

/* yellow tent price card: big number + a coin, nothing behind it */
.tag { position: relative; display: flex; align-items: center; gap: 4px; padding: 4px 12px 3px 14px; border: 0; cursor: pointer; min-height: 0;
  font-family: var(--font-head); font-size: 22px; line-height: 1; color: #fff; background: none; }
.tag::before { content: ""; position: absolute; inset: 0; z-index: -1; clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
  background: linear-gradient(#f6cf3a, #e0a816); }
.tag::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; z-index: -1; background: #8a6200; clip-path: polygon(0 0, 100% 0, 98% 100%, 2% 100%); }
.tag b { -webkit-text-stroke: 4px #2a1608; paint-order: stroke fill; text-shadow: 0 2px 0 #2a1608; }
.tag:disabled { cursor: not-allowed; filter: saturate(.35) brightness(.75); }
.tag.empty { opacity: .6; cursor: default; padding: 6px 16px; }
.ware.sold { min-width: 70px; justify-content: center; }
.coin { display: inline-block; width: 16px; height: 16px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ffe27a, #d9a014 60%, #9a6a00); box-shadow: 0 0 0 1.5px #5a3a00, inset 0 0 0 3px rgba(255,240,170,.55); }
.tag .coin { width: 18px; height: 18px; }

/* sell chest + merchant */
.scene-floor.right { justify-content: flex-end; gap: 0; }
.sellchest { position: relative; width: 150px; height: 120px; flex: none; cursor: default; transition: transform .14s; transform-origin: 50% 100%; }
.sellchest.drop-hot { transform: scale(1.08) rotate(-2deg); filter: drop-shadow(0 0 12px var(--gold)); }
.chest-label { position: absolute; left: 0; right: 0; bottom: 28px; text-align: center; font-family: var(--font-head); font-size: 14px; color: #f0d090; text-shadow: 0 1px 0 #000, 0 0 4px #000; pointer-events: none; }
.merchant { width: 150px; height: 205px; flex: none; animation: idle 2.2s ease-in-out infinite; transform-origin: 50% 100%; margin-right: 6px; }
@keyframes idle { 50% { transform: translateY(-3px) scaleY(1.015); } }

@media (max-width: 900px) {
  .scene { grid-template-columns: 1fr; padding: 10px 10px 0; min-height: 0; }
  .scene .sign { display: none; }
  .scene-top { justify-content: center; }
  .scene-floor { flex-wrap: wrap; }
  .stats-card { width: 100%; order: 3; }
  .me { width: 74px; height: 118px; }
  .storage.crate { min-width: 0; height: 132px; }
  .merchant { width: 96px; height: 132px; } .sellchest { width: 110px; height: 88px; }
  .shelf { min-height: 96px; padding: 0 6px 14px; flex-wrap: wrap; }
}

/* shelf wares are real pieces: grab and drag them straight into a bag */
.ware-piece { position: relative; }
.ware-piece .piece { left: 0; top: 0; }
.ware-piece .piece .cell { cursor: grab; }
.ware-piece .star { display: none !important; }
.ware.poor .ware-piece .piece .cell { cursor: not-allowed; }

/* --- shelf HD pass: real plank (top face + lit front edge + grain), contact shadows, crisper icons --- */
.shelf::after { height: 18px; border-radius: 3px 3px 2px 2px;
  background:
    linear-gradient(180deg, rgba(255,226,170,.55) 0 2px, rgba(255,214,150,.16) 2px 6px, transparent 6px),
    repeating-linear-gradient(92deg, rgba(0,0,0,.0) 0 14px, rgba(0,0,0,.16) 14px 15px, rgba(255,210,150,.06) 15px 17px, rgba(0,0,0,0) 17px 38px),
    repeating-linear-gradient(88deg, rgba(60,30,8,.0) 0 53px, rgba(60,30,8,.28) 53px 54px, rgba(60,30,8,0) 54px 97px),
    linear-gradient(180deg, #a56b36 0, #8a5a2e 34%, #5f3b1c 72%, #3a2410 100%);
  box-shadow: 0 1px 0 #000, 0 3px 0 rgba(0,0,0,.35), 0 10px 14px rgba(0,0,0,.6), inset 0 -2px 0 rgba(0,0,0,.45), inset 1px 0 0 rgba(255,220,160,.2); }
.shelf::before { height: 14px; bottom: -14px;
  background: linear-gradient(90deg, #4a2e16 0 10px, transparent 10px calc(100% - 10px), #4a2e16 calc(100% - 10px));
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); }
/* soft contact shadow where each ware touches the plank */
.ware-art { position: relative; }
.ware-art::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: -6px; height: 12px; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0,0,0,.65), rgba(0,0,0,0)); filter: blur(2px); pointer-events: none; }
.ware-art { filter: drop-shadow(0 5px 3px rgba(0,0,0,.65)) drop-shadow(0 0 8px color-mix(in srgb, var(--qc) 55%, transparent)); }
/* icons: HD source, smooth downscale, a touch more punch + a soft top gloss on the frame */
.piece .icon { image-rendering: auto; filter: contrast(1.05) saturate(1.1); }
.ware-piece .piece.item .frame { box-shadow: inset 0 0 0 1px #000, inset 0 0 0 2px var(--qc), inset 0 0 14px color-mix(in srgb, var(--qc) 40%, transparent), 0 3px 6px rgba(0,0,0,.85), 0 0 0 1px rgba(255,255,255,.07); }

/* ======================= SCENE v3: lit merchant room with depth (wall / lanterns / floor plane / vignette) ======================= */
#app:has(.scene) { max-width: none; padding: 10px 14px 14px; }
.scene { min-height: max(620px, calc(100vh - 72px)); gap: 6px 28px; padding: 16px 28px 0; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); grid-template-rows: auto 1fr;
  background: #140d07;
  box-shadow: inset 0 0 0 3px #120a04, inset 0 0 0 6px #5a3d22, inset 0 0 0 7px #000, 0 10px 30px rgba(0,0,0,.8); }
.scene::after { display: none; }
.scene > .scene-vig { position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: 8px; }
.scene-vig { background: radial-gradient(ellipse 78% 82% at 50% 46%, transparent 55%, rgba(0,0,0,.55) 100%), linear-gradient(180deg, rgba(0,0,0,.45), transparent 12%);
  box-shadow: inset 0 0 90px 10px rgba(0,0,0,.75); z-index: 3 !important; }

/* top row; the round history is a labelled plaque of win/loss pips (it was a stray green dot) */
.scene-top { align-items: flex-start; }
.history:not(:empty) { margin: 0; justify-content: center; gap: 5px; padding: 3px 10px; border-radius: 10px; background: rgba(10,6,2,.6); box-shadow: inset 0 0 0 1px #5a3d22, 0 2px 4px rgba(0,0,0,.6); }
.history i { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; font-style: normal; font-size: 11px; font-weight: bold; line-height: 1; color: #fff; text-shadow: 0 1px 0 #000; }
.history .w::after { content: "\2713"; } .history .l::after { content: "\2715"; } .history .d::after { content: "="; }

/* left: backpack board big, framed like a leather pack on the lit wall, hint tucked under it */
.scene-left { gap: 6px; }
.scene-left .board-wrap { margin-top: auto; align-self: center; padding: 16px 18px 18px; border-radius: 14px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,190,110,.16), transparent 60%),
    repeating-linear-gradient(45deg, rgba(0,0,0,.10) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #4a3320, #2a1b0e);
  box-shadow: inset 0 0 0 2px #1a0f06, inset 0 0 0 4px #7a5630, inset 0 0 0 5px #000, inset 0 10px 26px rgba(0,0,0,.8), inset 0 -8px 18px rgba(0,0,0,.5), 0 16px 26px -6px rgba(0,0,0,.85), 0 0 50px rgba(255,160,70,.12); }
.scene-left .selbar { justify-content: center; text-align: center; min-height: 30px; color: #d8c49a; text-shadow: 0 1px 2px #000; }
.scene-left .selbar .muted { font-size: 13px; }
.scene-floor { margin-top: auto; padding-bottom: 12px; min-height: 0; }
.scene-floor .me { filter: drop-shadow(0 6px 4px rgba(0,0,0,.6)); }
.me, .merchant { position: relative; }
.me::after, .merchant::after { content: ""; position: absolute; left: 4%; right: 4%; bottom: -6px; height: 16px; z-index: -1; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.7), transparent); }

/* storage = a chest on the floor: iron straps, dark inside lip */
.storage.crate { background:
    radial-gradient(ellipse at 50% -20%, rgba(0,0,0,.0), rgba(0,0,0,.55) 90%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.0) 0 38px, rgba(0,0,0,.45) 38px 40px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 1px, rgba(255,200,140,.05) 1px 3px, transparent 3px 22px),
    linear-gradient(180deg, #7c5128, #5a3819 70%, #402711);
  box-shadow: inset 0 0 0 5px #2e1b0b, inset 0 0 0 7px #7a5630, inset 0 0 0 8px #000, inset 0 14px 26px rgba(0,0,0,.85), 0 14px 18px -4px rgba(0,0,0,.8); }
.storage.crate::before, .storage.crate::after { width: 12px; background: linear-gradient(90deg, #26262a, #6a6a72 45%, #2a2a2e); box-shadow: inset 0 0 0 1px #000, 0 0 0 1px rgba(0,0,0,.5); }
.crate-label { color: rgba(240,210,150,.55); }

/* right: shelves fill the wall; thick boards with top face, lit front lip, wall shadow and brackets */
.reroll-tag { margin-top: -2px; margin-bottom: 8px; }
.shelves { flex: 1; justify-content: space-evenly; gap: 30px; padding: 20px 0 6px; }
.shelf { flex: 1; align-items: flex-end; min-height: 110px; padding: 0 22px 18px; }
.shelf::after { height: 26px; border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255,226,170,.65) 0 1px, rgba(255,214,150,.30) 1px 8px, rgba(0,0,0,.35) 8px 9px, transparent 9px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.0) 0 61px, rgba(40,20,5,.35) 61px 62px, rgba(0,0,0,0) 62px 140px),
    repeating-linear-gradient(92deg, rgba(0,0,0,0) 0 14px, rgba(0,0,0,.16) 14px 15px, rgba(255,210,150,.06) 15px 17px, rgba(0,0,0,0) 17px 38px),
    linear-gradient(180deg, #b27a40 0, #9b6a35 34%, #6a4220 36%, #5a381a 80%, #321e0c 100%);
  box-shadow: 0 1px 0 #000, 0 16px 16px -4px rgba(0,0,0,.7), 0 30px 26px -6px rgba(0,0,0,.35), inset 0 -2px 0 rgba(0,0,0,.5), inset 1px 0 0 rgba(255,220,160,.25); }
.shelf::before { left: 10%; right: 10%; bottom: -22px; height: 22px; z-index: 0;
  background:
    linear-gradient(135deg, #4a2e16 0 50%, transparent 50%) left top / 22px 22px no-repeat,
    linear-gradient(225deg, #4a2e16 0 50%, transparent 50%) right top / 22px 22px no-repeat;
  filter: drop-shadow(2px 4px 3px rgba(0,0,0,.6)); }
/* shelf items sit on the plank with a pooled contact shadow and only a faint footprint */
.ware-art::after { left: -4%; right: -4%; bottom: -5px; height: 14px; background: radial-gradient(closest-side, rgba(0,0,0,.8), rgba(0,0,0,0)); filter: blur(1.5px); z-index: -1; }
.ware-piece .piece .cell:not(.fill) { background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
/* price tag hangs from a nail on the plank directly under its item */
.ware { flex-direction: column; align-items: center; }
.ware-foot { position: absolute; left: 50%; top: calc(100% + 11px); transform: translateX(-50%); z-index: 3; flex-direction: row; align-items: center; gap: 4px; white-space: nowrap; }
.ware-foot::before { content: ""; position: absolute; left: 50%; top: -7px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ddd, #555); box-shadow: 0 1px 1px #000; }
.ware .tag { font-size: 20px; padding: 3px 11px 2px 13px; filter: drop-shadow(0 3px 2px rgba(0,0,0,.7)); }
.ware.sold { min-width: 90px; }
.ware.sold .ware-foot { position: static; transform: none; }
.ware .lock { font-size: 13px; filter: drop-shadow(0 1px 1px #000); }
.scene-floor.right { gap: 18px; align-items: flex-end; }

@media (max-width: 900px) {
  .scene { padding: 10px 10px 0; min-height: 0; }
  #app:has(.scene) { padding: 8px; }
  .scene-left .board-wrap { margin-top: 0; padding: 8px; }
  .shelves { gap: 26px; padding-top: 14px; }
  .shelf { flex: none; padding: 0 8px 21px; }
  .scene-floor { margin-top: 0; }
}

/* characters: big, standing on the floor plane (hero ~ 36vh, merchant a little shorter); they overlap upward into the wall space */
.scene-floor .me { width: clamp(150px, 36vh, 400px); height: clamp(186px, 38vh, 440px); margin-top: calc(clamp(186px, 38vh, 440px) * -.32); }
.scene-floor .merchant { width: clamp(150px, 34vh, 380px); height: clamp(205px, 36vh, 410px); margin-top: calc(clamp(205px, 36vh, 410px) * -.32); margin-right: 0; }
.scene-floor.right .sellchest { width: clamp(150px, 17vh, 200px); height: clamp(120px, 14vh, 160px); }
.ware.sold .tag, .ware.sold .ware-foot { display: none; }
@media (max-width: 900px) {
  .scene-floor .me { width: 96px; height: 150px; margin-top: 0; }
  .scene-floor .merchant { width: 110px; height: 150px; margin-top: 0; }
  .scene-floor.right .sellchest { width: 110px; height: 88px; }
}
@media (max-width: 900px) {
  .scene { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .scene-left .board-wrap { align-self: flex-start; max-width: 100%; }
  .scene-floor .me, .scene-floor .merchant { margin-top: 0; }
}
@media (min-width: 901px) {
  .scene-left .selbar { max-width: 34%; align-self: center; margin-right: auto; margin-left: 4%; justify-content: flex-start; text-align: left; flex-wrap: wrap; }
}
@media (min-width: 901px) {
  .scene { height: max(620px, calc(100vh - 72px)); grid-template-rows: auto minmax(0, 1fr); }
  .scene-left, .scene-right { min-height: 0; }
  .stats-card { padding: 8px 12px; } .srow { padding: 1px 4px; } .stats-card h4 { margin-bottom: 3px; }
}

/* ======================= SHOP FIX PASS (layout: fit, shelves clear of the goblin, board grid, hint, class row, crate, mobile) ======================= */
/* the board is a 9x7 play grid (bags can go anywhere in it), so the empty part reads as deliberate slots, not an empty slab */
/* interaction pass: the empty board is a plain worn surface (no Tetris-well lattice); only bag cells read as slots.
   While a BAG is dragged (drag.js sets body.drag-bag) faint cell marks fade in so the player can aim it. */
.scene .board { background-image: radial-gradient(ellipse at 50% 45%, rgba(255,214,150,.035), transparent 70%);
  background-size: auto; box-shadow: inset 0 0 0 1px rgba(255,214,150,.05); border-radius: 4px; transition: box-shadow .2s; }
body.drag-bag .scene .board { background-image: radial-gradient(circle at center, rgba(255,214,150,.22) 1.4px, transparent 1.9px);
  background-size: var(--cell) var(--cell); box-shadow: inset 0 0 0 1px rgba(255,214,150,.14); }
.scene-left .board-wrap { padding: 10px 12px 12px; }

/* character card: Class value was a pale class colour on parchment; dark text + a colour dot */
.cls-val { display: inline-flex; align-items: center; gap: 6px; color: #2a1608; font-weight: bold; }
.cls-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 1px #2a1608, inset 0 0 0 1px rgba(255,255,255,.35); }

/* non-rectangular shelf wares: only the icon square is shown, resting on the plank (the empty footprint stays invisible) */
.ware-piece.trim { overflow: hidden; border-radius: 4px; }
.ware-piece.trim .piece .frame.shape { display: none; }
.ware-piece.trim .piece .icon { box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--qc); }

/* storage hint */
.crate-hint { position: absolute; left: 22px; right: 22px; top: 4px; text-align: center; pointer-events: none; font-size: 11px; line-height: 1.2; color: rgba(255,226,170,.8); text-shadow: 0 1px 2px #000; }

@media (min-width: 901px) {
  /* footer stays but as one line so the room fits the viewport exactly: no page scroll */
  body:has(.scene) .fcp { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 18px; padding: 2px 16px; }
  .scene { height: calc(100vh - 85px); min-height: 500px; padding-top: 12px; }
  .scene-left .selbar { max-width: none; align-self: stretch; margin: 0; justify-content: center; text-align: center; min-height: 26px; }
  .scene-floor .me { width: clamp(120px, 24vh, 320px); height: clamp(170px, 34vh, 440px); margin-top: calc(clamp(170px, 34vh, 440px) * -.12); flex: 0 1 auto; min-width: 0; }
  .stats-card { padding: 6px 12px 8px; font-size: 13px; line-height: 1.2; } .stats-card h4 { font-size: 15px; margin-bottom: 2px; } .srow { padding: 0 4px; } .srow-sep { margin: 3px 0; }
  .scene-floor .merchant { width: clamp(120px, 23vh, 300px); height: clamp(165px, 30vh, 380px); margin-top: 0; }
  .scene-floor.right .sellchest { width: clamp(130px, 15vh, 190px); height: clamp(104px, 12vh, 150px); }
  .scene-floor { gap: 8px; }
  .storage.crate { flex: 3 1 400px; min-width: 240px; height: clamp(150px, 27vh, 280px); padding: 0; }   /* bin cells are board-sized (56..64px): a deeper, wider crate */
  .scene-floor .stats-card { width: 172px; } .scene-left .scene-floor .me { flex-shrink: 4; min-width: 110px; }   /* room for a wide storage bin (the hero model is narrow) */
  /* 2 shelves, each as tall as the tallest ware the shop can offer (--shelf-h from shopScreen.js: tallest x shelf cell +
     plank pad - 4px), so a 4-tall ware pokes past the rail above by 4px at most; 52px under the bottom plank so its price
     tags clear the sell chest's sign, which rises ~34px above the floor row */
  .shelves { flex: 1 1 0; min-height: 0; justify-content: space-evenly; gap: 0; padding: 0 0 52px; }
  .shelf { flex: none; min-height: 0; height: var(--shelf-h, auto); padding-bottom: 20px; }
  /* the reroll tag hangs over the top shelf's left end (out of flow, so the shelves get its row); that shelf starts after it */
  .scene-right { position: relative; }
  .scene-right .reroll-tag { position: absolute; top: -4px; left: 8%; margin: 0; z-index: 2; }
  .scene-right .shelf:first-child { padding-left: calc(8% + 84px); }
  .scene-right .scene-floor.right { margin-top: 0; }
}

@media (max-width: 900px) {
  /* compact phone layout: board, then the shop, with the sell chest pinned bottom-right so a drag can always reach it */
  .scene { display: flex; flex-direction: column; gap: 8px; }
  .scene-left, .scene-right { display: contents; }
  .scene-top { order: 0; }
  .scene-left .board-wrap { order: 1; align-self: center; }
  .scene-left .selbar { order: 2; min-height: 0; text-align: center; justify-content: center; max-width: none; }
  .scene-right .reroll-tag { order: 3; align-self: center; margin: 22px 0 0; }
  .scene-right .shelves { order: 4; padding-top: 6px; gap: 26px; }
  .scene-left .scene-floor { order: 5; }
  .scene-right .scene-floor.right { order: 6; z-index: 5; }
  .scene-floor.right .sellchest { position: fixed; right: 8px; bottom: 8px; width: 92px; height: 74px; z-index: 40; filter: drop-shadow(0 4px 6px rgba(0,0,0,.8)); }
  .scene-floor.right { justify-content: flex-start; }
  .scene-floor .me { width: 80px; height: 120px; }
  .scene-floor .merchant { width: 96px; height: 130px; }
  .stats-card { order: 0; width: 100%; }
  .scene { padding-bottom: 92px; }
}

/* interaction pass: the selection bar always sits above the hero body that overlaps it from the floor row */
.scene-left .selbar { position: relative; z-index: 6; }
.scene .m3d, .scene .m3d-canvas { pointer-events: none; }
@media (min-width: 901px) {
  /* footer disclaimer: one full line, not clipped (the <p> default margin pushed it out of its 18px box) */
  body:has(.scene) .fcp { height: auto; min-height: 18px; line-height: 16px; box-sizing: border-box; }
  body:has(.scene) .fcp p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ======================= SELL CHEST beside the storage bin (owner ask 11-04: "right next to storage and 4x its size") ======================= */
@media (min-width: 901px) {
  /* chest = left end of the right floor, so only the column gap separates it from the bin; the goblin keeps the right end */
  .scene-right .scene-floor.right { justify-content: space-between; align-items: flex-end; }
  /* 2x width and height of the old clamp(130..190 x 104..150): ~300x240 at 1280x800 */
  .scene-floor.right .sellchest { width: clamp(260px, 37.5vh, 300px); height: clamp(208px, 30vh, 240px); margin-left: -6px; }
}

/* ======================= HERO SCALE PASS (owner 11-04 Ready Check: "character model is far too small in the shop") =======================
   Desktop: the hero stands ~45vh tall on the floor line at the far left of the left column; the board sits to the hero's
   right (right-aligned, cell size from shopScreen.js shopCell() leaves the hero its width); the stats card moves up onto the
   wall above the hero; the goblin is scaled to pair with the hero (shorter, as a goblin is). Nothing overlaps: hero top is
   below the stats card, board starts right of the hero, the crate keeps the rest of the floor. */
@media (min-width: 901px) {
  .scene { --hero-h: clamp(300px, 48vh, 560px); --hero-w: calc(var(--hero-h) * .64); --crate-h: clamp(150px, 27vh, 280px);
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }   /* owner 11-06 "the bag is too small": the board column takes 1.6 shares */
  .scene-left { position: relative; }
  .scene-left .board-wrap { align-self: flex-end; margin-right: 0; }
  .scene-left .selbar { padding-left: calc(var(--hero-w) + 8px); box-sizing: border-box; }
  .scene-left .scene-floor .stats-card { position: absolute; left: 0; top: 0; z-index: 3; width: 172px; }
  .scene-left .scene-floor .me { flex: 0 0 var(--hero-w); width: var(--hero-w); min-width: 0; height: var(--hero-h);
    margin-top: calc(var(--crate-h) - var(--hero-h)); }   /* in-flow height = the crate's, the body rises up the wall */
  .storage.crate { height: var(--crate-h); }
  .scene-floor .merchant { --gob-h: calc(var(--hero-h) * .75); height: var(--gob-h); width: calc(var(--gob-h) * .75); flex: 0 0 auto; margin-top: 0; }
  .scene-floor.right .sellchest { --chest-w: min(clamp(240px, 36vh, 300px), 18vw); width: var(--chest-w); height: calc(var(--chest-w) * .8); }
}

/* shoploop: hover-only rules gated to real hover devices; touch gets :active */
@media (hover: hover) {
  .fight-sign:hover { transform: scale(1.05) rotate(-1deg); }
  .reroll-tag:hover:not(:disabled) { transform: rotate(3deg); }
  .ware-art:hover { transform: translateY(-4px) scale(1.06); filter: drop-shadow(0 8px 5px rgba(0,0,0,.6)) drop-shadow(0 0 10px var(--qc)); }
  .ware .lock:hover { opacity: 1; }
  .tag:hover:not(:disabled) { transform: translateY(-1px); }
  .ware-art:hover::after { opacity: .6; transform: translateY(4px) scaleX(.9); }
}
.tag:active:not(:disabled), .reroll-tag:active:not(:disabled), button.sign:active, .ware-art:active { transform: scale(.96); filter: brightness(1.15); }

/* css/shop-backdrop.css */
/* Shop backdrop: Booty Bay goblin trading post (module js/ui/shopBackdrop.js, art assets/ui/shop-bd/ from tools/backdrop/).
   Layering: wall < beam/rail/floor < props < light < shade (play areas darker) < dust; .scene-vig sits above all of it.
   Positions are % of the scene box, sizes in vh so the room scales with the viewport the shop is fitted to. */
.scene > .shop-bd { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; border-radius: 8px; }
.shop-bd, .shop-bd * { pointer-events: none; user-select: none; }
.shop-bd > * { position: absolute; }

/* teal-washed Booty Bay boards (jlo_bbay_woodwall), dimmed so the board and shelves read first */
.shop-bd .bd-wall { inset: 0; background: url(../assets/ui/shop-bd/wall.webp) 0 0 / auto 44vh repeat; filter: brightness(.36) saturate(.8) contrast(1.08); }
/* ceiling beams (jlo_bbay_ceiling) across the top, the lanterns hang from them */
.shop-bd .bd-beam { left: 0; right: 0; top: 0; height: 7%; background: url(../assets/ui/shop-bd/beam.webp) 0 62% / 20vh auto repeat-x;
  filter: brightness(.5) saturate(.9); box-shadow: 0 6px 14px rgba(0,0,0,.7); }
/* dado rail (js_bbay_trim) + plank floor (js_bbay_plank) laid back in perspective */
.shop-bd .bd-rail { left: 0; right: 0; bottom: 21%; height: 2.4vh; background: url(../assets/ui/shop-bd/rail.webp) 0 50% / 30vh auto repeat-x;
  filter: brightness(.55); box-shadow: 0 -4px 10px rgba(0,0,0,.55), 0 4px 8px rgba(0,0,0,.6); z-index: 1; }
.shop-bd .bd-floor { left: -12%; right: -12%; bottom: 0; height: 21%; transform-origin: 50% 0; transform: perspective(60vh) rotateX(34deg);
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.1) 30%, rgba(0,0,0,.5)), url(../assets/ui/shop-bd/floor.webp) 0 0 / auto 8vh repeat;
  filter: brightness(.62) saturate(.85); }

.shop-bd .bd-p { display: block; height: auto; filter: brightness(.62) saturate(.9) drop-shadow(0 6px 6px rgba(0,0,0,.7)); }
/* dock-side windows with the harbour at dusk behind them (top band, between the signs) */
.shop-bd .bd-window { top: 1.2%; height: 9.5vh; width: auto; filter: brightness(.85) saturate(.95);
  box-shadow: 0 0 0 3px #1a1008, 0 0 0 4px rgba(0,0,0,.8), 0 6px 14px rgba(0,0,0,.8); }
.shop-bd .bd-win-a { left: 19%; } .shop-bd .bd-win-b { left: 66.5%; }
.shop-bd .bd-sea { top: -6%; width: 18%; height: 30%; background: radial-gradient(closest-side, rgba(90,200,210,.30), rgba(255,170,90,.10) 60%, transparent);
  mix-blend-mode: screen; }
.shop-bd .bd-sea-a { left: calc(19% - 6%); } .shop-bd .bd-sea-b { left: calc(66.5% - 6%); }

/* hanging lanterns (Classic hanging lantern doodads) + their light pools */
.shop-bd .bd-lantern { top: 0; height: 12vh; width: auto; transform: translateX(-50%); transform-origin: 50% 0;
  filter: brightness(.95) saturate(1.05) drop-shadow(0 0 8px rgba(255,180,80,.55)); animation: bd-sway 7s ease-in-out infinite; }
.shop-bd .bd-l1 { left: 12%; } .shop-bd .bd-l2 { left: 33%; height: 10.5vh; animation-delay: -2s; }
.shop-bd .bd-l3 { left: 62.5%; height: 10.5vh; animation-delay: -4.5s; } .shop-bd .bd-l4 { left: 77.5%; animation-delay: -1.2s; }
.shop-bd .bd-glow { top: -10%; width: 26%; height: 50%; transform: translateX(-50%); mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(255,190,100,.42), rgba(255,150,60,.16) 45%, transparent); animation: bd-flicker 3.1s steps(1) infinite; }
.shop-bd .bd-gl1 { left: 12%; } .shop-bd .bd-gl2 { left: 33%; animation-duration: 3.7s; animation-delay: -1s; }
.shop-bd .bd-gl3 { left: 62.5%; animation-duration: 2.9s; animation-delay: -.4s; } .shop-bd .bd-gl4 { left: 77.5%; animation-duration: 4.2s; animation-delay: -2.2s; }

/* Booty Bay trophy shark hangs in the gap between the backpack and the shelves */
.shop-bd .bd-shark { left: 50.6%; top: 6%; height: 35vh; width: auto; transform: translateX(-50%) rotate(2deg); transform-origin: 50% 0;
  filter: brightness(.5) saturate(.85) drop-shadow(0 10px 10px rgba(0,0,0,.75)); animation: bd-sway 11s ease-in-out infinite; }
/* left wall: fish rack + crossed harpoons; floor corner: crates */
.shop-bd .bd-fishrack { left: .2%; top: 34%; height: 25vh; width: auto; }
.shop-bd .bd-harpoon { left: -1%; top: 22%; width: 17vh; }
.shop-bd .bd-h1 { transform: rotate(-24deg); } .shop-bd .bd-h2 { transform: rotate(24deg) translateY(2vh); }
.shop-bd .bd-crate { left: .4%; bottom: 4%; height: 19vh; width: auto; }
.shop-bd .bd-crate2 { left: 3%; bottom: calc(4% + 16.5vh); height: 12vh; width: auto; transform: rotate(-3deg); }
/* right: a goblin gear turning behind the Vendor sign, machinery and kegs on the floor around the goblin */
.shop-bd .bd-gear { right: -3.5%; top: -5%; height: 22vh; width: auto; filter: brightness(.45) saturate(.8); animation: bd-spin 80s linear infinite; }
.shop-bd .bd-machinery { right: .3%; bottom: 3%; height: 10vh; width: auto; }
.shop-bd .bd-barrel { left: 77.6%; bottom: 3.5%; height: 12.5vh; width: auto; transform: translateX(-50%); }
.shop-bd .bd-keg { left: 81.5%; bottom: 3%; height: 7vh; width: auto; }

/* keep the play areas calm: darker behind the backpack, the shelves and the floor line */
.shop-bd .bd-shade { inset: 0; background:
  radial-gradient(ellipse 27% 34% at 27% 42%, rgba(5,3,2,.62), rgba(5,3,2,.25) 70%, transparent),
  radial-gradient(ellipse 27% 32% at 75% 42%, rgba(5,3,2,.55), rgba(5,3,2,.2) 70%, transparent),
  linear-gradient(180deg, transparent 72%, rgba(0,0,0,.35)); }

/* dust drifting up through the lantern light */
.shop-bd .bd-dust { inset: 0; mix-blend-mode: screen; }
.shop-bd .bd-dust i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: rgba(255,228,170,.85);
  box-shadow: 0 0 4px rgba(255,200,120,.7); opacity: 0; animation: bd-mote var(--d) linear var(--dl) infinite; }

@keyframes bd-mote { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: .65; } 80% { opacity: .45; } 100% { transform: translate(var(--dx), -11vh); opacity: 0; } }
@keyframes bd-flicker { 0% { opacity: .9; } 9% { opacity: .74; } 14% { opacity: .95; } 31% { opacity: .82; } 44% { opacity: 1; } 58% { opacity: .78; } 66% { opacity: .9; } 81% { opacity: .7; } 88% { opacity: .92; } }
@keyframes bd-sway { 50% { rotate: 1.6deg; } }
@keyframes bd-spin { to { rotate: 360deg; } }

@media (max-width: 900px) {
  /* stacked mobile shop: textured wall + beam + lanterns + light only; floor and edge props would land mid-column */
  .shop-bd .bd-rail, .shop-bd .bd-floor, .shop-bd .bd-shade, .shop-bd .bd-sea,
  .shop-bd .bd-p:not(.bd-lantern) { display: none; }
  .shop-bd .bd-beam { height: 54px; }
  .shop-bd .bd-lantern { height: 70px; } .shop-bd .bd-glow { top: -60px; height: 260px; }
  .shop-bd .bd-l2, .shop-bd .bd-l3, .shop-bd .bd-gl2, .shop-bd .bd-gl3 { display: none; }
  .shop-bd .bd-wall { background-size: auto 300px; }
}
@media (prefers-reduced-motion: reduce) {
  .shop-bd *, .shop-bd .bd-dust i { animation: none !important; }
  .shop-bd .bd-dust { display: none; }
}

/* css/storage-bin.css */
/* Storage bin (js/ui/storageBin.js): the crate is a physical container. Stored items are absolutely placed bodies
   driven by transform (translate + tumble rotate + spawn scale); they fall in over the rim, pile up and rest.
   No flex flow, no scroll: a stuffed crate gets denser (smaller bin cell) and the pile can rise over the rim. */
.storage.crate { display: block; overflow: visible; z-index: 6; }
.storage.crate .bin-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.storage.crate .bin-layer .piece { position: absolute; left: 0; top: 0; margin: 0; transform-origin: 50% 50%;
  animation: none !important; transition: none; will-change: transform; filter: drop-shadow(0 4px 3px rgba(0,0,0,.6)); }
.storage.crate .bin-layer .piece .cell { pointer-events: auto; cursor: grab; }
.storage.crate .crate-label, .storage.crate .crate-hint { z-index: 1; }
/* the STORAGE stamp is a small plaque on the crate's top rim, under the bin layer: a pile rising over the rim covers it,
   it never covers an item. The overflow hint sits just below it inside the crate. */
.storage.crate .crate-label { top: -9px; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); padding: 1px 10px 2px;
  font-size: 11px; letter-spacing: .2em; line-height: 14px; color: rgba(240,210,150,.8); border-radius: 2px;
  background: linear-gradient(#5a381c, #3e2610); box-shadow: inset 0 0 0 1px rgba(0,0,0,.7), 0 1px 2px rgba(0,0,0,.6); }
.storage.crate .crate-hint { top: 10px; }
.storage.crate .crate-hint[hidden] { display: none; }

/* a buy you cannot afford springs back to the shelf; its price tag shakes (no toast) */
.tag.shake { animation: tag-shake .38s cubic-bezier(.36,.07,.19,.97); }
@keyframes tag-shake {
  15%, 85% { transform: translateX(-2px); } 30%, 70% { transform: translateX(4px) rotate(2deg); }
  45%, 55% { transform: translateX(-5px) rotate(-2deg); }
}
@media (prefers-reduced-motion: reduce) { .tag.shake { animation: none; outline: 2px solid #c0281c; } }

/* css/recipes.css */
/* Recipes book overlay (js/ui/recipeBook.js) + the shop button that opens it */
.scene .sign.recipes-btn { border: 0; cursor: pointer; display: inline-block; transition: transform .12s; }
.scene .sign.recipes-btn:hover { transform: scale(1.06) rotate(-1deg); }
@media (max-width: 900px) { .scene .sign.recipes-btn { display: inline-block; font-size: 16px; padding: 4px 16px; } }

.rb-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(8, 4, 0, .78); display: flex; align-items: center; justify-content: center; padding: 18px; }
.rb-book { position: relative; width: min(1180px, 100%); height: min(780px, 100%); display: flex; flex-direction: column; border-radius: 10px; color: #3a2410;
  background: radial-gradient(ellipse at 50% 45%, #ecd6a4 0%, #dcc08a 55%, #b8935a 88%, #7a5628 100%);
  box-shadow: inset 0 0 0 3px #5a3b17, inset 0 0 0 5px #e9d29c, inset 0 0 90px rgba(70, 40, 10, .55), 0 10px 40px #000; }
.rb-head { display: flex; align-items: center; justify-content: center; gap: 16px; padding: 14px 56px 6px; position: relative; flex: none; }
.rb-head h2 { font-family: var(--font-head); font-size: 40px; color: #4a2c0e; text-shadow: 0 1px 0 #f6e6c4; margin: 0; }
.rb-count { font-family: var(--font-head); font-size: 22px; color: #6a4a1c; background: rgba(90, 59, 23, .15); padding: 2px 14px; border-radius: 12px; }
.rb-close { position: absolute; right: 14px; top: 12px; width: 38px; height: 38px; border-radius: 50%; border: 2px solid #5a3b17; background: linear-gradient(#e8d2a8, #c9ad7a);
  color: #3a2410; font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 2px 0 #000; }
.rb-close:hover { background: #f0dca8; }
.rb-body { flex: 1; min-height: 0; display: flex; gap: 14px; padding: 6px 22px 22px; }
.rb-page { flex: 1; min-width: 0; overflow-y: auto; padding: 4px 10px 10px 4px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px 26px; }
.rb-group { flex: 0 1 auto; }
.rb-group h3 { font-family: var(--font-head); color: #5a3b17; font-size: 19px; text-shadow: none; margin: 4px 0 4px; border-bottom: 2px solid rgba(90, 59, 23, .35); letter-spacing: .03em; }
.rb-shelf { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 4px 8px; border-bottom: 5px solid #6b4620; border-radius: 0 0 3px 3px; background: linear-gradient(transparent 80%, rgba(60, 35, 10, .25)); max-width: 560px; }
.rb-result { width: 84px; height: 84px; padding: 0; border: 3px solid #4a3010; border-radius: 6px; background: #2a1a0c; cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, .5); overflow: hidden; }
.rb-result img { width: 100%; height: 100%; display: block; }
.rb-result:hover, .rb-result:focus-visible { outline: 3px solid #fff3d0; transform: translateY(-2px); }
.rb-result.r-uncommon { border-color: #1eff00; } .rb-result.r-rare { border-color: #0070dd; }
.rb-result.r-epic { border-color: #a335ee; } .rb-result.r-legendary { border-color: #ff8000; }
.rb-result.unknown { border-color: #6b4620; background: #a98450; }
.rb-result.unknown img { filter: grayscale(1) brightness(.3) contrast(1.8); opacity: .75; }
.rb-side { flex: 0 0 290px; padding: 12px; border-radius: 8px; background: rgba(90, 59, 23, .14); box-shadow: inset 0 0 0 2px rgba(90, 59, 23, .45); overflow-y: auto; }
.rb-side-head { font-family: var(--font-head); font-size: 22px; margin-bottom: 10px; text-align: center; text-shadow: 0 1px 0 #000; }
.rb-recipe { display: flex; align-items: flex-start; justify-content: center; gap: 8px; padding: 8px 0; border-top: 1px dashed rgba(90, 59, 23, .4); }
.rb-ing { display: flex; flex-direction: column; align-items: center; width: 100px; text-align: center; font-size: 13px; gap: 4px; }
.rb-ing img { width: 56px; height: 56px; border: 2px solid #4a3010; border-radius: 5px; background: #2a1a0c; }
.rb-ing span { text-shadow: 0 1px 1px #000; }
.rb-plus { font-family: var(--font-head); font-size: 30px; line-height: 56px; color: #4a2c0e; }
.rb-hint { font-size: 13px; color: #5a3b17; margin: 10px 0 0; }
@media (max-width: 760px) {
  .rb-overlay { padding: 0; }
  .rb-book { border-radius: 0; height: 100%; }
  .rb-head { padding: 10px 52px 4px; } .rb-head h2 { font-size: 28px; } .rb-count { font-size: 16px; }
  .rb-body { flex-direction: column-reverse; padding: 4px 10px 12px; gap: 8px; }
  .rb-side { flex: 0 0 auto; max-height: 34%; }
  .rb-page { gap: 4px 14px; }
  .rb-result { width: 60px; height: 60px; }
}
.scene .top-right { display: flex; align-items: center; gap: 10px; }

/* craft feedback (js/ui/craftFeedback.js): pieces about to fuse glow; a fresh craft flashes; the book ticks crafted recipes */
.piece.craft-hint { animation: crafthint 1.6s ease-in-out infinite; z-index: 3; }
@keyframes crafthint { 0%, 100% { filter: drop-shadow(0 0 2px #ffcf40); } 50% { filter: drop-shadow(0 0 9px #ffe27a) brightness(1.18); } }
.piece.crafted-new { animation: craftednew 1.4s ease-out 2; z-index: 4; }
@keyframes craftednew { 0% { filter: brightness(2.6) drop-shadow(0 0 16px #fff3b0); transform: scale(1.18); } 60% { filter: brightness(1.3) drop-shadow(0 0 10px #ffd24a); transform: scale(1); } 100% { filter: none; transform: none; } }
.combat-log .ll.craft { color: #ffd24a; }
.rb-result { position: relative; }
.rb-result.crafted::after { content: "\2713"; position: absolute; right: -4px; top: -6px; width: 22px; height: 22px; border-radius: 50%; background: #2c7a2c; color: #fff; font-size: 15px; line-height: 22px; text-align: center; box-shadow: 0 1px 0 #000; }

/* shoploop: 'You have n/m' and the Craftable soon count */
.rb-have { align-self: center; font-size: 12px; color: #6a4a1c; margin-left: 6px; } .rb-have.full { color: #2f7a1f; font-weight: bold; }
.recipes-btn .soon-count { margin-left: 6px; padding: 0 6px; border-radius: 9px; font-size: 12px; color: #2a1a0c; background: #ffd100; }

/* css/codex.css */
/* Combo Codex (js/ui/recipeBook.js + js/ui/codex/*). Layers on css/recipes.css; class names rb-* kept for e2e. */
.rb-codex { --rb-ink: #3a2410; }
.rb-head { flex-wrap: wrap; row-gap: 2px; }
.rb-discovered { font-size: 15px; color: #6a4a1c; }
.rb-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 2px 22px 6px; flex: none; }
.rb-tools select, .rb-tools button { font: inherit; font-size: 14px; color: var(--rb-ink); background: linear-gradient(#ead6ac, #cfb585); border: 2px solid #5a3b17; border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.rb-tools .rb-near-toggle.on { background: #ffd100; }
.rb-chain-select { display: none; }

.rb-body { min-width: 0; }
.rb-rail { flex: 0 0 196px; overflow-y: auto; padding: 4px 6px 10px 0; }
.rb-rail-group h4 { margin: 10px 0 3px; font-family: var(--font-head); font-size: 15px; color: #6a4a1c; letter-spacing: .04em; text-transform: uppercase; }
.rb-rail-item { display: flex; width: 100%; justify-content: space-between; align-items: baseline; gap: 6px; text-align: left; font: inherit; font-size: 14px; color: var(--rb-ink);
  background: transparent; border: 0; border-left: 3px solid transparent; border-radius: 3px; padding: 4px 6px; cursor: pointer; }
.rb-rail-item small { font-size: 12px; color: #7a5a2c; white-space: nowrap; }
.rb-rail-item:hover { background: rgba(90, 59, 23, .14); }
.rb-rail-item.on { background: rgba(90, 59, 23, .26); border-left-color: #5a3b17; font-weight: bold; }
.rb-group h3 small, .rb-chain-title small { font-size: 13px; color: #7a5a2c; font-family: inherit; }

/* tree mode: the page becomes a single scroll box */
.rb-page.rb-treemode { display: block; overflow: auto; }
.rb-chain-title { margin: 0 0 6px; font-family: var(--font-head); font-size: 24px; color: #4a2c0e; }
.rb-tree { position: relative; }
.rb-canvas { position: relative; }
.rb-edges { position: absolute; inset: 0; pointer-events: none; }
.rb-edge { stroke: #7a5a2c; stroke-width: 3; opacity: .55; transition: opacity .15s; }
.rb-edge.known { opacity: 1; }
.rb-edge.er-uncommon { stroke: #1a9c00; } .rb-edge.er-rare { stroke: #0b5fb8; } .rb-edge.er-epic { stroke: #8a2bd0; } .rb-edge.er-legendary { stroke: #d96a00; }
.rb-edge.catalyst { stroke-dasharray: 7 5; }
.rb-glyph { fill: #3a2410; stroke: #f0dca8; stroke-width: 1; }
.rb-edge.rb-near { stroke-width: 5; opacity: 1; }
.rb-edge.rb-dim, .rb-glyph.rb-dim { opacity: .18; }
.rb-edge.rb-faded, .rb-glyph.rb-faded { opacity: .12; }

.rb-node { position: absolute; width: 112px; margin-left: -30px; padding: 0 0 0 30px; box-sizing: border-box; display: flex; flex-direction: column; align-items: flex-start; font: inherit; background: none; border: 0; text-align: left; color: var(--rb-ink); cursor: pointer; transition: opacity .15s; }
.rb-node.rb-faded { opacity: .22; }
.rb-ico { display: block; width: 52px; height: 52px; border: 3px solid #4a3010; border-radius: 7px; background: #2a1a0c; overflow: hidden; margin-left: -0px; }
.rb-ico img { width: 100%; height: 100%; display: block; }
.rb-node.r-uncommon .rb-ico { border-color: #1eff00; } .rb-node.r-rare .rb-ico { border-color: #0070dd; }
.rb-node.r-epic .rb-ico { border-color: #a335ee; } .rb-node.r-legendary .rb-ico { border-color: #ff8000; }
.rb-name, .rb-riddle { display: block; width: 104px; margin-left: -28px; font-size: 11px; line-height: 1.15; text-shadow: 0 1px 0 #000; overflow: hidden; max-height: 26px; }
.rb-name { text-align: center; } .rb-riddle { text-align: center; font-style: italic; color: #5a3b17; text-shadow: none; }
.rb-node.st-silhouette .rb-ico img { filter: brightness(0); }
.rb-node.st-seen .rb-ico img { opacity: .85; }
.rb-node:hover .rb-ico, .rb-node:focus-visible .rb-ico { outline: 3px solid #fff3d0; }
.rb-wild { width: 112px; margin-left: -30px; padding-left: 30px; cursor: default; }
.rb-chip { display: inline-block; margin-top: 14px; padding: 4px 10px; border-radius: 12px; border: 2px dashed #5a3b17; background: rgba(90, 59, 23, .16); font-size: 12px; white-space: nowrap; }

/* results grid + side pane additions */
.rb-result.rb-dim, .rb-recipe.rb-dim { opacity: .3; }
.rb-result.rb-near { outline: 3px solid #ffd100; }
.rb-ing-wild { justify-content: center; }
.rb-ing em { font-size: 11px; color: #6a4a1c; }
.rb-side-head { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rb-side-head small { font-size: 12px; color: #5a3b17; text-shadow: none; text-transform: capitalize; }
.rb-side-head small.rb-riddle-line { font-style: italic; text-transform: none; }
.rb-card-ico { width: 60px; height: 60px; border: 3px solid #4a3010; border-radius: 7px; background: #2a1a0c; overflow: hidden; }
.rb-card-ico img { width: 100%; height: 100%; display: block; }
.rb-card-ico.r-uncommon { border-color: #1eff00; } .rb-card-ico.r-rare { border-color: #0070dd; } .rb-card-ico.r-epic { border-color: #a335ee; } .rb-card-ico.r-legendary { border-color: #ff8000; }
.rb-side h4 { margin: 10px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #6a4a1c; }
.rb-recipe { flex-wrap: wrap; }
.rb-share-box { width: 100%; box-sizing: border-box; font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.rb-calm *, .rb-calm *::before { transition: none !important; animation: none !important; }

@media (max-width: 900px) {
  .rb-overlay { padding: 0; overflow-x: hidden; }
  .rb-book { border-radius: 0; height: 100%; max-width: 100vw; }
  .rb-head { padding: 10px 52px 4px 16px; justify-content: flex-start; }
  .rb-head h2 { font-size: 26px; }
  .rb-tools { padding: 2px 16px 6px; }
  .rb-chain-select { display: inline-block; max-width: 100%; }
  .rb-rail { display: none; }
  .rb-body { flex-direction: column; padding: 4px 16px 12px; gap: 8px; min-height: 0; overflow-y: auto; }
  .rb-page { flex: 0 0 auto; min-height: 220px; max-width: 100%; overflow-x: auto; }
  .rb-page.rb-treemode { max-width: 100%; }
  .rb-side { flex: 0 0 auto; max-height: none; }
}

/* css/sell-chest.css */
/* Sell chest: closed / hover (lid ajar) / open (item dragged over). Module: js/ui/sellChest.js */
.sellchest { perspective: 420px; overflow: visible; }
.sellchest .sc-body { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 65%; }
.sellchest .sc-lid { position: absolute; left: 0; right: 0; bottom: 59%; height: 40%; transform-origin: 50% 100%;
  transition: transform .26s cubic-bezier(.3,1.5,.5,1); will-change: transform; }
.sellchest .sc-lid-svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); }
.sellchest.sc-hover .sc-lid { transform: rotateX(-50deg) translateY(-6px); }
.sellchest.sc-open .sc-lid { transform: rotateX(-66deg) translateY(-14px); }
.sellchest.sc-closed .sc-lid { transition: transform .12s cubic-bezier(.6,0,.9,.4); }
.sc-glow { position: absolute; left: 8%; right: 8%; bottom: 55%; height: 44%; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 70%, #fff3b0 0%, #ffcf4a 30%, rgba(255,170,30,.45) 58%, rgba(255,150,20,0) 78%);
  transition: opacity .22s; filter: blur(1px); }
.sc-rays { position: absolute; left: 4%; right: 4%; bottom: 56%; height: 85%; opacity: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at 50% 100%, rgba(255,214,90,.75), rgba(255,190,60,.25) 50%, rgba(255,180,40,0) 72%);
  clip-path: polygon(30% 100%, 0 0, 100% 0, 70% 100%); transition: opacity .25s, transform .25s; transform: scaleY(.6); transform-origin: 50% 100%; }
.sellchest.sc-hover .sc-glow { opacity: .55; }
.sellchest.sc-open .sc-glow { opacity: 1; animation: sc-pulse 1s ease-in-out infinite; }
.sellchest.sc-open .sc-rays { opacity: 1; transform: scaleY(1); }
.sellchest.sc-open { filter: drop-shadow(0 0 14px rgba(255,200,70,.8)); }
@keyframes sc-pulse { 50% { opacity: .78; } }
.sellchest.drop-hot { transform: none; }
.sc-tag { position: absolute; left: 50%; top: -6px; transform: translate(-50%, 10px); opacity: 0; white-space: nowrap; pointer-events: none; z-index: 3;
  font-family: var(--font-head); font-size: 14px; color: #ffe9a8; padding: 2px 10px; border-radius: 10px;
  background: rgba(20,12,4,.88); border: 1px solid #c9a24a; text-shadow: 0 1px 0 #000;
  transition: opacity .18s, transform .22s cubic-bezier(.3,1.4,.5,1); }
.sellchest.sc-hover .sc-tag, .sellchest.sc-open .sc-tag { opacity: 1; transform: translate(-50%, 0); }
.sellchest.sc-open .sc-tag { color: #fff3b0; border-color: #ffd34a; box-shadow: 0 0 10px rgba(255,200,70,.7); }

/* v2: unmistakable open state - dome lid folds away, inner face of the lid stands up behind, gold-lit interior with coins */
.sc-lid-open { position: absolute; left: 0; right: 0; bottom: 60%; height: 36%; transform-origin: 50% 100%; transform: scaleY(0); opacity: 0;
  transition: transform .22s cubic-bezier(.3,1.5,.5,1), opacity .12s; pointer-events: none; }
.sc-lid-open-svg, .sc-inside-svg { width: 100%; height: 100%; display: block; }
.sc-inside { position: absolute; left: 6%; right: 6%; bottom: 55%; height: 17%; opacity: 0; transition: opacity .15s; pointer-events: none; }
.sellchest.sc-open .sc-lid-open { transform: scaleY(1); opacity: 1; }
.sellchest.sc-open .sc-lid { transform: scaleY(.04) translateY(10px); opacity: 0; transition: transform .2s, opacity .12s; }
.sellchest.sc-open .sc-inside { opacity: 1; }
.sellchest.sc-hover .sc-lid { transform: rotateX(-32deg) translateY(-5px); }
.sellchest.sc-hover .sc-inside { opacity: .9; clip-path: inset(70% 0 0 0); }
.sellchest.sc-hover .sc-glow { opacity: .8; }
.sc-tag { top: -30px; }
.sellchest.sc-slam .sc-lid { animation: sc-slam .22s ease-in; }
.sellchest.sc-slam { animation: sc-thud .22s ease-out; }
@keyframes sc-slam { from { transform: rotateX(-66deg) translateY(-14px); } to { transform: none; } }
@keyframes sc-thud { 60% { transform: translateY(2px) scaleY(.97); } }

/* v3: real Classic chest model (js/ui/model3d.js chestModel). SVG pieces are fallback only. */
.sellchest .m3d.chest3d { position: absolute; left: -6%; right: -6%; top: -34%; bottom: -4%; z-index: 1; pointer-events: none; }
.sellchest .m3d.chest3d:not(.live) { display: none; }
.sellchest:has(.m3d.chest3d.live) .sc-fb { display: none; }
.sellchest:has(.m3d.chest3d.live) { filter: none; }
.sellchest.sc-open:has(.m3d.chest3d.live) { filter: drop-shadow(0 0 12px rgba(255,200,70,.55)); }
.chest3d.live::before { display: none; }

/* no 2D SVG chest: show nothing until the 3D chest loads (drop zone, glow and tag stay) */
.sellchest .sc-fb { display: none !important; }
/* hit area = the whole visible 3D chest (its canvas is pointer-events:none and overhangs the box), so drops on the lid register */
.sellchest::before { content: ""; position: absolute; left: -6%; right: -6%; top: -34%; bottom: -4%; z-index: 0; }

/* interaction pass: the chest reads as a sell zone at rest (small plaque + faint idle glow), before any drag */
.sellchest.sc-closed .sc-tag { opacity: .78; transform: translate(-50%, 0); font-size: 12px; padding: 1px 9px; }
.sellchest.sc-closed .sc-glow { opacity: .22; animation: sc-idle 3.2s ease-in-out infinite; }
@keyframes sc-idle { 50% { opacity: .38; } }
@media (prefers-reduced-motion: reduce) { .sellchest.sc-closed .sc-glow { animation: none; } }

/* v4: the chest is 4x larger on desktop (css/shop-scene.css): tag, glow and shine scale with it. Mobile keeps the pinned size. */
@media (min-width: 901px) {
  .sellchest .sc-tag { top: -16%; font-size: 19px; padding: 3px 14px; border-radius: 12px; border-width: 2px; }
  .sellchest.sc-closed .sc-tag { font-size: 16px; padding: 2px 12px; }
  .sellchest .sc-glow { filter: blur(3px); }
  .sellchest.sc-open:has(.m3d.chest3d.live) { filter: drop-shadow(0 0 22px rgba(255,200,70,.55)); }
}
/* touch: sc-hover/sc-open are JS classes (drag-over), so no hover media needed; lighter filters on coarse pointers */
.sellchest:active { transform: scale(.97); }
@media (pointer: coarse) { .sellchest .sc-lid-svg { filter: drop-shadow(0 2px 0 rgba(0,0,0,.35)); } .sellchest.sc-open { filter: drop-shadow(0 0 8px rgba(255,200,70,.7)); } }

/* css/shop-wow.css */
/* Shop skin v2: real WoW UI art (assets/ui from wowgoldfarms/assets/ui + coins). Overrides shop-scene.css; module: shop screen only. */
:root { --wow-gold: #ffd100; --wow-trim: #8a6a2c; }

/* money: white digits + real gold coin, Friz Quadrata like the in-game money frame */
.scene .coin, .tag .coin { width: 15px; height: 15px; border-radius: 0; background: url(../assets/ui/gold-hd.png) center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 1px 1px rgba(0,0,0,.8)); }
.tag .coin { width: 17px; height: 17px; }

/* price plate: the Auction House dark-metal plate instead of the yellow tent */
.tag { padding: 5px 13px 5px 15px; min-width: 54px; justify-content: center; font-family: var(--font-body); font-size: 17px; font-weight: bold; color: #fff;
  background: url(../assets/ui/auctionhouse-nav-button.png) center / 100% 100% no-repeat; filter: drop-shadow(0 3px 3px rgba(0,0,0,.65)); transition: transform .14s, filter .14s; }
.tag::before, .tag::after { content: none; }
.tag b { -webkit-text-stroke: 0; paint-order: normal; text-shadow: 0 1px 1px #000, 0 0 3px #000; letter-spacing: .02em; }
.tag:disabled { filter: drop-shadow(0 3px 3px rgba(0,0,0,.65)) saturate(.3) brightness(.7); }
.tag:disabled b { color: #c0392b; }
.tag.empty { opacity: .45; }

/* shelf plank: real dark-wood board tile */
.shelf::after { height: 19px; border-radius: 1px; background: url(../assets/ui/wood-edge-top.png) repeat-x left top / auto 100%;
  box-shadow: 0 1px 0 #000, 0 9px 10px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,225,170,.28); }
.shelf::before { background: linear-gradient(90deg, #1c1108 0 10px, transparent 10px calc(100% - 10px), #1c1108 calc(100% - 10px)); }

/* wooden signs: dark wood + gold lettering + thin gold trim */
.scene .sign { color: #f2d089; font-size: 19px; padding: 6px 22px; border-radius: 3px; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0,0,0,.7);
  background: url(../assets/ui/wood-edge-top.png) left top / auto 100% repeat;
  box-shadow: inset 0 0 0 1px #000, inset 0 0 0 2px var(--wow-trim), inset 0 0 12px rgba(0,0,0,.55), 0 4px 8px rgba(0,0,0,.65); }
button.sign { cursor: pointer; border: 0; }

/* parchment cards: the quest-log paper with an aged edge and a wood frame */
/* 11-11: the frame was a 24px ring floating ~20px off the parchment (parchment only reached 4px into it) and it starved the rows ("Weapon DPS2.5"). Thinner frame, parchment runs under it. */
.stats-card { width: 206px; padding: 8px 10px; border: 14px solid transparent; border-image: url(../assets/ui/frame-wood.png) 64 / 14px stretch; border-radius: 0; background: none; box-shadow: none; position: relative; }
.stats-card::before { content: ""; position: absolute; inset: -11px; z-index: -1; background: url(../assets/ui/questbg-parchment.png) center / 100% 100%;
  box-shadow: inset 0 0 22px rgba(90,50,10,.55), 0 6px 12px rgba(0,0,0,.6); }
.reroll-tag { border-radius: 2px; color: #3a2410; background: url(../assets/ui/questbg-parchment.png) center / 100% 100%;
  box-shadow: inset 0 0 12px rgba(100,60,15,.55), 0 0 0 1px #3a2410, 0 4px 8px rgba(0,0,0,.65); }
.reroll-tag::before { background: #b08a3a; width: 1px; box-shadow: 1px 0 0 rgba(0,0,0,.5); }
.reroll-tag .coin { width: 15px; height: 15px; }
.reroll-tag b { font-family: var(--font-body); font-size: 16px; }
.reroll-tag b { color: #2a1608; }

/* FIGHT button: WoW 128-redbutton art pre-composited and pre-scaled to exact 1:1 (88x64, 28px caps) so border-image never resamples the bevel */
.scene .fight-sign { position: relative; box-sizing: border-box; height: 64px; min-height: 64px; padding: 0 14px; border-style: solid; border-width: 0 28px; border-color: transparent; border-radius: 0; box-shadow: none; gap: 2px; justify-content: center; background: none;
  border-image: url(../assets/ui/fightbtn-n.png) 0 28 fill / 0 28px / 0 stretch;
  color: #ffd100; font-size: 28px; line-height: 1; letter-spacing: .02em; text-shadow: 0 2px 0 #000, 0 0 3px #000, 0 0 12px rgba(255,60,20,.55);
  filter: drop-shadow(0 4px 3px rgba(0,0,0,.7)); transition: filter .15s, transform .08s; transform: none; animation: fight-pulse 3.2s ease-in-out infinite; }
.scene .fight-sign::after { content: ""; position: absolute; inset: 0 -20px; background: url(../assets/ui/128-redbutton-highlight.png) center / 100% 100% no-repeat; opacity: 0; pointer-events: none; transition: opacity .15s; mix-blend-mode: screen; }
.scene .fight-sign small { font-family: var(--font-body); font-size: 11px; letter-spacing: .18em; color: #e8c872; text-shadow: 0 1px 0 #000, 0 -1px 0 rgba(255,235,170,.25); }
.scene .fight-sign:active { transform: translateY(2px); filter: brightness(.88) drop-shadow(0 2px 2px rgba(0,0,0,.7)); border-image-source: url(../assets/ui/fightbtn-p.png); }
.scene .fight-sign:focus-visible { outline: 2px solid #ffd100; outline-offset: 3px; }
.scene .fight-sign:disabled { cursor: default; animation: none; filter: grayscale(.4) brightness(.8); color: #9a8a60; border-image-source: url(../assets/ui/fightbtn-d.png); }
@keyframes fight-pulse { 0%,100% { filter: drop-shadow(0 4px 3px rgba(0,0,0,.7)); } 50% { filter: drop-shadow(0 0 8px rgba(255,190,60,.5)) drop-shadow(0 4px 3px rgba(0,0,0,.7)); } }
@media (prefers-reduced-motion: reduce) { .scene .fight-sign { animation: none; transition: none; } }
@media (max-width: 640px) { .scene .fight-sign { font-size: 24px; } }

/* shoploop: hover-only rules gated to real hover devices; touch gets :active */
@media (hover: hover) {
  .tag:hover:not(:disabled) { transform: translateY(-1px); filter: drop-shadow(0 4px 4px rgba(0,0,0,.7)) brightness(1.25); }
  button.sign:hover { filter: brightness(1.25); }
  .scene .fight-sign:hover { transform: none; filter: brightness(1.18) drop-shadow(0 0 9px rgba(255,200,70,.55)) drop-shadow(0 4px 3px rgba(0,0,0,.7)); animation: none; }
  .scene .fight-sign:hover::after { opacity: .6; }
}
.tag:active:not(:disabled), .reroll-tag:active:not(:disabled), button.sign:active, .ware-art:active { transform: scale(.96); filter: brightness(1.15); }

/* css/settings.css */
/* Settings gear (fixed top-right, every screen) + Interface-Options-style sound panel. */
#app { padding-top: 46px; }
@media (min-width: 1300px) { #app { padding-top: 12px; } }   /* wide screens: the gear sits in the side gutter */
.set-gear { position: fixed; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); z-index: 900; width: 36px; height: 36px; padding: 0; display: grid; place-items: center;
  font-size: 24px; line-height: 1; color: #3a2410; border: 0; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #f2e0b6, #cdb282 70%); box-shadow: inset 0 0 0 2px #8a6d3b, 0 3px 7px rgba(0,0,0,.65); transition: transform .25s, filter .15s; }
@media (hover: hover) { .set-gear:hover { filter: brightness(1.12); transform: rotate(40deg); } }
.set-gear:active { transform: scale(.94); }
.set-gear.muted::after { content: "\1F507"; position: absolute; right: -4px; bottom: -4px; font-size: 14px; line-height: 1; text-shadow: 0 1px 2px #000; }
.set-gear.open { box-shadow: inset 0 0 0 2px var(--gold), 0 3px 7px rgba(0,0,0,.65); transform: rotate(90deg); }
.set-gear:focus-visible, .set-panel button:focus-visible, .set-panel input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.set-veil { position: fixed; inset: 0; z-index: 950; display: flex; align-items: flex-start; justify-content: flex-end; padding: calc(52px + env(safe-area-inset-top)) 12px 12px; background: rgba(0,0,0,.45); }
.set-veil[hidden] { display: none; }
.set-panel { width: min(380px, 100%); border-radius: 8px; padding: 0 0 14px; color: var(--text);
  background: linear-gradient(180deg, #221a10, #120e08 80%); border: 2px solid var(--edge-hi);
  box-shadow: inset 0 0 0 1px #000, inset 0 1px 0 rgba(255,220,150,.12), 0 12px 32px rgba(0,0,0,.8); }
.set-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--edge);
  background: linear-gradient(#3a2a16, #241a0e); border-radius: 6px 6px 0 0; }
.set-head h2 { font-size: 20px; }
.set-x { width: 30px; height: 30px; padding: 0; font-size: 22px; line-height: 1; color: var(--gold); background: linear-gradient(#8b1a10, #5a0f08);
  border: 1px solid #c9a24a; border-radius: 4px; box-shadow: 0 2px 0 #000; }
@media (hover: hover) { .set-x:hover { filter: brightness(1.25); } }
.set-body { padding: 12px 16px 0; display: grid; gap: 14px; }
.set-row { display: grid; grid-template-columns: 1fr 34px 58px; grid-template-areas: "l l o" "r r t"; gap: 4px 8px; align-items: center; }
.set-row label { grid-area: l; font-size: 15px; }
.set-row.master label { color: var(--gold); font-family: var(--font-head); font-size: 17px; }
.set-row output { grid-area: o; text-align: right; color: var(--gold); font-variant-numeric: tabular-nums; }
.set-row input[type=range] { grid-area: r; width: 100%; margin: 0; height: 22px; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; --fill: 50%; }
.set-row input[type=range]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; border: 1px solid #000;
  background: linear-gradient(90deg, #c9a24a var(--fill), #3a2e1e var(--fill)); box-shadow: inset 0 1px 2px rgba(0,0,0,.7); }
.set-row input[type=range]::-moz-range-track { height: 8px; border-radius: 4px; border: 1px solid #000; background: #3a2e1e; }
.set-row input[type=range]::-moz-range-progress { height: 8px; border-radius: 4px; background: #c9a24a; }
.set-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 22px; margin-top: -8px; border-radius: 3px; border: 1px solid #000;
  background: linear-gradient(#f2e0b6, #b8975a); box-shadow: 0 1px 3px rgba(0,0,0,.7); }
.set-row input[type=range]::-moz-range-thumb { width: 16px; height: 20px; border-radius: 3px; border: 1px solid #000; background: linear-gradient(#f2e0b6, #b8975a); }
.set-test { grid-area: t; min-height: 28px; padding: 2px 8px; font-size: 13px; color: var(--text); background: var(--panel-2); border: 1px solid var(--edge); border-radius: 4px; }
@media (hover: hover) { .set-test:hover { border-color: var(--gold); color: var(--gold); } }
.set-test-gap { grid-area: t; }
.set-mute { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--edge); cursor: pointer; }
.set-mute input { width: 18px; height: 18px; accent-color: #c9a24a; }
.set-veil.is-muted .set-row input[type=range], .set-veil.is-muted .set-row output { opacity: .45; }
@media (max-width: 480px) { .set-veil { padding: 52px 8px 8px; justify-content: center; } }
.set-row.set-sel { grid-template-columns: 1fr auto; grid-template-areas: "l s"; }
.set-row.set-sel label { grid-area: l; } .set-row.set-sel select { grid-area: s; min-height: 32px; }
.set-row.set-chk { display: flex; }
.set-row.set-chk label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.set-row.set-chk input { width: 18px; height: 18px; accent-color: #c9a24a; }
@media (pointer: coarse) {
  .set-gear { width: 44px; height: 44px; }
  .set-x { width: 44px; height: 44px; }
  .set-test { min-height: 40px; }
  .set-row.set-sel select { min-height: 40px; }
  .set-veil { padding-top: calc(60px + env(safe-area-inset-top)); }
}

/* css/lane-drag.css */
/* lane-drag.css: owned by the drag lane. Placement-feel visuals: preview scale-in, rotate pulse, bag ghost contents,
   refusal label + bin head-shake, touch rotate button. JS skips the preview classes under reduced motion; the media query covers the OS flag. */
@keyframes pvIn { from { transform: scale(.55); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@keyframes pvPulse { 0% { transform: scale(1); } 40% { transform: scale(1.18); filter: brightness(1.5); } 100% { transform: scale(1); } }
.preview.pv-in { animation: pvIn 90ms ease-out; }
.preview.pv-pulse { animation: pvPulse 160ms ease-out; }

/* a loaded bag's ghost: contents ride on top at their relative cells */
.piece.dragging.has-contents .ghost-part { position: absolute; pointer-events: none; z-index: 4; opacity: 1; filter: none; }

@keyframes binShake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px) rotate(-.6deg); } 45% { transform: translateX(6px) rotate(.6deg); } 70% { transform: translateX(-3px); } }
[data-zone="storage"].bin-shake { animation: binShake 380ms ease-in-out; }

@keyframes dragLabelUp { from { transform: translate(-50%, 0); opacity: 0; } 15% { opacity: 1; } to { transform: translate(-50%, -26px); opacity: 0; } }
.drag-label { position: fixed; z-index: 900; pointer-events: none; transform: translate(-50%, 0); padding: 4px 10px; border-radius: 999px;
  background: rgba(24, 14, 8, .92); color: #ffd9a8; border: 1px solid #a8532e; font: 700 13px/1.2 system-ui, sans-serif; white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .55); animation: dragLabelUp 1000ms ease-out forwards; }

/* touch: persistent rotate button while an item is held (a second-finger tap on it rotates) */
.drag-rotate-btn { position: fixed; z-index: 900; right: max(16px, env(safe-area-inset-right)); bottom: max(96px, calc(env(safe-area-inset-bottom) + 80px));
  width: 64px; height: 64px; border-radius: 50%; border: 2px solid #c9a24a; background: rgba(32, 20, 10, .92); color: #ffe7b0;
  font-size: 32px; line-height: 1; display: grid; place-items: center; padding: 0; touch-action: none; box-shadow: 0 6px 16px rgba(0, 0, 0, .65); }
.drag-rotate-btn:active { background: #5a3a14; transform: scale(.94); }

@media (prefers-reduced-motion: reduce) {
  .preview.pv-in, .preview.pv-pulse, [data-zone="storage"].bin-shake { animation: none; }
  .drag-label { animation: none; transform: translate(-50%, 0); }
}

/* ware ghost over a valid board spot: a price tag on the ghost (data-buy = "Buy · 4g" | "Need 4g") */
.piece.dragging[data-buy]::after { content: attr(data-buy); position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -4px);
  white-space: nowrap; font: bold 12px/1 var(--font-ui, system-ui, sans-serif); color: #fff8e6; background: rgba(28,16,6,.92);
  border: 1px solid #c9a24a; border-radius: 6px; padding: 4px 7px; pointer-events: none; z-index: 5; text-shadow: 0 1px 0 #000; box-shadow: 0 2px 6px rgba(0,0,0,.6); }
.piece.dragging.cant-afford[data-buy]::after { color: #ffb3a7; border-color: #a33; }
@media (pointer: coarse) { .piece.dragging[data-buy]::after { transform: translate(-50%, -10px); font-size: 13px; } }

/* css/lane-synergy.css */
/* lane-synergy.css: owned by the synergy lane. Live drop preview (.syn-gain/.syn-lost/.syn-plan), connectors (.syn-layer),
   link pings, live tooltip values, battle plan. Motion is dropped under prefers-reduced-motion and .syn-static. */

/* ---- live drop preview ---- */
.board > .syn-gain, .board > .syn-lost, .board > .syn-plan-cell { position: absolute; width: var(--cell); height: var(--cell); pointer-events: none; z-index: 29; border-radius: 5px; }
.syn-gain { box-shadow: inset 0 0 0 2px #7dff8a, 0 0 10px rgba(125,255,138,.65); background: rgba(125,255,138,.14); animation: synRing 1s ease-in-out infinite; }
.syn-lost { box-shadow: inset 0 0 0 2px #ffb12e, 0 0 8px rgba(255,177,46,.55); background: rgba(255,177,46,.14); }
.syn-gain[data-mark]::after, .syn-lost[data-mark]::after { content: attr(data-mark); position: absolute; right: 2px; top: 0; font: 700 15px/1 var(--font-head, sans-serif); text-shadow: 0 0 3px #000, 0 0 2px #000; }
.syn-gain[data-mark]::after { color: #9dffa6; }
.syn-lost[data-mark]::after { color: #ffc766; }
@keyframes synRing { 50% { box-shadow: inset 0 0 0 3px #b6ffbd, 0 0 18px rgba(125,255,138,.9); } }
.syn-gain.syn-static { animation: none; }

/* drop plan: displaced items as dashed outlines; orange = goes to the bin */
.board > .syn-plan-cell { border: 2px dashed #ffd45a; background: rgba(255,212,90,.10); z-index: 28; }
.board > .syn-plan-cell.is-bin { border-color: #ff8a3d; background: rgba(255,138,61,.14); }
.syn-plan-cell[data-mark]::after { content: attr(data-mark); position: absolute; left: 2px; bottom: 1px; font: 700 10px/1 sans-serif; color: #ffb27a; text-transform: uppercase; text-shadow: 0 0 3px #000; }
.syn-plan-svg { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 28; }
.syn-plan-svg .plan-arrow { stroke: #ffd45a; stroke-width: 2.5; stroke-dasharray: 5 4; }
.syn-plan-svg .plan-head { fill: #ffd45a; }

/* ---- connectors + chips ---- */
.syn-layer { position: absolute; inset: 0; pointer-events: none; z-index: 12; }
.syn-svg { position: absolute; left: 0; top: 0; overflow: visible; }
.syn-link { fill: none; stroke-width: 2.2; stroke-linecap: round; opacity: .38; filter: drop-shadow(0 0 3px currentColor); transition: opacity .15s, stroke-width .15s; }
.syn-link.syn-hot { opacity: 1; stroke-width: 3.2; }
.syn-dot { opacity: .6; }
.syn-dot.syn-hot { opacity: 1; }
.syn-link.syn-new { stroke-dasharray: 14 86; animation: synFlow .9s ease-out forwards; opacity: .95; }
@keyframes synFlow { from { stroke-dashoffset: 100; } to { stroke-dashoffset: -14; stroke-dasharray: 100 0; opacity: .38; } }
.syn-chip { position: absolute; transform: translate(-100%, 0); padding: 0 4px; border-radius: 6px 0 4px 0; font: 700 10px/14px var(--font-body, sans-serif); white-space: nowrap;
  color: #c9ffd0; background: rgba(8,28,12,.88); box-shadow: 0 0 0 1px rgba(125,255,138,.6); text-shadow: 0 1px 1px #000; transition: transform .15s, box-shadow .15s; }
.syn-chip.syn-hot { box-shadow: 0 0 0 1px #7dff8a, 0 0 8px rgba(125,255,138,.8); }
.board.syn-on .piece .buffed { display: none; }   /* the chip replaces the old blue triangle */
.syn-layer.syn-static .syn-link.syn-new { animation: none; stroke-dasharray: none; opacity: .38; }

/* link formed: both pieces pulse, a chip floats from source to recipient */
.piece.syn-pulse .frame, .piece.syn-pulse .sprite-holder, .piece.syn-pulse .art { animation: synPulse .6s ease-out; }
@keyframes synPulse { 0% { filter: brightness(1.8) drop-shadow(0 0 8px #ffd45a); } 100% { filter: none; } }
.syn-float { position: absolute; transform: translate(-50%, -50%); padding: 0 5px; border-radius: 8px; font: 700 11px/16px var(--font-body, sans-serif); color: #fff3b0; background: rgba(40,28,6,.9);
  box-shadow: 0 0 0 1px #ffd45a; animation: synFloat .85s ease-out forwards; white-space: nowrap; }
@keyframes synFloat { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.8); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.05); } }

/* piece whose bonus row is hovered / tapped in the tooltip */
.piece.syn-src .frame, .piece.syn-src .sprite-holder, .piece.syn-src .art { filter: brightness(1.35) drop-shadow(0 0 6px #7fd1ff); }

@media (prefers-reduced-motion: reduce) {
  .syn-gain, .syn-link.syn-new, .piece.syn-pulse .frame, .piece.syn-pulse .sprite-holder, .piece.syn-pulse .art { animation: none; }
  .syn-float { display: none; }
}

/* ---- live tooltip values ---- */
.tt-base { margin-left: 4px; font-size: 11px; color: #8f8369; text-decoration: line-through; }
.tt-weapon .tt-base { margin: 0; line-height: 1; }
.tt-up { color: #5dff7a !important; }
.tt-down { color: #ff6a5a !important; }
.tt-card .tt-line.tt-live { color: #7dff8a; }
.tt-dps { margin: -2px 0 8px; text-align: center; font-size: 12px; color: #cdbf9d; }
.tt-dps-crit { color: #a8987a; }
.tt-sub { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #a8987a; margin-bottom: 2px; }
.tt-sect.active .tt-line { color: #7dff8a; }
.tt-sect.active .tt-row { cursor: default; padding: 1px 3px; margin: 1px -3px; border-radius: 3px; }
@media (hover: hover) { .tt-sect.active .tt-row:hover { background: rgba(127,209,255,.14); } }
.tt-sect.star .tt-line.tt-off { color: #ffb27a; }
.tt-sect.star .tt-line.tt-on { color: #7dff8a; }
.tt-boosting { color: #7ad0ff !important; }
#tooltip .tt-row { pointer-events: auto; }

/* ---- battle plan ---- */
.battle-plan { margin: 8px 0; border: 1px solid rgba(201,162,74,.28); border-radius: 6px; background: rgba(0,0,0,.28); font-size: 12px; color: #d8ccb0; }
.battle-plan > summary { cursor: pointer; padding: 6px 10px; min-height: 32px; list-style: none; color: #e6d7ac; }
.battle-plan > summary::-webkit-details-marker { display: none; }
.battle-plan > summary::before { content: '▸ '; }
.battle-plan[open] > summary::before { content: '▾ '; }
.bp-rows { display: grid; gap: 2px; padding: 0 6px 6px; }
.bp-row { display: grid; grid-template-columns: 24px 1fr 38px minmax(70px, auto) 26px; gap: 6px; align-items: center; text-align: left; padding: 3px 4px; min-height: 30px;
  border: 0; border-radius: 4px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
@media (hover: hover) { .bp-row:hover { background: rgba(255,212,90,.1); } }
.bp-row:active { background: rgba(255,212,90,.18); }
.bp-ico { width: 22px; height: 22px; border-radius: 3px; }
.bp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bp-cd { color: #a8987a; text-align: right; }
.bp-out { color: #efe4c8; font-size: 11.5px; }
.bp-syn.on { color: #7dff8a; font-weight: 700; text-align: right; }
.bp-warn { padding: 3px 10px; color: #ffb27a; font-size: 11.5px; }

/* css/lane-combos.css */
/* lane-combos.css: combo hints. Tooltip lines, shop anvil badge, fight-opener craft beats, end-screen strip.
   Motion is dropped under prefers-reduced-motion. */

/* ---- tooltip ---- */
.tt-card .tt-line.tt-keep { color: #f2d089; }
.tt-card .tt-line.tt-unknown i { color: #b9a77a; font-style: italic; }
.tt-card .tt-line.tt-more { color: #9a8a66; font-size: .9em; }
.tt-card .tt-line.tt-made, .tt-card .tt-line.tt-completes { color: #f2d089; }

/* ---- shop badge: small anvil on a ware that is the last missing piece of a recipe ---- */
.ware .recipe-badge { position: absolute; left: auto; right: 4px; top: 4px; transform: none; width: 22px; height: 22px; padding: 0; justify-content: center; border-radius: 50%; font-size: 13px; line-height: 22px; text-align: center; cursor: help; }
.ware .recipe-badge.pulse { animation: combo-pulse 1.4s ease-in-out infinite; box-shadow: inset 0 0 0 1px #f2d089, 0 0 8px rgba(242, 208, 137, .7); }
@keyframes combo-pulse { 50% { box-shadow: inset 0 0 0 1px #f2d089, 0 0 14px rgba(255, 220, 140, 1); transform: scale(1.12); } }

/* ---- fight opener ---- */
.craft-opener { position: absolute; left: 50%; top: 56%; transform: translate(-50%, -50%); z-index: 26; pointer-events: none; text-align: center; }
.co-beat { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: co-in var(--beat, 450ms) ease-out both; }
.co-in { display: flex; gap: 38px; justify-content: center; }
.co-ing { width: 44px; height: 44px; border-radius: 5px; box-shadow: 0 0 0 2px #000, 0 2px 8px #000; animation: co-slide var(--beat, 450ms) ease-in both; }
.co-ing:nth-child(odd) { --dir: 1; } .co-ing:nth-child(even) { --dir: -1; }
.co-ing.kept { box-shadow: 0 0 0 2px #ffd36b, 0 0 14px 4px rgba(255, 211, 107, .85); animation: none; }
.co-out { width: 56px; height: 56px; border-radius: 6px; margin-top: -50px; box-shadow: 0 0 0 2px #000, 0 0 18px 6px var(--qc, #fff); animation: co-flash var(--beat, 450ms) ease-out both; }
.co-beat.r-uncommon { --qc: #1eff00; } .co-beat.r-rare { --qc: #0070dd; } .co-beat.r-epic { --qc: #a335ee; } .co-beat.r-legendary { --qc: #ff8000; } .co-beat.r-common { --qc: #fff; }
.co-plate { padding: 3px 12px; border-radius: 10px; background: rgba(12, 8, 4, .9); box-shadow: inset 0 0 0 1px #8a6a2c; font-family: var(--font-head); font-size: 15px; text-shadow: 0 1px 0 #000; }
.co-text { font-size: 14px; color: #f2d089; }
.co-burst .co-ing { animation: none; width: 34px; height: 34px; }
.co-burst .co-in { gap: 6px; }
@keyframes co-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes co-slide { from { transform: translateX(calc(var(--dir, 1) * -34px)); opacity: .4; } to { transform: translateX(calc(var(--dir, 1) * 40px)); opacity: 0; } }
@keyframes co-flash { 0%, 40% { opacity: 0; transform: scale(.6); filter: brightness(3); } 100% { opacity: 1; transform: scale(1); filter: none; } }

/* ---- end screen ---- */
.end-combos { margin: 8px 0; text-align: center; }
.end-combos small { display: block; color: var(--muted, #9a8a66); letter-spacing: .06em; text-transform: uppercase; font-size: 11px; margin-bottom: 4px; }
.ec-icons { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ec-item { position: relative; display: inline-block; }
.ec-ico { width: 34px; height: 34px; border-radius: 4px; box-shadow: 0 0 0 2px var(--qc, #555); display: block; }
.ec-item i { position: absolute; right: -3px; bottom: -3px; font-style: normal; font-size: 10px; padding: 0 3px; border-radius: 6px; background: #000; color: #f2d089; }

@media (prefers-reduced-motion: reduce) {
  .ware .recipe-badge.pulse, .co-beat, .co-ing, .co-out { animation: none; }
}

/* css/lane-battle.css */
/* lane-battle.css: battle readability (owned by the battle lane). Loads after battle.css / board.css / fx.css. */

/* ---- duel layout: each board sits directly above its hero + status card, heroes face the centre on one ground line ---- */
.battlefield { grid-template-rows: auto 1fr; min-height: min(640px, calc(100svh - 188px)); }
.bf-duel { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; align-items: end; min-width: 0; }
.bf-col { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; justify-content: flex-end; }
.bf-col .board-wrap { background: none; box-shadow: none; padding: 0; position: relative; }
.bf-hero-row { display: flex; align-items: flex-end; gap: 4px; width: 100%; justify-content: center; padding-bottom: 6px; }
.bf-col.a .bf-hero-row { justify-content: flex-end; }
.bf-col.b .bf-hero-row { justify-content: flex-start; }
.bf-duel .stage { width: 210px; height: 330px; margin: 0 -14px; }
.bf-duel .status-card { width: 232px; flex: none; border-radius: 6px; }
@media (max-width: 900px) {
  .battlefield { min-height: 0; }
  .bf-duel { grid-template-columns: 1fr; gap: 6px; }
  .bf-col.a .bf-hero-row, .bf-col.b .bf-hero-row { justify-content: center; }
  .bf-duel .stage { width: 84px; height: 130px; margin: 0; }
  .bf-duel .status-card { flex: 1; width: auto; min-width: 0; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .battlefield { min-height: 0; padding-top: 24px; }
  .bf-duel { grid-template-columns: 1fr 1fr; gap: 4px 8px; }
  .bf-duel .stage { width: 70px; height: 100px; margin: 0; }
  .bf-duel .status-card { width: auto; flex: 1; min-width: 0; }
  .bf-col .board-wrap { transform: scale(.85); transform-origin: 50% 100%; }
}

/* ---- per-item cooldown clocks ---- */
.piece .cd-bar { position: absolute; left: 2px; right: 2px; bottom: 1px; height: 6px; z-index: 7; pointer-events: none; border-radius: 3px; overflow: hidden;
  background: rgba(10,8,4,.82); box-shadow: 0 0 0 1px #000; }
.piece .cd-fill { display: block; width: 100%; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(#ffe08a, #e0a020); will-change: transform; }
.piece .cd-bar.soon .cd-fill { background: linear-gradient(#fff6c8, #ffd34a); animation: cdsoon .28s ease-in-out infinite alternate; }
.piece .cd-bar.tired .cd-fill { background: linear-gradient(#ff8a7a, #a3241c); }
.piece .cd-badge { position: absolute; right: 2px; top: 2px; z-index: 8; pointer-events: none; font: bold 11px/14px var(--font-body, sans-serif); padding: 0 5px; border-radius: 7px;
  color: #fff3c4; background: rgba(12,8,2,.9); box-shadow: 0 0 0 1px #8a6200; }
.piece .cd-badge.full { color: #1a1000; background: #ffd34a; }
.piece .cd-badge[hidden], .piece .cd-bar[hidden] { display: none; }
@keyframes cdsoon { to { filter: brightness(1.4); } }

/* ---- bag-Tetris grid + footprints ---- */
.bg-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.bg-cell { position: absolute; box-sizing: border-box; border: 1px solid rgba(0,0,0,.38); background: rgba(255,255,255,.035); }
.bg-fp { position: absolute; overflow: visible; }
.bg-fp path { fill: none; stroke: var(--qc, #fff); stroke-width: 1.5; stroke-dasharray: 4 3; opacity: .55; }

/* ---- item pop (replaces the 0.32s brightness blink from board.css) ---- */
.piece.flash .frame, .piece.flash .cell.fill, .piece.has-art.flash .art, .piece.item.shaped.flash .frame.shape, .piece.item.has-sprite.flash .sprite-holder { animation: none; }
.piece.flash { animation: itempop .38s cubic-bezier(.2,.9,.3,1.2); z-index: 5; }
.piece.flash::after { content: ""; position: absolute; inset: -2px; border-radius: 7px; pointer-events: none; z-index: 8;
  box-shadow: 0 0 0 2px var(--ring, #ffd34a), 0 0 14px var(--ring, #ffd34a); animation: ringfade .42s ease-out forwards; }
@keyframes itempop { 0% { transform: none; } 35% { transform: translateY(-3px) scale(1.12); } 100% { transform: none; } }
@keyframes ringfade { from { opacity: 1; } to { opacity: 0; } }
.piece .proc-tag { position: absolute; left: 50%; top: -6px; z-index: 9; pointer-events: none; transform: translateX(-50%); font: bold 11px/14px var(--font-body, sans-serif); font-style: normal;
  padding: 0 6px; border-radius: 7px; color: #fff; background: rgba(12,8,2,.92); box-shadow: 0 0 0 1px #ffd34a; animation: proctag .9s ease-out forwards; white-space: nowrap; }
.piece .proc-tag.crit { color: #ffd34a; }
@keyframes proctag { 0% { opacity: 0; transform: translate(-50%, 6px); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -12px); } }
.piece.charged::before { content: ""; position: absolute; inset: -3px; z-index: 8; pointer-events: none; border-radius: 8px; padding: 2px;
  background: conic-gradient(from 0deg, #ffd34a, #ff7a3a, #ffd34a); -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: chargespin 1.6s linear infinite; }
@keyframes chargespin { to { filter: hue-rotate(40deg) brightness(1.3); } }
.piece.src-hl { outline: 2px solid #fff; outline-offset: 2px; z-index: 6; }

/* ---- persistent state overlays on the hero stage ---- */
.st-ward { position: absolute; inset: 8% 14% 4%; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .25s; z-index: 3;
  background: radial-gradient(closest-side, rgba(143,183,255,.05), rgba(143,183,255,.32)); box-shadow: 0 0 0 2px rgba(180,210,255,.7), 0 0 22px rgba(120,170,255,.7); }
.st-ward.on { opacity: 1; }
.st-mark { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); font-size: 54px; line-height: 1; color: #ff4a3a; text-shadow: 0 0 10px #ff4a3a, 0 0 2px #000;
  pointer-events: none; opacity: 0; transition: opacity .2s; z-index: 3; }
.st-mark.on { opacity: .9; animation: markspin 3s linear infinite; }
@keyframes markspin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.exec-notch { position: absolute; top: -2px; bottom: -2px; width: 0; border-left: 2px solid #ff4a3a; pointer-events: none; z-index: 3; box-shadow: 0 0 4px #ff4a3a; }

/* ---- HP duel bar: instant fill + pale lag layer, big numbers, low-HP pulse ---- */
.hpbar { height: 26px; }
.bar .fill.lag { background: linear-gradient(#f4e8c0, #c9b98a); opacity: .85; transition: width .4s ease-out .12s; box-shadow: none; }
.hpbar span { font-size: 16px; font-weight: bold; position: relative; z-index: 2; }
.srow2.hprow { grid-template-columns: 1fr; }
.srow2.hprow > span { display: none; }
.srow2.empty { display: none; }
.srow2:not(.hprow) > span { font-size: 11px; opacity: .8; }
.status-card.lowhp { animation: lowhp 1s ease-in-out infinite; }
@keyframes lowhp { 50% { box-shadow: 0 0 0 2px #e0443a, 0 0 18px #e0443a; } }
.battlefield.stalemate::after, .battlefield.late::after, .battlefield.fatigue::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.battlefield.late::after { box-shadow: inset 0 0 70px rgba(255,170,40,.28); }
.battlefield.fatigue::after { box-shadow: inset 0 0 90px rgba(224,68,58,.38); }
.battlefield.stalemate::after { background: radial-gradient(ellipse at 50% 50%, transparent 35%, rgba(120,130,150,.55)); }
.battlefield.stalemate { filter: saturate(.55); }
.fatigue-banner { position: absolute; left: 50%; top: 44px; transform: translateX(-50%); z-index: 12; padding: 3px 14px; border-radius: 12px; pointer-events: none; font-weight: bold; font-size: 13px;
  color: #ffd2c8; background: rgba(60,8,4,.88); box-shadow: 0 0 0 1px #e0443a; white-space: nowrap; }
.fatigue-banner[hidden] { display: none; }
.bf-ctrl .clock { min-width: 74px; }

/* ---- round intro card ---- */
.round-intro { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); z-index: 25; text-align: center; padding: 14px 34px; border-radius: 6px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.78) 18%, rgba(0,0,0,.78) 82%, transparent); transition: opacity .35s; animation: introin .3s ease-out; }
.round-intro.out { opacity: 0; }
.round-intro b { display: block; font-family: var(--font-head); font-size: clamp(30px, 8vw, 54px); color: var(--gold); text-shadow: 0 3px 0 #000; font-weight: normal; }
.round-intro small { display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #f1d58a; }
.round-intro span { font-size: 15px; color: #e8dcc0; }
@keyframes introin { from { opacity: 0; transform: translate(-50%, -40%); } }

/* ---- skip prominence ---- */
.skip-btn.prominent { background: var(--gold); color: #2a1a00; border-color: #000; animation: skippulse 1.1s ease-in-out infinite; }
@keyframes skippulse { 50% { box-shadow: 0 0 0 3px rgba(255,209,0,.45); } }

/* ---- result: a bottom sheet so Continue is always on screen; the recap scrolls under it ---- */
.bf-result.has-recap { position: fixed; left: 0; right: 0; bottom: 0; top: auto; transform: none; width: auto; max-height: 52svh; overflow-y: auto; z-index: 40; padding: 0 8px 8px;
  background: linear-gradient(rgba(14,10,6,0), rgba(14,10,6,.94) 14px); overscroll-behavior: contain; }
.bf-result.has-recap .banner { position: sticky; top: 0; z-index: 2; margin: 0 auto 6px; padding: 8px 16px 10px; max-width: 560px; }
.bf-result.has-recap .banner h1 { font-size: clamp(26px, 7vw, 40px); }
.bf-result.has-recap .banner p { margin: 2px 0 8px; font-size: 13px; }
.fight-recap { max-width: 560px; margin: 0 auto; text-align: left; font-size: 13px; }
.fr-head { display: flex; justify-content: space-between; padding: 4px 6px; color: #f1d58a; font-size: 12px; border-bottom: 1px solid #3a2a14; }
.fr-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 6px; background: rgba(0,0,0,.35); border: 0; border-bottom: 1px solid #241a0c; color: var(--text); text-align: left; cursor: pointer; font: inherit; min-height: 40px; }
.fr-row.mvp { background: rgba(255,209,0,.12); }
.fr-row.idle .fr-sub { color: #ff9a8a; }
.fr-ico { width: 30px; height: 30px; border-radius: 4px; flex: none; box-shadow: 0 0 0 1px #000, 0 0 0 2px var(--qc); }
.fr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fr-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-name em { color: var(--gold); font-style: normal; font-weight: bold; }
.fr-bar { display: block; height: 5px; background: #120d06; border-radius: 3px; overflow: hidden; }
.fr-bar i { display: block; height: 100%; }
.fr-bar .dmg { background: #e0603a; }
.fr-bar .heal { background: #3fd65a; }
.fr-bar .blk { background: #6f9bff; }
.fr-sub { font-size: 11px; color: #a39578; min-height: 13px; }
.fr-num { font-size: 12px; text-align: right; flex: none; max-width: 38%; color: #f1e6c8; }
.fr-foe { margin-top: 4px; }
.fr-foe summary { padding: 6px; cursor: pointer; color: #f1d58a; font-size: 12px; }
.fr-moments { padding: 6px; font-size: 12px; }
.fr-mom { display: flex; gap: 8px; padding: 2px 0; }
.fr-mom i { font-style: normal; color: #a39578; min-width: 40px; }

@media (prefers-reduced-motion: reduce) {
  .piece.flash { animation: none; }
  .piece .proc-tag { animation: none; opacity: 1; }
  .st-mark.on, .piece.charged::before, .skip-btn.prominent, .status-card.lowhp, .piece .cd-bar.soon .cd-fill, .round-intro { animation: none; }
  .bar .fill.lag, .round-intro { transition: none; }
}

/* owner 11-06 'make it fullscreen larger': on desktop the arena takes the whole viewport height and the heroes scale with it */
@media (min-width: 901px) { #app[data-screen="battle"] { max-width: 1600px; }
  /* 11-11: arena + #app padding (36px) + the two-line footer overflowed the window (page scrollbar in every fight). Footer goes to one line, like the shop. */
  body:has(.battlefield) .fcp { height: 18px; padding: 2px 16px; box-sizing: border-box; }
  body:has(.battlefield) .fcp p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 14px; }
  /* 88px = #app padding in battle (46 top + 24 bottom) + the 18px footer. Hero height is what is left after the fixed parts of a column (~323px of cards and plates), so the arena fits 768px laptops and still fills a 1080p window. */
  .battlefield { min-height: calc(100svh - 126px); --stage-h: clamp(240px, calc(100svh - 543px), 530px); }
  .bf-duel .stage, .bf-ground .stage { height: var(--stage-h); width: calc(var(--stage-h) * 0.645); margin: 0 calc(var(--stage-h) * -0.045); }
  .battlefield { grid-template-rows: auto minmax(0, 1fr); }
  .bf-duel { align-self: center; align-items: end; padding-bottom: 1svh; }
  .bf-col { gap: 2svh; } }

/* css/lane-fx.css */
/* lane-fx.css: stub created by the foundation lane; owned by the fx lane. */

/* fx3d: crit = brief rim glow on the hero canvas edge (never a body fill); death = desaturate and sink. Filters only on the canvas. */
.m3d.rim-crit .m3d-canvas { animation: rimCrit .32s ease-out 1; }
@keyframes rimCrit { 0% { filter: drop-shadow(0 0 3px #ffc23a) drop-shadow(0 0 8px #ff8a1a); } 100% { filter: none; } }
.m3d.dying .m3d-canvas { animation: m3dDie .9s ease-in forwards; }
@keyframes m3dDie { 0% { filter: none; transform: translateY(0); } 100% { filter: grayscale(1) brightness(.55); transform: translateY(6%); opacity: .85; } }
@media (prefers-reduced-motion: reduce) { .m3d.rim-crit .m3d-canvas, .m3d.dying .m3d-canvas { animation-duration: .01s; } }

/* fx3d damage numbers: outlined, log-scaled by hit size (.sz1-.sz5 from react.js), crit = gold fill + short shake */
.floater.dmg, .floater.crit { -webkit-text-stroke: 1.5px #1a0a00; paint-order: stroke fill; text-shadow: 0 2px 0 #000, 0 0 8px rgba(0,0,0,.85); }
.floater.dmg.sz1 { font-size: 20px; } .floater.dmg.sz2 { font-size: 24px; } .floater.dmg.sz3 { font-size: 28px; } .floater.dmg.sz4 { font-size: 33px; } .floater.dmg.sz5 { font-size: 38px; }
.floater.crit { color: #ffd23a; } .floater.crit.sz1 { font-size: 28px; } .floater.crit.sz2 { font-size: 33px; } .floater.crit.sz3 { font-size: 38px; } .floater.crit.sz4 { font-size: 44px; } .floater.crit.sz5 { font-size: 50px; }
.stage .floater.dmg.sz1 { font-size: 24px; } .stage .floater.dmg.sz3 { font-size: 32px; } .stage .floater.dmg.sz5 { font-size: 42px; }

/* css/lane-shop.css */
/* lane-shop.css: stub created by the foundation lane; owned by the shop lane. */
/* ===== lane shoploop: gold fx, shelf fx, sell undo, run tracker, round intro ===== */
.gfx-float { position: fixed; z-index: 900; pointer-events: none; font: bold 20px var(--font-head, serif); text-shadow: 0 1px 2px #000, 0 0 6px #000; white-space: nowrap; }
.gfx-float.spend { color: #ff5a4a; } .gfx-float.earn { color: #6cff7a; }
.gfx-coin { position: fixed; z-index: 900; pointer-events: none; width: 14px; height: 14px; margin: -7px; background: url(../assets/ui/gold-hd.png) center / contain no-repeat; }
.srow.gold-tween b { color: #ffd100; transition: color .25s; }
.srow.s-income { font-size: .85em; opacity: .85; } .srow.s-income b { color: #3d8a2a; }

.ware { position: relative; }
.ware.lock-frame { outline: 2px solid var(--gold, #ffd100); outline-offset: 2px; border-radius: 4px; }
.padlock-slam { position: absolute; left: 50%; top: 40%; font-size: 30px; z-index: 5; pointer-events: none; filter: drop-shadow(0 2px 3px #000); }
.sold-stamp { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) rotate(-14deg); z-index: 5; pointer-events: none; padding: 2px 10px; font: bold 22px var(--font-head, serif); letter-spacing: .12em; color: #d63a2a; border: 3px solid #d63a2a; border-radius: 4px; background: rgba(20, 8, 4, .55); animation: sold-stamp 1.6s ease-out forwards; }
@keyframes sold-stamp { 0% { opacity: 0; scale: 2.2; } 15% { opacity: 1; scale: .95; } 75% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: 1; } }
.bin-arrive { animation: bin-arrive 1s ease-out; }
@keyframes bin-arrive { 0% { box-shadow: 0 0 0 0 rgba(255, 209, 0, .9); } 100% { box-shadow: 0 0 0 18px rgba(255, 209, 0, 0); } }

.sell-undo-chip { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 850; display: flex; gap: 10px; align-items: center; padding: 6px 8px 6px 14px; border-radius: 18px; color: #f2d089; background: rgba(24, 14, 6, .94); box-shadow: inset 0 0 0 2px var(--wow-trim, #8a6a2c), 0 4px 10px #000; animation: undo-in .2s ease-out; }
.sell-undo-btn { min-height: 32px; padding: 4px 12px; border: 0; border-radius: 14px; cursor: pointer; font: inherit; font-weight: bold; color: #2a1a0c; background: linear-gradient(#ffe08a, #e0a82a); }
.sell-undo-btn:active { transform: translateY(1px); }
@keyframes undo-in { from { opacity: 0; translate: 0 10px; } }

.run-tracker { display: flex; align-items: center; gap: 12px; }
.rt-pips { display: flex; gap: 3px; } .rt-pip { width: 9px; height: 14px; border-radius: 2px; background: rgba(0, 0, 0, .45); box-shadow: inset 0 0 0 1px #5a3b17; }
.rt-pip.on { background: linear-gradient(#ffe08a, #e0a82a); box-shadow: 0 0 6px rgba(255, 209, 0, .7), inset 0 0 0 1px #8a6a2c; }
.rt-hearts { display: flex; gap: 3px; } .rt-heart svg { width: 18px; height: 17px; display: block; fill: #d3261a; filter: drop-shadow(0 1px 1px #000); }
.rt-heart.gone svg { fill: rgba(60, 30, 10, .35); filter: none; }
.rt-heart.breaking svg { animation: heart-break .5s ease-out; }
.rt-hearts.last-life { animation: last-life 1.2s ease-in-out infinite; }
@keyframes heart-break { 0% { scale: 1.5; fill: #fff; } 100% { scale: 1; } }
@keyframes last-life { 50% { filter: drop-shadow(0 0 8px #ff2a1a); } }
.rt-shard { position: fixed; z-index: 900; pointer-events: none; width: 6px; height: 6px; margin: -3px; background: #d3261a; clip-path: polygon(0 0, 100% 30%, 40% 100%); }

.round-intro { position: fixed; left: 0; right: 0; top: 34%; z-index: 880; pointer-events: none; text-align: center; padding: 14px 0; color: #f2d089; text-shadow: 0 2px 3px #000; background: linear-gradient(90deg, transparent, rgba(16, 8, 2, .88) 20% 80%, transparent); }
.ri-round { font: bold 44px var(--font-head, serif); } .ri-last { font-size: 16px; opacity: .9; } .ri-income { font-size: 18px; margin-top: 4px; } .ri-income b { color: #ffd100; }
.round-intro.won .ri-last { color: #7dff8a; } .round-intro.lost .ri-last { color: #ff7a6a; }
.restocking .ware { animation: restock .35s ease-out backwards; animation-delay: calc(var(--restock, 0) * 90ms + .5s); }
@keyframes restock { from { opacity: 0; translate: 0 -30px; } }

/* craft hint badge */
.recipe-badge { position: absolute; left: 50%; top: -6px; transform: translate(-50%, -100%); display: flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 10px; font-size: 11px; white-space: nowrap; color: #f2d089; background: rgba(24, 14, 6, .92); box-shadow: inset 0 0 0 1px #8a6a2c; z-index: 4; }
.recipe-badge img { width: 20px; height: 20px; border-radius: 3px; } .recipe-badge small { display: none; }
.recipe-badge:focus small, .recipe-badge:active small { display: inline; }
@media (hover: hover) { .recipe-badge:hover small { display: inline; } }

/* class pennant, bag boost glint, today's pick ribbon */
.ware .pennant { position: absolute; left: 4px; top: -4px; width: 14px; height: 22px; background: var(--pennant, #c9a14a); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); filter: drop-shadow(0 1px 1px #000); z-index: 3; }
.ware .pick-ribbon { position: absolute; right: -4px; top: 6px; padding: 1px 6px; font-size: 10px; font-weight: bold; color: #2a1a0c; background: linear-gradient(#ffe08a, #e0a82a); transform: rotate(6deg); z-index: 3; }
.ware .bag-glint { position: absolute; right: 2px; top: 2px; padding: 0 5px; font-size: 10px; font-weight: bold; color: #fff; border-radius: 8px; background: rgba(60, 120, 220, .75); overflow: hidden; z-index: 3; }
.ware .bag-glint::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.7) 50%, transparent 70%); translate: -100% 0; animation: glint 2.4s ease-in-out infinite; }
@keyframes glint { to { translate: 100% 0; } }

/* touch: bigger padlock hit area, pressed states */
.ware .lock { position: relative; } .ware .lock:active { transform: scale(.9); }
@media (pointer: coarse) { .ware .lock::after { content: ''; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); } }

@media (prefers-reduced-motion: reduce) {
  .sold-stamp, .restocking .ware, .bin-arrive, .rt-heart.breaking svg, .rt-hearts.last-life, .bag-glint::after, .sell-undo-chip { animation: none; }
}

/* integrate lane: shop wiring (opponent plaque host, battle-plan host, tracker slot) */
.opp-host { display: flex; justify-content: center; min-width: 0; max-width: 100%; }
.top-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.srow.plan-row { display: block; }
.srow.plan-row .battle-plan-host { width: 100%; }
@media (max-height: 500px) and (orientation: landscape) {
  .scene { padding-top: 6px; gap: 4px 12px; }
  .opp-host { display: none; }
}

/* touch targets (gate round 1): coarse pointers get real 40px hit boxes on shop buttons */
@media (pointer: coarse) {
  .ware .tag.buy { min-height: 40px; min-width: 60px; }
  .ware .lock { min-width: 40px; min-height: 40px; margin: -12px; display: inline-flex; align-items: center; justify-content: center; }
  .scene .sign.recipes-btn { min-height: 40px; }
  .bp-row { min-height: 40px; grid-template-columns: 24px 1fr 38px minmax(70px, auto) 40px; }
}

/* owner 11-06 "gold icon bigger / how much gold should be more prominent": the Gold row becomes a money plate */
.srow.s-gold { padding: 6px 8px; margin: 2px 0 5px; border-radius: 6px; color: #e8d9b0;
  background: linear-gradient(#2c1b09, #150c04); box-shadow: inset 0 0 0 1px #8a6d3b, inset 0 1px 0 rgba(255,255,255,.08), 0 1px 2px rgba(0,0,0,.5);
  font-family: var(--font-head), "FrizQuadrata", serif; font-size: 13px; letter-spacing: .02em; }
.srow.s-gold b { color: #ffd100; font-size: 23px; line-height: 1; gap: 7px; text-shadow: 0 1px 0 #000, 0 0 8px rgba(255,209,0,.35); }
.scene .srow.s-gold .coin, .srow.s-gold .coin { width: 26px; height: 26px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.8)) drop-shadow(0 0 4px rgba(255,209,0,.35)); }
.srow.s-gold.gold-tween b { color: #fff6b0; }
@media (max-width: 900px) { .srow.s-gold b { font-size: 19px; } .scene .srow.s-gold .coin, .srow.s-gold .coin { width: 21px; height: 21px; } }

/* 11-11 playthrough (390px): the top bar was one nowrap row 417px wide in a 354px scene. Recipes was cut off at the right edge,
   the opponent card hung 20px off the left, and the fixed settings gear sat on the hearts. Phone layout: Fight left, tracker +
   Recipes right (clear of the gear), opponent card on its own full-width row. */
@media (max-width: 600px) {
  .scene .scene-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 10px; align-items: start; }
  .scene .top-mid { display: contents; }
  .scene .top-mid .fight-sign { grid-column: 1; grid-row: 1; }
  .scene .top-right { grid-column: 2; grid-row: 1; min-width: 0; flex-direction: column; align-items: flex-end; flex-wrap: nowrap; gap: 6px; padding-right: 44px; }
  .scene .run-tracker { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; gap: 4px 8px; }
  .scene .top-mid .opp-host, .scene .top-mid .history { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .scene .opp-host .opp-plaque { width: 100%; max-width: 100%; box-sizing: border-box; }
}

/* css/lane-run.css */
/* lane-run.css: stub created by the foundation lane; owned by the run lane. */

/* ===== runmeta: title screen daily / history / class badges ===== */
.ts-daily b { font-weight: 700; }
.ts-histwrap { position: relative; display: flex; flex-direction: column; align-items: center; }
.ts-history { margin-top: 6px; min-width: 190px; padding: 6px 8px; background: rgba(20,12,6,.92); border: 2px solid #1a0d04; border-radius: 4px; font-size: 12px; color: #e8d9a8; }
.ts-history[hidden] { display: none; }
.ts-history > div { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.ts-history .lost b { color: var(--red, #c0392b); } .ts-history .won b { color: var(--green, #5fae4e); }
.cc-best { font-size: 10px; line-height: 1; color: var(--gold, #e0b84a); text-shadow: 0 1px 0 #000; }
.ts-die-note { display: block; min-height: 14px; margin-top: 2px; font-size: 11px; color: #cdbf9c; text-align: center; }
.ts-tagline { margin: 2px 0 4px; font-size: 12px; font-style: italic; color: #e8d9a8; }
.ts-cx { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; font-size: 11px; color: #cdbf9c; }
.ts-cx i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid #1a0d04; background: rgba(255,255,255,.12); }
.ts-cx i.on { background: var(--cc, var(--gold, #e0b84a)); }
.ts-best b { color: var(--gold, #e0b84a); }

/* preflight */
/* opponent plaque */
.opp-plaque { box-sizing: border-box; max-width: 340px; padding: 8px 10px; background: rgba(20,12,6,.92); border: 2px solid #1a0d04; border-radius: 6px; color: #e8d9a8; font-size: 12px; }
.opp-head { display: flex; align-items: center; gap: 8px; }
.opp-class { width: 32px; height: 32px; border-radius: 4px; border: 1px solid #1a0d04; }
.opp-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.opp-who b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-who small { color: #cdbf9c; }
.opp-scout { min-width: 64px; min-height: 44px; padding: 0 10px; font: inherit; font-weight: 700; color: #fff3d0; background: #5a3d22; border: 2px solid #1a0d04; border-radius: 4px; cursor: pointer; }
.opp-scout[aria-pressed="true"] { background: #8a6a2a; }
.opp-pips { display: flex; gap: 3px; margin: 6px 0; }
.opp-pips i { flex: 1; height: 5px; max-width: 18px; border-radius: 2px; background: rgba(255,255,255,.14); }
.opp-pips i.done { background: var(--gold, #e0b84a); } .opp-pips i.now { background: #fff3d0; box-shadow: 0 0 6px #ffd45a; }
.opp-items { display: flex; flex-wrap: wrap; gap: 4px; }
.opp-item { width: 44px; height: 44px; padding: 2px; background: #2b1d10; border: 1px solid #1a0d04; border-radius: 4px; cursor: pointer; }
.opp-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; display: block; }
.opp-cap { min-height: 16px; margin-top: 4px; font-size: 11px; color: #cdbf9c; }
.opp-board { margin-top: 6px; overflow: auto; pointer-events: none; }
/* fight gate */
.fight-sign.fight-ready { animation: fgReady 1.6s ease-in-out infinite; }
.fight-sign.fight-warn { filter: saturate(.85); }
.fight-sign.fight-armed { outline: 3px solid #ffd45a; outline-offset: 2px; }
@keyframes fgReady { 0%, 100% { box-shadow: 0 0 0 rgba(255,212,90,0); } 50% { box-shadow: 0 0 16px 3px rgba(255,212,90,.65); } }
@media (prefers-reduced-motion: reduce) { .fight-sign.fight-ready { animation: none; box-shadow: 0 0 10px 2px rgba(255,212,90,.5); } }
/* end card */
.end-card { max-width: 560px; margin: 0 auto; padding: 20px 16px 28px; }
.end-class { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; }
.end-portrait { width: 44px; height: 44px; border-radius: 6px; border: 2px solid #1a0d04; }
.end-note { display: inline-block; margin: 0 0 10px; padding: 3px 12px; border-radius: 12px; background: rgba(255,255,255,.08); font-size: 14px; }
.end-note.best { background: var(--gold, #e0b84a); color: #1a0d04; font-weight: 700; }
.end-board { display: flex; justify-content: center; margin: 8px 0; overflow-x: auto; pointer-events: none; }
.end-strip { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; margin: 8px 0; }
.end-strip i { width: 14px; height: 14px; border-radius: 3px; background: var(--muted, #888); }
.end-strip i.w { background: var(--green, #5fae4e); } .end-strip i.l { background: var(--red, #c0392b); }
.end-totals { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0; font-size: 14px; }
.end-mvp-ic { width: 22px; height: 22px; vertical-align: middle; border-radius: 3px; }
.end-log { max-width: 520px; margin: 8px auto; text-align: left; font-size: 13px; }
.end-log summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.end-seed { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 10px 0; font-size: 13px; }
.end-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.end-actions .btn, .end-copy { min-height: 44px; }
@media (max-width: 400px) { .end-actions .btn { flex: 1 1 100%; } }
/* first-run coach: strip never captures pointers except Skip */
.coach { position: fixed; left: 8px; right: 8px; bottom: 8px; z-index: 600; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: rgba(20,12,6,.95); border: 2px solid #ffd45a; border-radius: 8px; color: #fff3d0; font-size: 14px; pointer-events: none; }
.coach.done { border-color: var(--green, #5fae4e); }
.coach-n { font-weight: 700; color: #ffd45a; white-space: nowrap; }
.coach-t { flex: 1; min-width: 0; }
.coach-skip { pointer-events: auto; min-width: 64px; min-height: 44px; font: inherit; color: #fff3d0; background: #5a3d22; border: 2px solid #1a0d04; border-radius: 4px; cursor: pointer; }
.coach-ring { animation: coachRing 1.2s ease-in-out infinite; outline: 3px solid #ffd45a; outline-offset: 2px; border-radius: 6px; }
@keyframes coachRing { 50% { outline-color: rgba(255,212,90,.25); } }
@media (prefers-reduced-motion: reduce) { .coach-ring { animation: none; } }

/* css/lane-strip.css */
/* thewowdb header strip (shared design across the thewowdb games). Namespaced tdb-strip; never an ad- prefix. */
.tdb-strip { --tdb-h: 38px; box-sizing: border-box; flex: 0 0 auto; height: var(--tdb-h); width: 100%; display: flex; align-items: center; gap: 4px; padding: 0 12px; background: #0d0907; border-bottom: 1px solid #5a4423; font: 600 13px/1 Georgia, "Times New Roman", serif; overflow-x: auto; overflow-y: hidden; white-space: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; position: relative; z-index: 50; }
.tdb-strip::-webkit-scrollbar { display: none; }
.tdb-strip a, .tdb-strip span { flex: 0 0 auto; display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 4px; color: #c9a24a; text-decoration: none; }
.tdb-strip a:hover, .tdb-strip a:focus-visible { background: #2a1d0e; color: #f0d58a; outline: none; }
.tdb-strip .tdb-brand { font-weight: 700; color: #f0d58a; letter-spacing: .02em; }
.tdb-strip .tdb-sep { width: 1px; padding: 0; height: 16px; margin: 0 4px; background: #5a4423; border-radius: 0; }
.tdb-strip [aria-current="page"] { color: #fff3b0; background: #2a1d0e; cursor: default; }
