.tr-screen {
  --ink:#fff0d4; --soft:#e0c7ac; --line:#896044; --depth:#412d25; --cream:#f9ebc6;
  --board:linear-gradient(145deg,#513a2df7,#32251ff6); --button:linear-gradient(#a7714d,#805136);
  width:min(100%,1320px); margin:0 auto; padding:22px clamp(15px,3.8vw,54px) 60px;
  color:var(--ink); font:500 1rem/1.4 'DM Sans',sans-serif;
}
.tr-screen * {box-sizing:border-box}
.tr-screen :is(h1,h2,h3,p,dl,dd,ul) {margin:0}
.tr-screen :is(h1,h2,h3) {font-family:Barlow,sans-serif;line-height:1.07;font-weight:900}
.tr-screen h1 {font-size:clamp(2.25rem,4.3vw,3.8rem);letter-spacing:-.045em;text-shadow:0 3px 0 #412b27,0 0 15px #39251683}
.tr-screen h2 {font-size:clamp(1.35rem,2vw,1.8rem);letter-spacing:-.02em}
.tr-screen h3 {font-size:1.25rem;letter-spacing:-.015em}
.tr-screen :is(button,input,select) {font-family:inherit}
.tr-screen button {cursor:pointer}
.tr-screen button:disabled {cursor:default}
.tr-screen :is(button,input,select,a):focus-visible {outline:3px solid #f4e899;outline-offset:3px}
.tr-screen .tr-sr {position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap;padding:0;border:0}
.tr-head,.tr-title-row,.tr-team-controls,.tr-actions,.tr-resource,.tr-readout,.tr-stats,.tr-stats span,.tr-button,.tr-tabs {display:flex;align-items:center}
.tr-head,.tr-title-row,.tr-team-controls {justify-content:space-between;gap:14px}
.tr-head {margin-bottom:16px;min-height:64px}
.tr-readout,.tr-resource {display:inline-flex;gap:6px;border:1px solid #a77b54;border-radius:12px;padding:6px 11px;color:#ffe7ae;background:#463224ed;font-size:.89rem;white-space:nowrap;box-shadow:inset 0 1px #bb89604d}
.tr-readout svg,.tr-resource svg {width:18px;height:18px;color:#e5bd70}
.tr-panel {padding:20px;border:2px solid var(--line);border-radius:16px 12px 15px 12px;background:var(--board);box-shadow:inset 0 2px #a4785380,0 4px #4b322a,0 10px 20px #3520163b}
.tr-panel+.tr-panel {margin-top:22px}
.tr-presets {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:16px}
.tr-presets button {display:flex;gap:10px;align-items:center;min-width:0;padding:9px 13px;border:1.5px solid #89654e;border-radius:8px;background:#403029;color:#dec8ad;text-align:left}
.tr-presets button[aria-pressed=true] {background:linear-gradient(110deg,#73503a,#624632);border-color:#e0b778;color:#fff4d7;box-shadow:inset 0 2px #e8bb665e}
.tr-presets button>span:last-child {min-width:0}
.tr-presets button b,.tr-presets button small {display:block}
.tr-presets button b {overflow-wrap:anywhere;font:800 1.1rem/1.1 Barlow,sans-serif}
.tr-presets button small {margin-top:2px;color:var(--soft);font-size:.78rem}
.tr-slot-icon {display:grid;place-items:center;width:30px;height:31px;flex:none;border-radius:8px;background:#2a231c72;color:#efd59c}
.tr-slot-icon svg {width:19px;height:19px}
.tr-team-controls {align-items:end;margin-bottom:15px}
.tr-screen label {display:block;color:var(--soft);font-weight:700;font-size:.84rem}
.tr-team-controls label {width:min(245px,42%)}
.tr-screen :is(input,select) {width:100%;min-height:36px;border:1.5px solid #a5815f;border-radius:7px;background:#fbedd1;color:#3a2c22;padding:7px 11px;font-size:.97rem;font-weight:700}
.tr-screen input {display:block;margin-top:4px}
.tr-actions {gap:7px;flex-wrap:wrap}
.tr-button {display:inline-flex;justify-content:center;gap:5px;min-height:36px;padding:7px 13px;border-radius:8px;border:1.5px solid #ad7b56;box-shadow:inset 0 1.5px #d7ab7666,0 2px #33251d;background:var(--button);color:#fff0cf;font-weight:700;font-size:.87rem;white-space:nowrap}
.tr-button.tr-primary {background:linear-gradient(#b7cb70,#94ad50);border-color:#d4df91;color:#263920;text-shadow:0 1px #d9e7a0;box-shadow:inset 0 1px #edf5ba,0 2px #405136}
.tr-button.tr-quiet {background:#49352a;border-color:#89684f;color:#e3cab0}
.tr-button:disabled {filter:saturate(.55);opacity:.56}
.tr-button:not(:disabled):hover,.tr-presets button:hover,.tr-tabs button:hover {filter:brightness(1.12)}
.tr-formation {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border:2px solid #79553e;border-radius:12px;overflow:hidden;background:linear-gradient(#2a302b33,#463f2724 70%,#30251b),url(assets/maps/moss-gate.webp) center 53%/cover no-repeat}
.tr-fighter {display:flex;align-items:center;flex-direction:column;min-width:0;position:relative}
.tr-fighter+.tr-fighter {border-left:1px solid #392e2575}
.tr-position {align-self:flex-start;background:#3c3329df;color:#fbebbd;border-radius:0 0 7px 0;padding:4px 10px;font:800 .87rem/1.2 Barlow,sans-serif}
.tr-stage {display:flex;align-items:flex-end;justify-content:center;position:relative;width:100%;height:clamp(90px,13vw,151px);isolation:isolate}
.tr-stage:after {content:'';position:absolute;bottom:0;left:24%;width:52%;height:12%;z-index:-1;background:radial-gradient(ellipse,#332a21a1,transparent 72%)}
.tr-stage img {display:block;width:min(85%,170px);height:100%;max-height:100%;object-fit:contain;object-position:bottom center;filter:drop-shadow(0 3px 2px #30251b44)}
.tr-fighter-base {width:100%;background:linear-gradient(#3c392ad9,#3b2d23f2);padding:10px clamp(7px,1.5vw,18px);text-align:center}
.tr-fighter-base select {width:100%;max-width:245px;min-height:34px;text-align:center;font:800 1.18rem/1.12 Barlow,sans-serif}
.tr-stats {justify-content:center;gap:14px;margin-top:7px!important;flex-wrap:wrap;color:#f5e1b9;font-size:.81rem;font-weight:650}
.tr-stats span {gap:3px;white-space:nowrap}
.tr-stats svg {height:14px;width:14px;color:#cbe1a0}
.tr-stats span+span svg {color:#f2a28b}
.tr-text-btn {display:inline-block;padding:3px 1px;margin-top:5px;color:#ffe4a7;font-size:.8rem;font-weight:700;text-decoration:underline;text-underline-offset:2px}
.tr-note {font-size:.87rem;color:var(--soft);margin-top:12px!important;line-height:1.4}
.tr-title-row>span {font-size:.89rem;color:#e3cbb0;font-weight:650}
.tr-deck-owner {margin-top:17px;border-top:1px solid #785640;padding-top:15px}
.tr-deck-owner h3 {display:flex;align-items:center;gap:9px;font-size:1.45rem}
.tr-deck-owner h3 span {font:800 .76rem/1.1 'DM Sans',sans-serif;color:#2f3f2c;background:#c2d19a;border-radius:6px;padding:4px 7px}
.tr-loadout {color:var(--soft);font-size:.82rem;margin-top:3px!important}
.tr-skill-grid {display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:clamp(8px,1.2vw,17px);list-style:none;padding:18px 3px 3px 9px}
.tr-skill-grid li {min-width:0}
.tr-locus {display:flex;flex-direction:column;align-items:center;min-height:17px;gap:2px;margin-top:7px;font-size:.76rem;text-align:center;color:#e3c9a5}
.tr-locus span {font-size:.73rem;color:#c2df9e}
.tr-tabs {flex-wrap:wrap;gap:6px}
.tr-tabs button {min-height:34px;padding:7px 13px;border-radius:7px;border:1px solid #916c50;background:#3c2e27;color:#e4cbb0;font-size:.9rem;font-weight:700}
.tr-tabs button[aria-pressed=true] {background:#e8cf9f;color:#4b3424;border-color:#eacb95;box-shadow:inset 0 1.5px #fff0bc}
.tr-item-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;margin-top:18px}
.tr-inv-item,.tr-empty {background:linear-gradient(125deg,#fbebc7,#efdab3);border:2px solid #ae865b;border-radius:11px;box-shadow:inset 0 1px #fff4d9,0 3px #35281f;color:#473728}
.tr-inv-item {display:grid;grid-template-columns:46px 1fr;align-content:start;align-items:start;gap:8px 10px;padding:16px}
.tr-inv-item h3 {color:#3b382a;margin-top:2px}
.tr-inv-item small {font-weight:800;font-size:.75rem;line-height:1;letter-spacing:.045em;text-transform:uppercase;color:#75614a}
.tr-inv-item p {font-size:.88rem;margin-top:6px;line-height:1.4}
.tr-item-mark {width:42px;height:44px;display:grid;place-items:center;border-radius:10px 9px 14px 8px;background:linear-gradient(145deg,#c8d7a2,#75965f);border:1.5px solid #48633d;color:#385a30;box-shadow:inset 0 2px #e5edbb,0 2px #947b55}
.tr-item-mark svg {width:25px;height:25px;stroke-width:2}
.tr-item-mark.charm {border-radius:40% 40% 48% 48%;background:linear-gradient(145deg,#ebd9a8,#c79a59);color:#735331;border-color:#947741}
.tr-item-mark.dust {background:linear-gradient(145deg,#f8d79a,#d7a052);color:#83542d;border-color:#ab773b}
.tr-item-mark.egg {border-radius:52% 52% 42% 42%;background:#e7dfb5;color:#68764d}
.tr-counts {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;grid-column:1/-1;border-block:1px solid #bcaa87;padding:7px 0}
.tr-counts dt {font-size:.74rem;color:#6e604b}
.tr-counts dd {font:900 1.2rem/1.2 Barlow,sans-serif;color:#3e402c}
.tr-material-count {grid-column:1/-1;border-block:1px solid #bcaa87;padding:8px 0;font-size:.86rem;color:#65563d}
.tr-inv-item>.tr-button {grid-column:1/-1;justify-self:start;background:#68503a;border-color:#7d6146}
.tr-inv-item>.tr-button.tr-primary {background:#b6cb78;border-color:#859d54}
.tr-empty {grid-column:1/-1;text-align:center;padding:34px 15px}
.tr-empty>svg {width:34px;height:34px;color:#947e56;margin-bottom:8px}
.tr-empty h3 {margin-bottom:12px}
.tr-dialog {width:min(440px,calc(100vw - 28px));padding:0;max-height:85dvh;overflow:auto;color:#f6e6cc;background:linear-gradient(145deg,#604633,#392a24);border:3px solid #ab8058;border-radius:14px;box-shadow:0 6px #34271f,0 16px 55px #24191080}
.tr-dialog::backdrop {background:#211b18b8}
.tr-dialog-body {padding:22px}
.tr-dialog h2 {font-size:1.7rem}
.tr-dialog h3 {margin:15px 0 8px}
.tr-dialog p {color:#e5cdb2;margin:10px 0;font-size:.94rem}
.tr-dialog form label {padding:8px 0;display:grid;gap:5px}
.tr-dialog .tr-actions {margin-top:16px}
.tr-equipped-list {list-style:none;padding:0}
.tr-equipped-list li {display:flex;align-items:center;justify-content:space-between;gap:7px;padding:6px 0;border-bottom:1px solid #8e6b52}
@media(max-width:1000px) {
  .tr-skill-grid {grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 15px}
  .tr-item-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:650px) {
  .tr-screen {padding:14px 10px 35px}.tr-head {min-height:44px;margin-bottom:11px}
  .tr-panel {padding:12px}.tr-presets {gap:5px}.tr-presets button {padding:8px 6px}.tr-slot-icon {display:none}
  .tr-team-controls {flex-wrap:wrap;gap:8px}.tr-team-controls label {width:min(100%,245px)}
  .tr-actions {gap:5px}.tr-formation {border-radius:8px}.tr-position {font-size:.75rem;padding:3px 7px}
  .tr-stage {height:83px}.tr-fighter-base {padding:7px 3px}.tr-fighter-base select {font-size:.92rem;padding:5px 0;min-height:29px}
  .tr-stats {gap:2px 6px;font-size:.7rem}.tr-stats svg {width:11px;height:11px}.tr-text-btn {font-size:.75rem}
  .tr-title-row {flex-wrap:wrap;gap:8px}.tr-tabs {gap:4px}.tr-tabs button {font-size:.82rem;padding:6px 9px}
  .tr-item-grid {grid-template-columns:1fr}.tr-inv-item {padding:13px}.tr-skill-grid {gap:13px 10px}
}
@media(max-width:470px) {
  .tr-skill-grid {grid-template-columns:repeat(2,minmax(0,1fr))}.tr-readout,.tr-resource {font-size:.76rem;padding:5px 8px}
}
