/* Phone ergonomics: 44pt touch targets, safe areas, the one-screen preparation layout, phase bars and sheet footers. */
button{min-width:44px;min-height:44px}
.secondary{min-height:44px}
.app{overflow:clip}
.eyebrow,.sheet-eyebrow,.arena-label,.feed-title{letter-spacing:.6px}
.icon-btn{width:44px;height:44px}
.icon-btn .icon{width:18px;height:18px}

/* Header: run status and level while preparing or fighting, a back button on other pages. */
.topbar{height:auto;min-height:52px;gap:6px;padding:max(4px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) 4px max(10px,env(safe-area-inset-left))}
.run-chip{display:flex;align-items:center;gap:5px;min-height:44px;padding:0 12px;border:1px solid #71865a44;border-radius:22px;background:#22312b66;color:#e5dfc8;font-size:15px}
.run-chip .icon{width:16px;height:16px}
.run-chip>.icon:first-child{color:#d69b8d}
.run-chip>.icon:nth-of-type(2){color:var(--gold);margin-left:6px}
.run-chip small{font-size:11px;color:#9ca98d}
.run-chip{display:grid;grid-template-columns:repeat(4,auto);align-content:center;justify-content:start;column-gap:4px;row-gap:1px;padding:2px 12px;line-height:1.1}
.run-chip .day{grid-column:1/-1;margin:0;font-size:11px;line-height:1;color:#a7b5a6}
.topbar .wallet{display:flex;align-items:center;gap:4px;min-height:44px;padding:0 9px;border:1px solid #bda26b44;border-radius:8px;background:#bda26b10;color:#ecd293;font-size:15px}
.topbar .wallet .icon{width:16px;height:16px}
.topbar .level-chip{margin-left:0;min-width:54px}
.topbar .xp-buy{flex:none;width:46px;min-width:46px;min-height:44px;padding:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;border:1px solid #61705866;border-radius:8px;background:#26372d55;font-size:11px;font-weight:700;color:#e3cc92}
.topbar .xp-buy small{display:flex;align-items:center;gap:2px;margin:0;font-size:11px;color:#e7c484}
.topbar .xp-buy .icon{width:10px;height:10px}
.run-chip.lethal{border-color:#d58f7c99;color:#f4a38d}
.run-chip:disabled,.level-chip:disabled{opacity:1;cursor:default}
.level-chip{margin-left:auto;display:flex;flex-direction:column;justify-content:center;gap:5px;min-height:44px;min-width:70px;padding:0 10px;border:1px solid #bda26b44;border-radius:8px;background:#bda26b10;color:#ecd293;font-size:12px}
.level-chip b{font-size:14px}
.xp-mini{display:block;height:3px;border-radius:2px;background:#95a68133;overflow:hidden}
.xp-mini i{display:block;height:100%;background:#d6bd80}
.back-btn{display:flex;align-items:center;gap:6px;padding:0 10px 0 4px;background:transparent;color:var(--gold);font-size:15px}
.back-btn .icon{width:20px;height:20px}

/* Screens with a bottom bar fill the viewport, so on tall phones the bar sits at the bottom and the scene takes the spare height. */
.app[data-screen="tower"],.app[data-screen="camp"]{display:flex;flex-direction:column}
.app[data-screen="tower"]>.prep{flex:1 0 auto}

/* One-screen preparation: tower, combos and reserve, shop, then the bar. Sized for a 375×553 Safari viewport. */
.prep{display:flex;flex-direction:column}
/* The scene is a size container: slots grow with its height (53–140px) and the tower's width follows, clear of the screen edges. */
.arena.prep-arena{flex:1 0 auto;display:flex;flex-direction:column;height:205px;padding-bottom:6px;border-block:0;container-type:size}
.prep .prep-arena .tower{--h:clamp(53px,calc((100cqh - 60px)/3),140px);width:clamp(236px,calc(var(--h)*3.4 + 28px),calc(100cqw - 60px));margin:auto auto 0;padding:18px 10px 8px;border-radius:64px 64px 0 0}
.prep .tower:before{top:9px;height:10px}
.prep .tower-flag{display:none}
.prep .tower-grid{gap:5px 8px}
.prep .slot{height:var(--h);border-radius:18px 18px 4px 4px;padding:1px}
.prep .slot .relic{width:clamp(34px,calc(var(--h)*.6),72px);height:clamp(34px,calc(var(--h)*.6),72px)}
.prep .slot-index{top:4px;left:7px}
.prep .slot-level{top:3px;right:6px}
.prep .slot-empty{font-size:clamp(20px,calc(var(--h)*.28),36px)}
.slot-name,.slot-level,.slot-index{font-size:11px}
.slot .merge-ready-mark{left:7px;top:2px;bottom:auto;font-size:15px;line-height:1}

.prep-row{display:flex;align-items:center;gap:8px;margin:4px 12px}
.prep-row .combo-strip{flex:1;margin:0;min-height:44px;padding:0 10px;gap:8px;font-size:12px;text-align:left}
.prep-row .combo-strip>.icon{width:18px;height:18px}
.combo-strip b{color:#f0dcaa;font-weight:700}
.reserve-count{flex:none;font-size:12px;color:#9eae97}
.prep-row .move-banner{flex:1;display:flex;align-items:center;justify-content:space-between;min-height:44px;padding:0 0 0 12px;border-radius:7px;font-size:12px}
.prep .reserve{margin:0 12px 6px}
.prep .reserve-grid{gap:5px}
.prep .reserve-slot{height:48px}
.prep .reserve-slot .relic{width:30px;height:30px}
.reserve-slot>span:not(.reserve-plus){font-size:11px}
.reserve-slot .merge-ready-mark{font-size:12px}
.slot.filled[data-side="0"],.reserve-slot.filled{touch-action:manipulation;-webkit-touch-callout:none}
.drag-pending{transform:scale(.97);transition:transform .28s ease-out}
.prep .run-end-banner{margin:0 12px 6px}

/* Market cards: the whole card buys, the corner button opens details, badges flag upgrades and new combos. */
.prep .market{padding:0 12px 6px}
.prep .market-grid{gap:6px}
.market .market-card,.market-card{padding:0;display:flex;min-height:0}
.market-buy{flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;background:transparent;padding:6px 4px;border-radius:7px;min-width:0;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.market-card .relic{width:34px;height:34px;margin:0 auto}
.market-card:before{height:44px}
.market-card strong{font-size:12px;line-height:1.2}
.market-card .item-type{font-size:11px;margin:0;color:var(--color);letter-spacing:0}
.market-card .item-type i{font-style:normal;color:var(--rarity)}
.copy-line{font-size:12px;color:#e2d0a5;white-space:nowrap}
.copy-line.is-ready{color:#cad69b}
.card-foot{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:18px}
.market-card .price{margin:0;font-size:12px}
.market-card.unaffordable .price{color:#ff6b52}
.combo-badge{font-size:12px;font-weight:700;line-height:1.4;color:#ffe2a3;padding:0 5px;border-radius:4px;background:#d8b77b26;border:1px solid #d8b77b66}
.upgrade-badge{top:4px;right:4px;font-size:11px}
.market-card.fresh{animation:offer-in .35s ease-out both}
.market-card.fresh:nth-child(2){animation-delay:.06s}
.market-card.fresh:nth-child(3){animation-delay:.12s}
@keyframes offer-in{from{opacity:0;transform:translateY(10px) scale(.95)}}
.market-card.sold{flex-direction:column;align-items:center;justify-content:center;gap:6px}
.market-card.sold .icon{margin:0}

/* Holding a shop card: where it lands and which tower slots it would link with. */
.slot.combo-preview{outline:2px dashed #ffe0a2;outline-offset:2px;box-shadow:0 0 18px #f4d28566}
.combo-gain{position:absolute;right:5px;bottom:4px;font-size:12px;font-weight:800;color:#ffe2a3;text-shadow:0 0 4px #000;pointer-events:none}
.slot.landing,.reserve-slot.landing{background-color:#83b4b433!important;border-color:#a8d0ce!important}
.slot.landing:not(.filled):after,.reserve-slot.landing:not(.filled):after{content:'сюда';position:absolute;inset:auto 0 4px;height:auto;border:0;background:none;font-size:11px;color:#c9eef0;text-align:center}

/* Bottom bars change with the phase: shop controls while preparing, speed and skip in battle. */
.dock-wrap{position:sticky;bottom:0;z-index:50;background:#152022f2;border-top:1px solid var(--line)}
.dock{display:flex;gap:6px;align-items:center;padding:6px 12px max(6px,env(safe-area-inset-bottom))}
.dock .wallet{flex:none;min-height:44px;padding:0 10px;font-size:15px}
.dock .refresh,.dock .freeze-btn,.dock .xp-buy{flex:none;width:48px;min-width:48px;min-height:46px;padding:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;border:1px solid #61705866;border-radius:8px;background:#26372d55;color:#d7dcc4}
.dock .refresh .icon,.dock .freeze-btn .icon{width:18px;height:18px}
.dock .refresh small,.dock .xp-buy small{display:flex;align-items:center;gap:2px;margin:0;font-size:11px;color:#e7c484}
.dock .xp-buy{font-size:11px;font-weight:700;color:#e3cc92}
.dock .xp-buy .icon{width:10px;height:10px}
.dock .freeze-btn.frozen{border-color:#96c6cc;background:#75aeb933;color:#c9eef0}
.dock .primary{flex:1;min-height:46px;min-width:0;padding:0 8px;font-size:14px}
.refresh.suggested{border-color:var(--gold)!important;color:var(--gold)!important;box-shadow:0 0 0 1px #d8b77b55,0 0 14px #d8b77b33;animation:suggest 1.6s ease-in-out infinite}
@keyframes suggest{50%{box-shadow:0 0 0 1px #d8b77b88,0 0 20px #d8b77b55}}
.battle-bar{position:sticky;bottom:0;z-index:50;display:flex;gap:8px;align-items:center;justify-content:flex-end;padding:6px 12px max(6px,env(safe-area-inset-bottom));background:#152022f2;border-top:1px solid var(--line)}
.battle-bar .icon-btn{margin-right:auto}
.speed{min-height:44px;min-width:56px;font-size:13px}
.battle-bar .skip{padding:0 18px}

/* Camp: the home screen with the rating, the run, the relic book, rules and sound. Its bar leads into the workshop; it fits 375×553 without scrolling. */
.brand{display:flex;align-items:center;min-height:44px;padding-left:4px;font:600 22px var(--serif);color:var(--cream)}
.camp-run h3{margin:-2px 0 8px;font:600 22px var(--serif)}
.camp-start{display:flex;align-items:center;gap:8px}
.camp-relic{flex:none;width:64px;display:flex;flex-direction:column;align-items:center;gap:2px;padding:6px 2px 4px;border:1px solid #61705866;border-radius:16px 16px 4px 4px;background:#22312b;box-shadow:inset 0 -2px 0 var(--color)}
.camp-relic .relic{width:34px;height:34px}
.camp-relic small{font-size:11px;color:#e5dfc8}
.danger{display:flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:0 16px;border:1px solid #c0705a99;border-radius:6px;background:#5a2d2588;color:#f1c4b4;font-size:13px;font-weight:700}
.history-row>b.loss{color:#e09a85}
.result-forecast{display:block;font-size:13px;line-height:1.4;color:#c9cdb8}
.result-forecast b{display:block;margin-top:2px;font-size:17px;color:var(--gold)}
.camp-goal .lethal{color:#f4a38d}
.camp-goal .lethal .icon{color:#f4a38d!important}
.camp-warning{margin:6px 0 0;font-size:12px;color:#f4a38d}
/* A won training run ends there: endless mode belongs to ranked runs. */
.endless-note{display:flex;align-items:center;gap:6px;margin:8px 0 0;font-size:12px;line-height:1.4;color:#d8c38f}.endless-note .icon{width:14px;height:14px;flex:none}
.ranked-limit p{line-height:1.5}
/* The pass (iOS app only): its sheet, with Apple's renewal terms, and the rating page's row. */
.pass-gives{list-style:none;margin:10px 0;padding:0;display:grid;gap:8px}
.pass-gives li{display:flex;gap:8px;align-items:center;font-size:14px;line-height:1.4}
.pass-gives .icon{width:18px;height:18px;flex:none;color:#d8b77b}
.pass-price{font-size:15px;margin:12px 0 6px}
.pass-wait{color:#c9cdb8}
.pass-terms{font-size:12px;line-height:1.45;color:#c9cdb8}
.pass-links{display:flex;flex-wrap:wrap;gap:0 16px;margin:4px 0 0}
.pass-links a{display:inline-flex;align-items:center;min-height:44px;font-size:13px;color:#d8b77b}
.pass-row{display:flex;align-items:center;gap:12px;margin:20px 0 0;padding:12px 14px;border:1px solid #d8b77b44;border-radius:8px;background:#d8b77b0f}
.pass-row>.icon{width:22px;height:22px;flex:none;color:#d8b77b}
.pass-row span{flex:1;display:grid;gap:2px}
.pass-row b{font-size:14px}
.pass-row small{font-size:12px;color:#c9cdb8}
.pass-row button{min-height:44px;padding:0 14px;font-size:13px;flex:none}
.pass-actions{display:grid;grid-template-columns:1fr;gap:8px}.pass-actions button{width:100%}.ranked-limit h2{padding-right:40px}
.camp-summary .loss{color:#e09a85}
.camp-run.victory h3{color:#f1d58a}
#app[data-screen="collection"] .topbar,#app[data-screen="rating"] .topbar{position:sticky;top:0;z-index:5;background:#101719f2}
.type-badge{position:absolute;top:5px;left:5px;z-index:1;display:grid;place-items:center;width:22px;height:22px;border-radius:50%;border:1px solid var(--rarity);background:#101b1ccc;color:var(--color);pointer-events:none}
.type-badge .icon{width:14px;height:14px}
.collection-card{position:relative;padding-left:22px;gap:7px}
.collection-card .type-badge{top:4px;left:4px;width:20px;height:20px}
.collection-card small{white-space:nowrap}
.collection-card .relic{flex:none}
.collection-card>div{min-width:0}
.stat-row{gap:6px}
.stat{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 6px}
.stat .icon{width:18px;height:18px;color:#d8c18a}
.stat b{display:inline;margin:0;font-size:17px}
.stat[data-stat="damage"] .icon{color:#f2a37c}.stat[data-stat="heal"] .icon{color:#a4c98b}.stat[data-stat="shield"] .icon{color:#b4dfc4}.stat[data-stat="burn"] .icon{color:#ffa164}.stat[data-stat="poison"] .icon{color:#c2a0ed}
.result-outcome{display:flex;align-items:center;justify-content:center;gap:6px;margin:0 0 4px;font-size:13px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:#d8c18a}
.result-outcome .icon{width:16px;height:16px}
.result-outcome.loss{color:#e09a85}.result-outcome.draw{color:#b8c0a8}
.run-result-meters{flex-wrap:wrap;gap:8px;font-size:13px;margin:12px 0 14px}
.run-result-meters>span{gap:4px;padding:6px 10px;border:1px solid #6d755455;border-radius:16px;background:#ffffff08}
.run-result-meters b{font-size:14px;color:#efe6cc}
.run-result-meters em{font-size:12px}
.dock .refresh small .icon{width:10px;height:10px}
.slot.merge-ready,.reserve-slot.merge-ready{outline:2px solid var(--color);outline-offset:-2px;box-shadow:0 0 12px color-mix(in srgb,var(--color) 50%,transparent)}
@keyframes merge-glow{50%{box-shadow:0 0 18px color-mix(in srgb,var(--color) 75%,transparent)}}
@media(prefers-reduced-motion:reduce){.slot.merge-ready,.reserve-slot.merge-ready{animation:none}}
/* Rarity tints relic cards and filled slots: common barely, rare blue, epic violet, legendary gold. */
[data-rarity="common"]{--tint:7%}[data-rarity="rare"]{--tint:24%}[data-rarity="epic"]{--tint:28%}[data-rarity="legendary"]{--tint:34%}
.market-card[data-rarity],.collection-card[data-rarity]{background:linear-gradient(165deg,color-mix(in srgb,var(--rarity) var(--tint),#2a352d),#1b2826 72%)}
.slot.filled[data-rarity]{background:radial-gradient(ellipse at 50% 80%,#b8b9800c,#152423bb),linear-gradient(170deg,color-mix(in srgb,var(--rarity) var(--tint),transparent),transparent 78%)}
.reserve-slot.filled[data-rarity]{background:radial-gradient(ellipse at center,color-mix(in srgb,var(--color) 9%,transparent),#1d2a25),linear-gradient(170deg,color-mix(in srgb,var(--rarity) var(--tint),transparent),transparent 80%)}
[data-rarity="legendary"].market-card,[data-rarity="legendary"].slot.filled,[data-rarity="legendary"].collection-card{box-shadow:inset 0 0 0 1px #e8ba6d55,0 0 10px #e8ba6d22}
.slot .type-badge{top:3px;left:5px;width:19px;height:19px}.slot .type-badge .icon{width:12px;height:12px}
.reserve-slot .type-badge{top:2px;left:2px;width:16px;height:16px}.reserve-slot .type-badge .icon{width:10px;height:10px}
.slot-buff{position:absolute;right:4px;top:50%;transform:translateY(-58%);display:flex;flex-direction:column;align-items:flex-end;gap:2px;pointer-events:none;z-index:1}
.slot-buff i{display:flex;align-items:center;gap:1px;padding:0 3px;border-radius:4px;background:#0b1413cc;border:1px solid #e8ba6d55;font:700 11px/1.35 var(--sans);font-style:normal;color:#ffe2a3}
.slot-buff .icon{width:10px;height:10px}
.market-card .card-foot .upgrade-badge{position:static;padding:0 3px;font-size:11px}
.market-card .combo-badge{position:absolute;top:30px;left:4px}
/* Strong rarity: every relic card and filled slot is edged in its rarity colour over a clear tint. */
[data-rarity="common"]{--tint:12%}[data-rarity="rare"]{--tint:40%}[data-rarity="epic"]{--tint:44%}[data-rarity="legendary"]{--tint:48%}
.market-card[data-rarity],.slot.filled[data-rarity],.reserve-slot.filled[data-rarity],.collection-card[data-rarity]{border-color:var(--rarity)}
.market-card[data-rarity],.slot.filled[data-rarity]{border-width:1.5px}
/* A relic the player cannot afford turns grey. */
/* A card you cannot afford is muted a little (not greyed out), so its rarity tint, gems and element badge still read and you can plan for it;
   its art and name dim a bit more, and the price turns red. */
.market-card.unaffordable{filter:saturate(.55) brightness(.84)}
.market-card.unaffordable .market-buy>svg{opacity:.65}
.market-card.unaffordable .market-buy>strong{opacity:.75}
/* Extra elements: a second badge under the first; one added by an essence glows in its colour. */
.slot .type-badge.extra{top:calc(5px + var(--i,1) * 19px);width:16px;height:16px}.slot .type-badge.extra .icon{width:10px;height:10px}
.reserve-slot .type-badge.extra{top:calc(2px + var(--i,1) * 16px)}
.type-badge.infused{border-color:var(--color);color:var(--color);box-shadow:0 0 6px var(--color),inset 0 0 4px color-mix(in srgb,var(--color) 50%,transparent)}
.element-badge.infused{box-shadow:0 0 0 2px var(--color),0 0 10px var(--color)}
.essence-note{display:flex;align-items:center;gap:6px;margin:4px 0 0;font-size:12px;color:var(--color)}
.essence-note .icon{width:14px;height:14px;flex:none}
/* A frozen shop looks like a window in winter: frost ferns (frost.svg, drawn by scripts/frost.mjs) grow in from the frame,
   a pale haze gathers in the corners and the middle stays clear. Cards flip the pattern so neighbours differ. */
.market.frozen .market-card .ice{position:absolute;inset:0;z-index:2;border-radius:inherit;pointer-events:none;background:url(frost.svg) center/cover no-repeat,radial-gradient(ellipse at 0 0,#e9f9ff3d,transparent 48%),radial-gradient(ellipse at 100% 100%,#e9f9ff38,transparent 48%),radial-gradient(ellipse at 100% 0,#e9f9ff26,transparent 42%),radial-gradient(ellipse at 0 100%,#e9f9ff2b,transparent 42%);box-shadow:inset 0 0 0 1px #dff6ffb3,inset 0 0 14px #bfe9ff59;filter:drop-shadow(0 0 1px #e6f8ff);animation:frost-in .6s ease-out}
.market.frozen .market-card:nth-child(4n+2) .ice{transform:scaleX(-1)}
.market.frozen .market-card:nth-child(4n+3) .ice{transform:scaleY(-1)}
.market.frozen .market-card:nth-child(4n) .ice{transform:scale(-1)}
/* The price, name, gems and element badge stay readable on top of the frost; the art stays under it. */
.market.frozen .market-card :is(.card-foot,.type-badge,.rarity-gems,.level-stars){z-index:3}
.market.frozen .market-card .market-buy strong{position:relative;z-index:3;text-shadow:0 1px 2px #0b1413}
@keyframes frost-in{from{opacity:0}}
@media (prefers-reduced-motion:reduce){.market.frozen .market-card .ice{animation:none}}
.dock .freeze-btn small{margin:0;font-size:11px;color:#9fd4e6}
.dock .freeze-btn:disabled{opacity:.6}
/* Shop card badges share one compact row under the price, clear of the art and the name. */
.market-card .card-badges{display:flex;gap:2px}
.market-card .card-badges .combo-badge,.market-card .card-badges .upgrade-badge{position:static;padding:0 3px;font-size:11px;line-height:1.3}
#sheet-title[tabindex="-1"]:focus{outline:none}
.encounter-option{width:100%;min-height:44px;text-align:left;color:inherit;font:inherit;cursor:pointer;transition:transform .12s,background .12s}
.encounter-option>div{flex:1;min-width:0}
.encounter-option>.icon{flex:none;align-self:center;width:18px;height:18px;color:var(--color)}
.encounter-option:active{transform:scale(.98);background:color-mix(in srgb,var(--color) 22%,#1b2826)}
@media(hover:hover){.encounter-option:hover{border-color:var(--color)}}
/* Combo strip: compact link counts, then ten seconds of the tower's output. */
.combo-strip .links{display:flex;align-items:baseline;gap:3px}
.combo-strip .links small{margin:0;font-size:11px;color:#a7ad96}
.build-output{display:flex;align-items:center;gap:6px;margin-left:auto;white-space:nowrap}
.build-output i{display:flex;align-items:center;gap:2px;font-style:normal}
.build-output .icon{width:12px;height:12px}
.build-output [data-out="damage"] .icon{color:#f2a37c}.build-output [data-out="shield"] .icon{color:#b4dfc4}.build-output [data-out="heal"] .icon{color:#a4c98b}
.build-output small{margin:0;font-size:11px;color:#a7ad96}
.prep-row .combo-strip .icon:last-child{margin-left:4px}
/* Battle result: what each relic kind did. */
.relic-breakdown{margin:6px 0 4px}
.breakdown-row{display:flex;align-items:center;gap:8px;padding:5px 6px;border-radius:8px}
.breakdown-row.top{background:#e8ba6d14;box-shadow:inset 0 0 0 1px #e8ba6d44}
.breakdown-row .relic{flex:none;width:28px;height:28px}
.breakdown-name{flex:1;min-width:0;font-size:12px;color:#e5dfc8}
.breakdown-name small{margin-left:4px;font-size:11px;color:#9eae97}
.breakdown-chips{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.breakdown-chips i{display:flex;align-items:center;gap:2px;font-style:normal;font-size:12px}
.breakdown-chips .icon{width:12px;height:12px}
.breakdown-chips [data-out="damage"] .icon{color:#f2a37c}.breakdown-chips [data-out="shield"] .icon{color:#b4dfc4}.breakdown-chips [data-out="heal"] .icon{color:#a4c98b}.breakdown-chips [data-out="burn"] .icon{color:#ffa164}.breakdown-chips [data-out="poison"] .icon{color:#c2a0ed}
/* Element vs rarity: the element is a filled round badge in its own colour; rarity is the frame, the tint and 1–4 gems. */
.type-badge{border-color:var(--color);background:color-mix(in srgb,var(--color) 55%,#101b1c);color:#fbf6e8}
.type-badge .icon{stroke-width:2}
.rarity-gems{position:absolute;top:3px;left:50%;transform:translateX(-50%);z-index:1;display:flex;gap:2px;pointer-events:none}
.rarity-gems.curse-mark{color:var(--rarity,#8a4fc0)}.rarity-gems.curse-mark .icon{width:12px;height:12px;stroke-width:2;color:#c9a0f0;background:#2a1838;border-radius:50%;box-shadow:0 0 0 1px #8a4fc0}
.encounter-option.cursed{position:relative;border-color:var(--rarity);background:linear-gradient(135deg,#2a183888,transparent 70%)}.encounter-option.cursed .level-stars{top:4px;left:22px;transform:none}
.rarity-gems i{display:block;width:6px;height:6px;rotate:45deg;background:var(--rarity);box-shadow:0 0 0 1px #0b1413}
.market-card .rarity-gems{top:2px}
.reserve-slot .rarity-gems{top:2px}.reserve-slot .rarity-gems i{width:5px;height:5px}
.slot.filled[data-rarity]:before{background:radial-gradient(closest-side,var(--rarity) 25%,transparent)}
.blessing-row>svg,.blessing-row>.relic{flex:none;width:34px;height:34px}
.blessing-row strong{color:var(--color)}
.camp-tile{position:relative}.tile-badge{position:absolute;top:3px;right:3px;min-width:18px;padding:1px 5px;border-radius:9px;background:#c2414b;color:#fff;font-size:11px;font-weight:700;line-height:16px;text-align:center}.tile-badge.live{background:#2f6b4f}
.duel-chip b{font-variant-numeric:tabular-nums}.duel-chip .day{max-width:96px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.duel-ready .duel-clock{font-variant-numeric:tabular-nums}
.duel-invite{display:flex;gap:8px;align-items:center;margin:10px 0}.duel-invite .nick-input{margin:0;flex:1;min-width:0}.duel-invite .primary{flex:none;width:auto;min-height:48px;padding:0 14px}.duel-actions button{width:auto}
.duel-suggest{display:flex;flex-direction:column;gap:4px;margin:-2px 0 8px}.duel-suggest:empty{display:none}.duel-pick{display:flex;align-items:center;gap:8px;min-height:44px;padding:0 14px;border:1px solid #74816744;border-radius:10px;background:#1a2723;color:var(--cream);font-size:15px;text-align:left}.duel-pick .icon{width:16px;height:16px;color:var(--gold)}
.duel-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 0;border-top:1px solid #74816733}.duel-row strong{display:block;font-size:15px}.duel-row small{display:block;color:#b5b09a;font-size:12px}.duel-actions{display:flex;gap:6px}.duel-actions button{min-height:44px;padding:0 12px}
.perk-grid{display:grid;gap:6px;margin-top:8px}
.perk-card{display:flex;align-items:center;gap:10px;width:100%;min-height:52px;padding:8px 10px;text-align:left;border:1px solid #74816744;border-radius:10px;background:#22312b;color:inherit;font:inherit}
.perk-card>.icon{flex:none;width:20px;height:20px;color:var(--gold)}
.perk-card>span{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.perk-card strong{font-size:14px;color:#efe6cc}.perk-card small{font-size:12px;line-height:1.35;color:#b9c2ad}
.perk-card.selected{border-color:var(--gold);background:linear-gradient(160deg,#3a3524,#22312b 70%)}
.perk-card.selected>.icon:last-child{color:var(--gold)}
.perk-card.locked{opacity:.62}.perk-card.locked>.icon{color:#9eae97}
.camp-relic.mystery{--color:#e8ba6d;border-style:dashed}
.camp-relic.mystery b{display:grid;place-items:center;width:34px;height:34px;font:600 26px/1 'Cormorant Garamond',serif;color:#e8ba6d}
.camp-start p{margin:0 0 0 4px;font-size:12px;line-height:1.45;color:#c9cdb8}
.camp-goal{display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px;margin-top:10px;font-size:13px;color:#e5dfc8}
.camp-goal span{display:flex;align-items:center;gap:4px}
.camp-goal .icon{width:15px;height:15px;color:var(--gold)}
.camp-goal span:first-child .icon{color:#d69b8d}
.camp-board{display:grid;grid-template-columns:repeat(6,1fr);gap:5px}
.camp-mini{aspect-ratio:1;display:grid;place-items:center;border:1px solid #61705844;border-radius:8px;background:#22312b88}
.camp-mini.filled{background:#22312b;box-shadow:inset 0 -2px 0 var(--color)}
.camp-mini .relic{width:72%;height:72%}
.camp-bar .secondary{flex:none;min-height:46px;padding:0 16px;font-size:13px}
.camp-bar .primary{font-size:15px}

/* Combos sheet and other sheets. */
.sheet-subhead{font:700 12px var(--sans);letter-spacing:.6px;color:var(--gold);margin:18px 0 4px;text-transform:uppercase}
.possible-combo{display:flex;gap:10px;align-items:flex-start;padding:10px 0;border-bottom:1px solid #7a886533}
.slot-tag{flex:none;min-width:52px;padding-top:9px;font-size:12px;color:#d9ccaa}
.possible-ids{display:flex;flex-wrap:wrap;gap:6px}
.possible-id{display:flex;flex-direction:column;align-items:center;width:74px;text-align:center;color:#a7b5a6}
.possible-id .relic{width:32px;height:34px}
.possible-id small{display:block;max-width:100%;font-size:11px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.possible-id.shop small{color:#ffe2a3;font-weight:700}
.possible-id.owned small{color:#a8d0ce;font-weight:700}
#toast{top:calc(env(safe-area-inset-top,0px) + 12px);bottom:auto;transform:translate(-50%,-10px);display:flex;align-items:center;gap:12px;line-height:1.5;font-size:13px}
#toast.visible{transform:translate(-50%,0)}
#toast.actionable{pointer-events:auto;padding-right:8px}
.toast-action{flex:none;min-height:44px;padding:0 14px;border-radius:6px;background:#2b3a31;color:#f1e3bd;font-weight:700;font-size:13px}
dialog{padding:0}
dialog[open]{display:flex;flex-direction:column;overflow:hidden}
.sheet-scroll{overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:23px 23px 12px;min-height:0;flex:1 1 auto}
.sheet-footer{flex:none;padding:12px 23px 16px;border-top:1px solid #8a805b33;background:#1b2827}
.sheet-footer .sheet-actions{margin-top:0}
.sheet-footer .primary+.sheet-actions{margin-top:8px}
.sheet-actions.compact{gap:6px}
.sheet-actions.compact .secondary{padding:6px 4px;font-size:11px;gap:4px;min-width:0}
.sheet-actions.compact .icon{width:14px;height:14px}
.sheet-close{z-index:2;right:10px;top:10px}
dialog p{font-size:13px;line-height:1.65}
.dialog-footer{font-size:11px!important;line-height:1.6!important}
.star-preview button{min-height:44px}
.demo-button{min-height:44px;font-size:12px}
.relic-demo-target:after{bottom:-19px}
.guide-step{display:flex;gap:14px;align-items:flex-start;margin:6px 0 4px}
.guide-step span{font:34px/1 var(--serif);color:var(--gold)}
.guide-step p{margin:0;font-size:14px;line-height:1.65}
.guide-dots{display:flex;gap:6px;justify-content:center;margin:16px 0 0}
.guide-dots i{width:7px;height:7px;border-radius:50%;background:#d8b77b33}
.guide-dots i.active{background:var(--gold)}
.install-hint{display:flex;gap:8px;align-items:center;margin:10px 0;padding:10px 6px 10px 12px;border:1px solid #9cc6c855;background:#75aeb914;border-radius:7px}
.install-hint p{margin:0;font-size:12px;line-height:1.5;color:#c3d6d2}
.install-hint strong{display:block;color:#d9ecea;font-size:12px}
.install-hint .icon-btn{flex:none}
.rotate-hint{display:none}
@media (orientation:landscape) and (max-height:500px) and (pointer:coarse){
  .rotate-hint{display:flex;position:fixed;inset:0;z-index:20000;flex-direction:column;align-items:center;justify-content:center;gap:10px;background:#101719;color:var(--cream);text-align:center;padding:24px}
  .rotate-hint span{font:48px var(--serif);color:var(--gold)}
  .rotate-hint p{font-size:15px;line-height:1.6;margin:0}
}

/* Battle: compact header so both towers fit, names hidden on the narrow duel towers. */
.battle-head{padding:10px 18px 6px;gap:10px}
.battle-stakes{display:flex;align-items:center;gap:5px;margin:6px 0 0;font-size:13px;color:#d3c4a1;white-space:nowrap}
.battle-stakes .icon{width:15px;height:15px}
.fighters{margin-top:6px}
.fighter-title{gap:6px;align-items:baseline}
.fighter-title,.fighter-title b{font-size:11px}
.fighter-title span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fighter-title b{white-space:nowrap}
.duel{height:330px}
.duel-towers{margin-top:44px}
.versus{top:160px}
.duel .slot-name{display:none}
.duel .tower{width:162px}
.duel .slot{height:62px}
.battle-feed{height:auto;min-height:190px}
.feed-row{font-size:12px;margin:4px 0}
.battle-tip{font-size:12px}
/* On tall phones the chronicle takes the spare height, so the battle bar sits at the bottom. */
.app[data-screen="battle"]{display:flex;flex-direction:column}
.app[data-screen="battle"]>main{flex:1 0 auto;display:flex;flex-direction:column}
.app[data-screen="battle"] .battle-feed{flex:1 0 auto}
@media (min-height:840px){
  .duel{height:390px}
  .duel-towers{margin-top:52px}
  .versus{top:190px}
  .duel .tower{width:clamp(162px,calc((100vw - 90px)/2),172px)}
  .duel .slot{height:74px}
  .duel .slot .relic{width:48px;height:48px}
}

/* Other pages. */
.filter{flex:none;min-height:44px;padding:7px 14px}
.rating-unit{font-size:12px;font-weight:400}
.page{min-height:0}

/* Taller phones get bigger reserve slots and cards; the tower itself scales with the scene. */
@media (min-height:620px){
  .arena.prep-arena{height:256px}
  .prep .prep-arena .tower{padding-top:24px}
  .prep .tower:before{top:13px}
  .prep .reserve-slot{height:54px}
  .prep .reserve-slot .relic{width:36px;height:36px}
  .market-card .relic{width:42px;height:42px}
  .market-buy{padding:8px 4px;gap:3px}
}
/* iPhone Pro Max in Safari and Home Screen apps. */
@media (min-height:720px){
  .prep .prep-arena .tower{padding-top:26px}
  .prep .tower:before{top:14px}
  .prep .slot-name{font-size:12px}
  .prep-row{margin:6px 12px}
  .prep .reserve-slot{height:60px}
  .prep .reserve-slot .relic{width:40px;height:40px}
  /* Bigger bottom bars for bigger thumbs-reach areas. */
  .dock,.battle-bar{gap:8px;padding:8px 14px max(8px,env(safe-area-inset-bottom))}
  .dock .wallet{min-height:54px;padding:0 12px;font-size:17px}
  .dock .wallet .icon{width:20px;height:20px}
  .dock .refresh,.dock .freeze-btn,.dock .xp-buy{width:56px;min-width:56px;min-height:54px}
  .dock .refresh .icon,.dock .freeze-btn .icon{width:22px;height:22px}
  .dock .refresh small,.dock .xp-buy small{font-size:12px}
  .dock .xp-buy{font-size:12px}
  .dock .primary{min-height:54px;font-size:16px}
  .dock .primary .icon{width:20px;height:20px}
  .camp-bar .primary{font-size:17px}
  .camp-bar .secondary{min-height:54px;font-size:15px}
  .battle-bar .icon-btn{width:54px;height:54px}
  .battle-bar .icon-btn .icon{width:22px;height:22px}
  .speed{min-height:54px;min-width:64px;font-size:15px}
  .battle-bar .skip{padding:0 22px}
  .market-card .relic{width:48px;height:48px}
  .market-buy{padding:10px 4px;gap:4px}
}
/* Narrow tall phones keep the battle button wide: slimmer side buttons. */
@media (min-height:720px) and (max-width:400px){
  .dock{gap:6px;padding-inline:10px}
  .dock .wallet{padding:0 9px}
  .dock .refresh,.dock .freeze-btn,.dock .xp-buy{width:50px;min-width:50px}
}
@media (min-height:840px){
  .prep .reserve-slot{height:64px}
  .prep .reserve-slot .relic{width:44px;height:44px}
  .market-card .relic{width:54px;height:54px}
  .market-buy{padding:12px 4px;gap:5px}
}
@media(max-width:350px){
  .run-chip .day{display:none}
  .prep .reserve-grid{gap:3px}
}
@media(prefers-reduced-motion:reduce){.refresh.suggested{animation:none}.drag-pending{transition:none}}
#toast.over-row{transform:translate(-50%,-50%) scale(.97);max-width:calc(100% - 24px);padding:6px 14px}
#toast.over-row.visible{transform:translate(-50%,-50%)}
#toast.over-row.actionable{padding:4px 4px 4px 14px}
/* Six-card shop: compact cards, price and combo badge in the top-right corner, upgrade badge under the element icon. */
.market-buy{padding:5px 4px;gap:1px}
.market-card .relic{width:30px;height:30px}
.market-card .card-foot{position:absolute;top:4px;right:4px;display:flex;flex-direction:column;align-items:flex-end;gap:3px;margin:0}
.market-card .price{font-size:12px;line-height:1.2}
.market-card .combo-badge{font-size:11px;padding:0 4px}
.market-card .upgrade-badge{top:30px;left:4px;right:auto}
/* The corner column stays above the name line on the shortest cards, whatever the font's width. */
.market-card .card-foot{top:3px;gap:1px}
.market-card .card-foot .upgrade-badge{padding:0 3px;line-height:1.25}
@media(min-height:720px){.market-card .relic{width:42px;height:42px}.market-buy{padding:8px 4px;gap:3px}.market-card .upgrade-badge{top:32px}}
@media(min-height:840px){.market-card .relic{width:50px;height:50px}.market-buy{padding:10px 4px}}
.combo-list p .icon{display:inline-block;width:12px;height:12px;margin:0 2px;vertical-align:-1px;color:var(--gold)}
/* Two buff chips sit either side of the art, so neither reaches the name. */
.slot-buff{inset:0;transform:none;display:block}
.slot-buff i{position:absolute;top:50%;transform:translateY(-62%)}
.slot-buff i:nth-child(1){right:4px}
.slot-buff i:nth-child(2){left:4px}
/* Relic sheet title: elements left (ringed in the rarity colour, hybrids overlap), name, mechanics right. */
.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.title-row{display:flex;align-items:center;gap:8px;margin:6px 0 2px}
.title-row .detail-title{flex:0 1 auto;min-width:0;margin:0;text-align:left;line-height:1.1}
.element-badges{display:flex;flex:none}
.element-badge{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;border:1.5px solid var(--rarity);background:color-mix(in srgb,var(--color) 10%,#1b2728);color:var(--color)}
.element-badge+.element-badge{margin-left:-11px;box-shadow:-2px 0 0 #1b2827}
.element-badge .icon{width:17px;height:17px}
.mechanic-badges{display:flex;flex:none;margin-left:auto}
.mechanic-badge{display:grid;place-items:center;width:44px;height:44px;min-width:44px;padding:0;background:transparent;border:0;color:var(--color)}
.mechanic-badge span{display:grid;place-items:center;width:30px;height:30px;border-radius:50%;border:1px solid color-mix(in srgb,var(--color) 45%,transparent);background:color-mix(in srgb,var(--color) 9%,transparent)}
.mechanic-badge .icon{width:17px;height:17px}
.mechanic-hint{margin:2px 0 6px;padding:6px 10px;border-left:2px solid var(--color,#9aa58f);border-radius:0 6px 6px 0;background:#ffffff08;font-size:12px!important;line-height:1.45!important;color:#d9dcc8}
.detail-type{letter-spacing:.5px}
/* Up to six statuses: each keeps its line and number; a crowded row wraps onto a second line instead of squeezing them. */
.status-row{height:auto;min-height:18px;flex-wrap:wrap;column-gap:6px;row-gap:2px}
.status-row>span{flex:none;white-space:nowrap;display:inline-flex;align-items:center;gap:3px;height:16px;line-height:16px}
.status-row .icon{width:12px;height:12px}
/* Potions: flasks in the reserve and the shop, and the sheets that use them. */
.reserve-slot.consumable{border-style:solid;border-color:color-mix(in srgb,var(--color) 55%,transparent);background:radial-gradient(ellipse at center,color-mix(in srgb,var(--color) 12%,transparent),#1d2a25)}
.potion-hero{display:grid;place-items:center;margin:4px 0 6px}
.potion-card{border-bottom-color:var(--color)}
.held-targets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;max-height:40dvh;overflow:auto}
.held-targets .secondary{justify-content:flex-start;gap:6px;min-height:48px;padding:4px 8px;font-size:12px}
.held-targets .relic{width:30px;height:30px;flex:none}
/* Encounters and blessings. */
.encounter-option{display:flex;gap:10px;align-items:flex-start;margin:10px 0;padding:10px;border:1px solid color-mix(in srgb,var(--color) 45%,transparent);border-radius:10px;background:color-mix(in srgb,var(--color) 7%,#1b2828)}
.encounter-option>.relic{flex:none;width:52px;height:54px}
.encounter-option strong{display:block;font-size:15px;color:var(--cream)}
.encounter-option p{margin:2px 0 0;font-size:12px!important;line-height:1.45!important}
.encounter-kind{font-size:11px;letter-spacing:.5px;text-transform:uppercase;color:var(--color)}
.encounter-error{color:#e6b3a0!important;font-size:12px!important}
.sheet-footer .sheet-actions .primary{min-width:0;font-size:13px;padding:0 6px}
.blessing-row{display:flex;gap:10px;align-items:center;padding:6px 0;border-bottom:1px solid #7a886533}
.blessing-row .relic{flex:none;width:40px;height:42px}
.blessing-row p{margin:0}
/* Rules: collapsible sections with 44 pt headers; rows for mechanics and relics. */
.rule-section{border-bottom:1px solid #8a805b33}
.rule-section>summary{display:flex;align-items:center;justify-content:space-between;min-height:48px;cursor:pointer;list-style:none;font:700 13px var(--sans);letter-spacing:.5px;text-transform:uppercase;color:var(--gold)}
.rule-section>summary::-webkit-details-marker{display:none}
.rule-section>summary .icon{width:16px;height:16px;transition:transform .2s;transform:rotate(90deg)}
.rule-section[open]>summary .icon{transform:rotate(-90deg)}
.rule-section>p{margin:0 0 12px}
.rule-row{display:flex;gap:10px;align-items:center;padding:5px 0}
.rule-row>.relic{flex:none;width:34px;height:36px}
.rule-row p{margin:0;font-size:12px!important;line-height:1.45!important}
.mechanic-chip{flex:none;display:grid;place-items:center;width:30px;height:30px;border-radius:50%;border:1px solid color-mix(in srgb,var(--color) 45%,transparent);color:var(--color)}
.mechanic-chip .icon{width:16px;height:16px}
.combo-list .link-effect{display:block;margin-top:2px;font-size:12px;color:#d9dcc8}
/* UX audit part 2. Relic sheet: a compact effect preview; a preview note only while previewing other stars. */
.relic-demo{height:96px;margin:0 0 4px}
.relic-demo .detail-art{width:70px;height:74px;margin:0 auto}
.relic-demo-target{transform:scale(.8)}
.preview-note{margin:0;font-size:11px!important;letter-spacing:.5px;text-transform:uppercase;color:var(--gold)!important}
/* Battle: one line of stakes; on short phones a lower arena so the chronicle starts above the bar. */
.battle-head{padding:8px 18px 4px}
.battle-stakes{display:flex;justify-content:space-between;align-items:center;margin:0}
.battle-stakes .icon{width:14px;height:14px;vertical-align:-2px;color:#d69b8d}
@media (max-height:620px){
  .duel{height:250px}
  .duel-towers{margin-top:30px}
  .duel .slot{height:50px}
  .duel .slot .relic{width:34px;height:34px}
  .versus{top:120px}
  .battle-time{margin-top:4px}
  .fighters{margin-top:2px}
}
/* Reserve potions and blessings carry a small 'use' badge. */
.reserve-slot.consumable{position:relative}
.use-badge{position:absolute;top:3px;right:3px;display:grid;place-items:center;width:18px;height:18px;border-radius:50%;background:var(--gold);color:#1b2827;box-shadow:0 0 8px #d8b77b88}
.use-badge .icon{width:11px;height:11px}
/* Book: element filters are icons in the element colour and wrap instead of running off screen. */
.filter-tabs{flex-wrap:wrap;overflow:visible}
.filter.icon-filter{width:44px;min-width:44px;padding:0;display:grid;place-items:center;color:var(--color)}
.filter.icon-filter .icon{width:18px;height:18px}
/* Camp: the miniature tower only where the scene above cannot show the tower. */
.battle-stakes{justify-content:flex-start;gap:5px;white-space:nowrap;font-size:13px}
/* UX audit part 3. Short phones: both bonus chips stack at the right edge, clear of the relic's art; icons drop to save width. */
@media (max-height:620px){
  .prep .slot-buff i{right:2px;left:auto;transform:none;padding:0 2px;line-height:14px}
  .prep .slot-buff i:nth-child(1){top:3px}
  .prep .slot-buff i:nth-child(2){top:19px}
  .prep .slot-buff .icon{display:none}
}
.blessing-note{margin:6px 0;padding:6px 10px;border-left:2px solid var(--color);border-radius:0 6px 6px 0;background:#ffffff08;font-size:12px!important;line-height:1.45!important;color:#d9dcc8}
.card-mechanics{display:flex;gap:3px;margin-top:4px}
.mini-mech{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;border:1px solid color-mix(in srgb,var(--color) 45%,transparent);color:var(--color)}
.mini-mech .icon{width:12px;height:12px}

/* Leagues dress their button and card: the league's colour on the border and in a glow that grows with the league, and its emblem. */
.camp-rating[data-league]{border-color:color-mix(in srgb,var(--league) 70%,transparent);background:radial-gradient(ellipse at 12% 40%,color-mix(in srgb,var(--league) 22%,transparent),transparent 70%),#23302c;box-shadow:0 0 calc(var(--glow) * 3px) color-mix(in srgb,var(--league) 45%,transparent),inset 0 0 0 1px color-mix(in srgb,var(--league) 16%,transparent)}
.camp-rating .league-emblem{flex:none;width:30px;height:30px;filter:drop-shadow(0 0 calc(var(--glow) * 1px) var(--league))}
.camp-rating[data-league] .camp-rank small{color:color-mix(in srgb,var(--league) 75%,#f3ead2)}
.rank-card[data-league]{border-color:color-mix(in srgb,var(--league) 60%,transparent);box-shadow:0 0 calc(var(--glow) * 4px) color-mix(in srgb,var(--league) 35%,transparent)}
.rank-card .rank-emblem{display:block;width:76px;height:76px;margin:0 auto 6px;filter:drop-shadow(0 0 calc(var(--glow) * 1.5px) var(--league))}
.camp-rating[data-league] .camp-progress i,.rank-card[data-league] .rank-progress span{background:var(--league)}

/* The camp header's language switch sits at the right edge. */
.topbar .lang-btn{margin-left:auto}.lang-btn b{font-size:13px;font-weight:800;letter-spacing:.06em}
/* English for text drawn by CSS. */
:lang(en) .relic-demo-target:after{content:'TARGET'}:lang(en) .slot.landing:not(.filled):after,:lang(en) .reserve-slot.landing:not(.filled):after{content:'here'}
/* The nickname sheet: a large field (16px stops iOS from zooming) and its error. */
.nick-input{display:block;width:100%;min-height:48px;margin:14px 0 6px;padding:10px 14px;border:1px solid #bdab7066;border-radius:10px;background:#0b1413;color:var(--cream);font:600 16px var(--sans)}
.nick-input:focus{outline:2px solid var(--gold);outline-offset:1px}
.nick-error{color:#f0a0a6;font-size:13px;margin:4px 0 0}
/* The leaderboard on the rating page. */
.leaderboard{margin:18px 0 6px}.leaderboard-row{display:flex;align-items:center;gap:10px;padding:8px 10px;border-bottom:1px solid #ffffff12;font-size:14px}
.leaderboard-row .lb-rank{width:22px;color:#bdab70;font-weight:700;text-align:right}.leaderboard-row .lb-nick{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.leaderboard-row b{font-variant-numeric:tabular-nums}.leaderboard-row.me{background:#bdab7022;border-radius:8px}
.leaderboard-wait,.leaderboard-offline{color:#c9c2ad;font-size:13px}

/* A relic's potions: a small flask with their count, under the stars in the top-right corner. */
.potion-mark{position:absolute;top:21px;right:4px;z-index:2;display:flex;align-items:center;gap:1px;padding:1px 4px 1px 2px;border-radius:9px;background:#101b1ce6;border:1px solid #c9b6ff99;color:#e6dcff;font-size:11px;line-height:1;pointer-events:none}
.potion-mark .icon{width:12px;height:12px}.potion-mark b{font-weight:700}
.reserve-slot .potion-mark{top:2px;right:2px}
.temper-chip{margin-left:1px;padding:0 3px;border-radius:7px;background:#101b1ce6;border:1px solid var(--rarity);color:#ffe7b0;font-size:11px;font-weight:700;line-height:13px}
.temper-note{margin:8px 0 0;color:#ffe7b0;font-size:13px;line-height:1.4}.temper-note .icon{display:inline-block;width:15px;height:15px;vertical-align:-3px;margin-right:2px}
.potion-note{display:flex;flex-wrap:wrap;align-items:center;gap:4px;margin:10px 0 0;color:#e6dcff;font-size:13px}.potion-note .icon{width:15px;height:15px}
/* The ten-second output's change: small marks over the numbers that rise and fade in two seconds (transform and opacity only). */
.combo-strip{position:relative}
.output-deltas{position:absolute;right:30px;top:50%;margin-top:-9px;display:flex;gap:4px;pointer-events:none;z-index:2}
.output-delta{display:flex;align-items:center;gap:2px;padding:1px 6px;border-radius:9px;font-size:12px;font-weight:800;font-style:normal;line-height:16px;background:#101b1cf2;animation:output-delta 2.3s ease-out forwards}
.output-delta .icon{width:12px;height:12px}.output-delta.up{color:#a8e08a;box-shadow:0 0 0 1px #a8e08a66}.output-delta.down{color:#f0a0a6;box-shadow:0 0 0 1px #f0a0a666}
@keyframes output-delta{0%{opacity:0;transform:translateY(6px)}12%{opacity:1;transform:translateY(0)}75%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-4px)}}
@media (prefers-reduced-motion:reduce){.output-delta{animation:none}}

/* A relic's level: stars in its rarity colour at the top of its card or slot; one big star at 3★. */
.level-stars{position:absolute;top:3px;left:50%;transform:translateX(-50%);z-index:1;display:flex;align-items:center;gap:1px;pointer-events:none}
.level-stars:empty{display:none}
.star{display:block;width:11px;height:11px;background:var(--rarity);clip-path:polygon(50% 0,62% 34%,98% 36%,69% 58%,79% 94%,50% 73%,21% 94%,31% 58%,2% 36%,38% 34%)}
.star.big{width:19px;height:19px}
.star.none{background:#ffffff40}
.level-stars .star{filter:drop-shadow(0 0 1px #0b1413) drop-shadow(0 0 1px #0b1413)}
.reserve-slot .level-stars{top:1px}.reserve-slot .star{width:9px;height:9px}.reserve-slot .star.big{width:15px;height:15px}
.level-stars .curse-mark{display:grid;place-items:center}.level-stars .curse-mark .icon{width:12px;height:12px;stroke-width:2;color:#c9a0f0;background:#2a1838;border-radius:50%;box-shadow:0 0 0 1px #8a4fc0}
.tab-stars{display:inline-flex;align-items:center;gap:2px;vertical-align:middle}.tab-stars .star{width:12px;height:12px}.tab-stars .star.big{width:18px;height:18px}
/* The level label is gone, so a relic's potion flask moves up into the corner. */
.slot .potion-mark{top:3px}
/* Endless mode: the «Авто» button in the dock, the automatic battles and the summary with the winner's tower. */
.auto-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;min-width:48px;min-height:44px;border:1px solid #bdab7066;border-radius:6px;background:#bdab7014;color:#e3cc92}
.auto-btn small{font-size:11px;font-weight:700}.auto-btn .icon{width:16px;height:16px}
.auto-log{margin-top:10px;display:grid;gap:4px}.auto-log .feed-row.loss{color:#f0a0a6}.auto-log .feed-row.win{color:#cfe8b8}
.endless-foe{margin-top:14px}.foe-tower{display:grid;grid-template-columns:repeat(2,52px);gap:4px;justify-content:center;margin-top:6px}
.foe-slot{display:grid;place-items:center;width:52px;height:52px;border-radius:8px;background:#101b1c;border:1px solid #ffffff1a}.foe-slot .relic{width:40px;height:40px}
.endless-recap .run-result-meters small{font-size:11px;color:#c9c2ad;margin-left:3px}

/* Camp: the same stone, brass and typography as the workshop. The scene occupies
   its own space; run information and navigation always have a solid backdrop. */
.app[data-screen="camp"]{position:relative;isolation:isolate}
.title-bar{justify-content:space-between;flex:none;border-bottom:0;background:none;padding-inline:16px}
.camp-rating[data-league]{display:flex;flex:1;min-width:0;align-items:center;gap:8px;min-height:44px;padding:4px 10px 4px 5px;border:1px solid color-mix(in srgb,var(--league) 35%,transparent);border-radius:6px;background:#1d2a27;box-shadow:0 0 calc(var(--glow) * 1px) color-mix(in srgb,var(--league) 20%,transparent);color:var(--cream);text-align:left}
.camp-rating .league-emblem{width:28px;height:28px;flex:none}
.camp-rank{flex:1;min-width:0;display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:baseline;column-gap:6px;row-gap:4px}
.camp-rank b{font:700 15px/1 var(--sans);color:#e4d2a8;font-variant-numeric:tabular-nums}
.camp-rank small{font-size:11px;color:#b5bca9;line-height:1.25}
.camp-progress{grid-column:1/-1;display:block;height:2px;border-radius:2px;background:#95a68126;overflow:hidden}.camp-progress i{display:block;height:100%;background:var(--league)}
.title-bar .icon-btn{flex:0 0 44px;margin-left:0;border:1px solid #71865a44;border-radius:6px;background:#22312b66;font-size:12px}
.title-bar .sound-btn{color:#aebba5}
.title-bar .sound-btn[aria-pressed="true"]{border-color:#d8b77b88;background:#d8b77b18;color:var(--gold)}
.camp{flex:1 0 auto;min-height:0;display:flex;flex-direction:column;gap:14px;padding:0 16px 12px}
.camp-intro{position:relative;isolation:isolate;flex:1 0 116px;display:flex;align-items:center;min-height:116px}
.app[data-screen="camp"] .camp-hero{position:absolute;inset:0 -16px;z-index:-1;height:auto;min-height:0;border:0;overflow:hidden;pointer-events:none;background:linear-gradient(180deg,#18262800,#23352f77 65%,#18262800)}
.app[data-screen="camp"] .camp-hero:after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,#121a1c99,transparent 75%),linear-gradient(180deg,#121a1c,transparent 22%,transparent 65%,#121a1c)}
.app[data-screen="camp"] .camp-hero .moon{display:none}
.title-spire{position:absolute;right:24px;bottom:0;height:94%;width:auto;max-width:29%;opacity:.8;filter:none}
.title-mark{position:relative;margin:0 0 8px 6px;font-family:var(--serif);font-weight:600;line-height:.9;color:var(--cream);text-shadow:0 2px 12px #101719}
.title-mark span{display:block}.title-mark span:first-child{margin-bottom:5px;font-size:25px;font-weight:500;letter-spacing:.035em;color:var(--gold)}.title-mark span:last-child{font-size:68px;letter-spacing:.015em}
:lang(en) .title-mark span:last-child{font-size:72px}
.camp-run{flex:none;padding:12px 14px;border:1px solid #61705855;border-radius:8px;background:#22312b66;box-shadow:inset 0 1px 0 #e5dfc806}
.run-line{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:22px;margin:0 0 8px;font:700 13px/1.3 var(--sans);color:var(--cream)}
.camp-run .camp-start{gap:12px}
.camp-run .camp-start p{max-width:none;margin:0;color:#b9c4b2;font-size:12px;line-height:1.5}
.camp-run .camp-relic{width:44px;padding:2px 0;border-radius:6px;background:#1a2724}
.camp-run .camp-relic b{width:30px;height:25px;font-size:23px}
.camp-run .camp-relic small{font-size:11px}
.camp-new{display:inline-flex;align-items:center;gap:5px;min-height:44px;padding:0 0 0 8px;border:0;background:none;color:#aebba5;font:500 11px var(--sans);white-space:nowrap}.camp-new .icon{width:13px;height:13px}
.run-line:has(.camp-new){min-height:32px;margin:-6px 0 4px}
.camp-board{display:flex;gap:6px;margin:0}.camp-mini{width:30px;height:30px;flex:none;border-radius:4px}
.camp-goal{gap:5px 12px;margin-top:10px;padding-top:9px;border-top:1px solid #71865a33;font-size:12px;color:#c9d0bd;font-variant-numeric:tabular-nums}
.camp-goal .icon{width:14px;height:14px}
.camp-run h3{margin:0 0 8px;font:600 22px/1.1 var(--serif)}
.camp-run.victory{border-color:#d8b77b77}.camp-run.victory h3{color:#f1d58a}
.camp-warning{font-size:11px;line-height:1.4}
.camp-tiles{flex:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0;padding:0}
.menu-item{position:relative;display:flex;align-items:center;gap:10px;width:100%;min-height:64px;padding:10px 12px;border:1px solid #61705855;border-radius:6px;background:#22312b66;color:var(--cream);font:600 14px/1.25 var(--sans);text-align:left}
.menu-item>.icon{flex:none;width:22px;height:22px;color:#c9ae78}
.menu-item>span{flex:1;min-width:0}
.menu-copy{display:flex;flex-direction:column;gap:4px}
.menu-meta{font:500 11px/1.25 var(--sans);color:#9eaf97}
.menu-item .tile-badge{position:absolute;top:5px;right:5px;min-width:18px;padding:1px 5px;font:700 11px/16px var(--sans)}
.menu-item:active{background:#d8b77b18}
.app[data-screen="camp"]>.dock-wrap{flex:none;border:0;background:var(--bg)}
.camp-bar{padding:2px 16px max(14px,env(safe-area-inset-bottom));gap:8px}
.camp-bar .primary{min-height:50px;justify-content:space-between;padding-inline:18px;font-size:15px;border-radius:6px}
.camp-bar .secondary{padding-inline:10px;min-height:50px}.camp-bar .ranked-btn,.camp-bar .train-btn{justify-content:center;gap:10px}
@media (hover:hover){.menu-item:hover{border-color:#d8b77b77;background:#304035}.camp-new:hover{color:var(--gold)}.title-bar .sound-btn:hover{border-color:#d8b77b77}}
@media (max-height:600px){.camp{gap:8px}.camp-intro{flex-basis:94px;min-height:94px}.title-mark span:first-child{font-size:22px}.title-mark span:last-child{font-size:58px}:lang(en) .title-mark span:last-child{font-size:62px}.menu-item{min-height:56px;padding-block:8px}.camp-run{padding-block:10px}.camp:has(.camp-summary) .camp-intro{flex-basis:72px;min-height:72px}.camp:has(.camp-summary) .title-mark span:first-child{font-size:19px}.camp:has(.camp-summary) .title-mark span:last-child{font-size:48px}:lang(en) .camp:has(.camp-summary) .title-mark span:last-child{font-size:52px}}
@media (min-height:720px){.camp{gap:18px}.camp-intro{flex-basis:170px;min-height:170px}.title-mark{margin-left:10px}.title-mark span:first-child{font-size:30px}.title-mark span:last-child{font-size:82px}:lang(en) .title-mark span:last-child{font-size:88px}.camp-run{padding:16px}.menu-item{min-height:72px;padding:14px}.camp-bar{padding-top:0}.camp-bar .primary{min-height:54px;font-size:16px}.camp-bar .secondary{min-height:54px}}
