/* The Tower: a screen of the game. It sits in the hub's 1100x800 stage, in the hub's
   materials (game-surfaces.css): slate boards, #465964 edges, the 3px bottom accent bar on
   buttons, Libre Franklin. The stage scales to fit the window (tower.js) and never scrolls
   the page; phones reflow to a stacked layout. */
:root {
    --tw-surface-hi: #22333d;
    --tw-surface: #16232c;
    --tw-surface-low: #101a22;
    --tw-well: #0c151b;
    --tw-edge: #465964;
    --tw-edge-soft: #2f414b;
    --tw-text: #f2f3f0;
    --tw-muted: #b9c5c8;
    --tw-faint: #93a4aa;
    --tw-accent: #e3ad68;
    --tw-accent-hi: #f4c98f;
    --tw-danger: #e0675a;
    --tw-boss: #c9463d;
    --tw-heal: #6fbf8e;
    --tw-wound: #d9a441;
    --tw-common: #a9bfa6;
    --tw-rare: #6fb0f2;
    --tw-forbidden: #ef7a6e;
    --tw-prismatic: #d9a8ff;
    --tw-shadow: 0 16px 36px rgba(0, 0, 0, .38);
    --tw-kanji: 'Noto Serif JP', 'Yu Mincho', serif;
    --tw-ease: cubic-bezier(.16, 1, .3, 1);
    --tw-scale: 1;
    color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body.tower-page {
    overflow: hidden;
    background: #000;
    color: var(--tw-text);
    font: 500 13px/1.4 'Libre Franklin', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    accent-color: var(--tw-accent);
    caret-color: var(--tw-accent);
    scrollbar-color: var(--tw-edge) var(--tw-surface-low);
}
body.is-busy { cursor: progress; }
body.is-busy :is(button, a.tw-button) { pointer-events: none; }
body.is-leaving .tw-stage { opacity: 0; transition: opacity .25s ease; }
::selection { background: rgba(227, 173, 104, .45); color: var(--tw-text); }
button { font: inherit; color: inherit; }
img { display: block; }
:focus-visible { outline: 2px solid var(--tw-accent); outline-offset: 2px; }
.tw-num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- the stage */
.tw-viewport { position: fixed; inset: 0; overflow: hidden; }
/* The window around the stage shows the same scene, darker, like the hub's letterbox. */
.tw-viewport::before {
    content: '';
    position: absolute;
    inset: -24px;
    background: linear-gradient(rgba(5, 10, 13, .78), rgba(5, 10, 13, .78)), var(--tw-scene, url('ingamebg_4.jpg')) center / cover no-repeat;
    filter: blur(10px);
}
.tw-stage {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1100px;
    height: 800px;
    transform: translate(-50%, -50%) scale(var(--tw-scale));
    display: grid;
    grid-template-rows: 52px minmax(0, 1fr);
    overflow: hidden;
    isolation: isolate;
    background: #16252e;
}
.tw-backdrop { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.tw-backdrop::before {
    content: '';
    position: absolute;
    inset: -12px;
    background: var(--tw-scene, url('ingamebg_4.jpg')) center 35% / cover no-repeat;
    filter: blur(5px) saturate(.9);
}
.tw-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(9, 16, 21, .55), rgba(9, 16, 21, .72));
}
body[data-scene="waves"] { --tw-scene: url('ingamebg_4.jpg'); }
body[data-scene="forest"] { --tw-scene: url('ingamebg_3.jpg'); }
body[data-scene="konoha"] { --tw-scene: url('selectionbg_1.jpg'); }
body[data-scene="dusk"] { --tw-scene: url('ingamebg_5.jpg'); }
body[data-scene="boss"] { --tw-scene: url('ingamebg_2.jpg'); }
body[data-scene="victory"] { --tw-scene: url('selectionbg_2.jpg'); }

