#pause {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b));
  background: rgba(4, 11, 20, 0.55);
  backdrop-filter: blur(3px);
}
.panel { width: min(560px, 100%); max-height: 100%; overflow: auto; padding: 18px 20px 20px; display: grid; gap: 14px; }
.panel h2 { margin: 0; font: italic 800 34px / 1 var(--font-display); text-transform: uppercase; letter-spacing: 0.01em; text-align: center; }
.panel .tabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.panel .tab {
  font: italic 700 16px / 1 var(--font-display); text-transform: uppercase; letter-spacing: 0.01em; color: #e3eaf1;
  background: linear-gradient(#12253a, #0b1826); border: 1px solid var(--kit-line-soft); border-radius: 4px; padding: 8px 16px; cursor: pointer;
}
.panel .tab[aria-selected='true'] { border-color: #ffc35a; background: linear-gradient(#ffc35a, #f6a623 45%, #d98b14); color: #111a24; text-shadow: none; }
.panel .section { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--kit-line-soft); border-radius: 4px; background: linear-gradient(#0a1726d9, #0b1a29e6); box-shadow: inset 0 0 30px #0008; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 12px; align-items: center; font-weight: 600; }
.row-note { margin-top: -6px; font-size: 12px; font-weight: 700; color: var(--text-dim); opacity: 0.85; overflow-wrap: anywhere; }
.row label { color: var(--text); text-shadow: 0 1px 0 var(--ink); }
.row input[type='range'] { width: 100%; accent-color: var(--brass); }
.row select {
  font: inherit; font-weight: 600; color: #e9eef3; background: #07111c; border: 1px solid #6f8fae; border-radius: 4px; padding: 5px 8px;
}
.row select:focus-visible { outline: 2px solid var(--kit-orange); outline-offset: 1px; }
.row input[type='checkbox'] { width: 22px; height: 22px; accent-color: var(--brass); justify-self: start; }
.panel .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.controls-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 14px; align-items: center; font-weight: 700; }
.controls-list .soon { color: var(--text-dim); font-weight: 700; font-size: 0.9em; }
.confirm { display: grid; gap: 10px; justify-items: center; text-align: center; font-weight: 800; }

/* F4 debug panel */
.devpanel {
  position: fixed; right: calc(14px + var(--safe-r)); top: calc(70px + var(--safe-t)); z-index: 25;
  width: min(320px, calc(100cqw - 32px)); max-height: calc(100cqh - 100px); overflow: auto;
  padding: 10px 12px 12px; display: grid; gap: 8px; pointer-events: auto; font-size: 13px;
}
.devpanel h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 17px; color: var(--brass-l); display: flex; gap: 8px; align-items: center; }
.devpanel .dv-btns { display: flex; flex-wrap: wrap; gap: 5px; }
.devpanel button {
  font: inherit; font-weight: 800; font-size: 12px; color: var(--ink); cursor: pointer;
  background: linear-gradient(180deg, var(--brass-l), var(--brass)); border: 2px solid var(--ink); border-radius: 8px; padding: 3px 8px;
}
.devpanel .dv-check { display: flex; gap: 8px; align-items: center; font-weight: 800; }
.devpanel .dv-check input { accent-color: var(--brass); width: 16px; height: 16px; }
.devpanel .dv-sliders { display: grid; gap: 6px; }
.devpanel .dv-slider { display: grid; gap: 2px; font-weight: 700; }
.devpanel .dv-slider span { display: flex; justify-content: space-between; gap: 8px; color: var(--text); }
.devpanel .dv-slider b { color: var(--accent); font-variant-numeric: tabular-nums; }
.devpanel .dv-slider input { width: 100%; accent-color: var(--accent); }
.devpanel .dv-note { margin: 0; color: var(--text-dim); font-size: 11.5px; }

/* ---- M4: the character panel, item cards, the stall, dialogs, the map ---------------------------------- */
#charpanel { position: fixed; inset: 0; z-index: 20; pointer-events: none; display: flex; justify-content: flex-end; align-items: center; padding: calc(64px + var(--safe-t)) calc(14px + var(--safe-r)) calc(16px + var(--safe-b)) 14px; }
.cp { pointer-events: auto; width: min(720px, 100%); height: min(640px, 100%); display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 10px 12px 12px; gap: 8px; }
.cp-head { display: flex; align-items: center; gap: 8px; }
.cp-head .tabs { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.cp-pearls { padding: 4px 12px 12px; }
.cp-pearls h4 { margin: 16px 0 8px; color: var(--brass-l); }
.pearl-list { display: grid; gap: 12px; }
.pearl-card { padding: 12px; border: 2px solid var(--pearl); border-radius: 12px; background: rgba(10, 23, 38, 0.68); }
.pearl-card.swallowed { box-shadow: inset 0 0 24px #ff793b18; }
.pearl-card p { font-size: 13px; line-height: 1.5; margin: 8px 0; }
.pearl-card .tt-head b { color: var(--pearl); }
.pearl-card .tt-head { display: flex; align-items: center; gap: 10px; }
.pearl-card .tt-head b, .pearl-card .tt-head small { display: block; }
.pearl-card .tt-head small { color: var(--text-dim); margin-top: 3px; }
.pearl-curse { color: #ffbba2; }
.pearl-confirm { color: #ffe39d; background: #ff793b18; padding: 8px; border-radius: 8px; }
.pearl-empty { color: var(--text-dim); font-size: 13px; }
.pearl-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pearl-actions .btn { font-size: 12px; white-space: normal; min-height: 44px; }
.pearl-give { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pearl-give select { background: #0b1826; color: var(--parch); border: 1px solid var(--pearl); border-radius: 6px; padding: 6px; }
.cp-head .tab { font-family: var(--font-display); font-size: 15px; letter-spacing: 0.03em; color: var(--parch); background: rgba(10, 23, 38, 0.5); border: 2px solid var(--ink); border-radius: 10px; padding: 4px 10px; cursor: pointer; }
.cp-head .tab[aria-selected='true'] { background: linear-gradient(180deg, var(--brass-l), var(--brass)); color: var(--ink); }
.cp-head .tab .kbd { transform: scale(0.8); margin-left: 2px; }
.cp-x { width: 2.2em; height: 2.2em; font-size: 15px; }
.cp-body { overflow: auto; min-height: 0; padding: 2px; }
.cp-empty, .cp-hint { margin: 6px 0; color: var(--text-dim); font-weight: 800; font-size: 13px; text-align: center; }
.cp-gear { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 10px; height: 100%; }
.cp-left, .cp-right { background: rgba(10, 23, 38, 0.45); border-radius: 10px; box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45); padding: 10px; display: grid; gap: 8px; align-content: start; }
/* The paper doll: six slots around your portrait */
.doll { position: relative; height: 250px; }
.cp-portrait { position: absolute; left: 50%; top: 50%; width: 104px; height: 104px; transform: translate(-50%, -50%); border-radius: 50%; overflow: hidden; border: 4px solid var(--brass); box-shadow: 0 0 0 3px var(--ink), 0 4px 10px var(--shadow); }
.cp-portrait canvas { width: 100%; height: 100%; display: block; }
.doll-slot { position: absolute; width: 58px; height: 58px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 50% 30%, #16304a, #0b1826); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--rc, var(--brass-d)), 0 3px 0 var(--ink); }
.doll-slot svg { width: 32px; height: 32px; }
.doll-slot svg.ghost { opacity: 0.5; }
.doll-slot span { position: absolute; bottom: -15px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 900; color: var(--text-dim); text-shadow: 0 1px 0 var(--ink); white-space: nowrap; }
.doll-slot.r3, .doll-slot.r4, .bag-cell.r3, .bag-cell.r4 { box-shadow: inset 0 0 0 2px var(--rc), 0 0 12px color-mix(in srgb, var(--rc) 70%, transparent), 0 3px 0 var(--ink); }
.doll-slot.top { left: 50%; top: 0; transform: translateX(-50%); }
.doll-slot.left { left: 0; top: 54px; } .doll-slot.left2 { left: 0; top: 140px; }
.doll-slot.right { right: 0; top: 54px; } .doll-slot.right2 { right: 0; top: 140px; }
.doll-slot.bottom { left: 50%; bottom: 14px; transform: translateX(-50%); }
.doll-slot.sel, .bag-cell.sel { outline: 3px solid var(--accent); outline-offset: 1px; }
.cp-mini { display: flex; justify-content: space-around; font-weight: 900; font-size: 12px; color: var(--text-dim); }
.cp-mini b { color: var(--parch); font-size: 14px; }
/* The bag */
.bag-head { display: flex; align-items: baseline; gap: 8px; font-family: var(--font-display); font-weight: 400; font-size: 16px; color: var(--brass-l); }
.bag-head small { font-family: var(--font-ui); font-weight: 800; color: var(--text-dim); }
.bag-head .cp-gold { margin-left: auto; color: #ffe08a; }
.bag-head .cp-pot { color: #ffb0a0; font-size: 14px; }
.cp-right { grid-template-rows: auto auto minmax(120px, 1fr) minmax(0, 0.7fr); min-height: 0; }
.bag-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 5px; }
.bag-cell { position: relative; aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: radial-gradient(circle at 50% 30%, #16304a, #0b1826); border: 2px solid var(--ink); box-shadow: inset 0 0 0 2px var(--rc, #1a3048), 0 2px 0 var(--ink); }
.bag-cell.empty { cursor: default; opacity: 0.45; box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5); }
.bag-cell svg { width: 62%; height: 62%; }
.bag-cell .lv { position: absolute; left: 4px; bottom: 2px; font: 900 10px var(--font-ui); font-style: normal; color: var(--text-dim); text-shadow: 0 1px 0 var(--ink); }
.bag-cell .new { position: absolute; right: -3px; top: -5px; font: 400 9px var(--font-display); letter-spacing: 0.04em; color: var(--ink); background: #ffcf4a; border: 1.5px solid var(--ink); border-radius: 5px; padding: 0 3px; }
.pack-inventory { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 8px; border: 2px solid var(--ink); border-radius: 10px; background: linear-gradient(145deg, rgba(113, 76, 37, 0.24), rgba(20, 10, 30, 0.62)); box-shadow: inset 0 0 0 1px var(--brass-d), inset 0 2px 6px rgba(0, 0, 0, 0.4); }
.pack-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 6px; }
.pack-heading h4, .tool-belt h4 { flex: 1 0 100%; margin: 0; color: var(--brass-l); font: 400 15px var(--font-display); text-shadow: 0 2px 0 var(--ink); }
.pack-heading span { color: var(--text-dim); font-size: 11px; font-weight: 800; }
.pack-heading b { color: var(--parch); font-variant-numeric: tabular-nums; }
.pack-goods, .tool-belt ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 7px; list-style: none; margin: 0; padding: 0; }
.pack-good { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 4px; min-width: 0; min-height: 28px; padding: 2px 5px; border: 1px solid rgba(217, 176, 74, 0.28); border-radius: 7px; background: rgba(12, 8, 26, 0.48); }
.pack-good.is-pending { box-shadow: inset 0 0 0 1px rgba(255, 207, 74, 0.36); }
.pack-good-icon { display: grid; place-items: center; color: var(--brass-l); }
.pack-good-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pack-good-name { min-width: 0; overflow: hidden; color: var(--parch); font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.pack-good > b { color: var(--brass-l); font-size: 12px; font-variant-numeric: tabular-nums; }
.pack-pending { position: absolute; right: 3px; top: 3px; width: 5px; height: 5px; border: 1px solid var(--ink); border-radius: 50%; background: #ffcf4a; box-shadow: 0 0 5px #ffcf4a; }
.pack-empty { margin: 3px 0; color: var(--text-dim); font-size: 11px; font-weight: 800; }
.tool-belt { margin-top: 8px; padding-top: 6px; border-top: 1px solid rgba(217, 176, 74, 0.36); }
.tool-belt h4 { margin-bottom: 5px; }
.belt-tool { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 6px; border: 2px solid var(--ink); border-radius: 8px; background: radial-gradient(circle at 30% 20%, #3a2a5a, #1c1232); box-shadow: inset 0 0 0 1px var(--brass-d), 0 2px 0 var(--ink); color: var(--parch); font-size: 11px; font-weight: 900; }
.belt-tool svg { flex: 0 0 25px; width: 25px; height: 25px; fill: none; stroke: var(--brass-l); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.belt-tool small { display: block; color: var(--text-dim); font-size: 9px; }
/* The item card */
/* The card keeps the bag still: it scrolls in its own box and its buttons stay in view. */
.cp-detail { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.item-card { display: grid; gap: 6px 12px; align-content: start; padding: 9px 10px; border-radius: 10px; background: rgba(7, 17, 28, 0.85); border: 2px solid color-mix(in srgb, var(--rc) 70%, #0b1826); box-shadow: inset 0 0 18px color-mix(in srgb, var(--rc) 18%, transparent); }
.ic-head { display: flex; gap: 8px; align-items: center; }
.ic-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 2px var(--rc); }
.ic-icon svg { width: 30px; height: 30px; }
.ic-name { display: block; color: var(--rc); font-size: 15px; text-shadow: 0 1px 0 var(--ink); }
.ic-head small { color: var(--text-dim); font-weight: 800; font-size: 11.5px; }
.ic-stats, .ic-cmp ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; align-content: start; font-weight: 800; font-size: 12.5px; }
.ic-stats li { color: var(--parch); }
.ic-stats li.bad { color: #ff9a8a; }
.ic-cmp h5 { margin: 2px 0 2px; font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.ic-cmp li.up { color: #8dff9a; } .ic-cmp li.down { color: #ff8a80; }
.ic-cmp .same, .ic-kit, .ic-value { margin: 0; font-size: 12px; font-weight: 800; color: var(--text-dim); }
.ic-kit { color: #9ff6ff; }
.ic-value b { color: #ffe08a; }
.item-card.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.item-card > :not(.ic-stats, .ic-cmp) { grid-column: 1 / -1; }
.ic-acts { display: flex; gap: 8px; flex-wrap: wrap; position: sticky; bottom: -9px; margin: 0 -10px -9px; padding: 6px 10px 8px; background: linear-gradient(180deg, rgba(7, 17, 28, 0), rgba(7, 17, 28, 0.96) 35%); border-radius: 0 0 10px 10px; }
.ic-acts .btn { font-size: 14px; padding: 0.35em 0.9em 0.4em; }
/* Tía Perla's stall */
.shop { display: grid; gap: 8px; }
.shop h4, .cp-quests h4 { margin: 2px 0; font-family: var(--font-display); font-weight: 400; font-size: 17px; color: var(--brass-l); text-shadow: 0 2px 0 var(--ink); }
.shop-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 8px; border-radius: 10px; background: rgba(7, 17, 28, 0.55); }
.shop-row b { display: block; } .shop-row small { color: var(--text-dim); font-weight: 800; font-size: 11.5px; }
.shop-row.locked b { color: var(--text-dim); }
.shop-row .btn { font-size: 14px; padding: 0.35em 0.8em 0.4em; white-space: nowrap; }
.shop-note { margin: 0; font-size: 12px; font-weight: 800; color: var(--text-dim); }
/* Atributos */
.cp-stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.st-table { display: grid; gap: 3px; align-content: start; background: rgba(10, 23, 38, 0.45); border-radius: 10px; padding: 8px 10px; }
.st-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; font-weight: 800; font-size: 13px; padding: 2px 0; border-bottom: 1px solid rgba(255, 240, 200, 0.08); }
.st-row b { color: var(--parch); text-align: right; } .st-row small { grid-column: 1 / -1; color: var(--text-dim); font-size: 11px; }
.st-row small:empty { display: none; }
.st-side { display: grid; gap: 8px; align-content: start; }
.mast-card { display: grid; gap: 5px; padding: 8px 10px; border-radius: 10px; background: rgba(10, 23, 38, 0.45); }
.mc-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 900; }
.mc-head b { font-family: var(--font-display); font-weight: 400; color: var(--brass-l); font-size: 15px; }
.mast-card .bar.thin { width: 100%; }
.mast-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 12px; font-weight: 700; color: var(--text-dim); }
.mast-card li.ok { color: var(--parch); } .mast-card li.ok b { color: var(--good); } .mast-card li b { color: var(--brass-d); margin-right: 4px; }
.mast-card small { color: var(--text-dim); font-weight: 800; font-size: 11px; }
.tiers { display: flex; gap: 6px; flex-wrap: wrap; }
.tiers span { padding: 2px 8px; border-radius: 999px; font-weight: 900; font-size: 12px; background: rgba(0, 0, 0, 0.35); color: var(--text-dim); border: 1.5px solid #2a4560; }
.tiers span.ok { color: #ffd1a0; border-color: #a0401a; background: rgba(120, 30, 10, 0.55); }
/* Misiones */
.cp-quests { display: grid; gap: 8px; }
.q-card { padding: 8px 10px; border-radius: 10px; background: rgba(10, 23, 38, 0.5); display: grid; gap: 4px; border-left: 4px solid var(--brass); }
.q-card b { font-family: var(--font-display); font-weight: 400; font-size: 15px; color: var(--brass-l); }
.q-card p { margin: 0; font-weight: 700; font-size: 13px; }
.q-card small { color: var(--text-dim); font-weight: 800; font-size: 11.5px; }
.q-card .bar.thin { width: 100%; }
.q-card.ready { border-left-color: #ffcf4a; box-shadow: 0 0 10px rgba(255, 207, 74, 0.25); }
.q-card.offer { border-left-color: var(--accent); opacity: 0.9; }
.q-done { margin: 0; padding-left: 18px; color: var(--text-dim); font-weight: 800; font-size: 12.5px; }
/* Talking to people */
#dialog { position: fixed; left: 0; right: 0; bottom: calc(110px + var(--safe-b)); z-index: 22; display: flex; justify-content: center; pointer-events: none; padding: 0 14px; }
.dlg { pointer-events: auto; width: min(560px, 100%); padding: 12px 14px; display: grid; gap: 8px; }
.dlg-who { font: italic 800 22px / 1 var(--font-display); text-transform: uppercase; color: var(--kit-orange-l); text-shadow: 0 2px 0 #0009; }
.dlg-line { margin: 0; font-weight: 700; font-size: 14.5px; line-height: 1.4; }
.dlg-q { display: grid; gap: 3px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(7, 17, 28, 0.6); }
.dlg-q b { font-family: var(--font-display); font-weight: 400; font-size: 16px; color: var(--brass-l); }
.dlg-q small { color: #ffe08a; font-weight: 800; }
.dlg-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.dlg-opts .btn { font-size: 14px; padding: 0.4em 0.9em 0.45em; }
/* The map */
#mapview { position: fixed; inset: 0; z-index: 24; display: grid; place-items: center; background: rgba(4, 11, 20, 0.5); padding: calc(16px + var(--safe-t)) 14px calc(16px + var(--safe-b)); }
.mapv { width: min(680px, 100%); max-height: 100%; display: grid; gap: 8px; padding: 10px 12px 12px; grid-template-rows: auto minmax(0, 1fr) auto; }
.mapv-head { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-display); font-size: 20px; }
.mapv-body { position: relative; aspect-ratio: 1; max-height: calc(100cqh - 150px); margin: 0 auto; width: 100%; max-width: calc(100cqh - 150px); border-radius: 12px; overflow: hidden; border: 3px solid var(--ink); box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5); }
.mapv-body canvas { width: 100%; height: 100%; display: block; }
.mapv-labels span { position: absolute; transform: translate(-50%, -160%); font-family: var(--font-display); font-size: 13px; color: var(--parch); white-space: nowrap; text-shadow: 0 2px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink); pointer-events: none; }
.mapv-legend { display: flex; gap: 14px; justify-content: center; font-weight: 800; font-size: 12px; }
.mapv-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; border: 2px solid var(--ink); vertical-align: -1px; }
.mapv-legend .law::before { background: rgba(200, 30, 30, 0.6); border-color: #ff5a4a; border-style: dashed; }
.mapv-labels span.lawless { color: #ff8a7a; transform: translate(-50%, 0); }
.mapv-legend .me::before { background: #3bf0ff; } .mapv-legend .crew::before { background: #9dffc8; } .mapv-legend .npc::before { background: #ffe39a; } .mapv-legend .goal::before { background: #ffcf4a; box-shadow: 0 0 6px #ffcf4a; }
@container stage (max-width: 760px) {
  #charpanel { padding: calc(10px + var(--safe-t)) 8px calc(10px + var(--safe-b)); justify-content: center; }
  .cp-gear, .cp-stats { grid-template-columns: minmax(0, 1fr); }
  .doll { height: 220px; } .doll-slot { width: 50px; height: 50px; }
  .cp-gear { height: auto; } .cp-right { grid-template-rows: none; } .cp-detail { overflow: visible; }
  .pack-inventory { max-height: none; overflow: visible; }
  .bag-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .cp-head .tab .kbd { display: none; }
  #dialog { bottom: calc(14px + var(--safe-b)); }
}

/* ---- Tatuajes (M4.7) ------------------------------------------------------------------------------- */
.cp-tattoo { display: grid; gap: 8px; }
.tt-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; background: rgba(10, 23, 38, 0.45); border-radius: 10px; box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45); padding: 8px 10px; }
.tt-weapon b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 17px; color: var(--brass-l); text-shadow: 0 2px 0 var(--ink); }
.tt-weapon small { color: var(--text-dim); font-weight: 800; font-size: 12px; }
.tt-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tt-slot { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 2px 8px; text-align: left; padding: 6px 8px; min-height: 56px; border-radius: 10px; border: 2px solid var(--ink); background: radial-gradient(circle at 30% 20%, #16304a, #0b1826); color: var(--parch); cursor: pointer; }
.tt-slot.tattoo { box-shadow: inset 0 0 0 2px #8a5cff; }
.tt-slot .kbd { grid-row: 1 / 3; }
.tt-slot .tt-ico { grid-row: 1 / 3; }
.tt-slot .tinta { grid-column: 3; width: auto; }
.tt-ico svg { width: 32px; height: 32px; display: block; }
.tt-name { display: grid; line-height: 1.15; min-width: 0; }
.tt-name b { font-size: 14px; }
.tt-name small { color: var(--text-dim); font-weight: 800; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 10px; }
.tt-list, .tt-detail { background: rgba(10, 23, 38, 0.45); border-radius: 10px; box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45); padding: 8px 10px; }
.tt-list h4 { margin: 2px 0 6px; font-family: var(--font-display); font-weight: 400; font-size: 15px; color: var(--brass-l); text-shadow: 0 2px 0 var(--ink); }
.tt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-bottom: 8px; }
.tt-card .tt-name small { white-space: normal; }
.tt-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; text-align: left; padding: 6px 26px 6px 8px; min-height: 48px; border-radius: 10px; border: 2px solid var(--ink); background: rgba(18, 37, 58, 0.85); color: var(--parch); cursor: pointer; }
.tt-card.tattoo { box-shadow: inset 0 0 0 1.5px rgba(138, 92, 255, 0.75); }
.tt-card.locked { filter: grayscale(0.85); opacity: 0.7; }
.tt-card.unlearned:not(.locked) { box-shadow: inset 0 0 0 1.5px var(--brass-l); }
.tt-card.sel, .tt-slot.sel { outline: 3px solid var(--brass-l); outline-offset: 1px; }
.tt-card .rk { position: absolute; right: 6px; top: 4px; font: 400 12px var(--font-display); font-style: normal; color: #d9c6ff; text-shadow: 0 1px 0 var(--ink); }
.tt-card .in { position: absolute; right: 5px; bottom: 5px; font: 900 10px/1 var(--font-display); font-style: normal; color: var(--ink); background: var(--brass-l); border-radius: 4px; padding: 2px 4px; }
.tt-card-big .tt-head { display: flex; gap: 10px; align-items: center; }
.tt-card-big .tt-head .tt-ico svg { width: 44px; height: 44px; }
.tt-card-big .tt-head b { font-family: var(--font-display); font-size: 18px; font-weight: 400; color: var(--parch); }
.tt-card-big .tt-head small { display: block; color: var(--text-dim); font-weight: 800; font-size: 12px; }
.tt-hint { margin: 8px 0 4px; font-weight: 800; font-size: 13.5px; }
.tt-num { margin: 0 0 4px; font-size: 12.5px; color: #ffe0a8; font-weight: 700; }
.tt-how { margin: 0 0 8px; font-size: 12px; color: var(--text-dim); font-weight: 800; }
.tt-forms { display: grid; gap: 5px; margin-bottom: 8px; }
.tt-form { text-align: left; padding: 5px 8px; min-height: 44px; border-radius: 8px; border: 2px solid var(--ink); background: rgba(10, 23, 38, 0.6); color: var(--parch); cursor: pointer; }
.tt-form b { font-size: 13px; font-weight: 900; }
.tt-form small { display: block; color: var(--text-dim); font-size: 11.5px; font-weight: 800; }
.tt-form.on { background: linear-gradient(180deg, #6b46d8, #3f2590); box-shadow: inset 0 0 0 2px #c9a8ff; }
.tt-form.locked, .tt-form:disabled { opacity: 0.55; cursor: default; }
.tt-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tt-actions .btn { min-height: 44px; }
.tt-note { margin: 0; font-size: 11.5px; color: var(--text-dim); font-weight: 800; text-align: center; }
.tt-card-big.shake { animation: ttShake 0.35s; }
@keyframes ttShake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@container stage (max-width: 760px) {
  .tt-body, .tt-top { grid-template-columns: minmax(0, 1fr); }
  .tt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
