/* ELSDOR web client: a game screen, phone first. Nothing on the Play screen scrolls: the whole screen is the map, the buttons float on it. */

:root {
    --bg: #120d1f;
    --panel: #1c1530;
    --panel-2: #271d44;
    --glass: rgba(18, 13, 31, 0.78);
    --line: rgba(255, 255, 255, 0.12);
    --text: #f1ecff;
    --muted: #a79bc7;
    --gold: #f2c14e;
    --violet: #8b5cf6;
    --green: #3ddc84;
    --red: #ff5a5f;
    --twitch: #9146ff;
    --radius: 16px;
    --nav-h: 62px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);
    --tile: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    overscroll-behavior: none;
}

[hidden] { display: none !important; }

h1, h2, h3 { margin: 0; letter-spacing: 0.04em; }
h2 { font-size: 20px; margin-bottom: 10px; }
h3 { font-size: 13px; margin: 14px 0 8px; color: var(--gold); text-transform: uppercase; letter-spacing: 0.1em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- THE WORLD: the map of the season behind everything; the weather and the light of the game are drawn over the WHOLE screen ---------- */
#board { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #0c0818; }
#map-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.5) saturate(0.9); transform: scale(1.06); user-select: none; }
#board::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 42%, transparent 28%, rgba(8, 5, 18, 0.78) 100%); }

/* the canvases of the game's own weather (weatherOverlay.js) and light (daylight.js): the light is under the buttons, the weather falls over the content and under the bars; the light is only for the map screen */
#weather-canvas { z-index: 15 !important; }
#daylight-canvas { z-index: 12 !important; }
body:not(.on-play) #daylight-canvas { display: none !important; }

.center-screen {
    position: relative; z-index: 20; min-height: 100%;
    display: flex; align-items: center; justify-content: center; padding: 24px 16px;
}

.spinner {
    width: 40px; height: 40px; border-radius: 50%;
    border: 4px solid var(--panel-2); border-top-color: var(--gold);
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- login ---------- */
.login-card {
    width: 100%; max-width: 380px; text-align: center;
    background: linear-gradient(180deg, rgba(39, 29, 68, 0.88), rgba(28, 21, 48, 0.9));
    border: 1px solid var(--line); border-radius: 24px; padding: 32px 24px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px);
}
.login-logo { border-radius: 22px; box-shadow: 0 8px 30px rgba(139, 92, 246, 0.45); }
.login-card h1 { margin-top: 14px; font-size: 30px; color: var(--gold); }
.login-line { color: var(--muted); margin: 6px 0 22px; }
.login-note { color: var(--muted); font-size: 13px; margin: 18px 0 0; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 22px; border-radius: 14px; border: 0;
    font: inherit; font-weight: 700; color: #fff; text-decoration: none; cursor: pointer;
}
.btn-twitch { background: var(--twitch); width: 100%; font-size: 17px; box-shadow: 0 8px 24px rgba(145, 70, 255, 0.4); }
.btn-twitch:active { transform: translateY(1px); }

/* ---------- app frame: no stacking context here, so the weather (15) falls over the content and under the bars (30) ---------- */
#app { position: relative; display: flex; flex-direction: column; height: 100%; }

#top {
    position: relative; z-index: 30; flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
    padding: calc(8px + var(--safe-t)) 14px 8px;
    background: var(--glass); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px);
}
#top-hero { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; }
#top-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#top-job { font-weight: 500; font-size: 13px; white-space: nowrap; }
.chip { margin-left: auto; font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--panel-2); color: var(--gold); }

.bar { position: relative; flex: 1 1 90px; min-width: 70px; height: 18px; border-radius: 99px; background: #0c0818; border: 1px solid var(--line); overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, #2fbf71, #6df0a5); transition: width 0.5s ease; }
.bar.is-low .bar-fill { background: linear-gradient(90deg, #d93a40, #ff7a7e); }
.bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; text-shadow: 0 1px 2px #000; }

#main { flex: 1 1 auto; min-height: 0; position: relative; display: flex; flex-direction: column; padding-bottom: calc(var(--nav-h) + var(--safe-b)); }
.screen { flex: 1 1 auto; min-height: 0; position: relative; }

#tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
    height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: var(--glass); border-top: 1px solid var(--line); backdrop-filter: blur(10px);
}
.tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer;
}
.tab-icon { font-size: 20px; line-height: 1; }
.tab.is-on { color: var(--gold); }
.tab.is-on .tab-icon { filter: drop-shadow(0 0 6px rgba(242, 193, 78, 0.7)); }

/* ---------- the avatar: the SAME shape as in the game (the game's own playerShapes.js draws it; these are the game's own rules for it) ---------- */
.player { position: relative; flex: 0 0 auto; border-radius: 50%; background: #000; border: 2px solid #fff; box-shadow: 0 0 9px rgba(255, 255, 255, 0.6); }
.player.shaped { background: transparent; border: none; border-radius: 0; box-shadow: none; }
.player-shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.55)); pointer-events: none; }
.player-shape .shape-body { stroke-width: 2px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.player-shape .shape-detail { fill: none; stroke-width: 1px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#top-avatar { width: 26px; height: 26px; }

/* ---------- PLAY: a camera on the map that follows the hero ---------- */
#screen-play { padding: 0; }
#cam { position: absolute; inset: 0; overflow: hidden; }
#cam::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 70px 26px rgba(8, 5, 20, 0.82); }
#world { position: absolute; left: 0; top: 0; will-change: transform; transition: transform var(--glide, 0.9s) cubic-bezier(0.22, 0.8, 0.3, 1); }
#cam.no-motion #world, #cam.no-motion #token { transition: none; }
#world-image { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; border-radius: 6px; box-shadow: 0 10px 50px rgba(0, 0, 0, 0.6); }
#map-positions { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); grid-template-rows: repeat(10, minmax(0, 1fr)); }
.space {
    position: relative; display: flex; align-items: flex-end; justify-content: flex-end; min-width: 0; min-height: 0; padding: 2px 5px;
    background: rgba(255, 255, 255, 0.10); border: 1px solid rgba(0, 0, 0, 0.38); color: rgba(255, 255, 255, 0.62); font-weight: 700; font-size: calc(var(--tile) * 0.2);
}
.space.town { background: rgba(242, 193, 78, 0.34); }
.space.here { background: rgba(255, 255, 255, 0.24); box-shadow: inset 0 0 0 2px rgba(242, 193, 78, 0.95); }

#token {
    position: absolute; z-index: 5; width: calc(var(--tile) * 0.62); height: calc(var(--tile) * 0.62);
    transform: translate(-50%, -50%); transition: left var(--glide, 0.9s) cubic-bezier(0.22, 0.8, 0.3, 1), top var(--glide, 0.9s) cubic-bezier(0.22, 0.8, 0.3, 1);
}
#token::before { content: ""; position: absolute; inset: -34%; border-radius: 50%; border: 2px solid rgba(242, 193, 78, 0.8); animation: ring 1.9s ease-out infinite; pointer-events: none; }
@keyframes ring { 0% { transform: scale(0.7); opacity: 0.95; } 100% { transform: scale(1.35); opacity: 0; } }

/* ---------- the buttons that float on the map ---------- */
.hud { position: absolute; z-index: 25; }
.hud-topleft { top: 10px; left: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.hud-topright { top: 10px; right: 10px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
/* the roll column (the result of the roll, the dice, Roll) is ALWAYS ON TOP of the raid card (z-index 26): on a phone the card at the top covered the result of a roll made during a raid */
.hud-left { z-index: 28; left: 12px; bottom: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: min(64vw, 260px); }

#daylight-clock {
    display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 6px 12px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--glass); backdrop-filter: blur(6px);
    font-size: 12px; font-weight: 800; letter-spacing: 0.5px; color: rgba(255, 255, 255, 0.92); max-width: 200px;
}
#daylight-clock .daylight-phase { margin-left: auto; font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, 0.6); }
#daylight-clock .daylight-weather { flex: 0 0 100%; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.78); }
#daylight-clock .daylight-weather:empty { display: none; }
#daylight-clock .daylight-icon { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; background: #ffd84d; box-shadow: 0 0 8px 2px rgba(255, 216, 77, 0.65); }
#daylight-clock.is-twilight .daylight-icon { background: #ff9a4d; box-shadow: 0 0 8px 2px rgba(255, 140, 60, 0.7); }
#daylight-clock.is-night .daylight-icon { background: transparent; box-shadow: -4px 3px 0 1px #dfe8ff; transform: translate(3px, -2px) rotate(-18deg); width: 11px; height: 11px; }

.tile-chip { padding: 4px 12px; border-radius: 99px; background: var(--glass); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--gold); backdrop-filter: blur(6px); }

.hud-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 99px;
    background: var(--glass); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; backdrop-filter: blur(6px);
}
.hud-btn:active { transform: translateY(1px); border-color: var(--gold); }
.hud-btn[aria-pressed="true"] { color: var(--muted); }

/* rolls, dice, Roll button, result: all on the left */

