@charset "UTF-8";
/* Plain stylesheet for the server-rendered player UI. No build step needed. */
:root {
    --bg: #17130f;
    --panel: #221c16;
    --panel-2: #2b231b;
    --line: #3d3226;
    --text: #e9e0d2;
    --muted: #a1937f;
    --accent: #d6a85a;
    --danger: #c0563f;
    --ok: #7ea66a;
    --hp: #b9443a;
    --sp: #4f7fbf;
    --st: #c79a3c;
    --xp: #8e6fc0;
    --rarity-common: #e9e0d2;
    --rarity-uncommon: #8fd17a;
    --rarity-rare: #6fa8f0;
    --rarity-epic: #c08cf2;
    --rarity-legendary: #f59a4e;
}

* { box-sizing: border-box; }

/* Display font Cinzel (SIL OFL, public/fonts/cinzel, close to classic Trajan capitals) for headings, card titles and buttons.
   Running text stays in the readable body font. */
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("../fonts/cinzel/cinzel-latin-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("../fonts/cinzel/cinzel-latin-ext-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Body font Alegreya (SIL OFL, public/fonts/alegreya): a book serif with a calligraphic touch that stays readable in long texts. */
@font-face { font-family: "Alegreya"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("../fonts/alegreya/alegreya-latin-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Alegreya"; font-style: normal; font-weight: 400 900; font-display: swap; src: url("../fonts/alegreya/alegreya-latin-ext-wght-normal.woff2") format("woff2-variations"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
:root { --font-body: "Alegreya", "Palatino Linotype", Palatino, Georgia, serif; }
:root { --font-display: "Cinzel", "Trajan Pro", Georgia, "Times New Roman", serif; }
h1, h2, h3, .brand, .tile strong, .card > strong:first-child, .btn:not(.btn-link) { font-family: var(--font-display); }

/* Scrollbars in the game's colours instead of the bright system default (mostly visible on Windows desktops).
   Firefox and current Chrome/Edge use scrollbar-width/-color; Safari and older Chromium fall back to ::-webkit-scrollbar. */
:root { --scroll-thumb: #75603f; --scroll-thumb-hover: #a8834c; --scroll-track: rgba(14, 11, 8, 0.6); }
html { scrollbar-color: var(--scroll-thumb) var(--bg); }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) var(--scroll-track); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--scroll-track); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.5 var(--font-body); font-variant-numeric: lining-nums; }
/* Site background: the dragon pattern stays fixed behind the page, darkened so text on it stays readable. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(rgba(23, 19, 15, 0.35), rgba(23, 19, 15, 0.55)), url("../images/brand/background.webp") center / cover no-repeat; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-weight: 700; font-size: 1.75rem; line-height: 1.3; margin: 0.7rem 0 0.3rem; letter-spacing: 0.02em; text-shadow: 0 2px 0 #140c1c; }
h2 { font-weight: 700; font-size: 1.25rem; line-height: 1.35; margin: 1.4rem 0 0.6rem; color: var(--accent); letter-spacing: 0.02em; text-shadow: 0 2px 0 #140c1c; }
h3 { margin: 0 0 0.3rem; }
p { margin: 0.3rem 0; }

.page { max-width: 960px; margin: 0 auto; padding: 0 16px 48px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.warn { color: var(--accent); }
.email-status-ok { color: var(--ok); font-weight: 700; }

.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 700; font-size: 1.15rem; letter-spacing: 0.05em; text-transform: uppercase; }
.brand:hover { text-decoration: none; }
.brand-emblem { width: 32px; height: 32px; flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 0.1rem; flex: 1; font-size: 0.875rem; }
.nav a, .nav .locked { padding: 0.3rem 0.65rem; border-radius: 0; color: var(--text); }
.nav > a, .nav > .locked, .nav-town > a { display: inline-flex; align-items: center; gap: 0.25rem; padding-inline: 0.4rem; white-space: nowrap; }
.nav > span.locked::before { content: "\1F512\FE0E"; font-size: 0.85em; }
.nav-icon { width: 1.25rem; height: 1.25rem; flex: none; color: var(--accent); }
.nav a.active, .nav a:hover { background: var(--panel-2); text-decoration: none; }
/* Dropdowns in the top bar: "Town" (jumps straight to each town service) and "More"
   (language, sound, account …). Click opens them; on desktop "Town" also opens on hover. */
.nav-dropdown { position: relative; display: flex; align-items: center; }
.nav-dropdown-toggle { display: inline-flex; align-items: center; gap: 0.3rem; background: none; border: 0; color: var(--text); cursor: pointer; padding: 0.3rem 0.35rem; border-radius: 0; font: inherit; line-height: 1.5; }
.nav-dropdown-toggle:hover, .nav-dropdown.open .nav-dropdown-toggle { background: var(--panel-2); }
.nav-dropdown-arrow { display: inline-block; transition: transform 0.15s; }
.nav-dropdown.open .nav-dropdown-arrow { transform: rotate(180deg); }
.nav-town-toggle .nav-dropdown-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nav-dropdown-list { display: none; position: absolute; top: 100%; left: 0; z-index: 60; min-width: 230px; padding: 0.35rem; gap: 2px; background: var(--panel); background-clip: padding-box; border: 8px solid transparent; border-radius: 0; border-image: url("../images/ui/rpgui/border-image-golden.png") 4 / 8px stretch; image-rendering: pixelated; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45); }
.nav-dropdown.open .nav-dropdown-list { display: grid; }
.nav .nav-town-list a, .nav .nav-town-list .locked { display: flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.nav-more { margin-left: auto; }
.nav-more + .nav-more { margin-left: 0; }
.nav-more-toggle { color: var(--muted); }
.nav-more-list { left: auto; right: 0; min-width: 190px; }
.nav-more-list > .btn-link, .nav-more-list > .inline-form > .btn-link { display: block; width: 100%; padding: 0.35rem 0.6rem; border-radius: 0; text-align: left; color: var(--text); }
.nav-more-list > .inline-form:not(.lang-switch) { display: block; }
.nav-more-list > .btn-link:hover, .nav-more-list > .inline-form > .btn-link:hover:not(:disabled) { background: var(--panel-2); text-decoration: none; }
.nav-more-list > .btn-link.active { font-weight: bold; }
.nav-more-list > .lang-switch { flex-wrap: nowrap; padding-bottom: 0.25rem; margin-bottom: 0.2rem; border-bottom: 1px solid var(--line); }
.nav-more-list > .lang-switch .btn-link { width: auto; color: var(--muted); }
.nav-more-list > .lang-switch .btn-link.active { color: var(--text); }
.nav-more-legal { display: flex; flex-wrap: wrap; gap: 0 0.6rem; margin-top: 0.25rem; padding: 0.35rem 0.6rem 0.1rem; border-top: 1px solid var(--line); font-size: 0.78rem; }
.nav-more-legal a { color: var(--muted); }
.nav-more-legal a:hover { color: var(--text); }
html:not(.js) .nav-more-toggle { display: none; }
html:not(.js) .nav-more-list { position: static; display: flex; flex-wrap: wrap; min-width: 0; padding: 0; background: none; border: 0; box-shadow: none; }
.town-icon { width: 1.5rem; height: 1.5rem; flex: none; color: var(--accent); }
.town-heading-icon { width: 2.4rem; height: 2.4rem; vertical-align: middle; margin-right: 0.5rem; }
.town-tile-icon { float: right; width: 3.2rem; height: 3.2rem; margin: 0 0 0.3rem 0.6rem; }
.town-tile.locked .town-icon { filter: grayscale(1); }
.badge { display: inline-block; min-width: 1.3em; padding: 0 0.35em; margin-left: 0.2em; border-radius: 99px; background: var(--accent); color: #1b140c; font-size: 0.75rem; text-align: center; text-shadow: none; }
.progress-board-badge { display: inline-flex; align-items: center; padding: 0.15rem 0.55rem; border-radius: 99px; background: var(--ok); color: #10160d; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.progress-board-badge:hover { text-decoration: none; filter: brightness(1.1); }
.progress-board h2 { margin-top: 0; }
/* One column grid for all rows (subgrid): an empty status cell must not shift the detail text of its row. */
.progress-board-list { display: grid; grid-template-columns: minmax(8rem, 0.9fr) 2fr auto; column-gap: 0.8rem; }
.progress-board-row { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; row-gap: 0.5rem; align-items: center; padding: 0.45rem 0; border-top: 1px solid var(--line); color: var(--text); }
@supports not (grid-template-columns: subgrid) {
    .progress-board-row { grid-template-columns: minmax(8rem, 0.9fr) 2fr minmax(5.5rem, auto); column-gap: 0.8rem; }
}
.progress-board-row:first-of-type { border-top: 0; }
.progress-board-row:hover { text-decoration: none; background: var(--panel-2); }
.progress-board-name { font-weight: 600; }
.progress-board-detail { color: var(--muted); font-size: 0.88rem; }
.progress-board-status { text-align: right; white-space: nowrap; }
@media (max-width: 600px) {
    .progress-board-list, .progress-board-row { grid-template-columns: 1fr auto; }
    @supports (grid-template-columns: subgrid) { .progress-board-row { grid-template-columns: subgrid; } }
    .progress-board-status { grid-row: 1; grid-column: 2; }
    .progress-board-detail { grid-row: 2; grid-column: 1 / -1; }
}
.topbar-menu { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.6rem; flex: 1; }
.btn.menu-toggle { display: none; align-items: center; gap: 0.45rem; margin-left: auto; }
.menu-toggle-icon, .menu-toggle-icon::before, .menu-toggle-icon::after { display: block; width: 1.1rem; height: 2px; border-radius: 1px; background: currentColor; transition: transform 0.15s ease; }
.menu-toggle-icon { position: relative; }
.menu-toggle-icon::before, .menu-toggle-icon::after { content: ""; position: absolute; left: 0; }
.menu-toggle-icon::before { top: -6px; }
.menu-toggle-icon::after { top: 6px; }
.menu-open .menu-toggle-icon { background: transparent; }
.menu-open .menu-toggle-icon::before { transform: translateY(6px) rotate(45deg); }
.menu-open .menu-toggle-icon::after { transform: translateY(-6px) rotate(-45deg); }
/* Mobile: compact header with logo + menu button, links collapse behind it.
   The open menu is an icon grid (4 per row), town services fold out below it and the
   rest (language, sound, account …) is one small row of links at the bottom.
   Without JavaScript the full bar stays visible. */
@media (max-width: 800px) {
    .topbar { flex-wrap: nowrap; padding: 0.6rem 0; position: relative; }
    .js .btn.menu-toggle { display: inline-flex; }
    .js .topbar-menu { display: none; }
    .js .menu-open { flex-wrap: wrap; }
    .js .menu-open .topbar-menu { display: flex; flex-direction: column; align-items: stretch; flex-basis: 100%; gap: 0.5rem; padding-top: 0.6rem; }
    .js .menu-open .nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.3rem; }
    .js .menu-open .nav > a, .js .menu-open .nav > .locked, .js .menu-open .nav-town > a, .js .menu-open .nav-town > .locked {
        position: relative; flex-direction: column; justify-content: center; gap: 0.15rem; min-width: 0; padding: 0.5rem 0.2rem 0.4rem;
        background: var(--panel-2); font-size: 0.8rem; line-height: 1.2; text-align: center; overflow-wrap: anywhere;
    }
    .js .menu-open .nav-icon { width: 1.6rem; height: 1.6rem; }
    .js .menu-open .nav > a.active, .js .menu-open .nav-town > a.active { box-shadow: inset 0 0 0 1px var(--accent); }
    .js .menu-open .nav .badge { position: absolute; top: 0.2rem; right: 0.2rem; margin: 0; }
    .js .menu-open .nav .locked::before { position: absolute; top: 0.2rem; left: 0.3rem; font-size: 0.7rem; }
    .js .menu-open .nav-town { display: contents; }
    .js .menu-open .nav-town-toggle { order: 1; grid-column: 1 / -1; justify-content: space-between; padding: 0.4rem 0.7rem; background: var(--panel-2); color: var(--muted); font-size: 0.88rem; }
    .js .menu-open .nav-town-toggle .nav-dropdown-label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
    .js .menu-open .nav-town-list { order: 2; position: static; grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; padding: 0; background: none; border: 0; box-shadow: none; gap: 0.3rem; }
    .js .menu-open .nav .nav-town-list a, .js .menu-open .nav .nav-town-list .locked {
        position: relative; flex-direction: column; justify-content: center; gap: 0.15rem; min-width: 0; padding: 0.4rem 0.2rem;
        background: var(--panel-2); font-size: 0.75rem; line-height: 1.2; text-align: center; white-space: normal; overflow-wrap: anywhere; hyphens: auto;
    }
    .js .menu-open .nav-more { display: block; margin: 0; padding-top: 0.4rem; border-top: 1px solid var(--line); }
    .js .menu-open .nav-more-toggle { display: none; }
    .js .menu-open .nav-more-list { position: static; display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem 0.2rem; min-width: 0; padding: 0; background: none; border: 0; box-shadow: none; }
    .js .menu-open .nav-more-list > .btn-link, .js .menu-open .nav-more-list > .inline-form > .btn-link { width: auto; padding: 0.35rem 0.45rem; color: var(--muted); font-size: 0.88rem; }
    .js .menu-open .nav-more-list > .lang-switch { margin: 0 0.3rem 0 0; padding: 0 0.4rem 0 0; border-bottom: 0; border-right: 1px solid var(--line); }
    .js .menu-open .nav-more-legal { flex-basis: 100%; padding: 0.3rem 0.45rem 0; }
}
/* Desktop: the game menu is a fixed column on the left (like Shakes & Fidget), the game
   screen sits to its right. Town services and "More" unfold inside the column instead of
   floating; town services start open on town pages. Phones keep the burger menu above. */
@media (min-width: 801px) {
    .page.has-sidebar { max-width: 1180px; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 0 1.5rem; align-items: start; }
    .has-sidebar .topbar { position: sticky; top: 0; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0.7rem; max-height: 100vh; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 1rem 0; border-bottom: 0; scrollbar-color: transparent transparent; }
    /* The sidebar only scrolls when the menu is taller than the window; its scrollbar stays invisible until the mouse is on it. */
    .has-sidebar .topbar:hover, .has-sidebar .topbar:focus-within { scrollbar-color: var(--scroll-thumb) transparent; }
    .has-sidebar .topbar::-webkit-scrollbar-track { background: transparent; }
    .has-sidebar .topbar::-webkit-scrollbar-thumb { background: transparent; }
    .has-sidebar .topbar:hover::-webkit-scrollbar-thumb { background: var(--scroll-thumb); background-clip: padding-box; }
    .has-sidebar .brand { padding: 0 0.3rem; }
    /* Inbox and ongoing-tasks notices span the sidebar like the menu buttons. */
    .has-sidebar .progress-board-badge,
    .has-sidebar .inbox-badge { align-self: stretch; padding: 0.35rem 0.7rem; border-radius: 0; }
    .has-sidebar .topbar-menu { flex: none; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0.7rem; }
    .has-sidebar .nav { flex: none; flex-direction: column; flex-wrap: nowrap; gap: 4px; font-size: 0.92rem; }
    .has-sidebar .nav > a, .has-sidebar .nav > .locked, .has-sidebar .nav-town > a {
        display: flex; gap: 0.55rem; padding: 0.45rem 0.6rem; border: 1px solid var(--line); border-radius: 0;
        background: linear-gradient(180deg, var(--panel-2), var(--panel)); font-weight: 600;
    }
    .has-sidebar .nav > a:hover, .has-sidebar .nav-town > a:hover { border-color: var(--muted); background: var(--panel-2); }
    .has-sidebar .nav > a.active, .has-sidebar .nav-town > a.active { border-color: var(--accent); background: var(--panel-2); box-shadow: inset 3px 0 0 var(--accent); }
    .has-sidebar .nav .badge { margin-left: auto; }
    .has-sidebar .nav-town { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; }
    .has-sidebar .nav-town-toggle { align-self: stretch; padding: 0 0.55rem; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
    .has-sidebar .nav-town-list { grid-column: 1 / -1; position: static; min-width: 0; padding: 0 0 0.2rem 0.7rem; background: none; border: 0; box-shadow: none; }
    .has-sidebar .nav .nav-town-list a, .has-sidebar .nav .nav-town-list .locked { padding: 0.25rem 0.5rem; font-size: 0.86rem; white-space: normal; }
    .has-sidebar .nav-town-list .town-icon { width: 1.25rem; height: 1.25rem; }
    .has-sidebar .nav-more { display: block; margin: 0; padding-top: 0.5rem; border-top: 1px solid var(--line); }
    .has-sidebar .nav-more + .nav-more { margin-top: -0.4rem; padding-top: 0; border-top: 0; }
    .has-sidebar .nav-more-toggle { width: 100%; justify-content: space-between; }
    .has-sidebar .nav-more-list { position: static; min-width: 0; padding: 0.2rem 0 0; background: none; border: 0; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { .menu-toggle-icon::before, .menu-toggle-icon::after, .nav-dropdown-arrow { transition: none; } }

.status { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 1rem; align-items: center; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.status .who { display: flex; flex-direction: column; }
.status .right { text-align: right; }
.bars { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem 1rem; }
.stat { display: flex; flex-direction: column; font-size: 0.85rem; }
.stat.wide { max-width: 420px; margin: 0.3rem 0; }
.meter { display: block; height: 7px; border-radius: 0; background: #0e0b08; overflow: hidden; }
.meter b { display: block; height: 100%; }
.meter.hp b { background: var(--hp); }
.meter.sp b { background: var(--sp); }
.meter.st b { background: var(--st); }
.meter.xp b { background: var(--xp); }
.cooldown { color: var(--accent); font-size: 0.85rem; }
.ready { color: var(--ok); font-size: 0.85rem; }

.flash { margin: 0.8rem 0; padding: 0.6rem 0.8rem; border-radius: 0; border: 1px solid var(--line); }
.flash-ok { border-color: var(--ok); background: #1f2a1a; }
.flash-err { border-color: var(--danger); background: #2e1a15; }
.flash-info { border-color: var(--accent); background: #2a2216; }

/* Cards get the gold pixel frame (RPGUI border-image-golden) around a dark inside, so coloured text stays readable. */
.card { display: block; background: var(--panel); background-clip: padding-box; border: 8px solid transparent; border-radius: 0; border-image: url("../images/ui/rpgui/border-image-golden.png") 4 / 8px stretch; image-rendering: pixelated; padding: 0.6rem 0.8rem; margin: 0.6rem 0; color: var(--text); }
.card.dead { opacity: 0.45; }
.battle-defeated { padding: 0.4rem 1rem; }
.battle-defeated summary { cursor: pointer; color: var(--muted); }
.battle-defeated p { margin: 0.3rem 0 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.6rem; }
.grid .card { margin: 0; }
.player-stats { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 0.6rem 0; }
.player-presence { display: flex; align-items: center; gap: 0.4rem; }
.presence-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--muted); flex: none; }
.presence-dot.is-online { background: var(--ok); box-shadow: 0 0 0 2px rgba(126, 166, 106, 0.25); }
.tile:not(.card) { border-left: 4px solid var(--accent); }
.tile:hover { background: var(--panel-2); text-decoration: none; }
.tile strong { display: block; font-size: 1.05rem; }
.tile p { color: var(--muted); font-size: 0.9rem; }
.tutorial { border-color: var(--accent); }
/* Story tutorial: what the current quest is about glows, what it has not opened yet is greyed out. */
.tutorial-focus { outline: 2px solid var(--accent); outline-offset: 2px; animation: tutorial-pulse 1.6s ease-in-out infinite; }
.nav .locked, .tile.locked, .row > .locked { opacity: 0.45; cursor: not-allowed; }
.nav .locked::before, .tile.locked strong::before, .row > .locked::before { content: "\1F512\FE0E  "; }
@keyframes tutorial-pulse { 50% { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .tutorial-focus { animation: none; } }
.log ol, ol.log { margin: 0; padding-left: 1.4rem; font-size: 0.88rem; }
.log summary { cursor: pointer; color: var(--accent); }
.log li.log-loot { color: #b98cff; font-weight: 600; }
.log li.log-lumiis { color: #6fd3ff; font-weight: 600; }
.boss-sigil-stat span { color: #b98cff; }

/* Manual fight: player on the left, combat log in the middle, enemies on the right. */
.battle-layout { display: grid; grid-template-columns: minmax(170px, 210px) minmax(0, 1fr) minmax(230px, 300px); gap: 0.8rem; align-items: start; }
.battle-layout > * { min-width: 0; }
.battle-layout h2 { margin-top: 0.2rem; }
.battle-unit { position: relative; overflow: visible; }
.battle-log-column .log { max-height: 460px; overflow-y: auto; }
.damage-float {
    position: absolute;
    left: 50%;
    top: 22%;
    z-index: 5;
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.02em;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85), 0 0 12px rgba(0, 0, 0, 0.5);
    animation: damage-rise 1.5s ease-out both;
    animation-delay: var(--delay, 0s);
}
.damage-dealt { color: #f5c542; }
.damage-taken { color: #e25845; }
.damage-crit { font-size: 1.35em; color: #ffd75e; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85), 0 0 12px rgba(255, 196, 66, 0.8); }
/* Piercing hits ignore defence: the number gets a cold steel-blue edge. */
.damage-pierce { text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85), 0 0 10px rgba(120, 210, 255, 0.85); }
.damage-crit.damage-pierce { text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85), 0 0 12px rgba(255, 196, 66, 0.8), 0 0 4px rgba(120, 210, 255, 0.9); }
@keyframes damage-rise {
    0% { opacity: 0; transform: translate(-50%, 12px) scale(0.7); }
    18% { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
    65% { opacity: 1; transform: translate(-50%, -22px) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -44px) scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
    .damage-float { animation: none; opacity: 1; transform: translateX(-50%); }
}
/* Poison and burn: bubbles or flames rise over the hit card, the card glows, the number is coloured. */
.damage-poison { color: #8ee05a; }
.damage-burn { color: #ff8a3d; }
.status-fx {
    position: absolute;
    inset: 0;
    z-index: 4;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
}
.status-fx i {
    position: absolute;
    bottom: -14px;
    left: 50%;
    opacity: 0;
    animation: status-rise 1.5s ease-out both;
    animation-delay: calc(var(--delay, 0s) + var(--offset, 0s));
}
.status-fx i:nth-child(1) { left: 12%; --offset: 0s; --drift: 6px; }
.status-fx i:nth-child(2) { left: 32%; --offset: 0.18s; --drift: -8px; }
.status-fx i:nth-child(3) { left: 52%; --offset: 0.06s; --drift: 4px; }
.status-fx i:nth-child(4) { left: 70%; --offset: 0.26s; --drift: -5px; }
.status-fx i:nth-child(5) { left: 88%; --offset: 0.12s; --drift: 7px; }
.status-fx-poison i {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #e6ffcc 0 18%, #7bd44a 45%, #2f7d1f 100%);
    box-shadow: 0 0 6px rgba(120, 220, 70, 0.75);
}
.status-fx-poison i:nth-child(even) { width: 7px; height: 7px; }
.status-fx-burn i {
    width: 12px;
    height: 18px;
    border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
    background: radial-gradient(ellipse at 50% 75%, #fff2a8 0 20%, #ffb53d 45%, #e2401c 85%);
    box-shadow: 0 0 8px rgba(255, 120, 40, 0.8);
    animation-name: status-flame;
}
.status-fx-burn i:nth-child(even) { width: 9px; height: 13px; }
@keyframes status-rise {
    0% { opacity: 0; transform: translate(0, 0) scale(0.5); }
    15% { opacity: 0.95; }
    70% { opacity: 0.85; transform: translate(var(--drift, 0px), -62px) scale(1); }
    100% { opacity: 0; transform: translate(calc(var(--drift, 0px) * 2), -96px) scale(1.25); }
}
@keyframes status-flame {
    0% { opacity: 0; transform: translate(0, 0) scale(0.6, 0.5); }
    15% { opacity: 1; transform: translate(0, -10px) scale(1, 1.1); }
    35% { transform: translate(var(--drift, 0px), -30px) scale(0.85, 1.2); }
    55% { opacity: 0.9; transform: translate(0, -48px) scale(1.05, 0.95); }
    100% { opacity: 0; transform: translate(var(--drift, 0px), -80px) scale(0.4, 0.6); }
}
.status-hit-poison { animation: status-glow-poison 1.6s ease-out both; }
.status-hit-burn { animation: status-glow-burn 1.6s steps(8, end) both; }
.status-hit-poison.status-hit-burn { animation: status-glow-poison 1.6s ease-out both, status-glow-burn 1.6s steps(8, end) 0.4s both; }
@keyframes status-glow-poison {
    0%, 100% { box-shadow: none; }
    25%, 60% { box-shadow: inset 0 0 0 2px #6cc23f, 0 0 16px rgba(108, 194, 63, 0.55); }
}
@keyframes status-glow-burn {
    0%, 100% { box-shadow: none; }
    20%, 50% { box-shadow: inset 0 0 0 2px #ff7a2f, 0 0 18px rgba(255, 110, 40, 0.6); }
    35%, 65% { box-shadow: inset 0 0 0 2px #ffb347, 0 0 10px rgba(255, 170, 60, 0.45); }
}
/* The replay fighters are small emoji boxes: let bubbles and flames rise above them. */
.series-replay-fighter .status-fx { overflow: visible; inset: -6px; }
.series-replay-fighter .damage-float { font-size: 1rem; top: 45%; left: 135%; }
/* Critical hit: a short golden starburst with a ring on the card. Piercing hit: a bright streak through it. */
.hit-fx {
    position: absolute;
    inset: 0;
    z-index: 4;
    overflow: hidden;
    border-radius: inherit;
    pointer-events: none;
}
.hit-fx i { position: absolute; display: block; }
.hit-fx-crit { animation: hit-crit-ring 0.6s ease-out both; animation-delay: var(--delay, 0s); }
.hit-fx-crit i {
    left: 50%;
    top: 28%;
    width: 96px;
    height: 96px;
    margin: -48px 0 0 -48px;
    border-radius: 50%;
    background: repeating-conic-gradient(rgba(255, 220, 110, 0.9) 0 7deg, transparent 7deg 30deg);
    -webkit-mask: radial-gradient(circle, #000 0 18%, rgba(0, 0, 0, 0.6) 40%, transparent 70%);
    mask: radial-gradient(circle, #000 0 18%, rgba(0, 0, 0, 0.6) 40%, transparent 70%);
    opacity: 0;
    animation: hit-crit-burst 0.55s ease-out both;
    animation-delay: var(--delay, 0s);
}
.hit-fx-pierce i {
    left: -10%;
    top: 46%;
    width: 120%;
    height: 3px;
    border-radius: 0;
    background: linear-gradient(90deg, transparent, rgba(160, 225, 255, 0.95) 45%, #fff 60%, transparent);
    box-shadow: 0 0 8px rgba(120, 210, 255, 0.8);
    opacity: 0;
    transform-origin: center;
    animation: hit-pierce-streak 0.45s ease-out both;
    animation-delay: calc(var(--delay, 0s) + 0.05s);
}
@keyframes hit-crit-burst {
    0% { opacity: 0; transform: scale(0.3) rotate(0deg); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.35) rotate(25deg); }
}
@keyframes hit-crit-ring {
    0%, 100% { box-shadow: none; }
    25% { box-shadow: inset 0 0 0 2px #ffd75e, 0 0 14px rgba(255, 200, 70, 0.55); }
}
@keyframes hit-pierce-streak {
    0% { opacity: 0; transform: rotate(-16deg) translateX(-70%) scaleX(0.4); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: rotate(-16deg) translateX(70%) scaleX(1); }
}
.series-replay-fighter .hit-fx { overflow: visible; }
.series-replay-fighter .hit-fx-crit i { width: 64px; height: 64px; margin: -32px 0 0 -32px; top: 50%; }
@media (prefers-reduced-motion: reduce) {
    .hit-fx { display: none; }
}
.duel-replay-fighter { border-radius: 0; }
.log-poison { color: #a6e57d; }
/* Group fight log: the damage of a hit as a small bold badge after the line. */
.log-damage { display: inline-block; margin-left: 0.3rem; padding: 0 0.3rem; border-radius: 999px; font-weight: 800; }
.log-damage-dealt { color: #f5c542; background: rgba(245, 197, 66, 0.14); }
.log-damage-taken { color: #e25845; background: rgba(226, 88, 69, 0.14); }
.group-fight-damage { display: block; margin-top: 0.2rem; }
/* Group fight: all party cards share the height of the tallest one (SP bar, two-line names), values sit at the bottom. */
.group-fight-party { display: grid; grid-template-rows: auto; grid-auto-rows: 1fr; row-gap: 0.6rem; }
.group-fight-party > .battle-unit { display: flex; flex-direction: column; margin: 0; }
.group-fight-party > .battle-unit .group-fight-damage { margin-top: auto; padding-top: 0.2rem; }
.log-burn { color: #ffab70; }
.status-chips { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; margin-left: 0.25rem; vertical-align: middle; }
.status-chip {
    display: inline-block;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.75rem;
    line-height: 1.5;
    white-space: nowrap;
}
.status-chip-poison { background: rgba(108, 194, 63, 0.16); border: 1px solid rgba(108, 194, 63, 0.6); color: #a6e57d; }
.status-chip-burn { background: rgba(255, 122, 47, 0.16); border: 1px solid rgba(255, 122, 47, 0.6); color: #ffab70; }
@media (prefers-reduced-motion: reduce) {
    .status-fx { display: none; }
    .status-hit-poison, .status-hit-burn, .status-hit-poison.status-hit-burn { animation: none; }
    .status-hit-poison { box-shadow: inset 0 0 0 2px #6cc23f; }
    .status-hit-burn { box-shadow: inset 0 0 0 2px #ff7a2f; }
}
@media (max-width: 800px) {
    .battle-layout { grid-template-columns: 1fr; }
    .battle-player { order: 1; }
    .battle-enemies { order: 2; }
    .battle-log-column { order: 3; }
    .battle-log-column .log { max-height: none; }
}
/* Finished manual fight: one last look at both sides, then continue. */
.battle-result-banner { border-width: 2px; }
.battle-result-victory { border-color: var(--ok); }
.battle-result-defeat { border-color: var(--danger); }
.battle-result-victory h1 { color: var(--ok); }
.battle-result-defeat h1 { color: var(--danger); }
.battle-result-actions { margin-top: 0.8rem; gap: 0.6rem; flex-wrap: wrap; }
.battle-result-actions .btn { font-size: 1.15rem; padding: 0.7rem 1.6rem; min-width: 10rem; text-align: center; }
@media (max-width: 640px) { .battle-result-actions > * { flex: 1 1 100%; } .battle-result-actions .btn { width: 100%; } }
.bonus { color: var(--ok); }
.compare { margin-top: 0.2em; }
.delta-up { color: var(--ok); }
.delta-down { color: var(--danger); }
.missing { color: var(--danger); font-weight: 600; }
.inventory-filter { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; margin: 0.5rem 0 0.75rem; }
.inventory-filter label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.78rem; color: var(--muted); }
.inventory-filter select { min-width: 9rem; }
.series-filter { display: flex; flex-wrap: wrap; gap: 0.35rem 0.6rem; align-items: center; margin: 0.35rem 0; max-width: min(28rem, 100%); }
.series-filter label { display: inline-flex; gap: 0.25rem; align-items: center; }
ul.plain { padding-left: 1.2rem; }

.row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 0.6rem; max-width: 320px; }
.stack label { display: flex; flex-direction: column; gap: 0.2rem; }

/* Buttons use the RPGUI pixel textures (public/images/ui/rpgui, zlib licence) as 9-slice frames:
   plain buttons are the brown plate, primary buttons the orange plate, pressed shows the sunken plate.
   Slices are drawn 1:1 so the pixel edges stay crisp; the centre stretches. */
.btn {
    display: inline-block; padding: 0.05rem 0.5rem; min-height: 1.7rem; font-size: 0.82rem;
    border: solid transparent; border-width: 4px 8px 5px; border-radius: 0;
    border-image: url("../images/ui/rpgui/button-down.png") 4 8 5 8 fill / 4px 8px 5px stretch;
    background: none; image-rendering: pixelated;
    color: #f6ead0; font-family: inherit; font-weight: 700; line-height: 1.35; letter-spacing: 0.02em; text-shadow: 1px 1px 0 #140c1c;
    cursor: pointer;
}
.btn:hover:not(:disabled) { filter: brightness(1.15); text-decoration: none; }
.btn:active:not(:disabled) { filter: brightness(0.85); transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { filter: grayscale(0.85) brightness(0.7); opacity: 0.75; cursor: not-allowed; }
.btn-primary { border-image-source: url("../images/ui/rpgui/button.png"); color: #1e0f06; text-shadow: 0 1px 0 rgba(255, 230, 170, 0.45); }
.btn-primary:hover:not(:disabled) { border-image-source: url("../images/ui/rpgui/button-hover.png"); filter: none; }
.btn-primary:active:not(:disabled) { border-image-source: url("../images/ui/rpgui/button-down.png"); color: #f6ead0; text-shadow: 1px 1px 0 #140c1c; filter: none; }
.btn-danger { color: #ffc2ad; }
.btn-link { border: none; border-image: none; min-height: 0; background: none; color: var(--muted); padding: 0.3rem; font-size: inherit; font-weight: inherit; text-shadow: none; image-rendering: auto; }
.btn-link:hover:not(:disabled), .btn-link:active:not(:disabled) { filter: none; transform: none; }
.lang-switch .btn-link.active { color: var(--text, inherit); font-weight: bold; cursor: default; }

input, select { padding: 0.35rem 0.5rem; border-radius: 0; border: 1px solid var(--line); background: #120f0c; color: var(--text); font: inherit; }
input.qty { width: 4.5rem; }

.table { width: 100%; border-collapse: collapse; margin: 0.4rem 0; }
/* Every table sits in a .table-scroll box: if its columns need more room than the panel has,
   the table scrolls sideways inside the frame instead of running past the border. */
.table-scroll { max-width: 100%; overflow-x: auto; overflow-y: hidden; margin: 0.4rem 0; scrollbar-width: thin; }
.table-scroll > .table, .table-scroll > .wiki-table { margin: 0; }
.table th, .table td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
/* .row is a flex box; on a table cell that would drop it out of the table layout, so the
   cell's border and height no longer line up with its row. Keep the cell, space the buttons. */
.table td.row { display: table-cell; }
.table td.row > * { margin: 0.2rem 0.4rem 0.2rem 0; }
/* Bonus workshop reroll: soul anchor select on top, button underneath, never wider than the cell. */
.bonus-reroll { max-width: 100%; }
.bonus-reroll .inline-form { display: flex; flex-direction: column; align-items: flex-start; }
.bonus-reroll select { width: 100%; max-width: 22rem; min-width: 0; text-overflow: ellipsis; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.table tr.locked td { color: var(--muted); }
.table tr.own td { background: #2a2216; color: var(--accent); font-weight: 600; }
.pager { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 0.6rem; }

@media (max-width: 640px) {
    .status { grid-template-columns: 1fr; }
    .status .right { text-align: left; }
    .table { display: block; overflow-x: auto; }
}

.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.8rem 0; border-bottom: 1px solid var(--line); padding-bottom: 0.4rem; }
.tabs a { padding: 0.3rem 0.65rem; border-radius: 0; color: var(--text); }
.tabs a.active, .tabs a:hover { background: var(--panel-2); text-decoration: none; }
.tile span { display: block; }
.tile .tile-inline span, .tile .tile-inline strong { display: inline; font-size: inherit; }
.tile .countdown { display: inline; }

/* Elite packs: small badge on region paths, map tiles and enemy names. */
.elite-badge { display: inline-block; padding: 0 0.35rem; border: 1px solid var(--accent); border-radius: 0; color: var(--accent); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; }
.tile .tile-inline .elite-badge { display: inline-block; font-size: 0.75rem; }

/* Main story: quest log section and NPC dialog boxes. */
.card.story { border-image-source: url("../images/ui/rpgui/border-image.png"); }
.story-quest + .story-quest { border-top: 1px solid var(--line); margin-top: 0.6rem; padding-top: 0.6rem; }
.story input[name="answer"] { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 0; padding: 0.3rem 0.5rem; }

/* Account page. */
.account-head { justify-content: space-between; align-items: center; }
.account-locale { display: flex; flex-direction: column; gap: 0.3rem; border: 1px solid var(--line); border-radius: 0; padding: 0.5rem 0.7rem; margin: 0; }
.account-locale legend { color: var(--muted); padding: 0 0.3rem; }
.account-danger { border-color: var(--danger); }
.account-danger summary { cursor: pointer; color: #f0b4a6; }
.stack input[type="email"], .stack input[type="password"] { width: 100%; }

/* Attribute tooltips on the character page: hover on desktop, tap (focus) on mobile. */
.stat-tip { position: relative; display: inline-flex; align-items: center; gap: 0.3em; cursor: help; outline: none; }
.stat-tip-icon { display: inline-block; width: 1.1em; height: 1.1em; border: 1px solid var(--muted); border-radius: 50%; color: var(--muted); font-size: 0.7rem; line-height: 1.05em; text-align: center; }
.stat-tip-box { display: none; position: absolute; left: 0; top: calc(100% + 4px); z-index: 80; width: max-content; max-width: min(280px, 80vw); padding: 0.5rem 0.7rem; background: var(--panel-2); border: 1px solid var(--accent); border-radius: 0; color: var(--text); font-size: 0.85rem; font-weight: normal; line-height: 1.4; flex-direction: column; gap: 0.15rem; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); }
.stat-tip-box strong { color: var(--accent); }
.stat-tip:hover .stat-tip-box, .stat-tip:focus .stat-tip-box, .stat-tip:focus-within .stat-tip-box { display: flex; }
.stat-tip:focus-visible .stat-tip-icon { border-color: var(--accent); color: var(--accent); }
.stat-drop { position: relative; }
.stat-drop > summary { display: inline-flex; align-items: center; gap: 0.3em; cursor: pointer; list-style: none; }
.stat-drop > summary::-webkit-details-marker { display: none; }
.stat-drop[open] > summary .stat-tip-icon { border-color: var(--accent); color: var(--accent); }
.stat-drop-box { margin-top: 0.35rem; padding: 0.5rem 0.7rem; background: var(--panel-2); border: 1px solid var(--accent); border-radius: 0; font-size: 0.85rem; line-height: 1.4; max-width: min(340px, 85vw); }
.stat-drop-box strong { color: var(--accent); }
.stat-drop-box ul { margin: 0.25rem 0 0; padding-left: 1.1rem; }
.collapsible > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.collapsible > summary::-webkit-details-marker { display: none; }
.collapsible > summary h2, .collapsible > summary h3 { margin: 0; }
.collapse-toggle { font-size: 0.75rem; padding: 0.1rem 0.5rem; border: 1px solid var(--muted); border-radius: 999px; color: var(--muted); white-space: nowrap; }
.collapsible > summary:hover .collapse-toggle, .collapsible > summary:focus-visible .collapse-toggle { border-color: var(--accent); color: var(--accent); }
.collapsible:not([open]) .collapse-toggle .when-open, .collapsible[open] .collapse-toggle .when-closed { display: none; }

/* Item rarity colours (ItemRarityCatalog). The tier name is also in the title and for screen readers. */
.item-name { font-weight: 500; }
.rarity-common { color: var(--rarity-common); }
.rarity-uncommon { color: var(--rarity-uncommon); }
.rarity-rare { color: var(--rarity-rare); }
.rarity-epic { color: var(--rarity-epic); }
.rarity-legendary { color: var(--rarity-legendary); }
.flash-rare { background: #241c2c; border-color: var(--rarity-epic); }
.flash-rare.rarity-border-legendary { background: #2c2016; border-color: var(--rarity-legendary); }
.loot-list { display: inline; margin: 0; padding: 0; list-style: none; }
.loot-list li { display: inline; }
.loot-list li + li::before { content: ", "; color: var(--muted); }
.loot-rows { margin: 0.3rem 0 0; padding: 0; list-style: none; display: grid; gap: 0.45rem; }
.loot-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.6rem; }
.loot-row-head .btn { padding: 0.2rem 0.7rem; }
.loot-values summary { cursor: pointer; color: var(--muted); width: max-content; }
.loot-values[open] { padding: 0.4rem 0.6rem; margin-top: 0.25rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: 0; }
.loot-values .item-tooltip {
    display: block; position: static; width: auto; max-width: none; padding: 0; margin: 0.3rem 0 0;
    background: none; border: 0; box-shadow: none; pointer-events: auto; font-size: 0.85rem;
}
.loot-values .item-tooltip .tt-head { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.item-icon { display: inline-block; width: 1.35em; height: 1.35em; margin-right: 0.3em; vertical-align: -0.2em; fill: currentColor; }
.ally-unit { border-left: 3px solid var(--ok); }
.ally-unit.defeated { opacity: 0.55; }

/* 10-pack series replay (resources/js/series-replay.js): plays back already decided fights. */
.series-replay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(0, 0, 0, 0.7); }
.series-replay-box { max-height: calc(100vh - 2rem); overflow-y: auto; width: min(440px, 100%); padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--accent); border-radius: 0; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6); display: flex; flex-direction: column; gap: 0.6rem; }
.series-replay-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.series-replay-counter { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; }
.series-replay-dots { display: flex; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
.series-replay-dot { flex: 1; height: 0.45rem; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--muted); }
.series-replay-dot.current { border-color: var(--accent); animation: series-pulse 0.9s ease-in-out infinite alternate; }
.series-replay-dot.won { background: #3f8f4f; border-color: #3f8f4f; }
.series-replay-dot.lost { background: #a33a3a; border-color: #a33a3a; }
.series-replay-arena { display: flex; align-items: center; justify-content: center; gap: 1.2rem; height: 4.5rem; font-size: 2.3rem; overflow: hidden; }
.series-replay-clash { font-size: 1.6rem; opacity: 0.35; }
.series-replay-arena.fighting .series-replay-player { animation: series-lunge-right 0.7s ease-in-out infinite; }
.series-replay-arena.fighting .series-replay-enemy { animation: series-lunge-left 0.7s ease-in-out infinite 0.35s; }
.series-replay-arena.fighting .series-replay-clash { animation: series-flash 0.35s ease-in-out infinite alternate; }
.series-replay-arena.won .series-replay-enemy { transform: rotate(80deg) translateY(0.4rem); opacity: 0.35; transition: transform 0.4s, opacity 0.4s; }
.series-replay-arena.lost .series-replay-player { transform: rotate(-80deg) translateY(0.4rem); opacity: 0.35; transition: transform 0.4s, opacity 0.4s; }
.series-replay-enemy-name { text-align: center; font-weight: 600; }
.series-replay-health { display: flex; align-items: center; gap: 0.5rem; }
.series-replay-bar { flex: 1; height: 0.6rem; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.series-replay-bar span { display: block; height: 100%; background: #3f8f4f; transition: width 1.2s ease-out; }
.series-replay-bar span.low { background: #a33a3a; }
.series-replay-result { min-height: 2.6em; text-align: center; font-size: 0.9rem; }
.series-replay-stop { text-align: center; font-weight: 600; }
.series-replay-actions { justify-content: center; }
.series-replay-still .series-replay-arena * { animation: none !important; transition: none !important; }
.series-replay-live, .series-replay-summary { display: flex; flex-direction: column; gap: 0.6rem; }
.series-replay-totals { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem 1rem; font-weight: 600; }
.series-replay-loot { margin: 0; text-align: center; font-size: 0.9rem; }
.series-replay-gear .series-gear { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.9rem; }
.series-replay-list { margin: 0; padding: 0 0.2rem; list-style: none; max-height: min(45vh, 20rem); overflow-y: auto; display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; }
.series-replay-list li { display: flex; flex-direction: column; }
.series-replay-list li.warn strong { color: inherit; }
@keyframes series-lunge-right { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(0.9rem); } }
@keyframes series-lunge-left { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-0.9rem); } }
@keyframes series-flash { from { opacity: 0.25; transform: scale(0.9); } to { opacity: 1; transform: scale(1.2); } }
@keyframes series-pulse { from { background: var(--panel-2); } to { background: var(--accent); } }

/* Patch notes */
.topbar-menu > .btn-link.active { color: var(--text); font-weight: bold; }
.patch-note h2 { margin: 0 0 0.2rem; font-size: 1.1rem; }
.patch-note-meta { margin: 0 0 0.6rem; font-size: 0.85rem; }
.patch-note-changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.patch-note-changes li { display: flex; gap: 0.5rem; align-items: baseline; }
.patch-type { flex: 0 0 auto; min-width: 5.5em; padding: 0 0.4em; border: 1px solid currentColor; border-radius: 0; font-size: 0.72rem; text-align: center; text-transform: uppercase; }
.patch-type-new { color: var(--ok); }
.patch-type-change { color: var(--accent); }
.patch-type-fix { color: var(--sp); }
.patch-filter a.patch-filter-new.active { color: var(--ok); }
.patch-filter a.patch-filter-change.active { color: var(--accent); }
.patch-filter a.patch-filter-fix.active { color: var(--sp); }

/* Item hover cards: only on devices with a real mouse, mobile keeps the inline details. */
.item-tooltip { display: none; }
@media (hover: hover) and (pointer: fine) {
    .has-tooltip { position: relative; cursor: help; text-decoration: underline dotted rgba(161, 147, 127, 0.5); text-underline-offset: 3px; }
    .has-tooltip:hover > .item-tooltip, .has-tooltip:focus-visible > .item-tooltip { display: block; }
    .item-tooltip {
        position: absolute; left: 0; top: calc(100% + 6px); z-index: 80;
        width: max-content; max-width: 320px; padding: 0.55rem 0.7rem;
        background: var(--panel-2); border: 1px solid var(--line); border-radius: 0;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
        color: var(--text); font-size: 0.85rem; font-weight: 400; line-height: 1.4;
        text-align: left; white-space: normal; pointer-events: none;
    }
    .item-tooltip.is-placed { position: fixed; }
}
.item-tooltip .tt-head { display: block; font-weight: 600; font-size: 0.95rem; }
.item-tooltip .tt-rarity { font-weight: 400; font-size: 0.8rem; opacity: 0.8; }
.item-tooltip .tt-line { display: block; }
.item-tooltip .tt-section { display: block; margin-top: 0.35rem; padding-top: 0.35rem; border-top: 1px solid var(--line); }
.item-tooltip .tt-blocked { color: var(--danger); }

/* Inventory window: figure with equipment slots and the 5x9 bag grid (play.partials.equipment-table / bag-table).
   The layout follows the classic MMO inventory; frames, cells and icons are our own. */
html:not(.js) .js-only { display: none !important; }
/* Cell size lives on :root so the figure also fits outside the inventory page (character page). */
:root { --cell: 46px; --cell-gap: 2px; }
@media (max-width: 760px) {
    :root { --cell: min(56px, calc((100vw - 32px - 28px) / 5)); }
}
.inv-layout {
    display: grid; grid-template-columns: max-content minmax(0, 1fr);
    grid-template-areas: "equip detail" "bag detail" "tools tools";
    gap: 12px 20px; align-items: start; margin-top: 0.6rem;
}
.inv-contents { display: contents; }
.inv-equip-area { grid-area: equip; }
.inv-bag-window { grid-area: bag; }
.inv-detail { grid-area: detail; }
.inv-tools { grid-area: tools; }
.inv-window {
    width: max-content; padding: 6px 8px 8px;
    background: linear-gradient(180deg, #2c2219 0%, #1c1611 100%);
    border: 2px solid #6b5230; border-radius: 0;
    box-shadow: inset 0 0 0 1px #120c07, inset 0 0 0 2px rgba(226, 179, 71, 0.18), 0 6px 18px rgba(0, 0, 0, 0.45);
}
.inv-window-head {
    display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem;
    margin: -2px -4px 6px; padding: 2px 8px;
    background: linear-gradient(180deg, #4a3722, #2e2216); border-bottom: 1px solid #6b5230; border-radius: 2px;
    color: #f2d48a; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.inv-window-head .small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.inv-bag, .inv-doll {
    position: relative; display: grid; gap: var(--cell-gap);
    grid-template-columns: repeat(5, var(--cell));
}
.inv-bag { grid-template-rows: repeat(var(--inv-rows, 9), var(--cell)); }
.inv-bag + .inv-bag { margin-top: 6px; }
html.js .inv-bag:not(.is-active) { display: none; }
/* Sort + sell in one row: equal compact buttons across the five-cell width, one button fills it alone. */
.inv-bag-actions {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--cell-gap); margin-bottom: 6px;
    max-width: calc(5 * var(--cell) + 4 * var(--cell-gap));
}
.inv-bag-actions .inline-form { display: flex; min-width: 0; }
.inv-bag-actions .btn {
    width: 100%; min-width: 0; padding: 4px 6px; font-size: 0.78rem; font-weight: 700; line-height: 1.2;
    text-align: center; white-space: normal; padding-inline: 2px;
}
.inv-bag-actions .btn[aria-pressed="true"] { border-image-source: url("../images/ui/rpgui/button.png"); color: #1e0f06; text-shadow: none; }
.inv-page-tabs { display: grid; grid-template-columns: repeat(var(--inv-pages, 4), 1fr); gap: var(--cell-gap); margin-bottom: 4px; }
/* Main bag + special bags (stones, materials, quest): two rows of tabs fit the five-cell window. */
.inv-bag-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--cell-gap); margin-bottom: 6px; }
.inv-bag-tab {
    display: flex; justify-content: space-between; align-items: center; gap: 0.3rem; min-width: 0;
    padding: 3px 6px; font: inherit; font-weight: 700; font-size: 0.78rem; cursor: pointer;
    color: #a1937f; background: linear-gradient(180deg, #2e2216, #1a140e); border: 1px solid #4a3a28; border-radius: 0;
}
.inv-bag-tab:hover { color: #f2d48a; }
.inv-bag-tab.is-active { color: #f2d48a; background: linear-gradient(180deg, #5a4329, #2e2216); border-color: #6b5230; }
.inv-bag-tab-count { font-weight: 400; font-size: 0.72rem; color: #a1937f; }
html.js .inv-bag-group:not(.is-active) { display: none; }
.inv-bag-group + .inv-bag-group { margin-top: 10px; }
html.js .inv-bag-group + .inv-bag-group { margin-top: 0; }
.inv-bag-group-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.2rem 0.5rem; margin-bottom: 4px; max-width: calc(5 * var(--cell) + 4 * var(--cell-gap)); }
.inv-bag-group-title { color: #f2d48a; font-weight: 700; font-size: 0.82rem; }
html.js .inv-bag-group-title { display: none; }
.inv-tile.is-overflow { outline: 1px dashed #c9a24a; outline-offset: -3px; }
.inv-socket-form { align-items: end; margin: 0.4rem 0; }
.inv-socket-form select { max-width: 100%; }
.inv-page-tab {
    padding: 2px 0; font: inherit; font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em; cursor: pointer;
    color: #a1937f; background: linear-gradient(180deg, #2e2216, #1a140e); border: 1px solid #4a3a28; border-radius: 0 3px 0 0;
}
.inv-page-tab:hover { color: #f2d48a; }
.inv-page-tab.is-active { color: #f2d48a; background: linear-gradient(180deg, #5a4329, #2e2216); border-color: #6b5230; }
.inv-doll { grid-template-rows: repeat(5, var(--cell)); }
.inv-cell, .inv-slot.is-empty {
    background: #120e0b; border: 1px solid #36291d;
    box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #4a3a28;
}
.inv-bag.is-moving .inv-cell { cursor: crosshair; background: #1d1a10; }
.inv-cell.is-drop-target { background: #3a3215; border-color: var(--accent); }
.inv-drop-preview { display: none; z-index: 2; pointer-events: none; border: 2px solid var(--accent); background: rgba(226, 179, 71, 0.18); border-radius: 2px; }
.inv-drop-preview.is-drop-target { display: block; }
.inv-doll-figure {
    position: absolute; top: 0; bottom: 0; left: calc(var(--cell) + var(--cell-gap)); width: calc(3 * var(--cell) + 2 * var(--cell-gap)); height: 100%;
    fill: rgba(214, 168, 90, 0.06); stroke: rgba(214, 168, 90, 0.22); stroke-width: 0.8; pointer-events: none;
}
.inv-slot.is-empty { display: flex; align-items: center; justify-content: center; padding: 6px; }
.inv-slot.is-empty .inv-tile-icon { opacity: 0.16; filter: grayscale(1); }
.inv-slot.is-drop-target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.inv-tile {
    position: relative; z-index: 1; display: flex; align-items: center; justify-content: center;
    min-width: 0; min-height: 0; padding: 2px; margin: 0;
    background: radial-gradient(circle at 50% 40%, rgba(255, 240, 200, 0.07), rgba(0, 0, 0, 0) 70%), #17120d;
    border: 1px solid #4a3a28; border-radius: 2px; font: inherit; cursor: pointer;
}
.inv-tile.has-tooltip { text-decoration: none; cursor: pointer; }
/* Every tile is its own stacking layer, so the hovered one moves up or the next tiles cover its card.
   Phones keep :hover on the last tapped tile, so there the lift would cover the detail sheet. */
@media (hover: hover) { .inv-tile:hover { z-index: 80; } }
.inv-tile:focus-visible { z-index: 80; }
.inv-tile:not(.rarity-common) { border-color: currentColor; box-shadow: inset 0 0 8px color-mix(in srgb, currentColor 40%, transparent); }
.inv-tile:hover, .inv-tile:focus-visible { border-color: var(--accent); outline: none; background-color: #2a2016; }
.inv-tile.is-selected { box-shadow: 0 0 0 2px var(--accent), inset 0 0 10px rgba(226, 179, 71, 0.45); }
.inv-tile.is-blocked { background: radial-gradient(circle at 50% 40%, rgba(255, 120, 100, 0.12), rgba(0, 0, 0, 0) 70%), #4a1714; }
.inv-tile.is-dimmed { opacity: 0.18; }
.inv-tile.is-dragging { opacity: 0.35; }
.inv-tile { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
/* Sell mode: picks glow red with a check, items without vendor value fade out. */
.inv-layout.is-sell-mode .inv-tile, .inv-layout.is-sell-mode tr[data-sell-id] { cursor: copy; }
.inv-tile.is-picked { border-color: #e0604a; box-shadow: 0 0 0 2px #e0604a, inset 0 0 12px rgba(224, 96, 74, 0.55); }
.inv-tile.is-picked::after {
    content: "\2713"; position: absolute; right: 2px; top: 1px; font-size: 12px; font-weight: 700; line-height: 1; color: #ffb3a5;
    text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000; pointer-events: none;
}
.inv-tile.is-unsellable, tr.is-unsellable { opacity: 0.25; cursor: not-allowed; }
tr.is-picked > td { background: rgba(224, 96, 74, 0.16); }
.inv-detail.is-selling .inv-detail-empty { display: none; }
.inv-sell-summary { margin: 0.4rem 0; color: #f2d48a; font-weight: 600; }
.inv-sell-presets { margin-bottom: 0.3rem; }
.inv-tile-icon { display: block; width: 100%; height: 100%; }
.inv-tile-qty, .inv-tile-plus {
    position: absolute; font-size: 11px; font-weight: 700; line-height: 1; color: #fff; pointer-events: none;
    text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000;
}
.inv-tile-qty { right: 2px; bottom: 2px; }
.inv-tile-plus { left: 2px; top: 2px; color: #f2d48a; }
.inv-tile-sockets { position: absolute; left: 3px; bottom: 3px; display: flex; gap: 2px; pointer-events: none; }
.socket-pip { width: 6px; height: 6px; border-radius: 50%; box-sizing: border-box; box-shadow: 0 0 0 1px #000; }
.socket-pip.is-empty { border: 1px solid #c9b07a; background: rgba(0, 0, 0, 0.55); }
.socket-pip.is-stone { background: radial-gradient(circle at 35% 30%, #e6fbff, #47c6e8 55%, #1a6f8c); }
.socket-pip.is-shard { background: linear-gradient(135deg, #8a8580 45%, #c0392b 45%, #c0392b 55%, #5b5650 55%); }
.inv-loose { display: flex; flex-wrap: wrap; gap: var(--cell-gap); margin-top: 4px; }
.inv-loose .inv-tile { width: var(--cell); height: var(--cell); }
.inv-bag-foot { display: flex; align-items: center; justify-content: flex-end; gap: 0.3rem; margin-top: 6px; padding: 2px 6px; background: #120e0b; border: 1px solid #36291d; color: #f2d48a; font-weight: 600; font-size: 0.85rem; }
.inv-hint { max-width: calc(5 * var(--cell) + 8px); margin-top: 6px; }
.inv-hint-touch { display: none; }
@media (hover: none) {
    .inv-hint-mouse { display: none; }
    .inv-hint-touch { display: block; }
}
.inv-detail { position: sticky; top: 12px; min-height: 8rem; padding: 0.8rem 0.9rem; background: var(--panel); border: 1px solid var(--line); border-radius: 0; }
.inv-detail.has-selection .inv-detail-empty { display: none; }
.inv-detail-close { display: none; }
.inv-detail-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.3rem; font-size: 1.05rem; font-weight: 600; }
.inv-detail-icon { flex: 0 0 auto; width: 44px; height: 44px; padding: 3px; background: #120e0b; border: 1px solid #4a3a28; }
.inv-detail .item-tooltip {
    display: block; position: static; width: auto; max-width: none; padding: 0; margin: 0;
    background: none; border: 0; box-shadow: none; pointer-events: auto; font-size: 0.88rem;
}
.inv-detail .item-tooltip .tt-head { display: none; }
.inv-detail .item-tooltip .tt-section:first-of-type, .inv-detail .item-tooltip > .tt-line:first-child { margin-top: 0; }
.inv-detail-actions { margin-top: 0.7rem; }
.inv-view-toggle { display: flex; gap: 0.3rem; }
.inv-equipment-list { margin-top: 0.6rem; }
/* Character page: figure next to the value list, both inside the card. */
.inv-equipment-readonly { display: flex; flex-wrap: wrap; gap: 0.8rem 1.2rem; align-items: flex-start; }
.inv-equipment-readonly .inv-equipment-list { flex: 1 1 16rem; margin-top: 0; }
@media (max-width: 760px) {
    .inv-layout {
        grid-template-columns: minmax(0, 1fr); grid-template-areas: "equip" "bag" "tools";
        justify-items: center;
    }
    .inv-tools { justify-self: stretch; }
    .inv-detail {
        position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 90; max-height: 62vh; overflow-y: auto;
        /* Never wider than the phone screen, even when something else on the page overflows. */
        box-sizing: border-box; width: auto; max-width: 100vw; overflow-x: hidden; overflow-wrap: anywhere;
        border-radius: 0 12px 0 0; border-color: var(--accent); box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.6);
        transform: translateY(105%); visibility: hidden; transition: transform 0.18s ease, visibility 0s linear 0.18s;
    }
    .inv-detail.is-open { transform: none; visibility: visible; transition: transform 0.18s ease; }
    /* On phones the sell panel stays docked at the bottom, small enough to keep the bag in view. */
    .inv-detail.is-selling { transform: none; visibility: visible; max-height: 42vh; padding-bottom: 0.6rem; }
    .inv-layout.is-sell-mode { padding-bottom: 42vh; }
    /* Sticky instead of absolute, so the close button stays in view while the sheet scrolls. */
    .inv-detail-close {
        display: block; position: sticky; top: 0; z-index: 2; float: right; margin: -0.2rem -0.2rem 0.3rem 0.6rem;
        padding: 0.1rem 0.6rem; font-size: 1.2rem; background: var(--panel-2); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }
    .inv-detail-empty { display: none; }
}

/* Smith: the bag grid on the left, the chosen piece with chance and cost on the right. */
.smith-layout {
    display: grid; grid-template-columns: max-content minmax(0, 1fr);
    gap: 12px 20px; align-items: start; margin-top: 0.6rem;
}
.smith-grid { display: grid; gap: 8px; align-content: start; }
/* Equipped pieces wrap at the bag's five columns, otherwise the row outgrows a phone screen. */
.smith-grid .inv-loose { max-width: calc(5 * var(--cell) + 4 * var(--cell-gap)); }
/* The inventory places its detail by grid area; here it simply takes the second column. */
.inv-detail.smith-detail { grid-area: auto; }
span.inv-tile { cursor: default; }
.smith-step { margin: 0.2rem 0 0.4rem; }
.smith-cost { margin-top: 0.4rem; }
.smith-bonuses { margin-top: 0.4rem; }
.smith-recipe-tiers { margin: 0.2rem 0 0.6rem; padding-left: 1.1rem; }
/* The name row has a fixed height (two lines at most), so the buttons below it never move:
   not with a long name, more info lines, a material choice or the Blessing Scroll option. */
.smith-detail .inv-detail-head { height: 3.4rem; margin-bottom: 0.5rem; }
.smith-detail .inv-detail-head .item-name {
    min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3;
}
/* Buttons first in a fixed row, the upgrade options below them. The upgrade form is
   display: contents, so its button and fields join this grid without leaving the form. */
.smith-actions {
    display: grid; grid-template-columns: 9rem 9rem minmax(0, 1fr); gap: 0.4rem 0.5rem; align-items: center;
    margin: 0 0 0.7rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line);
}
.smith-actions > .smith-upgrade-form { display: contents; }
.smith-actions > form:not(.smith-upgrade-form), .smith-actions > .smith-upgrade-form > .btn { grid-row: 1; min-width: 0; }
.smith-actions .btn { width: 100%; justify-content: center; text-align: center; }
.smith-actions > .smith-upgrade-form > .btn { grid-column: 1; }
.smith-actions > form:not(.smith-upgrade-form) { grid-column: 2; display: flex; }
.smith-actions > .smith-upgrade-form > .smith-option { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.smith-actions .smith-option select { flex: 1 1 auto; min-width: 0; max-width: 24rem; }
@media (max-width: 760px) {
    .smith-layout { grid-template-columns: minmax(0, 1fr); justify-items: center; }
    /* The detail stays in the page flow below the bag instead of the inventory's bottom sheet.
       z-index must be reset too: as a grid item it would still be lifted above the footer chat. */
    .inv-detail.smith-detail {
        position: static; z-index: auto; justify-self: stretch; max-height: none; overflow: visible;
        transform: none; visibility: visible; border-radius: 0; border-color: var(--line); box-shadow: none;
    }
    .smith-detail .inv-detail-empty { display: block; }
    .smith-detail.has-selection .inv-detail-empty { display: none; }
}

/* Group fights: live playback, tactic editor and the small reaction row. */
[x-cloak] { display: none !important; }
.group-fight-banner {
    display: block; margin: 0.4rem 0 0.6rem; padding: 0.5rem 0.8rem;
    background: #2a2216; border: 1px solid var(--accent); border-radius: 0;
    color: #f2d48a; font-weight: 600; text-decoration: none;
}
.group-fight-banner:hover { filter: brightness(1.1); }
.world-boss-reward-banner { display: block; margin: 0.4rem 0 0.6rem; padding: 0.5rem 0.8rem; background: #2a2216; border: 1px solid #e8b84a; border-radius: 0; color: #f2d48a; font-weight: 600; text-decoration: none; }
.world-boss-reward-banner:hover { filter: brightness(1.1); }
.group-fight-controls { justify-content: space-between; align-items: center; }
.group-fight-moment { border-color: var(--accent); background: #1b140d; }
.group-fight-moment-announcement { font-size: 1.1rem; color: #f2d48a; margin: 0.4rem 0 0.6rem; }
.group-fight-cards { align-items: stretch; }
.group-fight-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem;
    flex: 1 1 180px; text-align: left; padding: 0.6rem 0.8rem; white-space: normal;
}
.group-fight-card:disabled { opacity: 0.75; }
.group-fight-round { list-style: none; margin: 0 0 0.7rem; }
.group-fight-round h3 { margin: 0 0 0.25rem; color: #f2d48a; }
.group-fight-round ul.plain { margin: 0; }
/* Tactic rules sit side by side on desktop; the form keeps its other fields narrow. */
.tactic-form { max-width: none; }
.tactic-form > :not(.tactic-rules) { max-width: 320px; }
.tactic-rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.6rem; }
@media (max-width: 640px) { .tactic-rules { grid-template-columns: 1fr; } }
.tactic-rule-tag { display: inline-block; padding: 0 0.35rem; margin-right: 0.3rem; border: 1px solid var(--line, currentColor); border-radius: 0.6rem; font-size: 0.8em; white-space: nowrap; }
.tactic-sim-log ul { margin: 0.2rem 0 0.5rem; padding-left: 1rem; }
.tactic-rule {
    display: grid; gap: 0.4rem; padding: 0.6rem;
    background: #120e0b; border: 1px solid #36291d; border-radius: 0;
}
.tactic-rule label { display: flex; flex-direction: column; gap: 0.15rem; }
.tactic-rule select { width: 100%; }
.tactic-rule input[type="number"] { width: 100%; }
.tactic-rule-head { justify-content: space-between; align-items: center; }
.tactic-rule-head .btn-link { padding: 0 0.3rem; }
.reaction-button { font-size: 1.35rem; line-height: 1; padding: 0.35rem 0.6rem; }
.group-fight-reaction-items { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-top: 0.5rem; }
.group-fight-reaction-items li { display: inline-flex; align-items: center; gap: 0.25rem; }
/* Pages outside the game: login, registration, password reset, error pages. */
.guest-menu { justify-content: flex-end; }
.guest-main { padding-top: 1.2rem; }
.brand-banner { margin: 0 auto 0.4rem; text-align: center; }
.brand-banner img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 0; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5); }
.brand-banner-tagline { margin: 0.5rem 0 0; color: var(--accent); font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.auth-card { max-width: 440px; margin: 1rem auto; padding: 1.2rem 1.4rem; }
.auth-card-wide { max-width: 760px; }
.auth-card h1 { margin-top: 0; }
.auth-form { display: flex; flex-direction: column; gap: 0.8rem; margin-top: 0.8rem; }
.auth-form label { display: flex; flex-direction: column; gap: 0.25rem; }
.auth-form label.auth-check { flex-direction: row; align-items: center; gap: 0.4rem; }
.auth-form input[type="email"], .auth-form input[type="password"], .auth-form input[type="text"] { width: 100%; }
.auth-form input:disabled { opacity: 0.7; }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.auth-actions { margin-top: 0.4rem; }
.field-error { color: var(--danger); font-size: 0.85rem; }
/* Guest accounts: "Play now" card, honeypot field, reminder bar in the game. */
.guest-start { text-align: center; }
.guest-start .btn-primary { font-size: 1.1rem; padding: 0.6rem 1.4rem; }
.guest-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.guest-banner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.8rem;
    margin: 0.4rem 0 0.6rem; padding: 0.4rem 0.8rem; font-size: 0.9rem;
    background: #1d1912; border: 1px dashed #6b5a36; border-radius: 0; color: #d9c79c;
}
.guest-banner-strong { border-style: solid; border-color: var(--accent); background: #2a2216; color: #f2d48a; font-weight: 600; }
.guest-banner .btn { white-space: nowrap; }
/* Login with Discord / Google */
.social-login { margin-top: 1rem; padding-top: 0.8rem; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.social-login-label { margin: 0 0 0.4rem; }
.social-login-buttons { gap: 0.5rem; flex-wrap: wrap; }
.social-login-btn { flex: 1 1 140px; text-align: center; }
.social-login-discord { border-color: #5865f2; }
.social-login-google { border-color: #c9c9c9; }
.race-grid { margin-top: 0.3rem; }
.race-grid .lumiis-race-card { cursor: pointer; }
.race-grid .lumiis-race-card.selected { border-color: var(--accent); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--accent); }
.error-card { margin-top: 2rem; }
/* Public legal pages (imprint, privacy, terms, withdrawal) rendered from Markdown. */
.legal-document { max-width: 760px; margin: 1rem auto; padding: 1.2rem 1.4rem; }
.legal-document h1 { margin-top: 0; }
.legal-document-body { line-height: 1.65; }
.legal-document-body h2 { margin: 1.6rem 0 0.4rem; color: var(--accent); font-size: 1.15rem; }
.legal-document-body h3 { margin: 1.1rem 0 0.3rem; font-size: 1rem; }
.legal-document-body p { margin: 0.5rem 0; }
.legal-document-body ul, .legal-document-body ol { margin: 0.5rem 0; padding-left: 1.25rem; }
.legal-document-body li { margin: 0.2rem 0; }
.legal-document-body blockquote {
    margin: 0.8rem 0; padding: 0.45rem 0.8rem;
    border-left: 3px solid var(--accent); background: #120e0b; color: #d8c7a8;
}
.legal-document-body code { padding: 0 0.25rem; background: #120e0b; border-radius: 0; }
.legal-document-body a { color: var(--accent); }
@media (max-width: 600px) { .legal-document { margin: 0.6rem 0; padding: 1rem; } }
@media (max-width: 600px) {
    .auth-grid { grid-template-columns: 1fr; }
    .guest-topbar .topbar-menu { justify-content: flex-start; }
    .brand-banner-tagline { font-size: 0.9rem; letter-spacing: 0.08em; }
}

/* Skill values: next-stage line on the character page, hover card around battle skill buttons. */
.skill-upgrade { margin-top: 0.2rem; }
.skill-change { overflow-wrap: anywhere; }
.skill-rank-inline { display: none; }
/* Skills the equipped weapon locks (bow vs. melee): greyed, with the reason in red. */
.skill-table tr.skill-locked .skill-name, .btn.skill-locked { opacity: 0.55; }
.btn.skill-locked { cursor: not-allowed; }
.skill-lock-reason { color: var(--danger); margin-top: 0.2rem; }
option.option-locked { color: var(--muted); }
.skill-table td.skill-rank, .skill-table td.skill-action { white-space: nowrap; }
.skill-values-touch { margin-top: 0.3rem; }
.skill-values-touch summary { cursor: pointer; color: var(--accent); }
.skill-values-list { display: grid; grid-template-columns: auto 1fr; gap: 0.1rem 0.8rem; margin: 0.3rem 0; }
.skill-values-list dt { color: var(--muted); }
.skill-values-list dd { margin: 0; }
@media (hover: hover) and (pointer: fine) and (min-width: 641px) { .skill-values-touch { display: none; } }
/* Phones: every skill becomes a small card. Name and rank on top, the description and
   the next-stage changes (one per line) below, the learn button across the bottom. */
@media (max-width: 640px) {
    .table.skill-table, .skill-table tbody { display: block; }
    .skill-table thead { display: none; }
    .skill-table tr { display: block; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
    .skill-table td { display: block; padding: 0; border: 0; }
    .skill-table td.skill-rank { display: none; }
    .skill-table .skill-name { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; font-weight: 600; }
    .skill-table .skill-rank-inline { display: inline; flex: none; color: var(--accent); font-size: 0.85rem; font-weight: 400; }
    .skill-table .skill-upgrade { display: grid; gap: 0.1rem; margin-top: 0.35rem; padding: 0.35rem 0.5rem; border-radius: 0; background: var(--panel-2); }
    .skill-table .skill-sep { display: none; }
    .skill-table td.skill-action .inline-form, .skill-table td.skill-action form { display: flex; margin-top: 0.45rem; }
    .skill-table td.skill-action .btn { flex: 1; }
}
.has-tooltip.skill-button { text-decoration: none; cursor: default; }

/* Wide tables on phones: each row becomes a small card. The title cell spans the row,
   the other cells line up with their column name in front (data-label), the buttons go
   to the bottom. Columns marked hide-narrow are dropped instead. */
.show-narrow { display: none; }
@media (max-width: 640px) {
    .hide-narrow { display: none; }
    .show-narrow { display: inline; }
    .table.table-cards, .table-cards tbody { display: block; overflow: visible; }
    .table-cards thead { display: none; }
    .table-cards tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
    .table-cards td { display: block; padding: 0; border: 0; }
    .table-cards td.hide-narrow { display: none; }
    .table-cards td.cell-title { flex-basis: 100%; }
    .table-cards td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.85rem; }
    .table-cards td.cell-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; flex-basis: 100%; margin-top: 0.3rem; }
    .table-cards td.cell-actions:empty { display: none; }
    .table-cards td.cell-actions > * { margin: 0; }
}
.group-fight-round li.group-fight-combo {
    margin: 0.2rem 0; padding: 0.25rem 0.5rem; border-left: 3px solid #f2b84a;
    background: #2a2216; color: #ffe5a3; font-weight: 600;
}

/* Footer chat: a slim bar at the end of the game column that folds out into the public
   chat (players + smith announcements). It is sticky, not fixed: it shares the column
   width with the content and at the end of the page sits below it, never over it.
   Hover cards (item, skill, stat tooltips) use z-index 80 so they stay above it. */
.chat-footer { position: sticky; bottom: 0; z-index: 50; margin-top: 1.5rem; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 0 10px 0 0; box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.4); }
.page:has(.chat-footer) { padding-bottom: 0; }
.chat-footer-bar { display: flex; align-items: center; gap: 0.5rem; width: 100%; min-height: 2.6rem; padding: 0.4rem 0.8rem; background: none; border: 0; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.chat-footer-bar:hover { background: var(--panel-2); border-radius: 0 10px 0 0; }
.chat-footer-title { font-weight: 600; }
.chat-footer-last { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chat-footer-toggle { margin-left: auto; white-space: nowrap; }
.chat-footer-panel { border-top: 1px solid var(--line); padding: 0.4rem 0.8rem 0.7rem; }
.chat-lines { height: 160px; overflow-y: auto; margin: 0 0 0.5rem; padding: 0; list-style: none; overscroll-behavior: contain; }
.chat-page-lines { max-height: 420px; overflow-y: auto; list-style: none; padding: 0; }
.chat-line { padding: 0.15rem 0; overflow-wrap: anywhere; }
.chat-time { font-size: 0.75rem; margin-right: 0.35rem; font-variant-numeric: tabular-nums; }
.chat-sender { margin-right: 0.25rem; }
.chat-line-smith { color: var(--accent); }
.chat-line-smith .chat-body { font-style: italic; }
.chat-line-world-boss { color: #e8b84a; }
.chat-line-world-boss .chat-body { font-style: italic; font-weight: 600; }
.chat-line-group { color: #9fd6a8; }
.chat-line-group .chat-body { font-style: italic; }
.chat-link { margin-left: 0.35rem; font-weight: 600; }
.chat-tabs { display: flex; gap: 0.35rem; margin-bottom: 0.35rem; }
.chat-tab { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.7rem; border: 1px solid var(--line); border-radius: 99px; background: none; color: var(--muted, inherit); font: inherit; font-size: 0.85rem; cursor: pointer; }
.chat-tab.is-active { background: var(--panel-2); color: var(--text); border-color: var(--accent); }
.chat-tab-dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--accent); }
.chat-lines-tab-world [data-chat-tab="groups"], .chat-lines-tab-groups [data-chat-tab="world"] { display: none; }
.chat-footer-form { display: flex; gap: 0.5rem; }
.chat-footer-form input { flex: 1; min-width: 0; }
.chat-footer-error { color: var(--danger); margin: 0.3rem 0 0; }
@media (max-width: 640px) {
    .chat-footer { margin-inline: -16px; border-radius: 0; border-inline: 0; }
    .chat-lines { height: 28vh; }
    .chat-footer-last { display: none; }
}

/* Inbox: private messages and system notifications, apart from the public chat. */
.inbox-badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.55rem; border-radius: 99px; background: var(--accent); color: #1b140c; font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.badge[hidden], .inbox-badge[hidden] { display: none; }
.inbox-badge:hover { text-decoration: none; filter: brightness(1.1); }
.inbox-badge .nav-icon { width: 1.1em; height: 1.1em; }
.inbox-columns { display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 1rem; align-items: start; }
.inbox-columns > * { min-width: 0; }
.inbox-list { list-style: none; padding: 0; margin: 0 0 0.8rem; }
.inbox-entry { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.inbox-entry:last-child { border-bottom: 0; }
.inbox-entry.active { background: var(--panel-2); border-radius: 0; }
.inbox-unread { border-left: 3px solid var(--accent); }
.inbox-conversation { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem; color: var(--text); }
.inbox-conversation:hover { text-decoration: none; }
.inbox-conversation time { margin-left: auto; }
.inbox-preview { flex-basis: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.inbox-meta { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.15rem; }
.inbox-text { display: block; }
.inbox-tag { padding: 0 0.4rem; border-radius: 0; background: var(--panel-2); color: var(--text); }
.inbox-tag-shop { color: var(--accent); }
.inbox-tag-fight { color: var(--ok); }
.inbox-new { color: var(--accent); font-weight: 700; }
.inbox-conversations .inline-form, .inbox-thread .inline-form { display: flex; flex-wrap: wrap; gap: 0.4rem; width: 100%; }
.inbox-conversations .inline-form input { flex: 1 1 100%; min-width: 0; }
.inbox-thread .inline-form input { flex: 1; min-width: 0; }
.inbox-messages { list-style: none; padding: 0; margin: 0 0 0.8rem; max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.4rem; }
.inbox-message { max-width: 85%; padding: 0.35rem 0.6rem; border-radius: 0; background: var(--panel-2); overflow-wrap: anywhere; }
.inbox-message-out { align-self: flex-end; background: color-mix(in srgb, var(--accent) 18%, var(--panel-2)); }
.inbox-message.inbox-unread { border-left: 3px solid var(--accent); }
@media (max-width: 720px) {
    .inbox-columns { grid-template-columns: minmax(0, 1fr); }
    .inbox-message { max-width: 100%; }
    .inbox-columns.has-thread .inbox-thread { order: -1; }
}

/* PvP duel replay */
.duel-replay-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.duel-replay-fighter { display: flex; flex-direction: column; gap: 0.25rem; }
.duel-replay-fighter:last-child { text-align: right; align-items: flex-end; }
.duel-replay-round { font-weight: 700; white-space: nowrap; }
.duel-replay-bar { width: 100%; height: 0.8rem; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.duel-replay-bar > span { display: block; height: 100%; background: var(--ok); transition: width 220ms ease; }
.duel-replay-bar > span.low { background: var(--danger); }
.duel-replay-log { list-style: none; padding: 0; margin: 0 0 0.8rem; max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.25rem; }
.duel-replay-event { padding: 0.15rem 0.4rem; border-left: 3px solid var(--line); }
.duel-replay-challenger { border-left-color: var(--accent); }
.duel-replay-defender { border-left-color: var(--ok); }
.duel-replay-status { color: var(--muted); font-style: italic; }
.duel-replay-result { font-weight: 700; margin-top: 0.5rem; }
@media (prefers-reduced-motion: reduce) {
    .duel-replay-bar > span { transition: none; }
}
@media (max-width: 720px) {
    .duel-replay-head { grid-template-columns: 1fr; text-align: left; }
    .duel-replay-fighter:last-child { text-align: left; align-items: flex-start; }
    .duel-replay-round { order: -1; }
}

/* Hire lists (mercenaries, shadows): one line per offer, info left and button right; wraps in narrow cards. */
.hire-list { display: flex; flex-direction: column; margin: 0.5rem 0 0.2rem; border-top: 1px solid var(--line); }
.hire-option { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.8rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.hire-info { display: flex; flex-direction: column; gap: 0.1rem; flex: 1 1 8rem; min-width: 0; }
.hire-info strong { overflow-wrap: break-word; }

/* Fame ranks next to character names */
.rank-tag { font-size: 0.8em; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.rank-friendly { color: #7ea66a; }
.rank-good { color: #4a90d9; }
.rank-noble { color: #b07ad0; }
.rank-chivalrous { color: #e2b347; }
.rank-champion { color: #c63b33; }
/* Negative ranks (Soul Stones): attackable without consent. */
.rank-aggressive { color: #d08a4a; }
.rank-deceitful { color: #d0663c; }
.rank-malicious { color: #c8452f; }
.rank-cruel { color: #a3241f; }
/* Bug report form under "More". */
.bug-report-form { max-width: 560px; }
.bug-report-form input[type="text"], .bug-report-form textarea, .bug-report-form select { width: 100%; }
.bug-report-form textarea { padding: 0.35rem 0.5rem; border-radius: 0; border: 1px solid var(--line); background: #120f0c; color: var(--text); font: inherit; resize: vertical; }
.bug-report-form input[type="file"] { width: 100%; }
.bug-status { color: var(--accent); }
.bug-status-done { color: var(--muted); }

/* Community Discord link: pill in the top bar (game + guest pages), card on the start page, line on the patch notes. */
.discord-icon { width: 1.15em; height: 1.15em; flex: none; }
.discord-badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.65rem; border-radius: 99px; background: #5865f2; color: #fff; font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.discord-badge:hover, .discord-btn:hover { text-decoration: none; filter: brightness(1.12); }
.btn.discord-btn { display: inline-flex; align-items: center; gap: 0.45rem; border: 1px solid #5865f2; border-image: none; border-radius: 0; background: #5865f2; text-shadow: none; color: #fff; font-weight: 700; }
.discord-card { max-width: 440px; margin: 1rem auto; padding: 1rem 1.4rem; text-align: center; }
.discord-card h2 { margin: 0 0 0.3rem; }
.discord-card p { margin: 0 0 0.8rem; }
.discord-line { margin: 0 0 1rem; }
/* Page footer with the Discord link and the forum threads about lumiis. */
.community-footer { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; margin: 2rem 0 1rem; padding: 0.8rem 0 0; border-top: 1px solid var(--line); }
.community-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
.legal-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 1rem; font-size: 0.85rem; }
.legal-footer-links a { color: var(--muted); }
.legal-footer-links a:hover { color: var(--accent); }
.community-link { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0.7rem 0.25rem 0.35rem; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); color: var(--text); font-size: 0.85rem; white-space: nowrap; }
.community-link:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.community-link-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: none; border-radius: 0; object-fit: contain; }
.community-link-icon-discord { background: #5865f2; color: #fff; }
.community-link-icon-discord .discord-icon { width: 14px; height: 14px; }
.community-link-wide { padding: 0.15rem 0.45rem; }
.community-link-banner { display: block; height: 22px; width: auto; border-radius: 0; }
.community-link-monogram { background: var(--panel-2); color: var(--accent); font-size: 0.55rem; font-weight: 800; letter-spacing: -0.02em; }
.community-link-icon-vote { background: #2563eb; color: #fff; font-size: 0.8rem; }
.vote-page { max-width: 640px; margin: 0 auto; }
.vote-card { display: flex; justify-content: center; margin: 1rem 0; min-height: 120px; }
@media (max-width: 420px) {
    .discord-badge { padding: 0.25rem 0.45rem; }
    .discord-badge-label { display: none; }
}

/* Achievement titles: the shown title next to a name and the titles page. */
.title-tag { color: var(--accent); font-style: italic; font-weight: 600; white-space: nowrap; }
.title-tag::before { content: "\00AB"; }
.title-tag::after { content: "\00BB"; }
.character-name .title-tag { font-size: 0.85em; }
.group-not-ready { color: var(--st); }
.titles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 0.6rem; margin-top: 0.6rem; }
.title-entry { border: 1px solid var(--line); border-radius: 0; padding: 0.55rem 0.7rem; display: flex; flex-direction: column; gap: 0.3rem; }
.title-entry h3 { margin: 0; font-size: 1rem; }
.title-entry p { margin: 0; }
.title-entry.is-locked { opacity: 0.72; }
.title-entry.is-active { border-color: var(--accent); }
.title-entry { scroll-margin: 5rem; }
.title-entry:target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 0 14px rgba(214, 168, 90, 0.45); }

/* Group finder: pressure estimate as a traffic light. */
.group-pressure { border-left: 4px solid var(--muted); padding: 0.35rem 0.6rem; margin: 0.5rem 0; background: var(--panel-2); border-radius: 0; }
.group-pressure p { margin: 0.1rem 0; }
.group-pressure-head { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.group-pressure-light { width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--muted); flex: none; }
.group-pressure-good { border-left-color: var(--ok); }
.group-pressure-good .group-pressure-light { background: var(--ok); }
.group-pressure-tight { border-left-color: var(--st); }
.group-pressure-tight .group-pressure-light { background: var(--st); }
.group-pressure-weak { border-left-color: var(--danger); }
.group-pressure-weak .group-pressure-light { background: var(--danger); }
.group-pressure-hints { margin: 0.2rem 0 0; padding-left: 1.1rem; }
.group-pressure-badge { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.group-pressure-badge::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--muted); }
.group-pressure-badge.group-pressure-good::before { background: var(--ok); }
.group-pressure-badge.group-pressure-tight::before { background: var(--st); }
.group-pressure-badge.group-pressure-weak::before { background: var(--danger); }
.group-target { border-top: 1px solid var(--line); padding: 0.5rem 0; }
.group-target:first-of-type { border-top: 0; }
/* Item search (/spiel/gegenstaende): search bar, category row and one card per item. */
.item-search-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.item-search-form input[type="search"] { flex: 1 1 14rem; min-width: 0; }
.item-search-categories { display: flex; flex-wrap: wrap; gap: 0.2rem 0.4rem; margin-top: 0.6rem; }
.item-search-categories .active { color: var(--accent); text-decoration: underline; }
.item-search-explain { margin-top: 0.5rem; }
.item-codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 0.6rem; }
.item-codex-entry { background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 0.6rem 0.8rem; display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.item-codex-entry:target { border-color: var(--accent); }
.item-codex-head { display: flex; gap: 0.6rem; align-items: flex-start; }
.item-codex-head h3 { margin: 0; font-size: 1rem; }
.item-codex-head p { margin: 0; }
.item-codex-icon { flex: 0 0 auto; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 0; background: var(--panel-2); }
.item-codex-stats { margin: 0; color: var(--text); }
.item-codex-facts { margin: 0; font-size: 0.88rem; }
.item-codex-facts dt { color: var(--accent); font-weight: 600; margin-top: 0.3rem; }
.item-codex-facts dd { margin: 0; overflow-wrap: anywhere; }
.item-codex-source { display: block; }
/* Welcome window on the first visit (play.partials.welcome-dialog), again under "More → About the game". */
.welcome-dialog { position: relative; z-index: 900; overflow: hidden; width: min(36rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); margin: 1rem auto; padding: 0; border: 8px solid transparent; border-radius: 0; border-image: url("../images/ui/rpgui/border-image-golden.png") 4 / 8px stretch; image-rendering: pixelated; background: var(--panel); background-clip: padding-box; color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); }
.welcome-dialog:not([open]) { display: none; }
.welcome-dialog.is-modal { position: fixed; inset: 0; margin: auto; }
.welcome-dialog::backdrop { background: rgba(5, 4, 3, 0.75); }
.welcome-dialog-body { position: relative; max-height: calc(100dvh - 2rem); overflow-y: auto; padding: 1.4rem 1.4rem 1.1rem; box-sizing: border-box; }
.welcome-dialog h2 { margin: 0.2rem 2rem 0.5rem 0; font-size: 1.35rem; }
.welcome-dialog h3 { margin: 1rem 0 0.35rem; font-size: 1rem; color: var(--accent); }
.welcome-dialog p, .welcome-dialog ul { margin: 0 0 0.5rem; }
.welcome-dialog ul { padding-left: 1.2rem; }
.welcome-emblem { display: block; width: 56px; height: 56px; }
.welcome-lead { font-size: 1.02rem; }
.welcome-steps li { margin-bottom: 0.3rem; }
.welcome-steps strong { color: var(--accent); }
.welcome-start { margin-top: 0.9rem !important; padding: 0.6rem 0.75rem; border-left: 3px solid var(--accent); background: var(--panel-2); border-radius: 0; }
.welcome-actions { display: flex; justify-content: flex-end; margin-top: 0.9rem; }
.welcome-actions .btn { min-width: 9rem; }
.welcome-close { position: absolute; top: 0.6rem; right: 0.7rem; width: 2rem; height: 2rem; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-2); color: var(--text); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.welcome-close:hover, .welcome-close:focus-visible { border-color: var(--accent); color: var(--accent); }
.welcome-hint { margin-top: 0.6rem !important; text-align: right; }
@media (max-width: 640px) {
    .welcome-dialog-body { padding: 1.1rem 1rem 0.9rem; }
    .welcome-actions .btn { width: 100%; }
    .welcome-hint { text-align: left; }
}
/* Guide page (/spiel/leitfaden): advice card, fit badges, region tiles with monster lists. */
.guide-advice { border-left: 4px solid var(--accent); }
.guide-advice h2 { margin: 0.2rem 0 0.4rem; color: var(--text); }
.guide-verdict-level { border-left-color: var(--ok); }
.guide-verdict-farm { border-left-color: var(--st); }
.guide-verdict-tutorial { border-left-color: var(--xp); }
.guide-verdict-badge { display: inline-block; padding: 0 0.45rem; border-radius: 0; background: var(--accent); color: #1b140c; font-size: 0.85rem; vertical-align: middle; }
.guide-verdict-level .guide-verdict-badge { background: var(--ok); }
.guide-verdict-tutorial .guide-verdict-badge { background: var(--xp); color: var(--text); }
.guide-reasons, .guide-tips { margin: 0.3rem 0; padding-left: 1.2rem; }
.guide-spot { margin: 0.5rem 0; padding: 0.45rem 0.6rem; background: var(--panel-2); border-radius: 0; }
.guide-fit { display: inline-block; margin-left: 0.3rem; padding: 0 0.4rem; border: 1px solid var(--line); border-radius: 0; font-size: 0.75rem; font-weight: 600; color: var(--muted); vertical-align: middle; }
.tile .guide-fit { display: inline-block; margin: 0.2rem 0; }
.guide-fit-good, .guide-gear-good { border-color: var(--ok); color: var(--ok); }
.guide-fit-risky, .guide-gear-fair { border-color: var(--accent); color: var(--accent); }
.guide-fit-too-hard, .guide-gear-weak { border-color: var(--danger); color: var(--danger); }
.guide-map { margin-bottom: 1rem; }
.guide-map h3 { margin-top: 1rem; }
.guide-area.locked { opacity: 0.7; }
.guide-monsters { margin-top: 0.35rem; }
.guide-monsters summary { cursor: pointer; color: var(--accent); }
.guide-monsters ul.plain { margin: 0.3rem 0; }
.tile .guide-monsters span { display: inline; }
.tile .guide-monsters .elite-badge { display: inline-block; margin-left: 0.25rem; }
.guide-glossary summary { cursor: pointer; }
.guide-glossary p { margin-top: 0.4rem; color: var(--muted); }
/* Manual group round: countdown, action buttons, picked target, who is ready. */
.group-fight-round-choice { border-color: rgba(245, 197, 66, 0.55); }
.group-fight-playback { border-color: rgba(120, 170, 255, 0.45); }
.group-fight-intro h2 { color: #f5c542; animation: group-intro-pulse 1.2s ease-in-out infinite; }
@keyframes group-intro-pulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .group-fight-intro h2 { animation: none; } }
.group-fight-timer { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0 0.6rem; }
.group-fight-timer .meter { flex: 1; }
.group-fight-timer .meter b { background: #f5c542; transition: width 0.5s linear; }
.group-fight-actions { flex-wrap: wrap; gap: 0.4rem; }
.group-fight-actions .btn { display: inline-flex; flex-direction: column; align-items: flex-start; }
.group-fight-ready { gap: 0.4rem 1rem; margin-top: 0.5rem; padding-left: 0; list-style: none; }
.group-fight-ready li { display: inline-flex; align-items: center; gap: 0.25rem; white-space: nowrap; }
.enemy-unit.is-target { outline: 2px solid #f5c542; outline-offset: 2px; }
.enemy-unit[role="button"] { cursor: pointer; }
.group-fight-chat-lines { max-height: 12rem; overflow-y: auto; margin: 0 0 0.5rem; }
.group-fight-chat-lines li { padding: 0.15rem 0; }
.group-fight-chat form { display: flex; gap: 0.4rem; }
.group-fight-chat input { flex: 1; min-width: 0; }

/* Group dungeon: room track above the fight, current room highlighted. */
.dungeon-track { padding: 0.6rem 0.75rem; overflow-x: auto; }
.dungeon-track ol { display: flex; list-style: none; margin: 0; padding: 0; gap: 0; min-width: max-content; }
.dungeon-track-room { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; width: 5.5rem; text-align: center; opacity: 0.55; }
/* The line runs from the edge of the previous circle to the edge of this one, never through them. */
.dungeon-track-room + .dungeon-track-room::before { content: ''; position: absolute; top: calc(0.95rem - 1px); left: calc(-50% + 1.15rem); right: calc(50% + 1.15rem); height: 2px; background: rgba(255, 255, 255, 0.18); }
.dungeon-track-room.is-done + .dungeon-track-room::before,
.dungeon-track-room.is-done + .dungeon-track-room.is-current::before { background: #7fb069; }
.dungeon-track-node { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); background: #1d1a17; font-weight: 700; }
.dungeon-track-room.is-done { opacity: 0.85; }
.dungeon-track-room.is-done .dungeon-track-node { border-color: #7fb069; color: #7fb069; }
.dungeon-track-room.is-current { opacity: 1; }
.dungeon-track-room.is-current .dungeon-track-node { border-color: #f5c542; color: #f5c542; box-shadow: 0 0 0 4px rgba(245, 197, 66, 0.2); }
.dungeon-track-room.is-boss .dungeon-track-node { border-color: #c94f4f; color: #e07070; }
.dungeon-track-room.is-boss.is-current .dungeon-track-node { border-color: #f5c542; }
.dungeon-track-name { line-height: 1.2; }
.dungeon-track-room.is-locked { opacity: 0.3; }
.dungeon-track-room.is-locked .dungeon-track-node { border-style: dashed; border-color: rgba(255, 255, 255, 0.3); color: inherit; font-size: 0.8rem; }
.dungeon-track-lock { line-height: 1.1; color: #e07070; }
.dungeon-track-note { margin: 0.5rem 0 0; color: #f5c542; }
.group-fight-run-end { margin: 0.5rem 0 0.75rem; padding: 0.5rem 0.75rem; border-left: 3px solid #f5c542; background: rgba(245, 197, 66, 0.1); }
.group-fight-run-end p { margin: 0.25rem 0 0; }
.group-fight-chat-lines li.is-system { color: #f5c542; }
.group-fight-room-divider { margin: 0.6rem 0 0.2rem; padding: 0.2rem 0.5rem; border-left: 3px solid #f5c542; background: rgba(245, 197, 66, 0.08); font-weight: 700; }
.tactic-order { margin: 0.3rem 0 0; padding-left: 1.4rem; }
.tactic-order li { gap: 0.3rem; align-items: center; }
.tactic-order li span { flex: 1; }

/* World boss: map tile, live status and contribution lists. */
.world-boss-map-tile { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.7rem; border-color: #e8b84a; }
.world-boss-map-tile .badge { background: #e8b84a; color: #1d1a17; }
.world-boss-status .meter.hp b { background: #e8b84a; }
.world-boss-recent { list-style: none; margin: 0; padding: 0; }
.world-boss-recent li { display: flex; flex-wrap: wrap; gap: 0.35rem 0.8rem; padding: 0.35rem 0; border-top: 1px solid var(--line); }
.world-boss-recent li:first-child { border-top: 0; }
.world-boss-own-row { background: rgba(232, 184, 74, 0.1); }
/* Cosmetics: frames and name styles are account-bound and purely visual. The avatar is the stick figure bust. */
.player-avatar {
    display: inline-flex; flex: none; align-items: center; justify-content: center;
    width: 40px; height: 40px; padding: 2px; overflow: hidden;
    background: radial-gradient(circle at 50% 35%, #b9b08a 0%, #8aa39a 70%, #5f7a70 100%); border: 2px solid #4a3a28; border-radius: 50%;
    vertical-align: middle;
}
.player-avatar-large { width: 72px; height: 72px; padding: 3px; border-width: 3px; }
.player-avatar-figure { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
.player-avatar-figure .sf { display: block; width: 100%; height: 100%; }
.player-avatar.cosmetic-frame-first-blood, .stick-portrait.cosmetic-frame-first-blood { border-color: #e2b347; box-shadow: 0 0 0 2px #6b3d24, 0 0 12px rgba(226, 179, 71, 0.55); }
.player-avatar.cosmetic-frame-boss-breaker, .stick-portrait.cosmetic-frame-boss-breaker { border-color: #a35ad6; box-shadow: 0 0 0 2px #2b1a3a, 0 0 12px rgba(163, 90, 214, 0.55); }
.player-profile-row { display: flex; align-items: flex-start; gap: 0.9rem; }
.ranking-player, .group-member { display: inline-flex; align-items: center; gap: 0.4rem; }
/* Damage ranking: level, skill group and target level sit on their own line under the main text. */
.ranking-player-text { display: inline-flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.damage-ranking .ranking-sub { display: block; white-space: nowrap; }
.damage-ranking .ranking-hit { color: var(--accent); white-space: normal; }
.damage-ranking .ranking-hit-skill { white-space: normal; }
/* Phones: the avatar gives its room to the damage column, so number, hit type and skill stay readable. */
@media (max-width: 640px) {
    .damage-ranking .player-avatar { display: none; }
}
.group-member .player-avatar { width: 26px; height: 26px; padding: 1px; border-width: 1px; }
.chat-line .player-avatar { width: 24px; height: 24px; padding: 1px; border-width: 1px; margin-right: 0.2rem; }
.chat-sender { vertical-align: middle; }

/* Enough contrast on the dark chat and ranking backgrounds, also inside links. */
.cosmetic-name-style-veteran,
.chat-sender.cosmetic-name-style-veteran a,
.character-name.cosmetic-name-style-veteran a { color: #ffd76a; font-weight: 700; text-shadow: 0 1px 0 #000, 0 0 3px #000; }

.wardrobe-summary { margin-top: -0.2rem; }
.wardrobe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.7rem; margin-top: 0.5rem; }
.wardrobe-card {
    display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.6rem;
    padding: 0.65rem; background: #120e0b; border: 1px solid #36291d; border-radius: 0;
}
.wardrobe-card.is-owned { border-color: #4a5a32; }
.wardrobe-card.is-equipped { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.wardrobe-preview { flex: none; width: 64px; height: 64px; padding: 3px; background: #1c1611; border: 1px solid #4a3a28; border-radius: 0; object-fit: contain; }
.wardrobe-info { flex: 1 1 130px; min-width: 0; }
.wardrobe-info p { margin: 0.2rem 0 0; }
.wardrobe-source { color: #d8c7a8; border: 1px solid #4a3a28; border-radius: 99px; padding: 0 0.4rem; white-space: nowrap; }
.wardrobe-actions { flex: 1 0 100%; display: flex; justify-content: flex-end; align-items: center; }
.wardrobe-equipped { background: #24361c; color: #b9e09a; border: 1px solid #5f7f40; padding: 0.1em 0.6em; font-weight: 600; }
.wardrobe-reset { margin-top: 0.5rem; justify-content: flex-end; }
.tt-line.tt-skin { color: #b9a7ff; }
/* Horse looks at the stable hand: small picture cards, picked look framed. */
.horse-look-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.6rem; margin: 0.5rem 0; }
.horse-look { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; padding: 0.5rem; background: #120e0b; border: 1px solid #36291d; text-align: center; }
.horse-look.is-equipped { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.horse-look img { width: 48px; height: 48px; }
@media (max-width: 600px) {
    .player-avatar-large { width: 58px; height: 58px; }
    .wardrobe-card { flex-wrap: nowrap; }
}

/* Cosmetic shop (Paddle Checkout overlay). Fixed prices, no premium currency. */
.basar-limits { border-left: 3px solid var(--accent); }
.basar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0.8rem; }
.basar-product { display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem; }
.basar-product.is-owned { border-color: #4a5a32; }
.basar-product-icon { width: 72px; height: 72px; padding: 4px; background: #120e0b; border: 1px solid #4a3a28; border-radius: 0; object-fit: contain; }
.basar-product h2 { margin: 0; font-size: 1.05rem; }
.basar-price { margin: 0; color: #f2d48a; font-size: 1.25rem; font-weight: 700; }
.basar-form { display: flex; flex-direction: column; gap: 0.5rem; width: 100%; margin-top: 0.2rem; }
.basar-birth-year { display: flex; flex-direction: column; gap: 0.2rem; max-width: 10rem; }
.basar-check { display: flex; align-items: flex-start; gap: 0.45rem; font-size: 0.85rem; line-height: 1.35; }
.basar-check input { margin-top: 0.25rem; flex: none; }
.basar-buy { align-self: flex-start; }
.basar-error { margin: 0; color: var(--danger); }
.basar-owned { color: #a8d68f; background: #1f2a17; border: 1px solid #4a5a32; }
.basar-note { margin-top: 1rem; }

/* Founder and supporter cosmetics. */
.player-avatar.cosmetic-frame-founder, .stick-portrait.cosmetic-frame-founder { border-color: #e2b347; box-shadow: 0 0 0 2px #4a2f14, 0 0 14px rgba(226, 179, 71, 0.7); }
.player-avatar.cosmetic-frame-supporter, .stick-portrait.cosmetic-frame-supporter { border-color: #7fb069; box-shadow: 0 0 0 2px #233a22, 0 0 12px rgba(127, 176, 105, 0.55); }
.cosmetic-name-style-founder { color: #f5c542; font-weight: 700; text-shadow: 0 1px 0 #000, 0 0 4px #000; }
.chat-sender.cosmetic-name-style-founder a,
.character-name.cosmetic-name-style-founder a { color: #f5c542; font-weight: 700; text-shadow: 0 1px 0 #000, 0 0 4px #000; }
/* Pre-registration community goal cosmetics (Vorhut / Vanguard). */
.player-avatar.cosmetic-frame-vanguard, .stick-portrait.cosmetic-frame-vanguard { border-color: #8fc3e8; box-shadow: 0 0 0 2px #1d3346, 0 0 12px rgba(143, 195, 232, 0.6); }
.cosmetic-name-style-vanguard,
.chat-sender.cosmetic-name-style-vanguard a,
.character-name.cosmetic-name-style-vanguard a { color: #a9d4f2; font-weight: 700; text-shadow: 0 1px 0 #000, 0 0 4px #1d3346; }

/* Public thank-you page and wardrobe opt-in. */
.thanks-list { margin-top: 0.8rem; display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; }
.thanks-list li { padding: 0.25rem 0.6rem; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); }

/* Wanderbuch season rewards. */
.player-avatar.cosmetic-frame-season-common, .stick-portrait.cosmetic-frame-season-common { border-color: #7fb069; box-shadow: 0 0 0 2px #233a22, 0 0 12px rgba(127, 176, 105, 0.5); }
.player-avatar.cosmetic-frame-season-premium, .stick-portrait.cosmetic-frame-season-premium { border-color: #c9a7ff; box-shadow: 0 0 0 2px #2b1a3a, 0 0 14px rgba(201, 167, 255, 0.65); }
.cosmetic-name-style-season-common { color: #9fd6a8; font-weight: 700; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.cosmetic-name-style-season-premium { color: #d9c2ff; font-weight: 700; text-shadow: 0 1px 0 #000, 0 0 4px #000; }
.player-avatar.cosmetic-frame-season-wanderer, .stick-portrait.cosmetic-frame-season-wanderer { border-color: #e0a64a; box-shadow: 0 0 0 2px #3a2610, 0 0 12px rgba(224, 166, 74, 0.55); }
.player-avatar.cosmetic-frame-season-master, .stick-portrait.cosmetic-frame-season-master { border-color: #f3cf5a; box-shadow: 0 0 0 2px #4a3a10, 0 0 16px rgba(243, 207, 90, 0.7); }
.cosmetic-name-style-season-wanderer { color: #f0c27a; font-weight: 700; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.cosmetic-name-style-season-master { color: #f7dc7a; font-weight: 700; text-shadow: 0 1px 0 #000, 0 0 4px #7a5a10; }
.chat-sender.cosmetic-name-style-season-common a,
.character-name.cosmetic-name-style-season-common a,
.chat-sender.cosmetic-name-style-season-premium a,
.character-name.cosmetic-name-style-season-premium a,
.chat-sender.cosmetic-name-style-season-wanderer a,
.character-name.cosmetic-name-style-season-wanderer a,
.chat-sender.cosmetic-name-style-season-master a,
.character-name.cosmetic-name-style-season-master a { color: inherit; }

/* Wanderbuch season page. */
.season-summary-row { align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.season-kicker { display: block; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; }
.season-level-value { font-size: 1.6rem; color: var(--accent); }
.season-progress { flex: 1 1 14rem; }
.season-closed { color: var(--danger); }
.season-premium-active { color: #d9c2ff; }
.season-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.6rem; }
.season-level { padding: 0.65rem; opacity: 0.62; }
.season-level.is-unlocked { opacity: 1; border-color: #4a5a32; }
.season-level h3 { margin: 0 0 0.1rem; font-size: 1rem; }
.season-track { display: flex; flex-direction: column; gap: 0.2rem; margin-top: 0.5rem; padding-top: 0.4rem; border-top: 1px solid #36291d; }
.season-premium-track { border-top-color: #4a2f5c; }
.season-reward { font-size: 0.85rem; color: #d8c7a8; }
.season-claim { margin-top: 0.3rem; }
.season-claimed { color: #a8d68f; background: #1f2a17; border: 1px solid #4a5a32; }
/* Pickup filter on the game settings page. */
.loot-filter-group { border: 1px solid var(--line); border-radius: 0; margin: 0.6rem 0; padding: 0.4rem 0.7rem 0.6rem; }
.loot-filter-group legend { padding: 0 0.3rem; font-weight: 600; }
.loot-filter-group p { margin: 0.2rem 0 0.4rem; }
.loot-filter-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.35rem 0.8rem; }
.loot-filter-options label { display: inline-flex; gap: 0.35rem; align-items: center; cursor: pointer; }
/* Public landing page (welcome.blade.php). */
.landing-hero { text-align: center; padding: 1.2rem 1.4rem; }
.landing-hero h1 { margin: 0 0 0.5rem; font-size: 1.6rem; }
.landing-lead { margin: 0 auto 0.9rem; max-width: 40rem; font-size: 1.05rem; }
.landing-cta { display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 0.6rem; }
.landing-cta .btn { flex: 0 1 13rem; padding: 0.6rem 1.4rem; font-size: 1.05rem; font-weight: 600; text-align: center; }
.landing-note { margin: 0.6rem 0 0; font-size: 0.9rem; }
.landing-note a { display: inline-block; }
.landing-section { margin: 1.4rem 0; }
.landing-section > h2 { margin: 0 0 0.6rem; }
.landing-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0.6rem; }
.landing-feature { margin: 0; }
.landing-feature h3 { margin: 0 0 0.3rem; color: var(--accent); font-size: 1rem; }
.landing-feature p { margin: 0; }
.landing-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 0.8rem; }
.landing-shot { margin: 0; }
.landing-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 0; }
.landing-shot figcaption { margin-top: 0.3rem; font-size: 0.85rem; text-align: center; }
.landing-faq { margin: 0.4rem 0; }
.landing-faq summary { cursor: pointer; font-weight: 600; }
.landing-faq p { margin: 0.5rem 0 0; }
/* Public wiki (resources/views/wiki). */
.wiki-breadcrumb { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.2rem 0 0.4rem; font-size: 0.9rem; color: var(--muted); }
.wiki-page h1 { margin-top: 0; }
.wiki-page h2 { margin: 1rem 0 0.4rem; }
.wiki-page h3 { margin: 0.9rem 0 0.3rem; }
.wiki-section { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 0.4rem; }
.wiki-table { width: 100%; border-collapse: collapse; margin: 0.4rem 0; font-size: 0.92rem; }
.wiki-table th, .wiki-table td { text-align: left; padding: 0.3rem 0.4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.wiki-table th { color: var(--muted); font-weight: 600; }
.wiki-links, .wiki-facts { margin: 0.3rem 0; padding-left: 1.2rem; }
.wiki-toc { display: flex; flex-wrap: wrap; gap: 0.2rem 0.4rem; }
.wiki-item-list { list-style: none; margin: 0.3rem 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0.2rem 1rem; }
.wiki-item-list li { display: flex; gap: 0.4rem; align-items: baseline; justify-content: space-between; }
.wiki-play { text-align: center; }

/* Horse in the mount slot: grade icon, level and condition bar. */
.horse-tile {
    position: relative;
    align-items: center;
    justify-content: center;
}
.horse-tile-level {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-shadow: 0 1px 2px #000;
}
.horse-tile-condition {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 4px;
    height: 4px;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.35);
}
.horse-tile-condition > b {
    display: block;
    height: 100%;
    background: #7ec85c;
}
.horse-tile-flag {
    position: absolute;
    left: 2px;
    bottom: 9px;
    font-size: 0.58rem;
    line-height: 1;
    color: #ffd27a;
}

/* Horse badge next to the player's name in a fight. */
.battle-horse-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 0.3rem;
    color: #d9a46b;
    vertical-align: -0.15em;
}
.battle-horse-icon {
    width: 1.15em;
    height: 1.15em;
}

/* World boss chests and honor board. */
.world-boss-chest { border-top: 1px solid var(--line); padding: 0.5rem 0; }
.world-boss-chest:first-of-type { border-top: 0; }
.world-boss-chest h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.world-boss-chest-items { margin: 0.25rem 0; }
.world-boss-claimed { margin-top: 0.6rem; }
.world-boss-honor-row { border-top: 1px solid var(--line); padding: 0.5rem 0; }
.world-boss-honor-row:first-child { border-top: 0; }
.meter.sp b { background-image: url("../images/ui/rpgui/progress-blue.png"); background-color: transparent; }
.meter.st b { background-image: url("../images/ui/rpgui/progress-green.png"); background-color: transparent; filter: hue-rotate(-50deg) saturate(1.3); }
.meter.xp b { background-image: url("../images/ui/rpgui/progress.png"); background-color: transparent; }

/* Text fields and dropdowns: sunken pixel field. */
input, select, textarea {
    border-radius: 0; border: 2px solid var(--px-outline);
    box-shadow: inset 0 0 0 1px #4a3220, inset 0 2px 0 rgba(0, 0, 0, 0.45);
}

/* ------------------------------------------------------------------
   Pixel look, third pass: remaining panels, tabs, pills and tables.
   ------------------------------------------------------------------ */
/* Larger floating panels get the gold frame like cards: item detail, tooltips, chat bar. */
.inv-detail, .item-tooltip, .chat-footer {
    border: 8px solid transparent; border-radius: 0;
    border-image: url("../images/ui/rpgui/border-image-golden.png") 4 / 8px stretch; image-rendering: pixelated;
    background-color: var(--panel); background-clip: padding-box;
}
.chat-footer { border-bottom-width: 0; }

/* Smaller boxes inside pages: sunken pixel field. */
.item-codex-entry, .loot-values[open], .title-entry, .loot-filter-group, .account-locale, .item-codex-icon {
    border: 2px solid var(--px-outline); border-radius: 0; background-color: var(--px-inset);
    box-shadow: inset 0 0 0 1px #4a3220, inset 0 2px 0 rgba(0, 0, 0, 0.4);
}
.title-entry.is-active { box-shadow: inset 0 0 0 2px var(--accent); }

/* Page tabs (guide, patch notes, inventory bags and pages): small RPGUI plates, the open tab orange. */
.tabs a, .inv-bag-tab, .inv-page-tab {
    border: solid transparent; border-width: 4px 8px 5px; border-radius: 0;
    border-image: url("../images/ui/rpgui/button-down.png") 4 8 5 8 fill / 4px 8px 5px stretch;
    background: none; image-rendering: pixelated; color: #f6ead0; text-shadow: 1px 1px 0 var(--px-outline);
}
.tabs a { padding: 0.1rem 0.45rem; font-family: var(--font-display); font-weight: 700; }
.inv-bag-tab, .inv-page-tab { padding-inline: 2px; }
.tabs a:hover, .inv-bag-tab:hover, .inv-page-tab:hover { background: none; filter: brightness(1.15); text-decoration: none; }
.tabs a.active, .inv-bag-tab.is-active, .inv-page-tab.is-active {
    border-image-source: url("../images/ui/rpgui/button.png"); background: none;
    color: #1e0f06; text-shadow: 0 1px 0 rgba(255, 230, 170, 0.45);
}
.inv-bag-tab.is-active .inv-bag-tab-count { color: #3a1d0a; }
.tabs { border-bottom: 2px solid var(--px-outline); box-shadow: 0 1px 0 #5a3a20; }

/* Pills and chips: square with a dark outline. */
.chat-tab, .thanks-list li, .community-link, .wardrobe-source, .collapse-toggle, .guide-fit, .log-damage {
    border-radius: 0; box-shadow: 0 0 0 1px var(--px-outline);
}
.chat-tab.is-active { box-shadow: 0 0 0 1px var(--px-outline), inset 0 -2px 0 var(--accent); }

/* Replay and timer bars: square track with a dark frame. */
.series-replay-dot, .series-replay-bar, .duel-replay-bar { border-radius: 0; border: 2px solid var(--px-outline); box-shadow: inset 0 0 0 1px #3a2718; }

/* Tables: column heads in the display font, row lines as a dark groove with a light edge. */
.table th { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.02em; border-bottom: 2px solid var(--px-outline); box-shadow: 0 1px 0 #5a3a20; }
.table td { border-bottom: 1px solid #2c2017; box-shadow: 0 1px 0 rgba(255, 236, 190, 0.04); }
.table tr.own td { background: #3a2a14; }

/* Phones: buttons a bit smaller still, so two fit next to each other in a fight card. */
@media (max-width: 640px) {
    .btn { font-size: 0.76rem; min-height: 1.6rem; padding-inline: 0.4rem; }
    .btn-link { font-size: inherit; min-height: 0; }
}

/* ---------------------------------------------------------------------------
   Fight stage (resources/js/combat-stage.js, stick-figures.js): a small side-view
   scene above every fight. Players stand left, monsters right. Switchable in settings.
   --------------------------------------------------------------------------- */
.combat-stage-host { margin: 0 0 0.9rem; }
.combat-stage { position: relative; container-type: inline-size; }
.cs-scene {
    position: relative;
    height: clamp(150px, 26cqi, 250px);
    overflow: hidden;
    border: 3px solid var(--px-outline, #140c1c);
    box-shadow: var(--px-edge-hi, none), var(--px-edge-lo, none);
    background:
        radial-gradient(120% 70% at 80% 0%, rgba(255, 210, 140, 0.32), transparent 60%),
        linear-gradient(#5d7d86 0%, #8aa39a 45%, #b9b08a 68%, #6b5a3a 68%);
}
.cs-scene::before {
    content: ""; position: absolute; inset: auto -10% 30% -10%; height: 36%;
    background:
        radial-gradient(40% 90% at 15% 100%, #4e6a4c 60%, transparent 61%),
        radial-gradient(35% 80% at 55% 100%, #3f5a40 60%, transparent 61%),
        radial-gradient(45% 100% at 95% 100%, #4a6447 60%, transparent 61%);
}
.cs-scene::after {
    content: ""; position: absolute; inset: auto 0 0 0; height: 33%;
    background:
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.08) 0 8px, transparent 8px 16px),
        linear-gradient(#7a6a45, #5a4a30 40%, #3f3322);
    border-top: 3px solid #8f8253;
}
.cs-units { position: absolute; inset: 0; z-index: 1; }
.cs-unit {
    position: absolute; bottom: 7%; z-index: var(--z, 2);
    display: grid; justify-items: center;
    transform: translateX(-50%);
    transition: transform var(--move-ms, 210ms) cubic-bezier(.3, .7, .4, 1), opacity 500ms, filter 500ms;
}
.cs-unit.cs-back { bottom: 15%; }
.cs-unit.cs-lunge { transform: translateX(calc(-50% + var(--lunge, 0px))); z-index: 3; }
.cs-figure { position: relative; line-height: 0; }
.cs-figure .sf { display: block; height: auto; overflow: visible; }
.cs-player .sf { width: clamp(40px, 9cqi, 92px); }
.cs-monster .sf { width: clamp(46px, 11cqi, 112px); }
.cs-crowded .cs-player .sf { width: clamp(36px, 7cqi, 76px); }
.cs-crowded .cs-monster .sf { width: clamp(40px, 8.5cqi, 90px); }
/* Bosses (area, dungeon, Lumiis bosses) half again as big, world bosses twice the size of every other monster, crowded or not. */
.cs-monster.cs-boss .sf, .cs-crowded .cs-monster.cs-boss .sf { width: clamp(69px, 16.5cqi, 168px); }
.cs-monster.cs-giant .sf, .cs-crowded .cs-monster.cs-giant .sf { width: clamp(92px, 22cqi, 210px); }
.sf-mirror { transform: scaleX(-1); }
.cs-tag {
    max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font: 700 0.68rem/1.1 var(--font-body, serif); color: #fff;
    text-shadow: 0 1px 2px #000, 0 0 3px #000;
}
.cs-self .cs-tag { color: #ffd98a; }
.cs-boss .cs-tag { color: #ffd25e; }
.cs-crowded .cs-tag { max-width: 5.5rem; font-size: 0.6rem; }
.cs-bar { width: 56px; height: 6px; margin: 2px 0 3px; background: #140c0a; border: 1px solid #000; }
.cs-bar b { display: block; height: 100%; width: 100%; background: var(--hp, #b9443a); transition: width 300ms; }
.cs-low .cs-bar b { background: #e0623a; }
.cs-flash {
    position: absolute; inset: 20% -10% 0; pointer-events: none; opacity: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.7), transparent 65%);
    mix-blend-mode: screen; transition: opacity 160ms;
}
.cs-hit .cs-flash { animation: cs-flash 320ms ease-out; }
.cs-hit .cs-figure { animation: cs-shake 300ms; }
.cs-crit .cs-flash { background: radial-gradient(circle, rgba(255, 214, 94, 0.9), transparent 65%); }
.cs-pierce .cs-flash { background: radial-gradient(circle, rgba(170, 214, 255, 0.9), transparent 65%); }
.cs-dead { opacity: 0.35; filter: grayscale(1); }
.cs-dead .cs-figure { transform: rotate(var(--fall, -78deg)) translateY(12%); transform-origin: 50% 100%; transition: transform 450ms; }
.cs-enemy.cs-dead .cs-figure { --fall: 78deg; }
.cs-dead .cs-bar, .cs-dead .cs-tag { visibility: hidden; }
/* A broken Lumiis crumbles instead of falling over. */
.cs-unit.cs-rock.cs-dead .cs-figure { transform: scale(1.05, .5); transform-origin: 50% 100%; }
.sf .sf-arm { transform-box: view-box; transform-origin: 65px 52px; }
.sf-monster .sf-arm { transform-origin: 60px 46px; }
.cs-swing .sf-arm { animation: cs-swing 380ms ease-out; }
.cs-swing .sf-jaw { animation: cs-bite 380ms; transform-box: fill-box; transform-origin: 100% 0; }
.cs-swing .sf-leg-front { animation: cs-step 380ms ease-out; transform-box: fill-box; transform-origin: 50% 0; }
.cs-buff .cs-figure { animation: cs-glow 700ms ease-out; }
.cs-unit:not(.cs-dead) .sf-body { animation: cs-breathe 2.6s ease-in-out var(--breathe-delay, 0s) infinite; transform-origin: 50% 100%; transform-box: fill-box; }
.cs-float {
    position: absolute; z-index: 5; pointer-events: none; white-space: nowrap;
    font: 700 1.1rem/1 var(--font-body, serif); color: #fff;
    text-shadow: 0 2px 0 #000, 0 0 4px #000;
    animation: cs-rise 1100ms ease-out var(--delay, 0s) both;
}
.cs-float.cs-taken { color: #ff8a78; text-shadow: 0 0 2px #000, 0 0 3px #000, 0 2px 0 #000; }
.cs-float.cs-crit-num { color: #ffd25e; font-size: 1.45rem; }
.cs-float.cs-pierce-num { color: #cfe6ff; text-shadow: 0 2px 0 #000, 0 0 8px #6fa8f0; }
.cs-float.cs-poison { color: #8fd17a; font-size: 0.95rem; }
.cs-float.cs-burn { color: #ffa25e; font-size: 0.95rem; }
.cs-float.cs-miss { color: #fff; font-size: 0.9rem; font-style: italic; text-shadow: 0 0 2px #000, 0 0 2px #000, 0 2px 0 #000; }
@keyframes cs-shake { 0%, 100% { translate: 0 } 25% { translate: 5px 0 } 50% { translate: -4px 0 } 75% { translate: 3px 0 } }
@keyframes cs-flash { 0% { opacity: 0 } 30% { opacity: 1 } 100% { opacity: 0 } }
@keyframes cs-swing { 0% { transform: rotate(0) } 35% { transform: rotate(-50deg) } 70% { transform: rotate(40deg) } 100% { transform: rotate(0) } }
@keyframes cs-bite { 40% { transform: rotate(16deg) } }
@keyframes cs-step { 40% { transform: rotate(-18deg) } }
@keyframes cs-breathe { 50% { scale: 1 1.025 } }
@keyframes cs-glow { 40% { filter: drop-shadow(0 0 8px #ffe28a) } }
@keyframes cs-rise {
    0% { transform: translate(-50%, 0) scale(.7); opacity: 0 }
    15% { transform: translate(-50%, -8px) scale(1.12); opacity: 1 }
    100% { transform: translate(-50%, -52px) scale(1); opacity: 0 }
}
@container (max-width: 560px) {
    .cs-tag { max-width: 4.6rem; font-size: 0.56rem; }
    .cs-bar { width: 38px; height: 5px; }
    /* Narrow stages (phones, series window): monster names stay in the cards below. */
    .cs-enemy.cs-monster .cs-tag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .cs-unit, .cs-figure, .cs-float, .sf-arm, .sf-jaw, .sf-leg-front, .sf-body { animation: none !important; transition: none !important; }
    .cs-float { opacity: 1; transform: translate(-50%, -20px); }
}
/* Lumiis: a glowing meteor boulder. */
.cs-rock:not(.cs-dead) .sf { filter: drop-shadow(0 0 6px rgba(143, 240, 255, .8)) drop-shadow(0 0 16px rgba(143, 240, 255, .45)); }
.sf-meteor-halo { animation: cs-lumiis-pulse 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.sf-meteor-crack { filter: drop-shadow(0 0 3px #8ff0ff); animation: cs-lumiis-crack 2.2s ease-in-out infinite; }
.sf-meteor-sparks circle { animation: cs-lumiis-spark 1.8s ease-in-out infinite; }
.sf-meteor-sparks circle:nth-child(2n) { animation-delay: -0.9s; }
@keyframes cs-lumiis-pulse { 50% { opacity: .55; transform: scale(.92) } }
@keyframes cs-lumiis-crack { 50% { opacity: .6 } }
@keyframes cs-lumiis-spark { 50% { opacity: .2; translate: 0 -4px } }

/* Skill animations (resources/js/skill-fx.js). */
.cs-fx { position: absolute; z-index: 4; pointer-events: none; line-height: 0; transform: translate(-50%, -50%); }
.cs-unit > .cs-fx { left: 50%; bottom: 0; top: auto; transform: translateX(-50%); }
.cs-wglow .sf-arm { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 4px var(--glow, #ffd25e)) drop-shadow(0 0 9px var(--glow, #ffd25e)); }
.cs-bglow .cs-figure, .cs-cast .cs-figure { filter: drop-shadow(0 0 5px var(--glow, #ffd25e)) drop-shadow(0 0 10px var(--glow, #ffd25e)); }
.cs-cast .sf-arm { animation: cs-raise 600ms ease-out; }
.cs-unit > .cs-aura {
    width: 120%; height: 95%; bottom: 2%; border-radius: 50% 50% 40% 40%;
    background: radial-gradient(closest-side, transparent 55%, var(--glow) 80%, transparent);
    opacity: 0; animation: cs-aura 1100ms ease-out;
}
.cs-unit > .cs-sparkle { width: 70%; height: 70%; bottom: 20%; background:
    radial-gradient(circle at 70% 20%, var(--glow) 0 2px, transparent 3px),
    radial-gradient(circle at 85% 45%, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 60% 35%, var(--glow) 0 1.5px, transparent 2.5px);
    animation: cs-sparkle 1000ms ease-out both; }
.cs-unit > .cs-whirl {
    width: 180%; height: auto; aspect-ratio: 1; bottom: -10%; border-radius: 50%;
    border: 4px solid var(--glow); border-left-color: transparent; border-right-color: transparent;
    box-shadow: 0 0 10px var(--glow); transform: translateX(-50%) rotateX(76deg);
    animation: cs-whirl 280ms linear infinite;
}
.cs-unit > .cs-whirl-dark { border-width: 5px; background: radial-gradient(closest-side, rgba(70, 20, 120, .45), transparent); }
.cs-spinning .cs-figure { animation: cs-spin 280ms linear infinite; }
.cs-leap .cs-figure { animation: cs-leap 640ms cubic-bezier(.3, .6, .5, 1); }
.cs-dashing { --move-ms: 120ms; }
.cs-dashing .cs-figure { filter: drop-shadow(-10px 0 3px rgba(255, 255, 255, .35)); }
.cs-vanish { opacity: 0 !important; transition: opacity 120ms !important; }
.cs-stealth .cs-figure { opacity: .28; transition: opacity 300ms; }
.cs-turn .cs-figure { transform: scaleX(-1); }
.cs-unit > .cs-circle {
    width: 150%; height: 18px; bottom: -6px; border-radius: 50%;
    border: 3px solid var(--glow); box-shadow: 0 0 10px var(--glow), inset 0 0 10px var(--glow);
    animation: cs-circle 1000ms ease-out both;
}
.cs-unit > .cs-shield { left: auto; right: -30%; bottom: 18%; transform: none; animation: cs-pop 1000ms ease-out both; filter: drop-shadow(0 0 6px #8fe0ff); }
.cs-enemy > .cs-shield { right: auto; left: -30%; transform: scaleX(-1); }
.cs-unit > .cs-bubble {
    width: 140%; height: 100%; bottom: 0; border-radius: 50%;
    background: radial-gradient(closest-side, rgba(60, 10, 110, .15) 60%, rgba(150, 80, 255, .55) 90%, transparent);
    box-shadow: 0 0 12px var(--glow); animation: cs-pop 1150ms ease-out both;
}
.cs-proj { animation: cs-fly var(--ms, 300ms) linear forwards; }
.cs-proj > svg, .cs-arrow > svg { display: block; }
.cs-arrow-fire { filter: drop-shadow(0 0 4px #ff8a2a) drop-shadow(-6px 0 3px #ffb23a); }
.cs-arrow-poison { filter: drop-shadow(0 0 4px #6aff5a) drop-shadow(-6px 0 3px #4ac83a); }
.cs-spit { width: 16px; height: 12px; border-radius: 50%; background: radial-gradient(circle, #b8ff6a, #3a9a2a); box-shadow: 0 0 8px #6aff5a; }
.cs-flame { filter: drop-shadow(0 0 6px #ff8a2a); }
.cs-flame-appear { animation: cs-flicker 1000ms ease-out both; }
.cs-burst { width: 70px; height: 70px; border-radius: 50%; animation: cs-burst 650ms ease-out both; }
.cs-burst-small { width: 44px; height: 44px; }
.cs-burst-fire { background: radial-gradient(circle, #fff6c0 0 15%, #ffb23a 35%, #e0421a 60%, transparent 70%); }
.cs-burst-poison { background: radial-gradient(circle, #eaffc0 0 12%, #8fe05a 35%, #2a8a2a 60%, transparent 70%); }
.cs-burst-light { background: radial-gradient(circle, #fff 0 15%, #bfe8ff 40%, #4a8aff 60%, transparent 70%); }
.cs-cloud {
    width: 90px; height: 60px; border-radius: 50%;
    background:
        radial-gradient(circle at 30% 60%, rgba(140, 220, 90, .85) 0 22%, transparent 40%),
        radial-gradient(circle at 60% 40%, rgba(110, 200, 70, .8) 0 25%, transparent 45%),
        radial-gradient(circle at 75% 65%, rgba(160, 240, 110, .75) 0 20%, transparent 40%);
    animation: cs-cloud 1000ms ease-out both;
}
.cs-smoke { width: 60px; height: 60px; border-radius: 50%; background: radial-gradient(circle, rgba(60, 60, 70, .8), rgba(30, 30, 40, .4) 50%, transparent 70%); animation: cs-cloud 700ms ease-out both; }
.cs-smoke-small { width: 40px; height: 40px; }
.cs-dust { width: 50px; height: 18px; transform: translate(-50%, -100%); border-radius: 50%; background: radial-gradient(closest-side, rgba(200, 180, 140, .8), transparent); animation: cs-cloud 600ms ease-out both; }
.cs-wave {
    width: 110px; height: 22px; transform: translate(-50%, -80%); border-radius: 50%;
    border: 3px solid rgba(240, 220, 170, .9); border-bottom-color: transparent;
    box-shadow: 0 -4px 8px rgba(240, 220, 170, .5); animation: cs-wave 700ms ease-out both;
}
.cs-wave-small { width: 70px; }
.cs-streak {
    height: 4px; width: var(--w); transform: translateY(-50%); transform-origin: var(--origin, left) center;
    background: linear-gradient(90deg, transparent, #cfe6ff 20%, #fff 60%, transparent);
    box-shadow: 0 0 8px #6fa8f0; animation: cs-streak 520ms ease-out both;
}
.cs-pillar {
    width: 34px; height: 110px; transform: translate(-50%, -100%); transform-origin: 50% 100%;
    border-radius: 50% 50% 20% 20%;
    background: linear-gradient(to top, #e0421a, #ffb23a 45%, rgba(255, 246, 192, .9) 75%, transparent);
    filter: drop-shadow(0 0 8px #ff8a2a); animation: cs-pillar 800ms ease-out both;
}
.cs-dragon { transform: translate(-50%, -100%); transform-origin: 50% 100%; filter: drop-shadow(0 0 8px #ff5a3a); animation: cs-dragon 1000ms ease-out both; }
.cs-heal { font: 900 1.7rem/1 var(--font-body, serif); color: #7aff8a; text-shadow: 0 0 4px #1a6a2a, 0 1px 0 #000; animation: cs-heal 900ms ease-out both; }
.cs-zap { inset: 0; left: 0; top: 0; transform: none; animation: cs-zap 360ms steps(3) both; }
.cs-zap-svg { overflow: visible; filter: drop-shadow(0 0 6px #8fd8ff); }
/* Buffs that last: visible on the figure as long as they are active. */
.cs-hidden { opacity: 0 !important; }
.cs-appear .cs-figure { animation: cs-appear 520ms ease-out; transition: none; }
.cs-unit[class*="cs-buff-"]:not(.cs-bglow):not(.cs-cast) .cs-figure {
    filter: var(--bf-body, drop-shadow(0 0 0 transparent)) var(--bf-heal, drop-shadow(0 0 0 transparent));
}
.cs-buff-stealth .cs-figure { opacity: .3; transition: opacity 300ms; }
.cs-buff-aura-of-the-sword .sf-arm { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 5px #ffd25e) drop-shadow(0 0 9px #ffd25e); animation: cs-buff-pulse 1.6s ease-in-out infinite; }
.cs-buff-enchanted-blade .sf-arm { filter: drop-shadow(0 0 3px #c08aff) drop-shadow(0 0 7px #8a3aff) drop-shadow(0 0 10px #6a1aff); animation: cs-buff-pulse 1.6s ease-in-out infinite; }
.cs-buff-strong-body { --bf-body: drop-shadow(0 0 8px rgba(255, 110, 50, 1)); }
.cs-buff-enchanted-armour { --bf-body: drop-shadow(0 0 8px rgba(130, 50, 255, 1)); }
.cs-buff-cure { --bf-heal: drop-shadow(0 0 7px rgba(110, 255, 140, .9)); }
.cs-unit > .cs-lasting { animation: cs-buff-pulse 1.8s ease-in-out infinite; }
.cs-unit > .cs-lasting.cs-bubble { opacity: .55; --glow: #8a4aff; }
.cs-unit > .cs-lasting.cs-circle { opacity: .8; --glow: #ffd25e; }
.cs-unit > .cs-lasting.cs-shield { opacity: .7; transform: none; }
.cs-enemy > .cs-lasting.cs-shield { transform: scaleX(-1); }
.cs-unit > .cs-lasting.cs-flame { left: auto; right: -28%; bottom: 62%; transform: none; animation: cs-hover 1.4s ease-in-out infinite; }
.cs-enemy > .cs-lasting.cs-flame { right: auto; left: -28%; }
@keyframes cs-buff-pulse { 50% { opacity: .55 } }
@keyframes cs-hover { 50% { translate: 0 -6px } }
@keyframes cs-appear { 0% { opacity: 0; transform: translateY(-30%) scale(.6) } 100% { opacity: 1; transform: none } }
/* While the stage plays a manual round, its log lines wait for it (the cards show no numbers then). */
.log-pending { display: none; }
/* End screen: who won; the fallen already lie on the ground. */
.cs-banner {
    position: absolute; z-index: 6; left: 50%; top: 14%; transform: translateX(-50%);
    padding: 0.25rem 1.1rem; font: 700 clamp(1.1rem, 4.5cqi, 2rem)/1.2 var(--font-heading, var(--font-body, serif));
    letter-spacing: .06em; text-transform: uppercase; color: #ffe9a8; white-space: nowrap;
    background: rgba(20, 12, 10, .78); border: 3px solid #d8a84a; box-shadow: 0 0 18px rgba(255, 210, 94, .45);
    text-shadow: 0 2px 0 #000; animation: cs-banner 600ms cubic-bezier(.2, 1.4, .4, 1) both;
}
.cs-banner-defeat { color: #ffb0a0; border-color: #a03a2a; box-shadow: 0 0 18px rgba(160, 40, 30, .5); }
.cs-stage-busy .battle-layout :is(button, .btn), .cs-stage-busy .group-fight-cards :is(button, .btn) { pointer-events: none; opacity: .55; }
@keyframes cs-aura { 0% { opacity: 0; transform: translateX(-50%) scale(.6) } 30% { opacity: 1 } 100% { opacity: 0; transform: translateX(-50%) scale(1.15) } }
@keyframes cs-sparkle { 0% { opacity: 0 } 30% { opacity: 1 } 100% { opacity: 0; translate: 0 -12px } }
@keyframes cs-whirl { to { transform: translateX(-50%) rotateX(76deg) rotateZ(360deg) } }
@keyframes cs-spin { 0% { transform: rotateY(0) } 100% { transform: rotateY(360deg) } }
@keyframes cs-leap { 0% { transform: translateY(0) } 45% { transform: translateY(-55%) rotate(-8deg) } 75% { transform: translateY(-20%) rotate(10deg) } 100% { transform: translateY(0) } }
@keyframes cs-raise { 40% { transform: rotate(-70deg) } }
@keyframes cs-circle { 0% { opacity: 0; transform: translateX(-50%) scale(.3) } 30% { opacity: 1; transform: translateX(-50%) scale(1) } 100% { opacity: 0; transform: translateX(-50%) scale(1.1) } }
@keyframes cs-pop { 0% { opacity: 0; scale: .5 } 25% { opacity: 1; scale: 1.05 } 80% { opacity: 1 } 100% { opacity: 0 } }
@keyframes cs-fly {
    from { transform: translate(-50%, -50%) rotate(var(--rot)) }
    to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)) }
}
@keyframes cs-flicker { 0% { opacity: 0; scale: .3 } 30% { opacity: 1; scale: 1.1 } 60% { scale: .95 } 100% { opacity: 0; translate: 0 -10px } }
@keyframes cs-burst { 0% { opacity: 0; scale: .2 } 30% { opacity: 1; scale: 1 } 100% { opacity: 0; scale: 1.4 } }
@keyframes cs-cloud { 0% { opacity: 0; scale: .4 } 30% { opacity: 1 } 100% { opacity: 0; scale: 1.3 } }
@keyframes cs-wave { 0% { opacity: 0; scale: .3 1 } 30% { opacity: 1 } 100% { opacity: 0; scale: 1.6 1.2 } }
@keyframes cs-streak { 0% { scale: 0 1; opacity: 1 } 50% { scale: 1 1; opacity: 1 } 100% { scale: 1 .3; opacity: 0 } }
@keyframes cs-pillar { 0% { scale: 1 0; opacity: 0 } 35% { scale: 1 1; opacity: 1 } 100% { scale: .7 1.1; opacity: 0 } }
@keyframes cs-dragon { 0% { scale: .6 0; opacity: 0 } 35% { scale: 1 1; opacity: 1 } 60% { scale: 1.05 1.08 } 100% { scale: 1 .6; opacity: 0 } }
@keyframes cs-heal { 0% { opacity: 0; translate: 0 6px } 30% { opacity: 1 } 100% { opacity: 0; translate: 0 -34px } }
@keyframes cs-zap { 0% { opacity: 1 } 50% { opacity: .4 } 100% { opacity: 0 } }
@keyframes cs-banner { from { opacity: 0; transform: translateX(-50%) scale(.6) } to { opacity: 1; transform: translateX(-50%) scale(1) } }
@media (prefers-reduced-motion: reduce) {
    .cs-fx:not(.cs-lasting) { display: none; }
    .sf-meteor-halo, .sf-meteor-crack, .sf-meteor-sparks circle, .cs-banner { animation: none !important; }
}
/* Series window: the stage replaces the emoji duel. */
.series-replay-arena.has-stage { display: block; padding: 0; height: auto; font-size: 1rem; gap: 0; }
.series-replay-arena.has-stage .cs-scene { height: 140px; }
.duel-replay .combat-stage { margin: 0.6rem 0; }
/* Big stick figure instead of the portrait on profile and character page. */
.stick-portrait {
    display: inline-block; flex: none; width: 92px; height: 128px; padding: 4px 6px 0; overflow: hidden;
    border: 3px solid var(--px-outline, #140c1c);
    background: linear-gradient(#8aa39a 0%, #b9b08a 74%, #6b5a3a 74%);
}
.stick-portrait .sf { display: block; width: 100%; height: 100%; }
.character-head { display: flex; align-items: center; gap: 0.9rem; }
.character-head h1 { margin: 0; }
@media (max-width: 640px) { .stick-portrait { width: 72px; height: 100px; } }
/* Map backdrops (resources/js/stage-backdrops.js) replace the default meadow. */
.cs-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cs-scene.cs-has-backdrop::before, .cs-scene.cs-has-backdrop::after { display: none; }
/* Release countdown: big card on the start page and in the waiting room, thin bar in the game. */
.release-countdown { text-align: center; border-color: var(--accent); }
.release-countdown h2 { margin-top: 0.2rem; }
.release-date { margin: 0.2rem 0 0.8rem; color: var(--muted); }
.release-units { display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap; }
.release-unit { min-width: 4.6rem; padding: 0.5rem 0.4rem; background: var(--panel-2); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; }
.release-unit strong { font-family: var(--font-display); font-size: 2rem; line-height: 1.1; color: #f2d48a; font-variant-numeric: tabular-nums; }
.release-unit span { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.release-lead { margin: 0.9rem auto 0; max-width: 40rem; }
/* Pre-registration page: real count, community goals, form. */
.prereg-hero h1 { margin-top: 0.2rem; }
.prereg-stats { margin-top: 0.8rem; }
.prereg-count { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; margin: 0.4rem 0; }
.prereg-count strong { font-family: var(--font-display); font-size: 2.2rem; line-height: 1; color: #f2d48a; font-variant-numeric: tabular-nums; }
.prereg-milestones { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.prereg-milestone { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 0.3rem 0.7rem; padding: 0.5rem 0.6rem; background: var(--panel-2); border: 1px solid var(--line); }
.prereg-milestone.is-reached { border-color: var(--ok); }
.prereg-milestone-text { display: flex; flex-direction: column; min-width: 0; }
.prereg-milestone progress { grid-column: 1 / -1; width: 100%; height: 0.5rem; accent-color: var(--accent); }
.prereg-website { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.release-countdown .prereg-cta { margin-top: 0.8rem; }
.release-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.7rem; margin: 0.4rem 0 0.6rem; padding: 0.4rem 0.8rem; font-size: 0.9rem; background: #2a2216; border: 1px solid var(--accent); color: #f2d48a; }
.release-bar-label { font-weight: 600; }
.release-bar-time { font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.release-bar-note { flex: 1 1 18rem; color: #d9c79c; }
.release-bar-link { color: #f2d48a; font-weight: 600; text-decoration: underline; }
.release-waiting ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
@media (max-width: 480px) {
    .release-unit { min-width: 3.6rem; }
    .release-unit strong { font-size: 1.5rem; }
}

/* Looks on the stick figure ("Tusche und Leuchten", StickLookCatalog + stick-figures.js). Purely visual. */
.sf-has-looks { overflow: visible; }
.sf-sheen { animation: sf-sheen 2.8s ease-in-out infinite; transform-box: view-box; }
@keyframes sf-sheen { 0% { transform: translate(-22px, 34px); } 55%, 100% { transform: translate(22px, -40px); } }
.sf-aura { animation: sf-aura 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 60%; }
@keyframes sf-aura { 50% { opacity: 0.55; transform: scale(1.05); } }
.sf-pt { animation: sf-rise 3.2s linear infinite; }
.sf-pt-star { animation-name: sf-twinkle; animation-duration: 2.4s; }
@keyframes sf-rise { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-58px); opacity: 0; } }
@keyframes sf-twinkle { 0%, 100% { transform: scale(0.2); opacity: 0; } 40% { transform: scale(1); opacity: 1; } 70% { transform: scale(0.5); opacity: 0.4; } }
.sf-wings { transform-box: view-box; transform-origin: 44px 54px; animation: sf-flap 2.6s ease-in-out infinite; filter: drop-shadow(0 0 3px var(--sf-glow)); }
.sf-wing-far { transform-box: view-box; transform-origin: 44px 54px; animation: sf-flap-far 2.6s ease-in-out infinite; }
@keyframes sf-flap { 0%, 100% { transform: rotate(4deg); } 50% { transform: rotate(-7deg); } }
@keyframes sf-flap-far { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(5deg); } }
.sf-wings-ember { animation: sf-flap 2.6s ease-in-out infinite, sf-flicker 1.1s steps(2) infinite; }
.sf-wings-demon { animation: sf-flap 2.2s ease-in-out infinite, sf-demon 1.6s ease-in-out infinite; }
.sf-wings-dragon { animation-duration: 3s; }
.sf-wings-moon { opacity: 0.9; filter: drop-shadow(0 0 6px var(--sf-glow)); }
@keyframes sf-flicker { 50% { filter: drop-shadow(0 0 6px var(--sf-glow)) brightness(1.12); } }
@keyframes sf-demon { 50% { filter: drop-shadow(0 0 7px var(--sf-glow)) brightness(1.1); } }
.cs-dead .sf-wings, .cs-dead .sf-aura, .cs-dead .sf-particles, .cs-dead .sf-sheen { animation: none; opacity: 0.35; }
.wardrobe-look-preview, .basar-look-preview { width: 64px; height: 80px; padding: 2px 4px 0; border-width: 1px; overflow: hidden; }
.basar-look-preview { width: 72px; height: 90px; }

/* Animated name styles: a light runs through the name, visible to everyone. Title and rank keep their own colour. */
.cosmetic-name-style-founder, .cosmetic-name-style-season-premium, .cosmetic-name-style-season-master,
.cosmetic-name-style-ember, .cosmetic-name-style-moon {
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    background-size: 220% 100%; text-shadow: none; filter: drop-shadow(0 1px 0 #000);
    animation: name-run 3.2s linear infinite;
}
.cosmetic-name-style-founder .title-tag, .cosmetic-name-style-season-premium .title-tag, .cosmetic-name-style-season-master .title-tag,
.cosmetic-name-style-ember .title-tag, .cosmetic-name-style-moon .title-tag,
.cosmetic-name-style-founder .rank-tag, .cosmetic-name-style-season-premium .rank-tag, .cosmetic-name-style-season-master .rank-tag,
.cosmetic-name-style-ember .rank-tag, .cosmetic-name-style-moon .rank-tag { -webkit-text-fill-color: currentColor; }
.chat-sender.cosmetic-name-style-founder a, .character-name.cosmetic-name-style-founder a { color: inherit; text-shadow: none; }
.cosmetic-name-style-founder { background-image: linear-gradient(100deg, #b88a2a 0%, #f5c542 35%, #fff4c2 50%, #f5c542 65%, #b88a2a 100%); }
.cosmetic-name-style-season-premium { background-image: linear-gradient(100deg, #9b7be0 0%, #d9c4ff 45%, #ffffff 50%, #d9c4ff 55%, #9b7be0 100%); animation-duration: 4s; }
.cosmetic-name-style-season-master { background-image: linear-gradient(90deg, #ff9a7a, #ffd36a, #a8f08a, #7ad0ff, #c49bff, #ff9a7a); background-size: 300% 100%; animation-duration: 6s; }
.cosmetic-name-style-moon { color: #cfe0f0; font-weight: 700; background-image: linear-gradient(100deg, #8fa6bd 0%, #cfe0f0 40%, #ffffff 50%, #cfe0f0 60%, #8fa6bd 100%); animation-duration: 3.6s; }
.cosmetic-name-style-ember { color: #ff9a4a; font-weight: 700; background-image: linear-gradient(0deg, #e0482a 0%, #ff8a3a 45%, #ffe08a 100%); background-size: 100% 100%; animation: name-ember 1.3s ease-in-out infinite; }
.cosmetic-name-style-jade { position: relative; color: #8fe0b4; font-weight: 700; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.cosmetic-name-style-jade::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: linear-gradient(90deg, transparent, #8fe0b4 30%, #e9fff2 50%, #8fe0b4 70%, transparent); background-size: 200% 100%; animation: name-run 2.4s linear infinite; }
.chat-sender.cosmetic-name-style-jade a, .character-name.cosmetic-name-style-jade a,
.chat-sender.cosmetic-name-style-moon a, .chat-sender.cosmetic-name-style-ember a { color: inherit; }
@keyframes name-run { from { background-position: 100% 0; } to { background-position: -120% 0; } }
@keyframes name-ember { 50% { filter: drop-shadow(0 0 4px #ff6a2a) drop-shadow(0 1px 0 #000); } }
@media (prefers-reduced-motion: reduce) {
    .sf-sheen, .sf-aura, .sf-pt, .sf-wings, .sf-wing-far,
    .cosmetic-name-style-founder, .cosmetic-name-style-season-premium, .cosmetic-name-style-season-master,
    .cosmetic-name-style-ember, .cosmetic-name-style-moon, .cosmetic-name-style-jade::after { animation: none !important; }
}
.btn .btn-icon { width: 1.35em; height: 1.35em; margin-right: 0.35em; vertical-align: -0.28em; }

/* Group finder: big countdown for leader and members (open window / fight start). */
.group-countdown-banner { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0.3rem 0.7rem; margin: 0.7rem 0; padding: 0.7rem 0.9rem; border: 2px solid var(--accent); background: rgba(214, 168, 90, 0.12); text-align: center; }
.group-countdown-banner .group-countdown-label { font-family: var(--font-display); font-size: 1.05rem; }
.group-countdown-banner .countdown { font-family: var(--font-display); font-size: 2rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.1; }
.group-countdown-banner .group-countdown-hint { flex-basis: 100%; font-size: 0.85rem; color: var(--muted, inherit); }
.group-countdown-banner.is-fight { border-color: var(--danger); background: rgba(192, 86, 63, 0.14); animation: group-countdown-pulse 1.6s ease-in-out infinite; }
.group-countdown-banner.is-fight .countdown { color: #f0a08c; }
@keyframes group-countdown-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(192, 86, 63, 0); } 50% { box-shadow: 0 0 14px 2px rgba(192, 86, 63, 0.45); } }
@media (prefers-reduced-motion: reduce) { .group-countdown-banner.is-fight { animation: none; } }

/* Path-choice dungeon map (Spinnendungeon 3, play.partials.dungeon-run-map): level 1 on top, rooms placed by their share of the row. */
.run-map {
    position: relative;
    margin: 0.5rem 0 1rem;
    padding-left: 1.5rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.run-map-links {
    position: absolute;
    inset: 0 0 0 1.5rem;
    width: calc(100% - 1.5rem);
    height: 100%;
}

.run-map-links line {
    stroke: var(--line);
    stroke-width: 2;
    stroke-dasharray: 4 4;
    opacity: 0.7;
}

.run-map-links line.walked {
    stroke: var(--accent);
    stroke-dasharray: none;
    opacity: 1;
}

.run-map-level {
    position: absolute;
    left: 0.35rem;
    transform: translateY(-50%);
}

.run-map-room {
    position: absolute;
    transform: translate(-50%, -50%);
    min-width: 2.4rem;
    min-height: 2.4rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid var(--line);
    background: var(--panel-2);
    font-size: 1.15rem;
    line-height: 1;
    opacity: 0.55;
}

.run-map-room.is-visited { opacity: 0.85; border-color: var(--accent); }
.run-map-room.is-current { opacity: 1; box-shadow: 0 0 0 3px var(--accent); }
.run-map-room.is-reachable { opacity: 1; border-color: var(--ok); }
.run-map-room.is-boss { min-width: 2.9rem; min-height: 2.9rem; border-color: var(--danger); }
.run-map-room.is-elite { border-color: var(--danger); }
.run-map-room .inline-form { margin: 0; }
.run-map-room .btn { min-width: 2.4rem; min-height: 2.4rem; padding: 0.2rem; font-size: 1.15rem; border-radius: 50%; }

.run-map-cards { margin: 0 0 1rem; padding-left: 1.2rem; }