/* ---------------------------------------------------------------- the hub nav */
.tw-nav {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 26px;
    background: #0f1b22;
    border-bottom: 1px solid #51616a;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .36);
    z-index: 2;
}
.tw-wordmark { width: 170px; color: #f0b866; font: 700 15px/1 'Libre Franklin', sans-serif; letter-spacing: -.025em; text-decoration: none; white-space: nowrap; }
.tw-wordmark span { color: #f0f1ed; margin-left: 4px; }
.tw-tabs { display: flex; height: 100%; }
.tw-tab {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 22px;
    color: #c0cbce;
    font: 700 11px/1 'Libre Franklin', sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
}
.tw-tab:hover, .tw-tab.is-active { color: #f4c27d; }
.tw-tab.is-active::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; background: var(--tw-accent); }
.tw-nav-tools { margin-left: auto; display: flex; gap: 8px; }
.tw-tool {
    height: 32px;
    padding: 0 12px;
    border: 1px solid #657780;
    border-radius: 6px;
    background: #20313a;
    color: #f1eee6;
    font: 700 11px/1 'Libre Franklin', sans-serif;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
}
.tw-tool:hover { border-color: var(--tw-accent); }
.tw-tool.is-danger:hover { border-color: var(--tw-danger); color: #ffd7d1; }

/* ---------------------------------------------------------------- body: team column + board */
.tw-body { position: relative; min-height: 0; padding: 18px 26px 22px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.tw-body.has-team { grid-template-columns: 262px minmax(0, 1fr); }
.tw-board {
    border: 1px solid var(--tw-edge);
    border-radius: 9px;
    background: linear-gradient(155deg, var(--tw-surface-hi) 0%, var(--tw-surface) 48%, var(--tw-surface-low) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.tw-main { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 14px; }
.tw-loading { place-self: center; width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--tw-edge-soft); border-top-color: var(--tw-accent); animation: tw-spin .8s linear infinite; }
@keyframes tw-spin { to { transform: rotate(360deg); } }

/* The team column. */
.tw-team { display: flex; flex-direction: column; gap: 12px; min-height: 0; padding: 16px 14px; }
.tw-label { margin: 0; color: var(--tw-muted); font: 800 11px/1 'Libre Franklin', sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.tw-label b { color: var(--tw-text); }
.tw-label .is-full { color: var(--tw-danger); }
.tw-members { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.tw-member {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 6px 6px 6px 9px;
    border: 0;
    border-radius: 0;
    background: none;
    text-align: left;
}
.tw-member.is-pickable { cursor: pointer; border-radius: 6px; background: rgba(227, 173, 104, .07); }
.tw-member.is-pickable:hover, .tw-member.is-pickable:focus-visible { background: rgba(227, 173, 104, .14); outline: none; }
.tw-member.is-pickable:hover .tw-face img, .tw-member.is-pickable:focus-visible .tw-face img { border-color: var(--tw-accent); box-shadow: 0 0 0 1px var(--tw-accent); }
.tw-member.is-blocked { opacity: .45; }
.tw-face { position: relative; width: 56px; height: 56px; }
.tw-face img { width: 56px; height: 56px; border: 1px solid #5c6e76; border-radius: 4px; object-fit: cover; }
.tw-member.is-dead .tw-face img { filter: grayscale(1) brightness(.5); }
.tw-member-name { display: flex; align-items: baseline; gap: 6px; font-weight: 800; font-size: 13px; line-height: 1.2; }
.tw-member-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-state { flex: none; font-size: 11px; font-weight: 800; }
.tw-state.is-fallen { color: var(--tw-wound); }
.tw-state.is-dead { color: var(--tw-danger); }
.tw-member > span:last-child { display: block; min-width: 0; }
.tw-hp { position: relative; display: block; height: 15px; margin: 5px 0; border: 1px solid #33444d; border-radius: 2px; background: var(--tw-well); overflow: hidden; }
.tw-hp i { display: block; height: 100%; background: #4caf50; transition: width .4s var(--tw-ease); }
.tw-hp.is-low i { background: var(--tw-wound); }
.tw-hp.is-dead i { background: transparent; }
.tw-hp span { position: absolute; inset: 0; display: grid; place-items: center; font: 800 10px/1 'Libre Franklin', sans-serif; color: #fff; text-shadow: 0 1px 1px #000; font-variant-numeric: tabular-nums; }
.tw-icons { display: flex; flex-wrap: wrap; gap: 4px; min-height: 18px; }
.tw-icons.is-grid { gap: 6px; }
.tw-aug { display: block; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 3px; background: none; box-shadow: 0 0 0 1px var(--tier, #5c6e76); cursor: help; }
.tw-aug img { width: 100%; height: 100%; border-radius: 3px; }
.tw-icons.is-grid .tw-aug { width: 30px; height: 30px; }
.tw-aug.tier-common, .tier-common { --tier: var(--tw-common); }
.tw-aug.tier-rare, .tier-rare { --tier: var(--tw-rare); }
.tw-aug.tier-forbidden, .tier-forbidden, .tier-kage { --tier: var(--tw-forbidden); }
.tw-aug.tier-prismatic, .tier-prismatic { --tier: var(--tw-prismatic); }
.tier-genin { --tier: var(--tw-common); }
.tier-jonin { --tier: var(--tw-rare); }
.tier-cursed { --tier: #b26cff; }
.tw-none { color: var(--tw-faint); font-size: 12px; }
.tw-auglist { display: grid; align-content: start; gap: 1px; min-height: 0; margin: 0; padding: 0; overflow: auto; list-style: none; }
.tw-augrow { display: flex; align-items: center; gap: 9px; width: 100%; padding: 4px 6px 4px 2px; border: 0; border-radius: 3px; background: none; color: var(--tier, var(--tw-text)); font-size: 12.5px; font-weight: 800; text-align: left; cursor: help; }
.tw-augrow:hover, .tw-augrow:focus-visible { background: rgba(255, 255, 255, .04); outline: none; }
.tw-augrow img { flex: none; width: 22px; height: 22px; border-radius: 3px; box-shadow: 0 0 0 1px var(--tier, #5c6e76); }
.tw-augrow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-augrow.is-new { animation: tw-new 1.6s var(--tw-ease) 2; }
@keyframes tw-new { 0%, 100% { background: transparent; } 40% { background: rgba(217, 168, 255, .22); } }
.tw-purse { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--tw-edge-soft); display: grid; gap: 3px; color: var(--tw-muted); font-size: 12px; font-weight: 700; }
.tw-purse strong { color: var(--tw-accent); font-size: 22px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tw-pickbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--tw-accent); border-radius: 6px; background: rgba(227, 173, 104, .1); font-weight: 800; font-size: 12px; }
.tw-pickbar button { border: 0; background: none; color: var(--tw-accent-hi); font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- the floor header */
.tw-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; align-items: center; min-height: 88px; padding: 14px 20px; }
.tw-floor { display: flex; align-items: baseline; gap: 4px; font-weight: 900; font-size: 40px; line-height: .9; font-variant-numeric: tabular-nums; }
.tw-floor small { color: var(--tw-muted); font-size: 15px; font-weight: 800; }
.tw-seal-big { display: grid; place-items: center; width: 52px; height: 52px; border: 2px solid var(--tw-accent); border-radius: 50%; color: var(--tw-accent-hi); font: 700 24px/1 var(--tw-kanji); }
.tw-seal-big.is-boss { border-color: var(--tw-boss); color: #ff9f95; }
.tw-title { min-width: 0; }
.tw-title h1 { margin: 0; font-size: 20px; font-weight: 900; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-title p { margin: 4px 0 0; color: var(--tw-muted); font-size: 12.5px; font-weight: 600; }
.tw-title p b { color: var(--tw-accent); }
.tw-title p .is-boss { color: #ff9f95; }
.tw-story-line { display: block; max-width: 72ch; color: var(--tw-text); font-size: 13.5px; font-weight: 500; line-height: 1.5; }
.tw-head-side { display: flex; align-items: center; gap: 18px; }
.tw-dist { display: grid; gap: 2px; color: var(--tw-muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.tw-dist strong { color: var(--tw-accent); font-size: 24px; line-height: 1; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.tw-dist.is-boss strong { color: #ff9f95; }
.tw-pips { display: flex; gap: 4px; margin-top: 8px; }
.tw-pips i { width: 22px; height: 5px; border-radius: 2px; background: #2a3a43; }
.tw-pips i.is-done { background: var(--tw-accent); }
.tw-pips i.is-next { background: var(--tw-accent-hi); box-shadow: 0 0 0 1px #0f1b22, 0 0 0 2px var(--tw-accent-hi); }
.tw-pips i.is-boss { background: #6a2a25; }
.tw-pips i.is-boss.is-done { background: var(--tw-boss); }

/* ---------------------------------------------------------------- postings */
.tw-postings { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; grid-template-rows: 196px minmax(0, 1fr); gap: 0 14px; min-height: 0; }
.tw-postings.is-scenic { grid-template-rows: minmax(0, 1fr) auto; }
/* Art and text rows line up across the postings, so seals and titles share one baseline. */
.tw-postings > .tw-posting:not(.is-slot) { grid-row: 1 / span 2; display: grid; grid-template-rows: subgrid; gap: 0; }
.tw-postings > .tw-posting.is-slot { grid-row: 1 / span 2; }
.tw-posting { position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.tw-posting.is-boss, .tw-posting.is-elite { border-color: var(--tw-boss); }
.tw-posting.is-elite .tw-posting-kind { color: #ff9f95; }
.tw-posting.is-elite .tw-seal { --seal: var(--tw-boss); --seal-ink: #ff9f95; }
.tw-posting.is-picked { border-color: var(--tw-accent); }
.tw-posting-art {
    position: relative;
    flex: none;
    min-height: 0;
    background: linear-gradient(180deg, rgba(12, 21, 27, .3), rgba(12, 21, 27, .9)), var(--tw-scene, url('ingamebg_4.jpg')) center 40% / cover no-repeat;
    border-bottom: 1px solid var(--tw-edge-soft);
}
.tw-posting-art > .tw-seal { position: absolute; left: 16px; bottom: -26px; }
.tw-seal {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border: 2px solid var(--seal, var(--tw-accent));
    border-radius: 50%;
    background: var(--tw-surface);
    color: var(--seal-ink, var(--tw-accent-hi));
    font: 700 25px/1 var(--tw-kanji);
    z-index: 1;
}
.tw-seal.is-boss, .tw-posting.is-boss .tw-seal { --seal: var(--tw-boss); --seal-ink: #ff9f95; }
.tw-seal.is-rest { --seal: var(--tw-heal); --seal-ink: #b5e8c8; }
.tw-seal.is-shop { --seal: var(--tw-rare); --seal-ink: #bfdcf8; }
.tw-seal.is-event { --seal: #b48cf0; --seal-ink: #dccaff; }
.tw-faces { position: absolute; inset: 14px 14px auto 14px; display: flex; justify-content: flex-end; gap: 7px; }
.tw-faces figure { flex: 0 1 72px; min-width: 0; margin: 0; }
.tw-faces img { width: 100%; height: auto; aspect-ratio: 1; border: 1px solid #5c6e76; border-radius: 4px; object-fit: cover; }
.tw-faces figcaption { margin-top: 3px; color: #ffb3aa; font-size: 11px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.tw-art-portrait { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; opacity: .9; }
.tw-art-face { position: absolute; right: 14px; top: 14px; width: 112px; height: 112px; border: 1px solid #5c6e76; border-radius: 6px; object-fit: cover; box-shadow: 0 10px 22px rgba(0, 0, 0, .4); }
.tw-art-icon { position: absolute; right: 14px; top: 14px; width: 72px; height: 72px; border-radius: 6px; box-shadow: 0 0 0 2px var(--tier, var(--tw-edge)), 0 10px 22px rgba(0, 0, 0, .4); }
.tw-posting-body { display: flex; flex: none; flex-direction: column; gap: 6px; min-height: 0; padding: 36px 16px 16px; }
.tw-posting-body h2 { margin: 0; font-size: 17px; font-weight: 900; line-height: 1.2; }
.tw-posting-kind { color: var(--tw-accent); font-size: 12px; font-weight: 800; }
.tw-posting.is-boss .tw-posting-kind { color: #ff9f95; }
.tw-posting-kind.tier-common { color: var(--tw-common); }
.tw-posting-kind.tier-rare { color: var(--tw-rare); }
.tw-posting-kind.tier-forbidden { color: var(--tw-forbidden); }
.tw-posting-kind.tier-prismatic { color: var(--tw-prismatic); }
.tw-posting-text { margin: 0; color: var(--tw-muted); font-size: 12.5px; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.tw-posting-text[data-tip] { cursor: help; }
.tw-posting-text.is-short { -webkit-line-clamp: 3; }
.tw-affixes { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.tw-affix { border: 0; padding: 0; background: none; color: #ffb3aa; font-size: 12px; font-weight: 800; cursor: help; text-decoration: underline dotted rgba(255, 179, 170, .5); text-underline-offset: 3px; }
.tw-fuse-note { margin: 2px 0 0; color: #e9d6ff; font-size: 12px; font-weight: 700; line-height: 1.35; }
.tw-fuse-note b { color: var(--tw-prismatic); }
.tw-posting-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 8px; }
.tw-price { color: var(--tw-accent); font-weight: 900; font-size: 14px; font-variant-numeric: tabular-nums; }
.tw-price.is-short { color: var(--tw-danger); }
.tw-blocked { color: var(--tw-faint); font-size: 12px; font-weight: 700; }
.tw-skills { display: flex; gap: 5px; }
.tw-skills img { width: 34px; height: 34px; border: 1px solid #4b5c64; border-radius: 3px; cursor: help; }

/* ---------------------------------------------------------------- buttons */
.tw-button {
    --bar: #9aabb3;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 18px;
    border: 1px solid #65777d;
    border-radius: 5px;
    background: linear-gradient(165deg, #2d424c 0%, #1d303a 42%, #13232b 100%);
    box-shadow: inset 0 1px rgba(255, 255, 255, .13), inset 0 -3px var(--bar), 0 6px 14px rgba(0, 0, 0, .3);
    color: var(--tw-text);
    font: 800 12px/1 'Libre Franklin', sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s ease, transform .15s var(--tw-ease), background .15s ease;
}
.tw-button:hover:not(:disabled) { border-color: var(--bar); background: linear-gradient(180deg, #344852, #192a34); transform: translateY(-1px); }
.tw-button:active:not(:disabled) { transform: translateY(1px); }
.tw-button.is-primary { --bar: var(--tw-accent); border-color: #a07a4a; }
.tw-button.is-danger { --bar: var(--tw-danger); }
.tw-button.is-wide { width: 100%; }
.tw-button.is-large { min-height: 48px; font-size: 13px; padding: 0 26px; }
.tw-button:disabled { opacity: .45; cursor: not-allowed; }
.tw-button.is-loading { color: transparent; }
.tw-button.is-loading::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--tw-muted); border-top-color: transparent; animation: tw-spin .7s linear infinite; }
.tw-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tw-link { border: 0; padding: 0; background: none; color: var(--tw-accent-hi); font-weight: 800; font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- draft */
.tw-slot-list { display: grid; grid-auto-rows: minmax(0, 1fr); flex: 1; gap: 0; min-height: 0; margin: 8px 0 12px; padding: 0 14px; list-style: none; }
.tw-slot-list > li + li { border-top: 1px solid #2f414b; }
.tw-slot-list > li { display: grid; min-height: 0; }
.tw-candidate {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    width: 100%;
    padding: 8px 8px 8px 11px;
    border: 0;
    border-radius: 0;
    background: none;
    text-align: left;
    cursor: pointer;
}
.tw-candidate:hover { background: rgba(255, 255, 255, .035); }
.tw-candidate[aria-pressed="true"] { background: rgba(227, 173, 104, .1); }
.tw-candidate[aria-pressed="true"] img.tw-portrait { border-color: var(--tw-accent); box-shadow: 0 0 0 2px var(--tw-accent); }
.tw-candidate[aria-pressed="true"] b { color: var(--tw-accent-hi); }
.tw-candidate img.tw-portrait { width: 76px; height: 76px; border-radius: 4px; border: 1px solid #5c6e76; object-fit: cover; }
.tw-candidate b { display: block; font-size: 14px; font-weight: 800; margin-bottom: 5px; }
.tw-candidate .tw-skills img { width: 30px; height: 30px; }
.tw-slot-foot { margin-top: auto; padding: 0 14px 14px; }
.tw-chakra { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--tw-well); }
.tw-chakra span { display: block; }

/* ---------------------------------------------------------------- detail boards */
.tw-detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0; min-height: 0; }
.tw-detail-col { padding: 18px 20px; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.tw-detail-col + .tw-detail-col { border-left: 1px solid var(--tw-edge-soft); }
.tw-enemies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tw-enemy { text-align: center; }
.tw-enemy img { width: 100%; aspect-ratio: 1; border: 1px solid #5c6e76; border-radius: 5px; object-fit: cover; }
.tw-enemy.is-leader img { border: 2px solid var(--tw-boss); }
.tw-enemies.has-leader { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.tw-enemies.has-leader .is-leader { grid-row: span 2; }
.tw-enemies.has-leader .is-leader b { font-size: 15px; }
.tw-enemies.has-leader .tw-enemy:not(.is-leader) { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 2px 8px; align-items: center; text-align: left; }
.tw-enemies.has-leader .tw-enemy:not(.is-leader) img { grid-row: span 2; width: 56px; }
.tw-enemies.has-leader .tw-enemy:not(.is-leader) b { margin: 0; align-self: end; }
.tw-enemies.has-leader .tw-enemy:not(.is-leader) span { align-self: start; }
.tw-enemy b { display: block; margin-top: 6px; font-size: 12.5px; font-weight: 800; }
.tw-enemy span { color: #ffb3aa; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tw-rules { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.tw-rules li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; color: var(--tw-muted); font-size: 12.5px; line-height: 1.45; cursor: help; }
.tw-rules li span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tw-rules li::before { content: ''; width: 8px; height: 8px; margin: 5px 0 0 6px; border-radius: 50%; background: var(--rule, var(--tw-accent)); }
.tw-rules.is-boss li { --rule: var(--tw-boss); }
.tw-champions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tw-champion { display: grid; justify-items: center; gap: 4px; padding: 8px; border: 0; border-radius: 4px; background: none; cursor: pointer; font-size: 12px; font-weight: 800; }
.tw-champion img { width: 52px; height: 52px; border-radius: 4px; object-fit: cover; }
.tw-champion[aria-pressed="true"] { background: rgba(227, 173, 104, .1); color: var(--tw-accent-hi); }
.tw-champion[aria-pressed="true"] img { box-shadow: 0 0 0 2px var(--tw-accent); }
.tw-detail-foot { margin-top: auto; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.tw-story { margin: 0; color: var(--tw-text); font-size: 14px; line-height: 1.55; max-width: 62ch; }

/* ---------------------------------------------------------------- end of a run */
.tw-main > .tw-ended:only-child { grid-row: 1 / -1; }
.tw-ended { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 16px; padding: 22px 24px; }
.tw-ended h1 { margin: 0; font-size: 30px; font-weight: 900; }
.tw-ended.is-victory h1 { color: var(--tw-accent-hi); }
.tw-ledger { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0; color: var(--tw-muted); font-size: 13px; font-weight: 700; }
.tw-ledger div { display: flex; gap: 6px; align-items: baseline; }
.tw-ledger dd { margin: 0; color: var(--tw-text); font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
.tw-ledger .is-ryo dd { color: var(--tw-accent); }
.tw-final { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.2fr); gap: 0; min-height: 0; border-top: 1px solid #2f414b; border-bottom: 1px solid #2f414b; }
.tw-final-member + .tw-final-member { border-left: 1px solid #2f414b; }
.tw-final-member { display: grid; justify-items: center; align-content: center; gap: 8px; padding: 16px; text-align: center; font-weight: 800; }
.tw-final-member > img { width: 112px; height: 112px; border: 1px solid #5c6e76; border-radius: 5px; object-fit: cover; }
.tw-final-member.is-dead > img { filter: grayscale(1) brightness(.5); }
.tw-final-member.is-team { justify-items: start; align-content: start; text-align: left; }
.tw-final-member .tw-icons { justify-content: center; }
.tw-fusions-made { margin: 0; padding: 0; list-style: none; color: var(--tw-muted); font-size: 12px; display: grid; gap: 4px; }
.tw-fusions-made b { color: var(--tw-prismatic); }
.tw-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------------------------------------------------------------- the fusion moment */
.tw-fusion {
    position: absolute;
    inset: 52px 0 0;
    z-index: 5;
    display: grid;
    place-items: center;
    background: rgba(6, 10, 14, .82);
    backdrop-filter: blur(2px);
}
.tw-fusion-card { display: grid; justify-items: center; gap: 14px; width: 520px; padding: 30px 32px 26px; text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, .55); }
.tw-fusion-stage { position: relative; width: 300px; height: 120px; }
.tw-fusion-stage img { position: absolute; top: 12px; width: 96px; height: 96px; border-radius: 8px; box-shadow: 0 0 0 2px var(--tier, var(--tw-edge)); }
.tw-fusion-stage .is-left { left: 0; animation: tw-fuse-left 1.1s var(--tw-ease) both; }
.tw-fusion-stage .is-right { right: 0; animation: tw-fuse-right 1.1s var(--tw-ease) both; }
.tw-fusion-stage .is-result { left: calc(50% - 48px); opacity: 0; animation: tw-fuse-result .6s var(--tw-ease) 1s both; }
@keyframes tw-fuse-left { 0% { transform: none; } 70% { transform: translateX(102px) scale(.86); opacity: 1; } 100% { transform: translateX(102px) scale(.6); opacity: 0; } }
@keyframes tw-fuse-right { 0% { transform: none; } 70% { transform: translateX(-102px) scale(.86); opacity: 1; } 100% { transform: translateX(-102px) scale(.6); opacity: 0; } }
@keyframes tw-fuse-result { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1.15); } }
.tw-fusion-card p { margin: 0; color: var(--tw-muted); font-size: 12.5px; }
.tw-fusion-from { font-weight: 700; }
.tw-fusion-from b { color: var(--tier, var(--tw-text)); }
.tw-fusion-card h2 { margin: 0; font-size: 24px; font-weight: 900; }
.tw-fusion-card .tw-posting-text { -webkit-line-clamp: 4; max-width: 46ch; }

/* ---------------------------------------------------------------- dialogs, sheet, toast, tips */
.tw-dialog {
    width: min(620px, calc(100vw - 32px));
    max-height: min(84vh, 680px);
    padding: 22px;
    border: 1px solid var(--tw-edge);
    border-radius: 9px;
    background: linear-gradient(155deg, var(--tw-surface-hi), var(--tw-surface-low));
    color: var(--tw-text);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .45);
}
.tw-dialog.is-narrow { width: min(440px, calc(100vw - 32px)); }
.tw-dialog.is-tall { height: min(84vh, 680px); }
.tw-dialog[open] { display: flex; flex-direction: column; }
.tw-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.tw-dialog h2 { margin: 0 0 6px; font-size: 18px; font-weight: 900; }
.tw-dialog > p { margin: 0 0 14px; color: var(--tw-muted); }
.tw-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.tw-dialog-list { display: grid; align-content: start; gap: 0; flex: 1; min-height: 0; margin: 0; padding: 0 4px 0 0; overflow: auto; list-style: none; }
.tw-dialog-list button {
    display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%;
    padding: 10px 11px; border: 0; border-radius: 0; background: none; text-align: left; cursor: pointer;
}
.tw-dialog-list > li + li { border-top: 1px solid #2f414b; }
.tw-dialog-list button:hover, .tw-dialog-list button:focus-visible { background: rgba(227, 173, 104, .1); outline: none; }
.tw-dialog-list img { width: 32px; height: 32px; border-radius: 4px; }
.tw-dialog-list small { display: block; margin-top: 2px; color: var(--tw-muted); font-size: 12px; }
.tw-entry { padding: 10px 4px; }
.tw-entry.is-off { opacity: .6; }
.tw-entry header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.tw-entry header b { font-size: 13.5px; }
.tw-entry header span { font-size: 11.5px; font-weight: 800; color: var(--tier, var(--tw-muted)); }
.tw-entry p { margin: 4px 0 0; color: var(--tw-muted); font-size: 12.5px; }
.tw-compendium-tools { display: flex; gap: 8px; margin: 6px 0 12px; }
.tw-compendium-tools input, .tw-compendium-tools select {
    min-height: 38px; padding: 0 10px; border: 1px solid var(--tw-edge); border-radius: 5px; background: var(--tw-well); color: var(--tw-text); font: inherit;
}
.tw-compendium-tools input { flex: 1; min-width: 0; }
.tw-compendium-tools input::placeholder { color: var(--tw-faint); }
.tw-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-height: 70vh; overflow: auto; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--tw-edge); background: var(--tw-surface); box-shadow: 0 -12px 30px rgba(0, 0, 0, .5); }
.tw-sheet h2 { margin: 0; font-size: 16px; }
.tw-sheet p { margin: 4px 0 10px; color: var(--tw-muted); font-size: 12.5px; }
.tw-sheet-list { display: grid; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.tw-sheet-list .tw-member { min-height: 64px; }
.tw-toast { position: fixed; left: 50%; bottom: 24px; z-index: 30; transform: translateX(-50%); max-width: min(520px, calc(100vw - 32px)); padding: 11px 16px; border: 1px solid var(--tw-edge); border-radius: 6px; background: var(--tw-surface); box-shadow: var(--tw-shadow); font-weight: 700; }
.tw-toast[data-tone="error"] { border-color: var(--tw-danger); }
.tw-tip { position: fixed; z-index: 40; max-width: 280px; padding: 9px 11px; border: 1px solid var(--tw-edge); border-radius: 6px; background: #0f1b22; box-shadow: var(--tw-shadow); font-size: 12px; pointer-events: none; }
.tw-tip strong { display: block; margin-bottom: 2px; font-size: 12.5px; }
.tw-tip span { color: var(--tw-muted); }
.tw-error { place-self: center; display: grid; justify-items: center; gap: 12px; padding: 24px; }

/* ---------------------------------------------------------------- motion */
.tw-enter .tw-board { animation: tw-in .32s var(--tw-ease) both; }
.tw-enter .tw-postings > :nth-child(2) { animation-delay: .04s; }
.tw-enter .tw-postings > :nth-child(3) { animation-delay: .08s; }
.tw-enter .tw-postings > :nth-child(4) { animation-delay: .12s; }
@keyframes tw-in { from { opacity: .5; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition: none !important; }
}

/* ---------------------------------------------------------------- phones: stacked, the page scrolls */
body.tw-compact { overflow: auto; }
body.tw-compact .tw-viewport { position: static; }
body.tw-compact .tw-stage {
    position: relative; left: auto; top: auto; width: 100%; height: auto; min-height: 100vh; transform: none;
    grid-template-rows: auto auto;
}
body.tw-compact .tw-backdrop { position: fixed; }
body.tw-compact .tw-viewport::before { display: none; }
body.tw-compact .tw-nav { flex-wrap: wrap; gap: 6px 12px; padding: 10px 14px; }
body.tw-compact .tw-wordmark { width: auto; }
body.tw-compact .tw-tabs { order: 3; width: 100%; height: 40px; overflow-x: auto; }
body.tw-compact .tw-tab { padding: 0 12px; }
body.tw-compact .tw-tool { height: 36px; }
body.tw-compact .tw-body, body.tw-compact .tw-body.has-team { grid-template-columns: minmax(0, 1fr); padding: 12px; }
body.tw-compact .tw-body.has-team .tw-main { display: contents; }
body.tw-compact .tw-body.has-team .tw-head { order: -1; }
body.tw-compact .tw-team { padding: 12px; gap: 10px; }
body.tw-compact .tw-members { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
body.tw-compact .tw-team .tw-member { grid-template-columns: minmax(0, 1fr); justify-items: stretch; gap: 4px; padding: 4px; text-align: center; }
body.tw-compact .tw-team .tw-face, body.tw-compact .tw-team .tw-face img { width: 48px; height: 48px; margin: 0 auto; }
body.tw-compact .tw-team .tw-member-name { justify-content: center; font-size: 11.5px; }
body.tw-compact .tw-team .tw-icons { justify-content: center; }
body.tw-compact .tw-auglist { display: flex; flex-wrap: wrap; gap: 6px; }
body.tw-compact .tw-augrow { width: auto; padding: 0; }
body.tw-compact .tw-augrow img { width: 28px; height: 28px; }
body.tw-compact .tw-augrow span { display: none; }
body.tw-compact .tw-purse { grid-auto-flow: column; justify-content: space-between; align-items: baseline; padding-top: 8px; }
body.tw-compact .tw-purse strong { font-size: 18px; }
body.tw-compact .tw-head { grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 12px 14px; }
body.tw-compact .tw-head-side { grid-column: 1 / -1; flex-wrap: wrap; gap: 12px; }
body.tw-compact .tw-title h1 { white-space: normal; }
body.tw-compact .tw-postings, body.tw-compact .tw-final { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 12px; }
body.tw-compact .tw-postings > .tw-posting { grid-row: auto; display: flex; }
body.tw-compact .tw-posting-art { flex: none; height: 150px; }
body.tw-compact .tw-detail { grid-template-columns: minmax(0, 1fr); }
body.tw-compact .tw-final-member + .tw-final-member { border-left: 0; border-top: 1px solid #2f414b; }
body.tw-compact .tw-detail-col + .tw-detail-col { border-left: 0; border-top: 1px solid var(--tw-edge-soft); }
body.tw-compact .tw-button { min-height: 44px; }
body.tw-compact .tw-member { min-height: 44px; }
body.tw-compact .tw-fusion { position: fixed; inset: 0; }
body.tw-compact .tw-fusion-card { width: calc(100vw - 24px); }
body.tw-compact.has-sheet .tw-stage { padding-bottom: 300px; }