.roll-button {
    width: 96px; height: 96px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.14); cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
    font: inherit; font-weight: 900; color: #fff; letter-spacing: 0.1em;
    background: linear-gradient(180deg, #2fbf71, #178a4c); box-shadow: 0 10px 30px rgba(47, 191, 113, 0.4);
}
.roll-button .roll-die { font-size: 38px; line-height: 1; }
.roll-button .roll-text { font-size: 14px; }
/* grey mask: cannot be pressed (cooldown, no rolls, not on) */
.roll-button:disabled { background: linear-gradient(180deg, #4a4560, #36314a); color: rgba(255, 255, 255, 0.55); box-shadow: none; cursor: not-allowed; filter: grayscale(0.4); }
.roll-button.is-ready { animation: ready-pulse 1.8s ease-in-out infinite; }
@keyframes ready-pulse { 0%, 100% { box-shadow: 0 10px 30px rgba(47, 191, 113, 0.35); } 50% { box-shadow: 0 10px 44px rgba(47, 191, 113, 0.7); } }

/* ---------- the dice and the result of a roll ---------- */
.dice-stage { display: flex; align-items: center; justify-content: center; width: 100%; height: 78px; perspective: 400px; }
.die {
    position: relative; width: 62px; height: 62px; border-radius: 15px; padding: 8px;
    display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 2px;
    background: linear-gradient(145deg, #fbf7ff, #e5dcff); border: 3px solid var(--gold); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55), inset 0 -4px 8px rgba(60, 36, 110, 0.18);
}
.die .pip { align-self: center; justify-self: center; width: 11px; height: 11px; border-radius: 50%; background: transparent; }
.die .pip.on { background: #3c246e; box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.4); }
.die .face-number { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 900; color: #3c246e; }
.dice-stage.tumbling .die { animation: tumble 0.5s linear infinite; }
.dice-stage.landed .die { animation: land 0.55s ease-out; }
@keyframes tumble { 0% { transform: translateY(0) rotate(0deg) scale(1); } 25% { transform: translateY(-14px) rotate(95deg) scale(1.08); } 50% { transform: translateY(0) rotate(190deg) scale(1); } 75% { transform: translateY(-10px) rotate(275deg) scale(1.06); } 100% { transform: translateY(0) rotate(360deg) scale(1); } }
@keyframes land { 0% { transform: translateY(-22px) rotate(-14deg) scale(1.18); } 55% { transform: translateY(2px) rotate(4deg) scale(0.96); } 100% { transform: translateY(0) rotate(0) scale(1); } }

.roll-result { width: 100%; padding: 9px 12px; border-radius: 14px; background: var(--glass); border: 1px solid var(--gold); backdrop-filter: blur(6px); animation: rise 0.25s ease-out; }
.roll-result.is-bad { border-color: var(--red); }
.roll-result .rr-title { font-size: 17px; font-weight: 800; color: var(--gold); }
.roll-result.is-bad .rr-title { color: var(--red); }
.roll-result .rr-line { margin-top: 3px; font-size: 13px; overflow-wrap: anywhere; }
.roll-result .rr-more { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- the other screens: panels over the world, the world and the weather stay visible behind; they scroll inside, with no bar ---------- */
.panel-screen {
    overflow-y: auto; padding: 14px 14px 18px; scrollbar-width: none;
    background: linear-gradient(180deg, rgba(10, 6, 22, 0.55), rgba(10, 6, 22, 0.78));
}
.panel-screen::-webkit-scrollbar { display: none; }
.panel-screen > * { max-width: 760px; margin-left: auto; margin-right: auto; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; backdrop-filter: blur(4px); }
.stat.wide { grid-column: 1 / -1; }
.stat-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.stat-value { font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.stat-value.small-text { font-size: 14px; font-weight: 700; }

.button-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.button-grid.icons { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.big-btn {
    display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; text-align: left;
    background: linear-gradient(180deg, rgba(39, 29, 68, 0.9), rgba(28, 21, 48, 0.9)); border: 1px solid var(--line); border-radius: var(--radius);
    color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
}
.big-btn:active { transform: translateY(1px); border-color: var(--gold); }
.big-btn .ico { font-size: 22px; }
.big-btn.danger { color: var(--red); }
.icons .big-btn { flex-direction: column; justify-content: center; text-align: center; gap: 4px; font-size: 11px; min-height: 66px; padding: 6px 2px; }
.icons .big-btn .ico { font-size: 20px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.seg { display: flex; gap: 6px; margin-bottom: 10px; }
.seg-btn { flex: 1; min-height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.seg-btn.is-on { color: var(--gold); border-color: var(--gold); }
.potion { display: flex; align-items: center; gap: 12px; }
.potion-icon { font-size: 26px; }
.potion-text { flex: 1; min-width: 0; }
.potion-name { font-weight: 800; }
.potion-info { font-size: 12px; color: var(--muted); }
.use-btn { min-width: 74px; min-height: 40px; border-radius: 12px; border: 0; background: linear-gradient(180deg, #2fbf71, #178a4c); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.use-btn:disabled { background: linear-gradient(180deg, #4a4560, #36314a); color: rgba(255, 255, 255, 0.55); cursor: not-allowed; }
.use-result { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--gold); font-size: 14px; }
.use-result.is-bad { border-color: var(--red); }
.item { background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; overflow-wrap: anywhere; }
.item .tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 800; background: var(--green); color: #07110b; }
.empty { padding: 24px 16px; text-align: center; color: var(--muted); background: var(--glass); border: 1px dashed var(--line); border-radius: var(--radius); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.kv b { color: var(--gold); font-weight: 600; }
.line { padding: 8px 2px; overflow-wrap: anywhere; }
.line.head { font-weight: 800; font-size: 17px; }
code { background: rgba(255, 255, 255, 0.10); padding: 1px 6px; border-radius: 6px; font-size: 0.92em; }
.progress { height: 12px; border-radius: 99px; background: #0c0818; border: 1px solid var(--line); overflow: hidden; margin: 6px 0; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--violet), var(--gold)); }

/* ---------- the sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 12px; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); }
.sheet-panel {
    position: relative; width: 100%; max-width: 760px; max-height: 88%; display: flex; flex-direction: column;
    background: var(--panel); border: 2px solid var(--gold); border-radius: 20px; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.7); animation: pop 0.2s ease-out;
}
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { margin: 0; flex: 1; font-size: 16px; color: var(--text); text-transform: none; letter-spacing: 0.02em; }
.sheet-body { overflow-y: auto; padding: 8px 16px 18px; scrollbar-width: none; }
.sheet-body::-webkit-scrollbar { display: none; }
.mini-btn {
    display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px;
    border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-size: 13px; text-decoration: none; cursor: pointer;
}

/* ---------- the stream card (small, calm, in the game's frame): the player starts by itself, muted ---------- */
.stream {
    position: fixed; z-index: 40; right: 12px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
    width: 150px; border-radius: 14px; overflow: hidden; background: #000;
    border: 2px solid rgba(242, 193, 78, 0.55); box-shadow: 0 10px 34px rgba(0, 0, 0, 0.65);
}
.stream-frame { position: relative; overflow: hidden; aspect-ratio: 16 / 9; width: 100%; background: #0c0818; }
/* the player is never smaller than 534 x 300 (Twitch starts it by itself only from 400 x 300); app.js scales it down to the card */
.stream-player { position: absolute; left: 0; top: 0; width: 534px; height: 300px; transform-origin: 0 0; }
.stream-player iframe { width: 100%; height: 100%; border: 0; display: block; }
.stream-bar { display: flex; gap: 4px; padding: 4px; background: rgba(18, 13, 31, 0.95); }
.stream-bar .mini-btn { height: 26px; min-width: 26px; font-size: 11px; padding: 0 7px; }
.stream-bar #stream-open { flex: 1; }
.stream.is-big { left: 12px; right: 12px; width: auto; bottom: auto; top: calc(56px + var(--safe-t)); }
.stream-pill {
    position: fixed; z-index: 40; right: 12px; bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
    height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid rgba(242, 193, 78, 0.55);
    background: rgba(18, 13, 31, 0.95); color: var(--gold); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}

/* ---------- the colours of the words (the same as the Recent Moves of the game): red = hurt, green = good, gold = results; the story itself stays calm ---------- */
.tx-gain { color: #4dff88; font-weight: 700; }
.tx-loss { color: #ff4d4d; font-weight: 700; }
.tx-gold { color: #ffd24d; font-weight: 700; }
.tx-remaining { color: #f1f3fa; font-weight: 700; }
.tx-notice { color: #fff; font-weight: 800; }
.rr-line, .raid-log div, .raid-meta, .raid-you { color: #cfc8e6; }

/* ---------- THE RAID ---------- */
.raid {
    position: absolute; z-index: 26; left: 8px; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px;
    background: var(--glass); border: 2px solid var(--gold); border-radius: 16px; backdrop-filter: blur(8px); box-shadow: 0 10px 34px rgba(0, 0, 0, 0.6); animation: rise 0.25s ease-out;
}
.raid.tier-common { border-color: #aab2c0; } .raid.tier-uncommon { border-color: #4dff88; } .raid.tier-rare { border-color: #4da6ff; }
.raid.tier-epic { border-color: #b06bff; } .raid.tier-legendary { border-color: #ffb02e; } .raid.tier-unique { border-color: #ff4d9a; }
.raid-head { display: flex; align-items: center; gap: 10px; }
.raid-pic { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 12px; object-fit: cover; background: #0c0818; border: 1px solid var(--line); }
.raid-titles { flex: 1 1 auto; min-width: 0; }
.raid-name { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.raid-sub { font-size: 12px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; }
.raid-warn { padding: 6px 10px; border-radius: 10px; background: rgba(255, 77, 77, 0.2); border: 1px solid var(--red); color: #ffb3b3; font-size: 13px; font-weight: 700; animation: warn-pulse 1s ease-in-out infinite; }
@keyframes warn-pulse { 0%, 100% { background: rgba(255, 77, 77, 0.18); } 50% { background: rgba(255, 77, 77, 0.42); } }
.raid-hp { position: relative; height: 26px; flex: 0 0 auto; border-radius: 99px; background: #0c0818; border: 1px solid var(--line); overflow: hidden; }
.raid-hp-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #d93a40, #ff7a7e); transition: width 0.4s ease; }
.raid-hp-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.raid-mode { flex: 0 0 auto; padding: 5px 10px; border-radius: 10px; font-size: 13px; font-weight: 800; letter-spacing: 0.03em; text-align: center; border: 1px solid; }
.raid-mode[hidden] { display: none; }
.raid-mode.is-lethal { color: #ffb3b3; border-color: var(--red); background: rgba(255, 77, 77, 0.16); }
.raid-mode.is-sparring { color: #a8f0c0; border-color: #4fcf86; background: rgba(79, 207, 134, 0.14); }
.raid-you { flex: 0 0 auto; font-weight: 800; }
.raid-meta, .raid-you { font-size: 13px; }
.raid-you.is-down { color: var(--red); font-weight: 700; }
.raid { overflow-y: auto; max-height: calc(100% - 16px); scrollbar-width: thin; }
.raid > * { flex-shrink: 0; }
.raid-log { min-height: 96px; max-height: 150px; overflow-y: auto; font-size: 12px; line-height: 1.35; scrollbar-width: thin; }
.raid-actions { flex-wrap: wrap; }
.raid-actions .raid-action-btn { flex: 1 1 120px; }
.raid-log div { padding: 1px 0; overflow-wrap: break-word; }
/* rolled up: only the head (the picture, the name, the kind of fight), a warning and the buttons that can be pressed are left; the card stays where it is */
.raid.is-rolled > :not(.raid-head):not(.raid-mode):not(.raid-warn):not(.raid-foot) { display: none; }
.raid.is-rolled .raid-foot > :not(.raid-actions) { display: none; }
/* THE FOOT OF THE CARD (deliver 318): Defend, Potion, the note and the answer stay at the bottom of the card, in view, however tall the card is and whatever is scrolled (they were scrolled out of sight on a phone) */
.raid-foot { position: sticky; bottom: -8px; z-index: 3; display: flex; flex-direction: column; gap: 6px; padding: 0; }
/* (deliver 320: a SOLID strip across the card with a thin line above it - the glow of 318 lay over the text and looked bad) */
.raid-foot:has(> :not([hidden])) { margin: 0 -10px -8px; padding: 8px 10px; background: #19122b; border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; }
.raid-banner { padding: 6px 10px; border-radius: 10px; text-align: center; font-weight: 900; letter-spacing: 0.08em; background: rgba(255, 210, 77, 0.2); border: 1px solid var(--gold); color: var(--gold); }
.raid-banner.is-lost { background: rgba(255, 77, 77, 0.2); border-color: var(--red); color: var(--red); }
.raid-banner.is-cancelled { background: rgba(167, 155, 199, 0.18); border-color: var(--muted); color: var(--muted); }
.raid-actions { display: flex; gap: 8px; }
.raid-action-btn { flex: 1; min-height: 40px; padding: 8px 12px; border: 0; border-radius: 12px; font: inherit; font-weight: 800; color: #fff; cursor: pointer; background: linear-gradient(180deg, #2fbf71, #178a4c); }
.raid-action-btn.is-defend { background: linear-gradient(180deg, #4d8fff, #2a5fcf); }
.raid-acted-note { margin: 6px 0 0; padding: 5px 10px; border-radius: 10px; font-size: 12px; font-weight: 700; text-align: center; color: #c9c3e0; background: rgba(120, 110, 160, 0.18); border: 1px dashed rgba(160, 150, 200, 0.45); }
.raid-action-btn:disabled { background: linear-gradient(180deg, #4a4560, #36314a); color: rgba(255, 255, 255, 0.55); cursor: not-allowed; }
.raid-action-result { padding: 5px 9px; border-radius: 10px; background: rgba(255, 210, 77, 0.14); border: 1px solid var(--gold); font-size: 12px; }
.raid-action-result.is-bad { background: rgba(255, 77, 77, 0.14); border-color: var(--red); }
/* a raid on the phone: the buttons of the map go under the card; a red dot shows on the Play tab while a raid is going */
body.raid-open .hud-topleft, body.raid-open .hud-topright { top: calc(var(--raid-h, 0px) + 18px); }
.tab-icon { position: relative; }
body.raid-live .tab[data-tab="play"] .tab-icon::after { content: ""; position: absolute; top: -2px; right: -6px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); }

/* the menu of the buttons: a computer sees them all (the group takes no box of its own), a phone sees ONE button that opens them */
.hud-menu { display: contents; }
.hud-menu-toggle { display: none; }
.hud-icon-only .hud-label { display: none; }
.roll-result, .dice-stage { transition: opacity 0.8s ease; }
.is-idle { opacity: 0; pointer-events: none; }

/* ---------- the windows that ask for a choice (a stranger, the boons) ---------- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); }
.hud-btn { position: relative; }
.hud-btn .dot { position: absolute; top: -2px; right: -2px; }
/* the tutorial asks for a click: a gold glow that breathes, and a red dot, until it has been clicked once */
.hud-attn { border-color: var(--gold); animation: attn-glow 1.6s ease-in-out infinite; }
@keyframes attn-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 210, 77, 0.75), 0 0 6px 1px rgba(255, 210, 77, 0.5); } 50% { box-shadow: 0 0 0 7px rgba(255, 210, 77, 0), 0 0 14px 3px rgba(255, 210, 77, 0.8); } }
.job-card.is-current { border-color: var(--gold); }

/* ---------- THE COLOR COLLECTION: the Pull button above Roll, the pull window, the Collection tab ---------- */

/* six tabs on a phone: a little smaller, one line each */
.tab { min-width: 0; font-size: 11px; }
.tab span:last-child { white-space: nowrap; }

/* an icon of the Legendary tier is animated gold like the S rank (the pill needs room for the moving line) */
.rar-pill.gold-anim { position: relative; overflow: hidden; }
.rar-pill.gold-still { color: #2a1d00; border-color: #8a6a10; background: linear-gradient(180deg, #f6cf62, #c0922a); box-shadow: 0 0 6px rgba(255, 200, 61, 0.35); }

/* the swatches: a rounded square = a CHARACTER color, a ring = a RING color; a shiny one has the moving line (black, or white on a dark color) and a star */
.col-token { position: relative; width: 48px; height: 48px; flex: 0 0 auto; border-radius: 12px; border: 2px solid rgba(255, 255, 255, 0.25); overflow: hidden; }
.col-ring { position: relative; width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%; background: radial-gradient(circle, transparent 52%, var(--c, #888) 54%); }
.col-token.is-big, .col-ring.is-big { width: 120px; height: 120px; }
.col-token.is-big { border-radius: 26px; }
.col-token.shiny::after { content: ""; position: absolute; inset: -20%; background: linear-gradient(115deg, transparent 38%, rgba(0, 0, 0, 0.7) 48%, rgba(0, 0, 0, 0.7) 52%, transparent 62%); background-size: 260% 100%; animation: col-sweep 2.4s ease-in-out infinite; }
.col-token.shiny.inv::after { background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.9) 48%, rgba(255, 255, 255, 0.9) 52%, transparent 62%); background-size: 260% 100%; }
.col-ring.shiny::after { content: ""; position: absolute; inset: 0; border-radius: 50%; -webkit-mask: radial-gradient(circle, transparent 52%, #000 54%); mask: radial-gradient(circle, transparent 52%, #000 54%); background: linear-gradient(115deg, transparent 38%, rgba(0, 0, 0, 0.75) 48%, rgba(0, 0, 0, 0.75) 52%, transparent 62%); background-size: 260% 100%; animation: col-sweep 2.4s ease-in-out infinite; }
.col-ring.shiny.inv::after { background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.95) 48%, rgba(255, 255, 255, 0.95) 52%, transparent 62%); background-size: 260% 100%; }
@keyframes col-sweep { 0% { background-position: 160% 0; } 100% { background-position: -60% 0; } }

/* the Pull button: a round button above Roll. The gold ring is the way to the next pull; the number is how many are ready */
.pull-button {
    position: relative; width: 58px; height: 58px; flex: 0 0 auto; border: 0; padding: 0; border-radius: 50%; cursor: pointer; color: #fff; font: inherit;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    background: conic-gradient(var(--gold) calc(var(--p, 0) * 360deg), rgba(255, 255, 255, 0.16) 0); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.pull-button[hidden] { display: none; }
.pull-button::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: linear-gradient(180deg, #3b2f66, #241c44); }
.pull-button > span { position: relative; }
.pull-icon { font-size: 22px; line-height: 1; }
.pull-time { font-size: 10px; font-weight: 800; line-height: 1; color: rgba(255, 255, 255, 0.82); font-variant-numeric: tabular-nums; }
.pull-count { position: absolute !important; top: -5px; right: -5px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; background: #4a4560; color: #fff; border: 2px solid var(--bg); }
.pull-button.is-ready .pull-count { background: var(--gold); color: #1a1100; }
.pull-button.is-ready { animation: pull-ready 1.8s ease-in-out infinite; }
.pull-button.is-busy { opacity: 0.6; pointer-events: none; }
@keyframes pull-ready { 0%, 100% { box-shadow: 0 6px 18px rgba(242, 193, 78, 0.35); } 50% { box-shadow: 0 6px 26px rgba(242, 193, 78, 0.8); } }
.pull-note { padding: 4px 10px; border-radius: 10px; background: var(--glass); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--text); max-width: 100%; }
.pull-note[hidden] { display: none; }

/* the pull window */
.pull-modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 6, 12, 0.74); backdrop-filter: blur(4px); }
.pull-modal[hidden] { display: none; }
.pull-card-wrap { width: min(100%, 440px); max-height: 94%; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; align-items: center; padding: 18px 16px; border-radius: 18px; background: linear-gradient(180deg, #2b2013, #1a1410); border: 2px solid #c9a227; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.7); }
.pull-card-wrap h3 { margin: 0; font-size: 20px; letter-spacing: 0.06em; color: #f2d98a; text-transform: uppercase; }
.pull-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); text-align: center; animation: pull-in 0.45s ease-out both; }
.pull-card.is-big { padding: 18px 22px; }
.pull-card.t3 { border-color: #a86bff; box-shadow: 0 0 18px rgba(168, 107, 255, 0.4); }
.pull-card.t4 { border-color: #ffc83d; box-shadow: 0 0 26px rgba(255, 200, 61, 0.55); }
.pull-card.is-shiny { box-shadow: 0 0 34px rgba(255, 216, 74, 0.8); }
.pull-name { font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }
.pull-card.is-big .pull-name { font-size: 20px; }
.pull-tags { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.pull-side { font-size: 12px; color: var(--muted); }
.pull-fresh { font-size: 12px; font-weight: 800; color: var(--muted); }
.pull-fresh.is-new { color: var(--green); }
.pull-summary { font-size: 13px; color: var(--muted); text-align: center; }
.pull-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; width: 100%; }
.pull-grid .pull-card { padding: 8px; }
.pull-grid .pull-name { font-size: 13px; }
#pull-body { width: 100%; }
.pull-result.is-many { flex-direction: column; justify-content: flex-start; align-items: center; gap: 10px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.col-decree { font-size: 12px; font-weight: 800; letter-spacing: 0.04em; color: #f2d98a; }
.pull-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.pull-actions .big-btn.is-quiet { color: var(--muted); }
body.pull-open { overflow: hidden; }
@keyframes pull-in { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }

/* the Collection tab */
.col-head { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-bottom: 8px; }
.col-own b { font-size: 22px; color: var(--gold); font-variant-numeric: tabular-nums; }
.col-pulls { font-size: 13px; color: var(--muted); }
.col-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.col-tabs .seg-btn { flex: 0 0 auto; padding: 0 12px; min-height: 36px; }
#col-search { width: 100%; padding: 10px 12px; margin: 4px 0 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: var(--text); font: inherit; }
#col-search:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.col-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.col-chip { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); min-width: 0; }
.col-chip.is-missing { opacity: 0.55; }
.col-chip.is-shiny { border-color: #ffd84a; }
.col-chip-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.col-name { font-weight: 800; font-size: 14px; overflow-wrap: anywhere; }
.col-hex { font-size: 11px; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; }
.col-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.col-count { font-size: 12px; font-weight: 800; color: var(--muted); }
.col-heart { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.col-heart.is-on { color: #ff5a8a; border-color: #ff5a8a; }
.col-heart:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.col-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 4px; }
.col-pager .seg-btn { flex: 0 0 auto; min-width: 84px; }
.col-pager .seg-btn:disabled { opacity: 0.4; cursor: default; }
.col-soon { margin-top: 10px; }
.col-actions { margin-top: 4px; }
.col-wear { min-height: 32px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--green); background: rgba(61, 220, 132, 0.12); color: var(--green); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.col-wear:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.col-wear.is-worn, .col-wear:disabled { border-color: var(--line); background: transparent; color: var(--muted); cursor: default; }
.col-note { min-height: 0; margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.col-note:empty { display: none; }
.col-note.is-ok { color: var(--green); }
.col-note.is-bad { color: var(--red); }
@media (prefers-reduced-motion: reduce) { .pull-card { animation: none; } .col-token.shiny::after, .col-ring.shiny::after { animation: none; background-position: 50% 0; } .pull-button.is-ready { animation: none; } }


/* ---------- 291: THE PULL WINDOW (opens closed: press Pull; the orb charges with the colour of what is inside), the rarity bar, the shiny ball, the tags ---------- */

.pull-foot { width: 100%; text-align: center; font-size: 13px; font-weight: 700; color: #d9c98f; font-variant-numeric: tabular-nums; border-top: 1px solid rgba(201, 162, 39, 0.35); padding-top: 10px; }
.pull-hint { min-height: 20px; text-align: center; font-size: 14px; font-weight: 700; color: var(--muted); }
.pull-stage { position: relative; width: 100%; min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pull-orb-wrap { display: flex; justify-content: center; padding: 10px 0; }
.pull-stage[data-phase="reveal"] .pull-orb-wrap { display: none; }
.pull-result { display: none; width: 100%; justify-content: center; }
.pull-stage[data-phase="reveal"] .pull-result { display: flex; }
.pull-result .pull-card { animation: card-flip 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.pull-orb { --orb: #aeb4c2; position: relative; width: 150px; height: 150px; border: 0; padding: 0; border-radius: 50%; background: transparent; cursor: pointer; animation: orb-float 2.6s ease-in-out infinite; }
.pull-orb:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; }
.pull-orb-core { position: absolute; inset: 0; border-radius: 50%; background-color: #3a3150; box-shadow: 0 0 22px rgba(255, 255, 255, 0.12), inset 0 -16px 26px rgba(0, 0, 0, 0.5), inset 0 12px 20px rgba(255, 255, 255, 0.16); transition-property: background-color, box-shadow; transition-duration: inherit; transition-timing-function: ease-in; }
.pull-orb-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 58px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); }
.pull-orb:not(:disabled):hover .pull-orb-core { box-shadow: 0 0 34px rgba(255, 255, 255, 0.28), inset 0 -16px 26px rgba(0, 0, 0, 0.5), inset 0 12px 20px rgba(255, 255, 255, 0.2); }
.pull-orb.is-shaking { animation: orb-shake 0.16s linear infinite; }
.pull-orb.is-charging { animation: orb-pulse 0.85s ease-in-out infinite; }
.pull-orb.is-charging .pull-orb-core { background-color: var(--orb); box-shadow: 0 0 70px var(--orb), 0 0 24px var(--orb), inset 0 -16px 26px rgba(0, 0, 0, 0.35), inset 0 12px 20px rgba(255, 255, 255, 0.3); }
.pull-stage[data-tier="4"] .pull-orb.is-charging { animation-duration: 1.4s; }
.pull-orb.is-burst { animation: orb-burst 0.4s ease-out forwards; }
.pull-flash { position: absolute; inset: -16px; border-radius: 18px; pointer-events: none; opacity: 0; background: radial-gradient(circle, rgba(255, 233, 150, 0.95), rgba(255, 200, 61, 0) 68%); }
.pull-flash.is-on { animation: pull-flash 1s ease-out forwards; }
.pull-stage[data-tier="4"]::before { content: ""; position: absolute; inset: -10px; border-radius: 18px; pointer-events: none; background: radial-gradient(circle at 50% 45%, rgba(255, 200, 61, 0.34), rgba(255, 200, 61, 0) 62%); animation: pull-glow 3s ease-in forwards; }
.pull-stage.is-shiny::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle, #fff 0 1px, transparent 2px), radial-gradient(circle, #ffe9a0 0 1px, transparent 2px); background-size: 46px 46px, 71px 71px; background-position: 0 0, 20px 30px; animation: pull-twinkle 1.1s ease-in-out infinite; opacity: 0.8; }
.pull-namerow { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
@keyframes orb-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes orb-shake { 0% { transform: translate(-3px, 1px) rotate(-3deg); } 25% { transform: translate(3px, -2px) rotate(3deg); } 50% { transform: translate(-2px, 2px) rotate(-2deg); } 75% { transform: translate(2px, 1px) rotate(2deg); } 100% { transform: translate(-3px, 1px) rotate(-3deg); } }
@keyframes orb-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes orb-burst { 0% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes pull-flash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
@keyframes pull-glow { from { opacity: 0; } to { opacity: 1; } }
@keyframes pull-twinkle { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.9; } }
@keyframes card-flip { from { transform: perspective(700px) rotateY(90deg) scale(0.8); opacity: 0; } to { transform: perspective(700px) rotateY(0) scale(1); opacity: 1; } }

/* the shiny mark: a small gold ball with a star, next to the name (the color itself only has the moving line) */
.col-shiny-ball { display: inline-flex; flex: 0 0 auto; width: 18px; height: 18px; vertical-align: middle; filter: drop-shadow(0 0 4px rgba(255, 216, 74, 0.7)); }
.col-shiny-ball svg { width: 100%; height: 100%; display: block; }
.pull-card.is-big .col-shiny-ball { width: 24px; height: 24px; }
.col-namerow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* the bar of rarities: a letter in the colour of each rarity */
#col-tabs { gap: 4px; }
.col-tab.t-all, .col-tab.t-dupes { flex-grow: 1.5; }
.col-tab { flex: 1 1 0; min-width: 0; min-height: 38px; padding: 0 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); font: inherit; font-size: 15px; font-weight: 900; cursor: pointer; color: var(--muted); }
.col-tab:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.col-tab.t-all { color: var(--text); font-size: 13px; }
.col-tab.t-common { color: #aeb4c2; }
.col-tab.t-uncommon { color: #5ee07f; }
.col-tab.t-rare { color: #5aaeff; }
.col-tab.t-epic { color: #c084ff; }
.col-tab.t-legendary { color: #ffc83d; }
.col-tab.t-dupes { color: #8fd3ff; font-size: 13px; }
.col-tab.t-favs { color: #ff5a8a; font-size: 18px; }
.col-tab.is-on { border-color: currentColor; background: rgba(255, 255, 255, 0.09); box-shadow: 0 0 12px -2px currentColor; }

/* My Tags */
.col-tagbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 2px 0 8px; }
.col-tagbar .col-select { flex: 0 1 34%; min-width: 0; }   /* the tag menu is smaller: the toggle Owned / Not owned fits next to Select */
.col-owntoggle { display: inline-flex; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.col-ownbtn { min-height: 40px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.col-ownbtn.is-on { background: linear-gradient(180deg, #2fbf71, #178a4c); color: #fff; }
.col-selectbtn { flex: 0 0 auto; min-height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: var(--text); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.col-selectbtn[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); background: rgba(242, 193, 78, 0.12); }
.col-selectbtn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.col-selbar { display: flex; flex-direction: column; gap: 8px; margin: 0 0 10px; padding: 10px; border-radius: 14px; border: 1px solid rgba(242, 193, 78, 0.45); background: rgba(242, 193, 78, 0.07); }
.col-selbar[hidden] { display: none; }
.col-selcount { font-size: 13px; font-weight: 800; color: var(--gold); }
.col-selrow { display: flex; gap: 8px; align-items: stretch; }
.col-selrow .seg-btn, .col-selrow .col-select { flex: 1 1 0; min-width: 0; }
.col-selrow .seg-btn:disabled { opacity: 0.45; cursor: default; }
.col-chip.is-select { cursor: pointer; }
.col-chip.is-picked { border-color: var(--gold); background: rgba(242, 193, 78, 0.12); }
.col-check { flex: 0 0 auto; align-self: center; width: 34px; height: 34px; border-radius: 10px; border: 2px solid var(--line); background: transparent; color: #1a1100; font: inherit; font-size: 20px; font-weight: 900; line-height: 1; cursor: pointer; }
.col-check.is-on { border-color: var(--gold); background: var(--gold); }
.col-check:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.col-select { flex: 1 1 auto; min-width: 0; min-height: 40px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: var(--text); font: inherit; font-weight: 700; }
.col-select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.col-plus { position: relative; flex: 0 0 auto; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--gold); background: rgba(242, 193, 78, 0.12); color: var(--gold); font-size: 0; cursor: pointer; }
.col-plus::before, .col-plus::after { content: ""; position: absolute; left: 50%; top: 50%; background: currentColor; border-radius: 2px; transform: translate(-50%, -50%); }
.col-plus::before { width: 16px; height: 3px; }
.col-plus::after { width: 3px; height: 16px; }
.col-plus:focus-visible, .col-minor:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.col-minor { flex: 0 0 auto; min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--red); background: transparent; color: var(--red); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.col-tagform { display: flex; gap: 6px; margin: 0 0 8px; }
.col-tagform[hidden] { display: none; }
.col-tagform input { flex: 1 1 auto; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: var(--text); font: inherit; }
.col-tagform .seg-btn { flex: 0 0 auto; min-width: 70px; }
.col-taglabels { display: flex; gap: 4px; flex-wrap: wrap; }
.col-taglabel { padding: 0 8px; border-radius: 99px; background: rgba(143, 211, 255, 0.14); color: #8fd3ff; font-size: 11px; font-weight: 700; }
.col-tagbtn { min-height: 32px; padding: 0 12px; margin-left: 6px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.col-tagbtn.is-open { border-color: #8fd3ff; color: #8fd3ff; }
.col-tagpanel { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.col-tagchip { min-height: 30px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.col-tagchip.is-on { border-color: #8fd3ff; color: #8fd3ff; background: rgba(143, 211, 255, 0.12); }
.col-tagbtn:focus-visible, .col-tagchip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* THE PANEL TABS (Hero, Bag, Collection, Guild, More): the weather and the night tint stay BEHIND the text and the windows, the labels are bright; the Play screen is as it was */
body:not(.on-play) #weather-canvas { z-index: 1 !important; }
body:not(.on-play) .panel-screen { z-index: 20; background: rgba(10, 7, 22, 0.62); --muted: #d4cbec; }

@media (prefers-reduced-motion: reduce) { .pull-orb, .pull-orb.is-shaking, .pull-orb.is-charging, .pull-orb.is-burst { animation: none; } .pull-result .pull-card { animation: none; } .pull-flash.is-on, .pull-stage[data-tier="4"]::before, .pull-stage.is-shiny::after { animation: none; } }

/* THE MARKET SQUARE (the skin shop): a heraldic look - gold edges, a dark parchment, the lettering of a manuscript */
.choice.is-market .choice-card { border-color: #c9a227; background: linear-gradient(180deg, #2b2013 0%, #1a1410 100%); box-shadow: 0 18px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(201, 162, 39, 0.35) inset; }
.choice.is-market .choice-head { border-bottom: 1px solid rgba(201, 162, 39, 0.5); }
.choice.is-market .choice-head h3 { font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; font-size: 19px; letter-spacing: 0.08em; color: #f2d98a; text-transform: uppercase; }
.market-welcome { padding: 8px 12px; border: 1px solid rgba(201, 162, 39, 0.45); border-radius: 10px; background: rgba(201, 162, 39, 0.08); color: #ead9a8; font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; font-style: italic; font-size: 14px; line-height: 1.4; text-align: center; }
.choice.is-market .shop-name { font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; color: #f2d98a; }
.choice.is-market .shop-preview, .choice.is-market .shop-card { border-color: rgba(201, 162, 39, 0.4); background: rgba(60, 42, 20, 0.55); }
.choice.is-market .shop-card.is-selected { border-color: #f2d98a; box-shadow: 0 0 8px rgba(242, 217, 138, 0.35); }
.choice.is-market .seg-btn.is-on { color: #f2d98a; border-color: #c9a227; }
/* THE SKIN SHOP */
.shop-preview { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(39, 29, 68, 0.6); }
.shop-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.shop-name { font-size: 18px; font-weight: 800; }
.shop-avatar { display: inline-block; flex: 0 0 auto; width: 34px; height: 34px; }
.shop-avatar.is-big { width: 74px; height: 74px; }
.shop-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.shop-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(39, 29, 68, 0.6); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.shop-card.is-selected { border-color: var(--gold); }
.shop-card-name { flex: 1; min-width: 0; font-weight: 700; font-size: 13px; overflow-wrap: anywhere; }
/* RARITY: Common grey, Uncommon green, Rare blue, Epic purple, Legendary gold (the same everywhere) */
.rar-common, .choice-card-item .rar.rar-common { color: #aeb4c2; }
.rar-uncommon, .choice-card-item .rar.rar-uncommon { color: #5ee07f; }
.rar-rare, .choice-card-item .rar.rar-rare { color: #5aaeff; }
.rar-epic, .choice-card-item .rar.rar-epic { color: #c084ff; }
.rar-legendary, .choice-card-item .rar.rar-legendary { color: #ffc83d; }
/* MYTHIC: a deep, glowing ruby red that breathes, with a shine that runs across it and the same black line that sweeps over the S rank; the name glows the same red */
.rar-mythic, .choice-card-item .rar.rar-mythic { color: #ff2d55; text-shadow: 0 0 8px rgba(255, 30, 70, 0.85), 0 0 18px rgba(255, 30, 70, 0.4); animation: mythic-glow 2.4s ease-in-out infinite; }
.rar-pill.rar-mythic { position: relative; overflow: hidden; color: #fff; border-color: #000; background: linear-gradient(110deg, #4d000b 0%, #c4001f 22%, #ff3b5c 40%, #ffb3be 50%, #ff3b5c 60%, #c4001f 78%, #4d000b 100%); background-size: 240% 100%; text-shadow: 0 0 4px rgba(0, 0, 0, 0.85); box-shadow: 0 0 10px rgba(255, 30, 70, 0.85), 0 0 24px rgba(255, 30, 70, 0.45); animation: mythic-shine 2.8s linear infinite; }
.rar-pill.rar-mythic::after { content: ""; position: absolute; top: 0; bottom: 0; left: -45%; width: 35%; background: linear-gradient(100deg, transparent, rgba(0, 0, 0, 0.6), transparent); animation: black-sweep 2.1s ease-in-out infinite; }
.bag-item.is-mythic { border-color: #ff2d55; background: linear-gradient(120deg, rgba(120, 0, 20, 0.4), rgba(25, 5, 15, 0.65)); box-shadow: 0 0 14px rgba(255, 30, 70, 0.45), inset 0 0 18px rgba(255, 30, 70, 0.14); animation: mythic-box 2.4s ease-in-out infinite; }
@keyframes mythic-box { 0%, 100% { box-shadow: 0 0 10px rgba(255, 30, 70, 0.35), inset 0 0 14px rgba(255, 30, 70, 0.1); } 50% { box-shadow: 0 0 24px rgba(255, 50, 90, 0.7), inset 0 0 26px rgba(255, 30, 70, 0.22); } }
@keyframes mythic-shine { to { background-position: -240% 0; } }
@keyframes mythic-glow { 0%, 100% { text-shadow: 0 0 6px rgba(255, 30, 70, 0.7), 0 0 14px rgba(255, 30, 70, 0.3); } 50% { text-shadow: 0 0 12px rgba(255, 60, 90, 1), 0 0 28px rgba(255, 30, 70, 0.6); } }
.bag-serial { font-weight: 800; color: var(--gold); }
.rar-pill { display: inline-block; padding: 0 8px; border-radius: 99px; border: 1px solid currentColor; background: rgba(255, 255, 255, 0.06); font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.7; }
/* GUILD RANKS (F to S) and JOB TIERS (coloured like a rarity): S and the best tier are animated gold with a black lining that sweeps across */
.rank, .tier { position: relative; display: inline-block; min-width: 1.7em; padding: 0 0.45em; overflow: hidden; border: 1px solid currentColor; border-radius: 6px; text-align: center; vertical-align: middle; font-size: 0.85em; font-weight: 900; line-height: 1.55; }
.rank-F, .tier-common { color: #aeb4c2; background: rgba(174, 180, 194, 0.12); }
.rank-E, .tier-uncommon { color: #5ee07f; background: rgba(94, 224, 127, 0.12); }
.rank-D, .tier-rare { color: #5aaeff; background: rgba(90, 174, 255, 0.12); }
.rank-C, .tier-epic { color: #c084ff; background: rgba(192, 132, 255, 0.14); }
.rank-B { color: #ff6b7a; background: rgba(255, 107, 122, 0.14); }
.rank-A { color: #ff9a3d; background: rgba(255, 154, 61, 0.14); }
.gold-anim { color: #1a1100; border-color: #000; background: linear-gradient(110deg, #ffc21a 0%, #fff3a3 25%, #ffd24d 50%, #fff3a3 75%, #ffc21a 100%); background-size: 220% 100%; box-shadow: 0 0 8px rgba(255, 210, 77, 0.75); text-shadow: 0 0 1px rgba(255, 255, 255, 0.4); animation: gold-shine 2.6s linear infinite; }
.gold-anim::after { content: ""; position: absolute; top: 0; bottom: 0; left: -45%; width: 35%; background: linear-gradient(100deg, transparent, rgba(0, 0, 0, 0.6), transparent); animation: black-sweep 2.1s ease-in-out infinite; }
@keyframes gold-shine { to { background-position: -220% 0; } }
@keyframes black-sweep { 0% { left: -45%; } 60%, 100% { left: 125%; } }
#top-rank { margin-left: 4px; }
/* COINS in the colour of their metal */
.coin { font-weight: 800; }
.coin-gold { color: #ffd24d; }
.coin-silver { color: #d5dbe8; }
.coin-bronze { color: #e0914a; }
/* the "i" that opens what a word means, and the things of the bag */
.info-btn { width: 16px; height: 16px; margin-left: 6px; padding: 0; border: 1px solid var(--muted); border-radius: 50%; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; line-height: 14px; cursor: pointer; vertical-align: middle; }
.stat-hint, .bag-note { margin-top: 6px; font-size: 12px; font-weight: 400; color: #d8d1ee; text-transform: none; letter-spacing: 0; }
.bag-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.bag-name { font-weight: 800; }
.bag-count { font-weight: 800; color: var(--muted); }
.bag-i { margin-left: auto; width: 16px; height: 16px; border: 1px solid var(--muted); border-radius: 50%; color: var(--muted); font-size: 10px; text-align: center; line-height: 14px; }
.bag-item.has-note { cursor: pointer; }
/* the countdown of a raid: an hourglass, the time big on its own line, a bar that empties */
.raid-timer { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: rgba(39, 29, 68, 0.6); border: 1px solid var(--line); }
.hourglass { flex: 0 0 auto; width: 26px; height: 34px; overflow: visible; }
.hg-glass { fill: rgba(255, 255, 255, 0.07); stroke: var(--gold); stroke-width: 1; stroke-linejoin: round; }
.hg-cap { stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.hg-sand { fill: var(--gold); }
.hg-stream { stroke: var(--gold); stroke-width: 1.2; stroke-dasharray: 1.5 1.5; animation: hg-fall 0.45s linear infinite; }
@keyframes hg-fall { to { stroke-dashoffset: -3; } }
.raid-timer-body { flex: 1; min-width: 0; }
.raid-timer-label { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.raid-timer-time { font-size: 24px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.raid-timer-bar { height: 5px; margin-top: 3px; border-radius: 99px; background: #0c0818; overflow: hidden; }
.raid-timer-bar > div { height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold), #ff9a3d); transition: width 0.5s linear; }
.raid-timer.is-urgent { border-color: var(--red); animation: warn-pulse 1s ease-in-out infinite; }
.raid-timer.is-urgent .raid-timer-time { color: #ff7a7e; }
.raid-timer.is-urgent .hourglass { animation: hg-shake 0.5s ease-in-out infinite; }
@keyframes hg-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.job-tier { color: var(--gold); }
.choice { position: fixed; inset: 0; z-index: 65; display: flex; align-items: center; justify-content: center; padding: 12px; }
.choice-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); }
.choice-card { position: relative; width: 100%; max-width: 520px; max-height: 88%; display: flex; flex-direction: column; background: var(--panel); border: 2px solid var(--gold); border-radius: 20px; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.7); animation: rise 0.22s ease-out; }
.choice-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.choice-head h3 { flex: 1; margin: 0; font-size: 16px; color: var(--text); text-transform: none; letter-spacing: 0.02em; }
.choice-icon { font-size: 24px; }
.choice-body { overflow-y: auto; padding: 12px 14px 16px; scrollbar-width: none; display: flex; flex-direction: column; gap: 10px; }
.choice-body::-webkit-scrollbar { display: none; }
.choice-intro { font-size: 15px; line-height: 1.45; }
.choice-time { font-size: 12px; color: var(--muted); }
.choice-answer { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 12px; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(180deg, rgba(39, 29, 68, 0.95), rgba(28, 21, 48, 0.95)); color: var(--text); font: inherit; cursor: pointer; }
.choice-answer:disabled { opacity: 0.5; cursor: not-allowed; }
.choice-answer:active:not(:disabled) { border-color: var(--gold); }
.choice-letter { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; background: var(--gold); color: #1b1330; }
.choice-result { padding: 10px 12px; border-radius: 12px; background: rgba(255, 210, 77, 0.14); border: 1px solid var(--gold); font-size: 15px; line-height: 1.45; }
.choice-result.is-bad { background: rgba(255, 77, 77, 0.14); border-color: var(--red); }
.choice-tabs { display: flex; gap: 6px; }
/* THE BOON CARDS (deliver 321): the rarity is the colour of the frame and of its glow */
.boon-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.boon-grid.is-pick { grid-template-columns: minmax(0, 1fr); }
.boon-card { --rc: #aeb4c2; --rgb: 174, 180, 194; position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 13px; min-width: 0; border-radius: 16px; border: 1.5px solid var(--rc); background: linear-gradient(180deg, rgba(var(--rgb), 0.14), rgba(20, 14, 36, 0.94) 65%); box-shadow: 0 0 14px rgba(var(--rgb), 0.3), inset 0 0 22px rgba(var(--rgb), 0.12); overflow: hidden; }
.boon-card::before { content: ""; position: absolute; left: -20%; right: -20%; top: -45%; height: 90%; background: radial-gradient(closest-side, rgba(var(--rgb), 0.3), transparent); pointer-events: none; }
.boon-card.bt-uncommon { --rc: #5ee07f; --rgb: 94, 224, 127; }
.boon-card.bt-rare { --rc: #5aaeff; --rgb: 90, 174, 255; }
.boon-card.bt-epic { --rc: #c084ff; --rgb: 192, 132, 255; }
.boon-card.bt-legendary { --rc: #ffc83d; --rgb: 255, 200, 61; }
.boon-card.bt-stack { --rc: #7dd3fc; --rgb: 125, 211, 252; }
.boon-card.is-curse { --rc: #ff5a5f; --rgb: 255, 90, 95; }
.boon-card.bt-legendary::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 235, 170, 0.28), transparent); animation: boon-shine 3.6s ease-in-out infinite; pointer-events: none; }
@keyframes boon-shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.boon-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.boon-rar { font-size: 10px; font-weight: 800; letter-spacing: 0.12em; color: var(--rc); }
.boon-count { padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 900; background: var(--rc); color: #120d1f; }
.boon-name { position: relative; font-weight: 800; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.boon-tag { position: relative; align-self: flex-start; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--rc); font-size: 10px; font-weight: 800; color: var(--rc); }
.boon-fx { position: relative; font-size: 13px; line-height: 1.35; color: #d8d1ee; }
.boon-card.is-big { padding: 14px; gap: 8px; }
.boon-card.is-big .boon-name { font-size: 19px; }
.boon-card.is-big .boon-fx { font-size: 14px; }
.boon-pick { position: relative; margin-top: 4px; }
@media (min-width: 900px) { .boon-grid:not(.is-pick) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* THE CHIPS AND THE SORT of My boons (deliver 323): the Collection's habit */
.boon-tools { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 8px; }
.boon-filters { padding-bottom: 0; }

/* ---------- the achievements window ---------- */
.ach-total { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 10px; }
.ach-total-label { font-size: 13px; color: var(--muted); margin-right: 4px; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.ach-card { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(39, 29, 68, 0.95), rgba(28, 21, 48, 0.95)); }
.ach-head { display: flex; align-items: center; gap: 8px; }
.ach-icon { font-size: 22px; }
.ach-name { font-size: 15px; font-weight: 800; color: var(--gold); }
.ach-progress { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.ach-what { font-size: 12px; color: var(--muted); }
.ach-bonus { display: flex; flex-wrap: wrap; gap: 6px; }
.ach-chip { padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 800; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); }
.ach-chip.ach-hp { color: #7be08a; border-color: #7be08a66; }
.ach-chip.ach-atk { color: #ff8a7a; border-color: #ff8a7a66; }
.ach-chip.ach-def { color: #7ab8ff; border-color: #7ab8ff66; }
.ach-next { font-size: 12px; color: var(--gold); }

/* ---------- the leaderboards window ---------- */
.lb-chips { margin-bottom: 8px; }
.lb-title { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 8px; }
.lb-name { font-size: 18px; font-weight: 800; color: var(--gold); }
.lb-label { font-size: 13px; color: var(--muted); }
.lb-crown { font-size: 13px; line-height: 1.4; padding: 8px 10px; margin-bottom: 8px; border-radius: 12px; border: 1px solid #ff3b5c66; background: rgba(255, 59, 92, 0.08); }
.lb-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-bottom: 1px solid var(--line); }
.lb-rank { flex: 0 0 44px; font-weight: 800; color: var(--muted); font-size: 15px; }
.lb-player { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.lb-value { flex: 0 0 auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.lb-first .lb-player { color: var(--gold); }
.lb-you { background: rgba(255, 210, 77, 0.12); border-radius: 10px; }
.lb-gap { text-align: center; color: var(--muted); padding: 2px 0; }
.lb-foot { margin-top: 10px; font-size: 12px; color: var(--muted); text-align: center; }
.boon-filters .col-tab { flex: 1 1 auto; padding: 0 9px; }
.boon-filters .col-tab.t-stack { color: #7dd3fc; font-size: 12px; }
.boon-filters .col-tab.t-curse { color: #ff5a5f; font-size: 12px; }
.boon-filters .col-tab:disabled { opacity: 0.32; cursor: default; }
.boon-sort .seg-btn { font-size: 12px; padding: 0 6px; }
.boon-showing { margin: 0 0 8px; }
/* THE RELIC AND ANCIENT RELIC COLLECTION (deliver 326): the boon cards again, greyed when you have not found it, a "owned" pill, the supply line, your numbers */
.boon-card.is-missing { opacity: 0.62; filter: grayscale(0.6); box-shadow: none; }
.boon-card.bt-mythic { --rc: #ff3b5c; --rgb: 255, 59, 92; }
.relic-card.has-numbers { cursor: pointer; }
.relic-own { padding: 1px 9px; border-radius: 99px; font-size: 11px; font-weight: 900; background: var(--rc); color: #120d1f; white-space: nowrap; }
.relic-status { position: relative; font-size: 12px; line-height: 1.35; color: var(--muted); }
.relic-status.is-source { color: #c9bfe8; }
.relic-serials { position: relative; display: flex; flex-wrap: wrap; gap: 6px; }
.relic-serials[hidden] { display: none; }
.relic-serial { padding: 2px 10px; border-radius: 99px; border: 1px solid var(--rc); font-size: 13px; font-weight: 800; color: var(--rc); font-variant-numeric: tabular-nums; }
.col-tab.t-mythic { color: #ff3b5c; }
.relic-section { margin: 14px 0 8px; font-size: 13px; font-weight: 800; color: #ff9aae; }
.choice-card-item { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(39, 29, 68, 0.6); }
.choice-card-item .rar { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.choice-card-item .nm { font-weight: 800; font-size: 16px; }
.choice-card-item .fx { font-size: 14px; color: #d8d1ee; }
/* the stranger waits only so long and a roll walks away from him: his window does not block the screen (the Roll button works under it) and has no "later" */
.choice.is-stranger { pointer-events: none; align-items: flex-start; padding-top: 14vh; }
.choice.is-stranger .choice-backdrop { display: none; }
.choice.is-stranger .choice-card { pointer-events: auto; }
.use-btn.is-danger { background: linear-gradient(180deg, #d9534f, #a32b27); }
.use-btn.is-danger:disabled { background: linear-gradient(180deg, #4a4560, #36314a); }
.wide-btn { width: 100%; margin-top: 10px; }
.town-quest { display: flex; flex-direction: column; gap: 4px; }
.town-name { font-weight: 800; }
.town-goal { font-size: 13px; color: #d8d1ee; }
.town-reward { font-size: 12px; color: var(--gold); }
.town-buttons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.town-buy { align-items: center; margin-top: 0; }
.town-step { min-width: 40px; padding: 0; font-size: 20px; line-height: 1; }
.town-qty { min-width: 22px; text-align: center; font-weight: 800; }
.town-why { color: #ff9b94; }
.town-picks { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 2px; }
.town-pick-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.town-pick-rarity { min-width: 74px; font-weight: 800; font-size: 13px; }
.town-pick { flex: 1 1 160px; min-width: 0; min-height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; padding: 0 8px; }
.town-missing { font-size: 12px; color: #ff9b9b; }
.item .tag.is-extra { background: var(--gold); }
.town-chip { top: calc(94px + var(--safe-t)); }
.swatch { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.5); }

/* the heroes that are near: small tokens, the names under them */
.others { position: absolute; inset: 0; pointer-events: none; }
.other-wrap { position: absolute; z-index: 4; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; transition: left 1.2s ease, top 1.2s ease; opacity: 0.92; }
.other-name { margin-top: 2px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px #000, 0 0 4px #000; }
#cam.no-motion .other-wrap { transition: none; }

/* what you are facing */
.raid-stats { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #d8d1ee; }
.raid-stat-row { display: flex; gap: 6px; }
.raid-stat { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 10px; background: rgba(39, 29, 68, 0.6); border: 1px solid var(--line); }
.raid-stat-label { font-size: 9px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-align: center; }
.raid-stat-value { font-size: 17px; color: var(--text); }
.raid-row { display: flex; align-items: baseline; gap: 8px; }
.raid-k { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); min-width: 92px; }
.raid-value b { font-size: 15px; color: var(--gold); }
.raid-rewards span:last-child { font-weight: 700; }
.raid-rewards span:last-child:not([class]) { color: #8be3a4; }
.raid-skill { color: var(--muted); }

.choice-chip { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); top: calc(54px + var(--safe-t)); height: 34px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--gold); background: var(--glass); color: var(--gold); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; backdrop-filter: blur(6px); animation: warn-pulse 1.8s ease-in-out infinite; }

/* ---------- A PHONE: less on the screen, more room between the things ---------- */
@media (max-width: 899px) {
    .hud-topleft { top: 12px; left: 12px; gap: 8px; }
    .hud-topright { top: 12px; right: 12px; gap: 10px; }
    .hud-left { left: 14px; bottom: 14px; gap: 10px; width: min(56vw, 220px); }

    /* the clock: one short line (the weather is seen on the screen: no words for it); where you are: just the tile */
    #daylight-clock { flex-wrap: nowrap; padding: 5px 10px; font-size: 12px; max-width: none; }
    #daylight-clock .daylight-weather, #daylight-clock .daylight-phase { display: none; }
    .tile-chip { padding: 3px 10px; font-size: 11px; }

    /* the buttons of the map: music is a round icon, the rest are behind one round button */
    #boons-button, #jobs-button, #shop-button, #hud-tutorial { display: inline-flex; justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 18px; }
    #boons-button .hud-label, #jobs-button .hud-label, #shop-button .hud-label, #hud-tutorial .hud-label { display: none; }
    #music-button, .hud-menu-toggle { display: inline-flex; justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 18px; }
    #music-button .hud-label { display: none; }
    .hud-menu { display: none; flex-direction: column; align-items: flex-end; gap: 8px; }
    .hud-menu.is-open { display: flex; }
    body.raid-open .hud-topleft, body.raid-open .hud-topright { top: calc(var(--raid-h, 0px) + 22px); }

    /* the Roll column: smaller */
    .roll-button { width: 80px; height: 80px; }
    .roll-button .roll-die { font-size: 30px; }
    .roll-button .roll-text { font-size: 12px; }
    .dice-stage { height: 62px; }
    .die { width: 50px; height: 50px; padding: 6px; border-radius: 12px; }
    .die .pip { width: 9px; height: 9px; }
    .die .face-number { font-size: 22px; }
    .roll-result { padding: 7px 10px; }
    .roll-result .rr-title { font-size: 15px; }
    .roll-result .rr-line { font-size: 12px; }

    /* the raid card: a slim card (the hero and the map stay in view) */
    /* the card stops ABOVE the Roll button of the bottom left (it lies on top of the map: z-index 28), so that the Roll column never covers Defend / Potion (deliver 320) */
    .raid { left: 12px; right: 12px; top: 10px; gap: 5px; padding: 7px 9px; border-radius: 14px; max-height: calc(100% - 20px - 112px); }
    .raid-foot { bottom: -7px; }
    .raid-foot:has(> :not([hidden])) { margin: 0 -9px -7px; padding: 7px 9px; }
    .raid-head { gap: 8px; }
    .raid-pic { width: 36px; height: 36px; border-radius: 10px; }
    .raid-name { font-size: 14px; }
    .raid-sub { font-size: 10px; }
    .raid-hp { height: 24px; }
    .raid-hp-text { font-size: 13px; }
    .raid-mode { padding: 4px 8px; font-size: 12px; }
    .raid-meta { font-size: 12px; }
    .raid-you { font-size: 14px; }
    .raid-warn { padding: 4px 8px; font-size: 12px; }
    .raid-log { min-height: 84px; max-height: 120px; font-size: 12px; }
    .raid-banner { padding: 4px 8px; font-size: 13px; }
    .raid-action-btn { min-height: 34px; padding: 5px 10px; font-size: 13px; }
    .raid-timer { padding: 4px 8px; gap: 8px; }
    .hourglass { width: 20px; height: 27px; }
    .raid-timer-time { font-size: 20px; }
    .raid-stats { gap: 3px; font-size: 11px; }
    .raid-stat-row { gap: 4px; }
    .raid-stat { padding: 3px 2px; border-radius: 8px; }
    .raid-stat-label { font-size: 8px; }
    .raid-stat-value { font-size: 14px; }
    .raid-k { min-width: 74px; font-size: 9px; }
    .raid-value b { font-size: 13px; }
    .raid-action-result { padding: 4px 8px; font-size: 11px; }

    /* the stream card: smaller, and out of the way of the Roll column */
    .stream { width: 124px; right: 10px; }
}

@media (min-width: 900px) {
    /* a computer: the raid has the right side (the hero is moved to the left of it); the stream card has the bottom right */
    .raid { left: auto; width: 320px; right: 10px; top: 10px; max-height: calc(100% - 210px); }
    .raid-log { flex: 1 0 auto; min-height: 150px; max-height: 260px; font-size: 13px; }
    body.raid-open .hud-topleft { top: 10px; }
    body.raid-open .hud-topright { top: 10px; right: 344px; }
    .stream { width: 260px; }
    .panel-screen { padding-left: 24px; padding-right: 24px; }
    .roll-button { width: 110px; height: 110px; }
    .hud-left { width: 280px; }
    .stat-grid { grid-template-columns: repeat(4, 1fr); }
    #hero-buttons.button-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* SHINY heroes: a soft gold pulse round the token (the moving line is drawn by playerShapes.js) */
.player.is-shiny:not(.shaped) { animation: shiny-dot-glow 1.8s ease-in-out infinite; }
.player.is-shiny .player-shape { animation: shiny-shape-glow 1.8s ease-in-out infinite; }
@keyframes shiny-dot-glow { 0%, 100% { box-shadow: 0 0 2px 0 rgba(255, 216, 74, 0.5); } 50% { box-shadow: 0 0 7px 2px rgba(255, 216, 74, 0.95); } }
@keyframes shiny-shape-glow { 0%, 100% { filter: drop-shadow(0 0 1px rgba(255, 216, 74, 0.5)); } 50% { filter: drop-shadow(0 0 5px rgba(255, 216, 74, 1)); } }
@media (prefers-reduced-motion: reduce) { .player.is-shiny:not(.shaped), .player.is-shiny .player-shape { animation: none; } }

/* A SHORT PHONE (360 x 640 and the like) with the raid card OPEN: the card cannot push the buttons off the screen. The buttons go in a row under the card, the clock and the tile step aside,
   and the card scrolls inside itself, so it ends above the Roll column. (Rolled up, the card is small and nothing needs to move.) */
@media (max-width: 899px) and (max-height: 760px) {
    body.raid-open:not(.raid-rolled) .hud-topright { left: 12px; right: 12px; flex-direction: row; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
    body.raid-open:not(.raid-rolled) .hud-topleft { display: none; }
    body.raid-open:not(.raid-rolled) .raid { max-height: max(220px, calc(100dvh - 330px)); overflow-y: auto; scrollbar-width: none; }
    body.raid-open:not(.raid-rolled) .raid::-webkit-scrollbar { display: none; }
}

/* A WINDOW NEVER COVERS THE BUTTONS OF THE RAID CARD (deliver 345, from the video of a phone: Defend could not be pressed while a window - a stranger, a chest, the boons, the town - was open; when it was closed it worked).
   While the raid card is on the screen a window opens BELOW it, without a dark cover over it (the card has rolled up by itself: the head and the Defend / Potion buttons stay on the top, pressable). */
@media (max-width: 899px) {
    body.raid-open .choice { pointer-events: none; align-items: flex-end; padding-top: calc(var(--raid-h, 0px) + 20px + var(--safe-t)); padding-bottom: calc(var(--nav-h) + var(--safe-b) + 8px); }
    body.raid-open .choice-backdrop { display: none; }
    body.raid-open .choice-card { pointer-events: auto; max-height: 100%; }
}

/* THE TOWN BUTTON belongs to the map screen like the stream pill: on the other tabs it sat over the Hero cards (video of a phone) */
body:not(.on-play) .town-chip { display: none; }

/* THE STREAM PILL belongs to the map screen: on the other tabs it sat over the right edge of the lists. THE TOWN CHIP never sits over the raid card: while the card is open it is not shown
   (a raid is not the moment to go to town), rolled up it goes under the card. */
body:not(.on-play) .stream-pill { display: none; }
@media (max-width: 899px) {
    body.raid-open:not(.raid-rolled) .town-chip { display: none; }
    body.raid-open.raid-rolled .town-chip { top: calc(94px + var(--safe-t) + var(--raid-h, 0px)); }
}

/* A PHONE ON ITS SIDE (deliver 333): wide but SHORT (640 x 360, 740 x 360, 915 x 412 ...). The rules above leave the raid card 100dvh - 330px (30 px on a 360 px phone) or 100% - 210px: the card was a sliver and Defend / Potion
   a few pixels high. Now the card is a COLUMN on the right over the whole height (the buttons stay sticky at its bottom), the buttons of the map stay on the left, and the buttons are big enough for a finger. */
@media (orientation: landscape) and (max-height: 540px) and (max-width: 1100px) {
    .raid { left: auto; right: max(8px, env(safe-area-inset-right, 0px)); width: min(50vw, 380px); top: 8px; max-height: calc(100% - 16px); }
    body.raid-open:not(.raid-rolled) .raid { max-height: calc(100% - 16px); }
    .raid-log { min-height: 60px; max-height: 110px; }
    body.raid-open .hud-topleft { top: 8px; }
    body.raid-open:not(.raid-rolled) .hud-topleft { display: flex; }
    body.raid-open .hud-topright, body.raid-open:not(.raid-rolled) .hud-topright { top: 8px; left: auto; right: calc(min(50vw, 380px) + max(8px, env(safe-area-inset-right, 0px)) + 8px); flex-direction: column; flex-wrap: wrap-reverse; align-content: flex-start; align-items: flex-end; justify-content: flex-start; max-height: calc(100% - 16px); }
    body.raid-open:not(.raid-rolled) .town-chip { display: none; }
    body.raid-open .choice-chip { left: 8px; transform: none; top: auto; bottom: calc(var(--nav-h) + var(--safe-b) + 106px); }
    /* (deliver 345) a window stays left of the raid column: Defend / Potion are never under it */
    body.raid-open .choice { align-items: center; justify-content: flex-start; padding-top: 12px; padding-bottom: 12px; padding-right: calc(min(50vw, 380px) + 16px); }
}

/* a finger is about 44 px: on a touch screen the raid buttons are never smaller */
@media (pointer: coarse) {
    .raid-action-btn { min-height: 44px; }
}

/* THE EFFECT LAYER OF A MONSTER (the cracked glass of the World Devourer, the fog, the burning edges, the frost) covers the map and stays UNDER the raid card and the buttons: the card is always easy to read.
   (The game puts its layer very high by itself (9990); this rule puts it between the map (0) and the buttons (25) and the card (26).) */
#unique-ambient { z-index: 10 !important; }

/* ---------- 300: THE MARKET SQUARE REMADE: a fantasy shop (awning, bunting, wooden signs, stalls on shelves), the Pass & Gems shelf ---------- */

.choice.is-market .choice-head { background: linear-gradient(180deg, #8a5a2b 0%, #6b4220 100%); border-radius: 14px 14px 0 0; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25), inset 0 2px 0 rgba(255, 220, 150, 0.35); }
.market-banner, .market-tabs, .market-stage, .decree-card, .gem-shelf, .shop-grid { flex-shrink: 0; }
.market-banner { position: relative; height: 44px; margin: 0; }
.market-awning { display: flex; height: 38px; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.4)); }
.market-stripe { flex: 1 1 0; min-width: 0; height: 100%; background: #d7263d; border-radius: 0 0 50% 50% / 0 0 14px 14px; box-shadow: inset 0 6px 6px rgba(0, 0, 0, 0.18); }
.market-stripe.is-cream { background: #fff4d6; }
.market-stripe:first-child { border-top-left-radius: 8px; }
.market-stripe:last-child { border-top-right-radius: 8px; }
.market-welcome { text-align: center; }
.market-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.market-tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px; border: 1px solid #5a3c1c; border-radius: 4px 4px 10px 10px; background: linear-gradient(180deg, #7a4f26 0%, #5c3a1a 100%); color: #f2d98a; font: inherit; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.3), 0 3px 0 #3d2610; }
.market-tab::before { content: ""; position: absolute; top: -7px; left: 50%; width: 2px; height: 7px; background: #3d2610; }
.market-tab-icon { font-size: 20px; line-height: 1; }
.market-tab-name { font-size: 11px; font-weight: 800; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.market-tab.is-on { background: linear-gradient(180deg, #f6d878 0%, #d9a52b 100%); color: #3a2208; border-color: #fff0b0; transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 1px 0 #3d2610, 0 0 14px rgba(255, 216, 100, 0.55); }
.market-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 12px 12px; text-align: center; border: 1px solid rgba(201, 162, 39, 0.55); border-radius: 16px; background: radial-gradient(ellipse at 50% 18%, rgba(255, 230, 150, 0.32), transparent 62%), linear-gradient(180deg, rgba(90, 60, 28, 0.6), rgba(45, 30, 14, 0.7)); overflow: hidden; }
.market-stage::before, .market-stage::after { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #fff6c8; box-shadow: 0 0 6px 2px rgba(255, 230, 150, 0.8); animation: market-twinkle 2.2s ease-in-out infinite; }
.market-stage::before { top: 16px; left: 18%; }
.market-stage::after { top: 34px; right: 16%; animation-delay: 1.1s; }
@keyframes market-twinkle { 0%, 100% { opacity: 0.15; transform: scale(0.6); } 50% { opacity: 1; transform: scale(1.2); } }
.market-podium { display: flex; align-items: flex-end; justify-content: center; width: 120px; padding-bottom: 10px; background: radial-gradient(ellipse at 50% 100%, #c9a227 0 38%, #8a5a2b 39% 58%, transparent 60%) 50% 100% / 100% 16px no-repeat; }
.market-podium .shop-avatar.is-big { width: 84px; height: 84px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45)); animation: market-bob 2.6s ease-in-out infinite; }
@keyframes market-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.market-ribbon { padding: 3px 18px; font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; font-size: 18px; font-weight: 800; letter-spacing: 0.04em; color: #3a2208; background: linear-gradient(180deg, #f6d878, #d9a52b); clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 50%, 100% 100%, 0 100%, 10px 50%); }
.market-price, .market-owned { padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; }
.market-price { color: #3a2208; background: #ffe49a; border: 2px dashed #c9a227; }
.market-owned { color: #bff5cf; background: rgba(46, 204, 113, 0.18); border: 1px solid rgba(46, 204, 113, 0.5); }
.shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 8px; padding-bottom: 6px; }
.shop-card { position: relative; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; padding: 8px 4px 6px; text-align: center; background: rgba(60, 42, 20, 0.45); }
.shop-card::after { content: ""; position: absolute; left: -4px; right: -4px; bottom: -10px; height: 8px; border-radius: 2px; background: linear-gradient(180deg, #a06a32, #6b4220); box-shadow: 0 3px 3px rgba(0, 0, 0, 0.4); pointer-events: none; }
.shop-card .shop-avatar { width: 44px; height: 44px; }
.shop-card-name { font-size: 12px; flex: 0 0 auto; }
.shop-card .tag { font-size: 10px; }
.choice.is-market .shop-card.is-selected { transform: translateY(-3px); border-color: #fff0b0; box-shadow: 0 0 14px rgba(255, 224, 130, 0.6); }
.decree-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 14px 14px; text-align: center; border: 2px solid #f2d98a; border-radius: 18px; background: radial-gradient(ellipse at 50% 0%, rgba(255, 220, 120, 0.4), transparent 65%), linear-gradient(180deg, #4a2a6a 0%, #2a1740 100%); box-shadow: 0 0 22px rgba(201, 162, 39, 0.45), inset 0 0 0 3px rgba(242, 217, 138, 0.18); }
.decree-crown { font-size: 40px; line-height: 1; filter: drop-shadow(0 0 10px rgba(255, 216, 100, 0.9)); animation: market-bob 2.6s ease-in-out infinite; }
.decree-title { font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; font-size: 24px; font-weight: 800; letter-spacing: 0.06em; color: #ffe49a; text-transform: uppercase; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
.decree-sub { font-size: 13px; color: #e8dcf5; font-style: italic; }
.decree-list { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 5px; text-align: left; width: 100%; }
.decree-list li { position: relative; padding-left: 26px; font-size: 13px; color: #f4ecff; line-height: 1.3; }
.decree-list li::before { content: "✦"; position: absolute; left: 4px; top: 0; color: #ffd84a; text-shadow: 0 0 6px rgba(255, 216, 74, 0.8); }
.decree-price, .decree-status { padding: 4px 14px; border-radius: 999px; font-size: 14px; font-weight: 800; }
.decree-price { color: #3a2208; background: #ffe49a; border: 2px dashed #c9a227; }
.decree-status { color: #3a2208; background: linear-gradient(180deg, #f6d878, #d9a52b); }
.decree-buy { width: 100%; }
.amethyst-card { margin-top: 2px; }
.amethyst-card.is-legendary { border-color: #ffc83d; box-shadow: 0 0 22px rgba(255, 200, 61, 0.45), inset 0 0 0 2px rgba(255, 200, 61, 0.18); }
.tier-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 2px; }
.market-wallet { align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 999px; font-size: 14px; color: #e6f5ff; background: linear-gradient(180deg, rgba(60, 120, 190, 0.5), rgba(25, 60, 110, 0.6)); border: 1px solid rgba(140, 210, 255, 0.55); box-shadow: 0 0 12px rgba(120, 200, 255, 0.3); }
.market-wallet b { font-size: 16px; color: #ffffff; }
.gem-balance { text-align: center; font-weight: 800; font-size: 15px; color: #ffffff; }
.gem-shelf { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid rgba(120, 200, 255, 0.45); border-radius: 16px; background: radial-gradient(ellipse at 50% 0%, rgba(120, 200, 255, 0.2), transparent 70%), rgba(20, 32, 56, 0.6); }
.gem-head { font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; font-size: 17px; font-weight: 800; color: #bfe6ff; letter-spacing: 0.05em; text-transform: uppercase; text-align: center; }
.gem-packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.gem-pack { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border: 1px dashed rgba(120, 200, 255, 0.5); border-radius: 12px; background: rgba(120, 200, 255, 0.08); opacity: 0.85; }
.gem-icon { font-size: 18px; line-height: 1.1; filter: drop-shadow(0 0 6px rgba(120, 200, 255, 0.8)); }
.gem-name { font-size: 13px; font-weight: 800; color: #e6f5ff; }
.gem-soon { font-size: 11px; color: #9fc4de; }
@media (prefers-reduced-motion: reduce) { .market-stage::before, .market-stage::after, .market-podium .shop-avatar.is-big, .decree-crown { animation: none; } }

/* ---------- THE AUCTION HOUSE (deliver 335): its own window, the gavel button of the Hero tab ---------- */
.auc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; margin-bottom: 8px; }
.auc-crowns { font-weight: 800; color: var(--gold); font-size: 17px; }
.auc-tabs { margin-bottom: 8px; }
.auc-msg { margin: 6px 0 8px; padding: 7px 10px; border-radius: 10px; background: rgba(242, 193, 78, 0.14); border: 1px solid var(--gold); font-size: 13px; font-weight: 700; }
.auc-chips { margin-bottom: 6px; }
.auc-tools { display: flex; gap: 6px; margin: 4px 0 8px; }
.auc-tools .auc-search { flex: 1 1 auto; min-width: 0; }
.auc-input { min-height: 34px; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: #0c0818; color: var(--text, #fff); font: inherit; font-size: 13px; min-width: 0; }
.auc-list { display: flex; flex-direction: column; gap: 8px; }
.auc-row { display: flex; flex-direction: column; gap: 4px; text-align: left; width: 100%; }
button.auc-pick { cursor: pointer; font: inherit; color: inherit; }
.auc-thing { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.auc-name { font-weight: 800; font-size: 15px; }
.auc-price { font-weight: 800; }
.auc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.auc-actions .auc-input { width: 84px; }
/* THE BUTTONS OF THE AUCTION HOUSE ARE PETITE (deliver 336): a small gold pill, never a full-width bar (a touch screen keeps a 40 px target) */
.big-btn.auc-go { flex: 0 0 auto; width: auto; min-height: 34px; padding: 5px 16px; border-radius: 99px; border: 0; font-size: 13px; font-weight: 800; letter-spacing: 0.02em; color: #1b1230; background: linear-gradient(180deg, #ffd978, #d9a23a); box-shadow: 0 2px 8px rgba(242, 193, 78, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.55); cursor: pointer; }
.big-btn.auc-go:hover { filter: brightness(1.06); }
.big-btn.auc-go:active { transform: translateY(1px); }
.auc-actions { justify-content: flex-start; }
.auc-actions .mini-btn { min-height: 30px; padding: 3px 12px; border-radius: 99px; font-size: 12px; }
.auc-tabs .seg-btn, .auc-chips .seg-btn { min-height: 30px; padding: 4px 12px; font-size: 12px; border-radius: 99px; }
.auc-tabs { gap: 5px; }
.auc-row { padding: 9px 11px; }
.auc-label { margin: 6px 0; font-size: 12px; }
.auc-label .auc-input { width: 140px; }
@media (pointer: coarse) { .big-btn.auc-go { min-height: 40px; } .auc-input { min-height: 40px; } }
.auc-label { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; font-size: 13px; font-weight: 700; }
.auc-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.auc-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin: 6px 0; }
.auc-tile { padding: 6px 2px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); text-align: center; }
.auc-tile-label { font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.auc-tile-value { font-size: 14px; font-weight: 800; }
.auc-chart { margin: 4px 0 8px; }
.auc-svg { display: block; width: 100%; height: 80px; border-radius: 10px; background: rgba(0, 0, 0, 0.25); }
.auc-line { fill: none; stroke: var(--gold); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

/* ---------- THE TURN WINDOW OF THE RAID CARD (deliver 335): a fixed window with only the current turn (no history, nothing to scroll) ---------- */
.raid-turn { flex: 0 0 auto; padding: 9px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.32); border: 1px solid var(--line); font-size: 15px; line-height: 1.45; color: #cfc8e6; overflow: visible; max-height: none; min-height: 0; }
.raid-turn[hidden] { display: none; }
.raid-turn-row { padding: 3px 0; overflow-wrap: break-word; }
.raid-turn-row:first-child { font-weight: 800; }

/* THE DUEL WINDOW (turn by turn) and the Auto battle checkmark */
.duel-row { margin: 6px 0; }
.duel-name { font-size: 12px; font-weight: 800; margin-bottom: 2px; }
.duel-bar { position: relative; height: 22px; border-radius: 99px; background: #0c0818; border: 1px solid var(--line); overflow: hidden; }
.duel-fill { height: 100%; background: linear-gradient(90deg, #d93a40, #ff7a7e); transition: width 0.4s ease; }
.duel-fill.is-mine { background: linear-gradient(90deg, #2fbf71, #6df0a5); }
.duel-hp { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; text-shadow: 0 1px 2px #000; }
.duel-log { margin: 8px 0; font-size: 12px; line-height: 1.5; color: var(--muted, #b9b2d6); }
.duel-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.duel-btn { margin: 0; }
.auto-battle { display: flex; align-items: flex-start; gap: 6px; margin: 10px 0 4px; font-size: 12px; line-height: 1.4; color: var(--muted, #b9b2d6); }
.auto-battle input { margin-top: 2px; flex: 0 0 auto; }
