/* Rogue Stars: flat panels, one accent. The paintings carry the light and colour; the page around them adds none (no glows,
   gradients or blur). Type: 10px for small labels, 11.5px for secondary text, 13-15px for text, Georgia for titles. */
:root{color-scheme:dark;--bg:#0e0f13;--panel:#171920;--raise:#1e212a;--line:#2d313d;--line2:#3b4050;--ink:#ece7dc;--muted:#9aa1b0;--gold:#e0b25c;--gold-dim:#2a2418;--danger:#e0707f;--good:#6fcf9e;--r:10px;--ease:cubic-bezier(.2,.8,.2,1)}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
body{margin:0;min-height:100vh;background:var(--bg);color:var(--ink);font:15px/1.35 Inter,ui-sans-serif,system-ui,sans-serif}
.gameShell{width:min(510px,100%);min-height:100vh;margin:auto;padding:12px 12px 28px}
button{font-family:inherit;font-size:inherit;color:var(--ink);cursor:pointer;touch-action:manipulation}
[hidden]{display:none!important}

/* top bar */
.topbar{display:flex;justify-content:space-between;align-items:center;padding:2px 2px 10px}
.brand{color:var(--ink);font-family:Georgia,serif;font-weight:700;text-decoration:none;letter-spacing:.03em}
.brand span{font-size:18px}
.topTools{display:flex;align-items:center;gap:8px}
.resource{display:flex;align-items:center;gap:6px;color:var(--gold);border:1px solid var(--line2);background:var(--panel);padding:5px 11px 5px 8px;border-radius:999px}
.resource img{width:18px;height:18px;object-fit:contain}
.resource b{font-size:15px;font-variant-numeric:tabular-nums}
.resource small{color:var(--muted);font-size:11.5px}
.soundButton{width:32px;height:32px;padding:0;border:1px solid var(--line2);border-radius:50%;background:var(--panel);font-size:14px;line-height:1}
.soundButton:hover{border-color:var(--gold)}.soundButton:active{transform:scale(.94)}
.soundButton .soundOff{display:none;color:var(--danger)}
.soundButton.off .soundOn{display:none}.soundButton.off .soundOff{display:inline}
.connection{margin:0 0 8px;text-align:center;color:var(--muted);font-size:11.5px}
.sessionButton{display:block;margin:-2px auto 8px;padding:5px 12px;border:1px solid var(--gold);border-radius:99px;background:var(--gold-dim);color:var(--gold);font-size:12px}

/* the first-person view; its height follows the screen so a turn can be played without scrolling */
.dungeon{position:relative;isolation:isolate;aspect-ratio:4/5;min-height:300px;max-height:80vh;width:100%;overflow:hidden;border:1px solid var(--line2);border-radius:14px;background:#14151b;touch-action:manipulation}
.gameShell[data-mode="hub"] .dungeon{aspect-ratio:auto;height:clamp(210px,32vh,290px);min-height:0}
.gameShell[data-mode="battle"] .dungeon{aspect-ratio:auto;height:clamp(250px,calc(100vh - 372px),560px);height:clamp(250px,calc(100svh - 372px),560px);min-height:0}
.gameShell[data-mode="reward"] .dungeon,.gameShell[data-mode="haven"] .dungeon{aspect-ratio:auto;height:clamp(250px,42vh,420px);min-height:0}
.dungeon canvas{position:absolute;inset:0;width:100%;height:100%;display:block;z-index:0}
.scrim{position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(rgba(6,7,12,.6),rgba(6,7,12,0) 30%)}
.roomRail{position:absolute;z-index:4;top:10px;left:10px;right:10px;display:flex;gap:5px}
.roomNode{flex:1;min-width:0;padding:4px 2px;border:1px solid var(--line2);border-radius:7px;background:#14151bd9;text-align:center;text-transform:uppercase;font-size:10px;letter-spacing:.04em;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:clip}
.roomNode.haven{border-style:dashed}
.roomNode.current{border-color:var(--gold);background:var(--gold-dim);color:var(--gold)}
.roomNode.done{border-color:#3f7a62;color:var(--good)}
.roomNode.boss{color:var(--danger)}
.sceneCopy{position:absolute;z-index:3;top:42px;left:13px;max-width:50%;text-shadow:0 1px 3px #000;pointer-events:none}
.sceneCopy p{margin:0}
.sceneCopy h1{margin:2px 0 3px;font:700 clamp(19px,5.2vw,25px)/1.05 Georgia,serif;white-space:nowrap}
.sceneCopy #eyebrow,.kicker{text-transform:uppercase;letter-spacing:.12em;font-size:10px;color:var(--gold);white-space:nowrap}
.sceneCopy #sceneText{font-size:12px;line-height:1.3;color:#e6e2d6;max-width:200px}
.sceneCopy #sceneText:empty{display:none}
.dungeon[data-mode="battle"] #sceneText,.dungeon[data-mode="reward"] .sceneCopy,.dungeon[data-mode="haven"] .sceneCopy{display:none}
.intentCard{position:absolute;z-index:5;top:42px;right:10px;display:flex;align-items:center;gap:8px;width:146px;padding:6px 9px 6px 6px;border:1px solid var(--danger);border-radius:var(--r);background:#1b1115eb}
.intentCard span,.intentCard small{display:block;color:#e8b4bb;font-size:10px;text-transform:uppercase;letter-spacing:.07em}
.intentCard small{letter-spacing:0;text-transform:none;font-size:10.5px;line-height:1.2;margin-top:1px}
.intentCard strong{display:block;margin:1px 0;color:#fff;font-size:14px;letter-spacing:.03em}
.intentIcon{flex:0 0 32px;width:32px;height:32px;background:center/contain no-repeat}
.intentCard[data-intent="heavy"]{border-color:#e8943c;background:#251a0eeb}
.intentCard[data-intent="heavy"] span,.intentCard[data-intent="heavy"] small{color:#f0cd9e}
.intentCard[data-intent="guard"]{border-color:#6a9ad0;background:#111a28eb}
.intentCard[data-intent="guard"] span,.intentCard[data-intent="guard"] small{color:#b4cde8}

/* what the hero and the foe have left; the foe's card is only there in a fight, so the hero's takes the whole row */
.statusGrid{display:flex;gap:8px;margin-top:8px}
.gameShell[data-mode="hub"] .statusGrid{display:none}
.vital{flex:1;min-width:0;padding:8px 10px;border:1px solid var(--line);border-radius:var(--r);background:var(--panel)}
.vital>div{display:flex;justify-content:space-between;align-items:baseline;gap:6px}
.vital span{min-width:0;color:var(--muted);font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.vital strong{font-size:13px;font-variant-numeric:tabular-nums;white-space:nowrap}
.vital small{display:block;color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bar{display:block;height:6px;margin:6px 0 5px;overflow:hidden;border-radius:3px;background:#2a2d38}
.bar b{display:block;width:0;height:100%;background:var(--good);transition:width .35s var(--ease)}
.bar.enemy b{background:var(--danger)}
.chips{display:flex;flex-wrap:wrap;gap:4px;margin-top:5px}
.chips:empty{display:none}
.mark{padding:1px 7px;border:1px solid var(--mc);border-radius:99px;font-size:10px;line-height:1.4;color:#f2f2f6;background:color-mix(in srgb,var(--mc) 16%,var(--panel))}

/* the hub: tabs, then the page of the tab; the start row stays in reach */
.hubPanel,.rewardDeck{margin-top:8px;padding:12px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.hubPanel h2,.rewardDeck h2{margin:2px 0 4px;font:700 20px/1.1 Georgia,serif}
.hubPanel p,.rewardDeck p{margin:0;color:var(--muted)}
.purse{display:flex;justify-content:flex-end;gap:6px;margin:0 0 8px;font-size:12px;font-weight:700;color:var(--gold)}
.purse span{padding:3px 10px;border:1px solid var(--line2);border-radius:99px;background:var(--raise);white-space:nowrap;font-variant-numeric:tabular-nums}
.hubTabs{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;margin:0 0 4px}
.hubTabs button{padding:9px 4px;border:1px solid var(--line2);border-radius:8px;background:var(--raise);color:var(--muted);font-size:12.5px;font-weight:700}
.hubTabs button[aria-selected="true"]{border-color:var(--gold);color:var(--gold);background:var(--gold-dim)}
.hubTabs button{position:relative}
.hubTabs button.dot::after{content:"";position:absolute;top:5px;right:6px;width:7px;height:7px;border-radius:50%;background:var(--gold)}
.hubBody{margin:4px 0 0}
.hubFooter{display:flex;gap:8px;margin-top:12px}
.hubPanel .hubFooter{position:sticky;bottom:8px;z-index:6;margin:12px -4px 0;padding:8px 4px 4px;background:var(--panel);border-top:1px solid var(--line)}
.primaryButton{flex:1;min-height:48px;border:0;border-radius:var(--r);background:var(--gold);color:#1b1408;font-size:15px;font-weight:700;line-height:1}
.primaryButton:hover{background:#ecc274}.primaryButton:active{transform:scale(.98)}
.primaryButton span{font-size:18px;margin-left:5px}
.primaryButton.small{flex:1;min-height:40px;font-size:14px}
.storeButton{padding:0 13px;border:1px solid var(--line2);border-radius:var(--r);background:var(--raise);font-size:13px}
.secTitle{margin:16px 0 7px;font-size:11px;font-weight:700;line-height:1;letter-spacing:.12em;text-transform:uppercase;color:var(--gold)}
.secTitle:first-child{margin-top:6px}
.secTitle small{color:var(--muted);letter-spacing:0;font-weight:400;margin-left:4px;font-size:11px}
.hint{margin:6px 0!important;color:var(--muted);font-size:12px;line-height:1.4}
.hint b{color:var(--ink)}
.statGrid{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}
.statGrid span{padding:6px 3px;text-align:center;border:1px solid var(--line);border-radius:8px;background:var(--raise)}
.statGrid small{display:block;font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.statGrid b{font-size:15px;font-variant-numeric:tabular-nums}
.slotGrid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.slotTile{position:relative;aspect-ratio:1;display:flex;align-items:center;justify-content:center;padding:4px;border:2px solid var(--rc,var(--line2));border-radius:10px;background:var(--raise)}
.slotTile img{width:66%;height:66%;object-fit:contain}
.slotTile:not(.filled) img{opacity:.3}
.slotTile small{position:absolute;bottom:2px;left:0;right:0;text-align:center;font-size:10px;color:var(--ink);text-shadow:0 1px 2px #000}
.slotTile:active{transform:scale(.97)}
/* rows that slide sideways: the next card peeks in and the edge fades, so a cut-off card reads as "more" */
.chipRow{display:flex;gap:6px;overflow-x:auto;padding:2px 28px 8px 1px;scrollbar-width:none;scroll-snap-type:x proximity;-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent)}
.chipRow::-webkit-scrollbar{display:none}
.chip{flex:0 0 auto;scroll-snap-align:start;display:flex;align-items:center;gap:8px;width:min(212px,68%);padding:6px 10px 6px 6px;border:1px solid var(--line2);border-left:3px solid var(--rc,var(--line2));border-radius:var(--r);background:var(--raise);text-align:left}
.chip img{flex:0 0 34px;width:34px;height:34px;object-fit:contain}
.chip span{min-width:0}
.chip b{display:block;font-size:12.5px}.chip small{display:block;color:var(--muted);font-size:10.5px;line-height:1.25}
.chip.on{border-color:var(--gold);background:var(--gold-dim)}
.chip.locked{opacity:.45}
.chip.curse{width:min(236px,72%)}
.chip.curse.on{border-color:var(--danger);background:#2a1a1e}
.chip:active:not(:disabled){transform:scale(.98)}
.runCard{padding:9px 12px;border:1px solid #3f7a62;border-radius:var(--r);background:#14231d}
.runCard.lost{border-color:#9a5262;background:#26161b}
.runCard b{display:block;font-size:14px}.runCard>small{display:block;color:var(--muted);font-size:11.5px}
.runCard .close{color:#f0c9a0}
.hint.grit b{color:var(--good)}
.hint.unlocks b{color:var(--gold)}
.runStats{display:flex;gap:12px;margin-top:6px;font-size:12px;font-variant-numeric:tabular-nums}
.pills{display:flex;flex-wrap:wrap;gap:5px;margin-top:7px}
.pill{padding:2px 8px;border:1px solid var(--line2);border-radius:99px;font-size:10.5px;color:#d5d9e4;background:var(--raise)}
.pill.gold{border-color:#8d7440;color:var(--gold)}
.packHead{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:8px 0 6px;color:var(--muted);font-size:12px}
.miniButton{padding:7px 12px;border:1px solid var(--line2);border-radius:8px;background:var(--raise);font-size:12px;font-weight:700;color:var(--ink);white-space:nowrap}
.miniButton:disabled{opacity:.4}.miniButton.danger{border-color:#8a4a58;color:#f0aab3}
.filter{flex:0 0 auto;padding:6px 12px;border:1px solid var(--line2);border-radius:99px;background:var(--raise);font-size:11.5px;color:var(--muted)}
.filter.on{border-color:var(--gold);color:var(--gold);background:var(--gold-dim)}
.packList,.starList,.featList{display:grid;gap:6px}
.packRow{display:flex;align-items:center;gap:10px;padding:7px 10px;text-align:left;border:1px solid var(--line);border-left:3px solid var(--rc);border-radius:var(--r);background:var(--raise)}
.packRow.on{background:#16261f}
.packRow img{flex:0 0 44px;width:44px;height:44px;object-fit:contain}
.packRow .txt{min-width:0}.packRow b{font-size:13.5px}
.packRow small{display:block;color:var(--muted);font-size:11px;line-height:1.25}.packRow .stats{color:#c4c9d6}
.starRow{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--line);border-radius:var(--r);background:var(--raise)}
.starRow img{flex:0 0 40px;width:40px;height:40px;object-fit:contain}
.starRow .txt{flex:1;min-width:0}.starRow b{font-size:13.5px}.starRow small{display:block;color:var(--muted);font-size:11.5px}
.pips{display:flex;gap:3px;margin-top:5px}.pips i{width:12px;height:5px;border-radius:2px;background:#2d313d}.pips i.on{background:var(--gold)}
.featRow{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid var(--line);border-radius:var(--r);background:var(--raise);opacity:.7}
.featRow.done{opacity:1;border-color:#8d7440;background:var(--gold-dim)}
.featRow i{font-style:normal;font-size:20px;color:var(--gold);width:24px;text-align:center}
.featRow .txt{flex:1}.featRow b{font-size:13.5px}.featRow small{display:block;color:var(--muted);font-size:11.5px}
.featRow em{font-style:normal;font-size:12px;color:var(--gold)}
.foeGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.foeCard{padding:6px 5px 8px;text-align:center;border:1px solid var(--line);border-radius:var(--r);background:var(--raise)}
.foeCard.elite{border-color:#8d7440}.foeCard.boss{border-color:#9a5262}
.foeCard .portrait{height:62px;display:flex;align-items:flex-end;justify-content:center}
.foeCard img{max-width:100%;max-height:62px;object-fit:contain}
.foeCard.unseen img{filter:brightness(0) opacity(.5)}
.foeCard b{display:block;margin-top:3px;font-size:11.5px;line-height:1.15}
.foeCard small{display:block;color:var(--muted);font-size:10px;line-height:1.25}.foeCard .traits{color:#a2a9bc}
.stagePick{display:flex;align-items:center;justify-content:space-between;gap:10px}
.stagePick span{flex:1;text-align:center}.stagePick b{display:block;font-size:15px}.stagePick small{display:block;color:var(--muted);font-size:11px}
.hubBody .curses{margin-top:8px}

/* the five moves: the weapon's strike across the top, the other four in two rows */
.actionDeck{display:grid;grid-template-columns:repeat(2,1fr);gap:6px;margin-top:8px}
.actionCard{display:flex;align-items:center;gap:8px;min-height:54px;padding:6px 9px 6px 7px;text-align:left;border:1px solid var(--line2);border-radius:var(--r);background:var(--raise)}
.actionCard .ico{flex:0 0 38px;width:38px;height:38px;object-fit:contain}
.actionCard .txt{min-width:0}
.actionCard b,.actionCard .txt>span{display:block}
.actionCard b{font-size:14px;line-height:1.2}
.actionCard .txt>span{margin-top:1px;color:var(--muted);font-size:11px;line-height:1.25;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.primaryAction{grid-column:1/-1;border-color:var(--gold);background:var(--gold-dim)}
.primaryAction .ico{flex-basis:44px;width:44px;height:44px}
.actionDeck.waiting .actionCard{opacity:.65;pointer-events:none}
/* the move that answers the foe's intent */
.actionCard{position:relative}
.actionCard.suggest{border-color:var(--good)}
.actionCard .tag{position:absolute;top:-7px;right:8px;padding:1px 7px;border-radius:99px;background:var(--good);color:#0d2118;font:700 10px/1.5 Inter,ui-sans-serif,system-ui,sans-serif;font-style:normal;letter-spacing:.03em;text-transform:uppercase}
.actionCard:hover:not(:disabled),.rewardCard:hover:not(:disabled){border-color:var(--gold)}
.actionCard:active:not(:disabled),.rewardCard:active:not(:disabled){transform:scale(.98)}

/* discoveries and the rooms between fights */
.rewardDeck>div{display:grid;gap:6px;margin-top:10px}
#deckText:empty{display:none}
.rewardCard{display:flex;align-items:center;gap:11px;min-height:60px;padding:7px 11px 7px 9px;text-align:left;border:1px solid var(--line2);border-left:3px solid var(--rc,var(--line2));border-radius:var(--r);background:var(--raise)}
.rewardCard img{flex:0 0 46px;width:46px;height:46px;object-fit:contain}
.rewardCard .txt{flex:1;min-width:0}
.rewardCard b,.rewardCard .txt>span,.rewardCard .txt small{display:block}
.rewardCard .txt>span{color:#c4c9d6;font-size:12px;line-height:1.3}
.rewardCard .txt small{margin-top:2px;color:var(--muted);font-size:11px;line-height:1.25}
.rewardCard .price{font-style:normal;flex:0 0 auto;padding:3px 9px;border:1px solid #8d7440;border-radius:99px;font-size:12px;font-weight:700;color:var(--gold);background:var(--gold-dim);font-variant-numeric:tabular-nums}
.rewardCard .price.short{border-color:#8a4a58;color:#f0aab3;background:#26161b}
.rewardCard.sold{opacity:.4}
.rewardCard:disabled{cursor:not-allowed}

/* what happened last, newest first */
.log{margin-top:8px;padding:8px 11px;border-left:2px solid var(--gold);background:var(--panel);color:#c9cedb;font-size:12px;border-radius:0 var(--r) var(--r) 0}
.log p{margin:0}
.log p+p{opacity:.7}
.log p+p+p{opacity:.5}
.gameShell button:disabled{opacity:.5;cursor:wait}

/* one item */
.sheetBack{position:fixed;inset:0;z-index:60;display:flex;align-items:flex-end;justify-content:center;background:#07080cd9}
.sheet{position:relative;width:min(510px,100%);max-height:88vh;overflow-y:auto;padding:16px 14px 22px;border:1px solid var(--line2);border-bottom:0;border-radius:16px 16px 0 0;background:var(--panel);animation:rise .25s var(--ease)}
.sheetClose{position:absolute;top:10px;right:12px;width:32px;height:32px;border:1px solid var(--line2);border-radius:50%;background:var(--raise);font-size:14px;padding:0}
.sheetHead{display:flex;align-items:center;gap:13px;padding-right:34px}
.sheetHead img{flex:0 0 72px;width:72px;height:72px;object-fit:contain;padding:6px;border:2px solid var(--rc);border-radius:12px;background:var(--raise)}
.sheetHead b{display:block;font-size:17px;line-height:1.15}.sheetHead small{display:block;color:var(--muted);font-size:11.5px;margin-top:2px}
.sheetStats{list-style:none;margin:12px 0 6px;padding:0;display:grid;gap:5px}
.sheetStats li{padding:7px 10px;border:1px solid var(--line);border-radius:8px;background:var(--raise);font-size:13px}
.sheetStats li.sub{border-color:#4b4466;color:#e3d9ff}.sheetStats li small{display:block;color:var(--muted);font-size:11px}
.sheetStats em{font-style:normal;font-size:11px;margin-left:6px}.sheetStats em.up{color:var(--good)}.sheetStats em.down{color:var(--danger)}
.sheetBtns{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}

@keyframes rise{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.actionDeck,.rewardDeck{animation:rise .3s var(--ease)}

@media(max-width:400px){
  .gameShell{padding:8px 8px 24px}
  .intentCard{width:120px;padding:5px 7px 5px 5px}
  .intentIcon{flex-basis:28px;width:28px;height:28px}
  .intentCard small{display:none}
}
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important}
}
