/* Forest RPG: a mobile-first journal and HUD over the existing game. */
body.forest-rpg {
  --ink: #f3ead3;
  --muted: #b0bfab;
  --gold: #e5c47e;
  --mint: #b7d2ad;
  --panel: #14291ff5;
  --line: #baad7955;
  --rpg-topbar: 58px;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--rpg-tg-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--rpg-tg-bottom, 0px));
  --safe-left: max(env(safe-area-inset-left, 0px), var(--rpg-tg-left, 0px));
  --safe-right: max(env(safe-area-inset-right, 0px), var(--rpg-tg-right, 0px));
  height: var(--rpg-height, 100dvh);
  background: #07100e;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.forest-rpg #app { width: 100%; height: 100%; max-width: 1680px; max-height: none; border: 0; border-radius: 0; background: #14281c; }
.forest-rpg button, .forest-rpg select { min-height: 44px; touch-action: manipulation; }
.forest-rpg button:focus-visible, .forest-rpg select:focus-visible { outline: 2px solid #ffe5a8; outline-offset: 3px; }
.forest-rpg button:disabled { cursor: default; }
.forest-rpg .rpg-topbar { position: absolute; z-index: 18; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: calc(var(--rpg-topbar) + var(--safe-top)); padding: calc(6px + var(--safe-top)) calc(16px + var(--safe-right)) 6px calc(16px + var(--safe-left)); border-bottom: 1px solid #cbb78045; background: linear-gradient(110deg, #152820fa, #102019f7); box-shadow: 0 5px 24px #0004; }
.forest-rpg .rpg-brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: #f3e3bc; font: 700 16px/1.05 Georgia, "Times New Roman", serif; white-space: nowrap; }
.forest-rpg .rpg-brand small { display: block; margin-top: 5px; color: #a6b49b; font: 600 8px/1.2 system-ui, sans-serif; letter-spacing: 2px; }
.forest-rpg .rpg-emblem { display: grid; place-items: center; width: 33px; height: 38px; color: #e5c47e; font: 29px Georgia, serif; border: 1px solid #b09b5e77; border-radius: 12px 12px 16px 16px; background: #8f984018; }
.forest-rpg .rpg-settings { display: flex; align-items: center; flex-shrink: 0; gap: 6px; }
.forest-rpg .rpg-settings button, .forest-rpg .rpg-quality { border: 1px solid #afac7752; background: #172e24; color: #e2dfc8; border-radius: 10px; padding: 8px 11px; font: 650 12px/1.2 system-ui, sans-serif; }
.forest-rpg .rpg-settings button:disabled, .forest-rpg .rpg-quality:disabled { color: #93a18e; opacity: .75; }
.forest-rpg .rpg-view-button { min-width: 44px; font-variant-numeric: tabular-nums; }
.forest-rpg .rpg-view-button[aria-pressed="true"] { background: #3e4e30; color: #ffe4a7; border-color: #c5ad6f; }
.forest-rpg .rpg-quality { max-width: 110px; padding-right: 6px; }
.forest-rpg .rpg-settings .rpg-quest-button { display: flex; align-items: center; gap: 6px; border-color: #d1b66e8f; color: #f4d797; background: #5b522c44; }
.forest-rpg .rpg-quest-badge { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #ebcf87; color: #243726; font-size: 10px; }
.forest-rpg .rpg-render-notice { position: absolute; z-index: 19; top: calc(var(--rpg-topbar) + var(--safe-top) + 8px); left: 50%; transform: translateX(-50%); width: min(440px, calc(100% - 24px)); padding: 10px 14px; color: #ead5ac; background: #302d20f5; border: 1px solid #ac986277; border-radius: 10px; font-size: 12px; line-height: 1.45; pointer-events: none; }

.forest-rpg .overlay { padding: calc(var(--rpg-topbar) + var(--safe-top) + 18px) calc(var(--safe-right) + 14px) calc(var(--safe-bottom) + 18px) calc(var(--safe-left) + 14px); background: linear-gradient(110deg, #08170dde, #0b1b1380 56%, #0b1a11b0); backdrop-filter: blur(4px); }
.forest-rpg .overlay .panel { max-width: 490px; padding: 28px; border: 1px solid #b8ae786b; border-radius: 22px; background: radial-gradient(ellipse at 10% 0%, #46643b55, transparent 48%), linear-gradient(135deg, #1b3328f5, #102019f7); box-shadow: 0 22px 90px #0009, inset 0 0 0 5px #d5c58506; scrollbar-color: #687552 #172a20; }
.forest-rpg .panel::before { display: block; left: 35px; right: 35px; background: linear-gradient(90deg, transparent, #d9bd77, transparent); }
.forest-rpg .eyebrow { color: #c9be91; font-size: 9px; letter-spacing: 2px; line-height: 1.5; }
.forest-rpg .panel h1 { margin: 18px 0 14px; color: #f5e6bd; font: 700 clamp(38px, 7vw, 57px)/.96 Georgia, "Times New Roman", serif; letter-spacing: -1.5px; text-shadow: 0 3px 24px #0005; }
.forest-rpg .panel h1 span { color: #b9cf9f; }
.forest-rpg .panel h2 { color: #f0dfb7; font-family: Georgia, "Times New Roman", serif; letter-spacing: -.6px; }
.forest-rpg .panel p { color: #bfccb8; font-size: 13px; line-height: 1.65; }
.forest-rpg .preview-row { padding: 12px 0; margin: 8px 0 12px; border-color: #b8ae7840; }
.forest-rpg #portrait { background: radial-gradient(#49613a55, #071e184f); border-color: #b7a77066; border-radius: 14px; }
.forest-rpg .preview-row strong { font-family: Georgia, "Times New Roman", serif; font-size: 16px; color: #ece3c8; }
.forest-rpg .preview-row small { color: #aebfa5; line-height: 1.5; }
.forest-rpg .hero-picker { gap: 8px; margin: 16px 0 10px; }
.forest-rpg .hero-picker button { position: relative; overflow: hidden; min-height: 78px; padding: 13px 4px; border: 1px solid #b5b18a40; border-radius: 12px; color: #e1dfc5; background: linear-gradient(#244031, #192d24); transition: border-color .15s, background .15s; }
.forest-rpg .hero-picker button::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 2px; background: #b7a06b50; }
.forest-rpg .hero-picker b { font-size: 14px; }
.forest-rpg .hero-picker small { margin-top: 8px; font-size: 10px; color: #adbda4; }
.forest-rpg .hero-picker button.selected { border-color: #ddc07a; background: linear-gradient(#52613b, #293c29); box-shadow: inset 0 0 22px #cebc6812; color: #ffebae; }
.forest-rpg .hero-picker button.selected::before { background: #f5d88e; }
.forest-rpg .rpg-journey { display: flex; flex-wrap: wrap; gap: 5px 13px; justify-content: center; margin: 10px 0 16px; color: #bfc7a9; font-size: 10px; line-height: 1.6; }
.forest-rpg .primary { min-height: 52px; border: 1px solid #f0d695; border-radius: 11px; color: #233324; background: linear-gradient(110deg, #e8cf8d, #c8a660); box-shadow: 0 4px 15px #0003, inset 0 1px 0 #fff6; font-size: 13px; letter-spacing: .5px; }
.forest-rpg .secondary { min-height: 44px; border-color: #b7b68545; color: #d8dfc7; background: #ced79b06; border-radius: 10px; }
.forest-rpg .secondary:hover { border-color: #cdbb7b99; background: #ced79b0e; }
.forest-rpg .menu-actions { gap: 8px; }
.forest-rpg .rpg-menu-quests { grid-column: 1 / -1; color: #ebd39b; }
.forest-rpg .connection-box { background: #081b1455; border-color: #8a9e6d4d; }
.forest-rpg .cloud-badge { font-size: 10px; }
.forest-rpg .panel .mini-note { font-size: 10px; color: #9dac94; }
.forest-rpg .privacy-link, .forest-rpg .telegram-link { color: #c9c792; }
.forest-rpg #version { bottom: calc(4px + var(--safe-bottom)); color: #c2c6a877; font-size: 8px; }

.forest-rpg .hud { top: calc(var(--rpg-topbar) + var(--safe-top)); padding-top: 12px; max-width: 600px; background: linear-gradient(#091912d9, #09191280 78%, transparent); }
.forest-rpg .hud .iconbtn { width: 44px; height: 44px; }
.forest-rpg .xp-track { height: 6px; border-color: #d5d19c26; }
.forest-rpg .xp-track i { background: linear-gradient(90deg, #79a779, #c9d494); }
.forest-rpg .chip { border-color: #bdbb7940; background: #152e22da; color: #d1ddbe; }
.forest-rpg #portalHint { top: calc(var(--rpg-topbar) + var(--safe-top) + 168px); }
.forest-rpg #eliteBar { top: calc(var(--rpg-topbar) + var(--safe-top) + 208px); }
.forest-rpg .realm-top { top: calc(var(--rpg-topbar) + var(--safe-top)); padding-top: 10px; background: linear-gradient(#10251eed, #10251fa0, transparent); }
.forest-rpg .realm-heading { justify-content: flex-start; gap: 8px; }
.forest-rpg .realm-heading > b { margin-right: auto; font: 700 18px/1.2 Georgia, serif; color: #efe0b9; }
.forest-rpg .realm-heading button, .forest-rpg .realm-heading #realmOnline { min-height: 44px; height: 44px; min-width: 44px; border-color: #aeaf7566; border-radius: 10px; }
.forest-rpg .realm-heading #realmOnline { font-size: 10px; min-width: 70px; padding: 6px 9px; }
.forest-rpg .realm-vitals { min-height: 22px; }
.forest-rpg .realm-vitals > span { max-width: 64%; line-height: 1.35; }
.forest-rpg .realm-tabs { gap: 6px; margin-top: 8px; }
.forest-rpg .realm-tabs button { min-height: 44px; border-color: #aaa76f66; border-radius: 9px; font-size: 11px; background: #163025eb; }
.forest-rpg .realm-tabs .selected { border-color: #e0c180; background: #596440dd; color: #ffebaf; }
.forest-rpg #realmNetworkWarning { top: calc(var(--rpg-topbar) + var(--safe-top) + 153px); }
.forest-rpg .bottomhud, .forest-rpg .realm-controls { padding-top: 15px; }
.forest-rpg .hero-switch button, .forest-rpg .realm-controls button { min-width: 48px; min-height: 54px; border-color: #b0ab746b; color: #e8e1c0; background: linear-gradient(#274336f2, #152c22f2); }
.forest-rpg .hero-switch button.selected, .forest-rpg #realmHeroes .selected { border-color: #e5c078; color: #ffe7a7; background: linear-gradient(#647049f5, #3c5034f5); }
.forest-rpg #dash, .forest-rpg #realmDash { border-color: #d6bd798c; color: #f3dfa6; background: radial-gradient(at 50% 20%, #515e35f0, #152b22f5); }
.forest-rpg #ability, .forest-rpg #realmAbility { color: #f1d9ee; background: radial-gradient(at 50% 20%, #655079f0, #2d243cf5); border-color: #bf9cccaa; }
.forest-rpg #socialPanel { top: calc(var(--rpg-topbar) + var(--safe-top) + 146px); border-color: #b4aa7777; background: linear-gradient(140deg, #243d2ff7, #10251cfb); }
.forest-rpg .social-heading { background: #1f352bf5; }
.forest-rpg .social-heading button { min-width: 44px; min-height: 44px; }
.forest-rpg .realm-dialog button, .forest-rpg .shop-tabs button { min-height: 44px; }
.forest-rpg .realm-dialog { padding-top: calc(var(--rpg-topbar) + var(--safe-top) + 12px); }
.forest-rpg .rpg-quest-tracker { position: absolute; z-index: 8; top: calc(var(--rpg-topbar) + var(--safe-top) + 176px); right: calc(12px + var(--safe-right)); display: flex; flex-direction: column; align-items: flex-start; gap: 5px; width: min(210px, 49%); padding: 11px 13px; border: 0; border-left: 2px solid #d2b876; border-radius: 0 10px 10px 0; background: linear-gradient(100deg, #14261ded, #14261d9c); color: #e9dbb5; text-align: left; box-shadow: 0 6px 20px #0002; }
.forest-rpg .rpg-quest-tracker small { color: #cfbe86; font-size: 8px; letter-spacing: 1.1px; }
.forest-rpg .rpg-quest-tracker strong { font-size: 12px; line-height: 1.4; }
.forest-rpg .rpg-quest-tracker > span { color: #bfcea9; font-size: 10px; }

.forest-rpg .rpg-quest-overlay { position: absolute; z-index: 30; inset: 0; display: flex; align-items: center; justify-content: center; padding: calc(18px + var(--safe-top)) calc(14px + var(--safe-right)) calc(18px + var(--safe-bottom)) calc(14px + var(--safe-left)); background: #07150dd9; backdrop-filter: blur(8px); overscroll-behavior: contain; touch-action: pan-y; }
.forest-rpg .rpg-journal { display: flex; flex-direction: column; width: min(100%, 620px); max-height: 100%; padding: 24px; overflow: auto; overscroll-behavior: contain; border: 1px solid #bdae7580; border-radius: 20px; background: radial-gradient(ellipse at 100% 0, #65704222, transparent 40%), linear-gradient(145deg, #1d3429, #10241c); box-shadow: 0 28px 100px #000a, inset 0 0 0 5px #e8cc7705; scrollbar-width: thin; scrollbar-color: #798460 #173026; }
.forest-rpg .rpg-journal-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.forest-rpg .rpg-overline { color: #b7b286; font-size: 9px; font-weight: 700; letter-spacing: 2px; }
.forest-rpg .rpg-journal h2 { margin: 9px 0 0; color: #f0dfb5; font: 700 29px/1.15 Georgia, "Times New Roman", serif; letter-spacing: -.5px; }
.forest-rpg .rpg-close { flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid #bbb07c66; border-radius: 11px; color: #e6d6ad; background: #12251d; font-size: 18px; }
.forest-rpg .rpg-npc-row { display: flex; align-items: center; gap: 16px; padding: 17px 0; border-block: 1px solid #b4b27833; }
.forest-rpg .rpg-npc-portrait { display: grid; place-items: center; flex: 0 0 62px; width: 62px; height: 74px; border: 1px solid #b7b17b88; border-radius: 22px 22px 15px 15px; background: radial-gradient(#72835766, #152c21); color: #d5d7a0; font: 48px Georgia, serif; box-shadow: inset 0 0 0 4px #b5b47b0b; }
.forest-rpg .rpg-npc-row p { margin: 0; color: #c6d0b7; font: italic 15px/1.55 Georgia, "Times New Roman", serif; }
.forest-rpg .rpg-quest-scope { margin: 12px 0 0; color: #a7b99e; font-size: 11px; line-height: 1.5; }
.forest-rpg .rpg-combat-note { margin: 10px 0 0; color: #e1c393; font-size: 11px; line-height: 1.5; }
.forest-rpg .rpg-journal-status { padding: 12px 14px; margin: 14px 0 0; border: 1px solid #c6b27055; border-radius: 10px; background: #b6af4410; color: #e8d5a3; font-size: 13px; line-height: 1.55; }
.forest-rpg .rpg-quest-list { display: grid; gap: 12px; margin-top: 18px; }
.forest-rpg .rpg-quest-card { border: 1px solid #aab3804a; border-radius: 13px; padding: 16px; background: linear-gradient(110deg, #293e2c99, #10251c77); }
.forest-rpg .rpg-quest-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.forest-rpg .rpg-quest-state { color: #afc6a0; font-size: 9px; font-weight: 750; letter-spacing: .7px; text-transform: uppercase; }
.forest-rpg .rpg-quest-symbol { color: #c3b47a; font-size: 18px; }
.forest-rpg .rpg-quest-card h3 { margin: 5px 0 9px; color: #ebe3c5; font: 700 21px/1.2 Georgia, "Times New Roman", serif; }
.forest-rpg .rpg-quest-card p { margin: 0 0 13px; color: #b5c2ab; font-size: 12px; line-height: 1.6; }
.forest-rpg .rpg-quest-card progress { display: block; width: 100%; height: 6px; overflow: hidden; border: 0; border-radius: 8px; color: #b6cb8a; background: #091c13; appearance: none; }
.forest-rpg .rpg-quest-card progress::-webkit-progress-bar { background: #091c13; border-radius: 8px; }
.forest-rpg .rpg-quest-card progress::-webkit-progress-value { background: linear-gradient(90deg, #729e6c, #c6d493); border-radius: 8px; }
.forest-rpg .rpg-quest-card progress::-moz-progress-bar { background: #b6cb8a; border-radius: 8px; }
.forest-rpg .rpg-quest-count { margin: 6px 0 9px; color: #b6c9a4; font: 600 10px/1.4 system-ui, sans-serif; text-align: right; font-variant-numeric: tabular-nums; }
.forest-rpg .rpg-quest-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.forest-rpg .rpg-quest-reward { color: #e6cc87; font-size: 11px; font-weight: 650; }
.forest-rpg .rpg-quest-action { padding: 10px 16px; border: 1px solid #d9c183; border-radius: 9px; background: linear-gradient(#dfca89, #baa163); color: #233627; font: 750 12px/1.3 system-ui, sans-serif; }
.forest-rpg .rpg-quest-action:disabled { opacity: .65; }
.forest-rpg .rpg-quest-ready { border-color: #d2b66fa6; background: linear-gradient(110deg, #71663338, #172d2088); }
.forest-rpg .rpg-quest-ready .rpg-quest-state { color: #eed393; }
.forest-rpg .rpg-quest-locked { background: #0c201766; border-style: dashed; }
.forest-rpg .rpg-quest-locked .rpg-quest-state { color: #9eae96; }
.forest-rpg .rpg-quest-locked h3, .forest-rpg .rpg-quest-claimed h3 { color: #bac9ae; }
.forest-rpg .rpg-quest-locked .rpg-quest-reward { color: #bbaf82; }
.forest-rpg .rpg-quest-claimed { background: #14302366; }
.forest-rpg .rpg-journal-footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.forest-rpg .rpg-journal-footer .primary { flex: 1 1 180px; }
.forest-rpg .rpg-journal-footer .secondary { flex: 1 1 100px; width: auto; margin-top: 0; }

@media (max-width: 520px) {
  .forest-rpg .rpg-topbar { padding-left: calc(10px + var(--safe-left)); padding-right: calc(10px + var(--safe-right)); }
  .forest-rpg .rpg-brand { gap: 7px; font-size: 13px; }
  .forest-rpg .rpg-emblem { display: none; }
  .forest-rpg .rpg-brand small { letter-spacing: 1px; font-size: 7px; }
  .forest-rpg .rpg-settings { gap: 4px; }
  .forest-rpg .rpg-settings button, .forest-rpg .rpg-quality { padding: 8px; font-size: 11px; }
  .forest-rpg .rpg-quality { max-width: 88px; }
  .forest-rpg .overlay .panel { padding: 23px 21px; }
  .forest-rpg .rpg-journal { padding: 20px 17px; }
  .forest-rpg .rpg-journal h2 { font-size: 26px; }
  .forest-rpg .rpg-quest-card { padding: 14px; }
}
@media (max-width: 370px) {
  .forest-rpg .rpg-brand > span:not(.rpg-emblem) { max-width: 76px; white-space: normal; line-height: 1.1; }
  .forest-rpg .rpg-brand small { display: none; }
  .forest-rpg .rpg-topbar { gap: 4px; }
  .forest-rpg .rpg-quality { max-width: 82px; }
  .forest-rpg .overlay .panel { padding: 20px 15px; }
  .forest-rpg .hero-picker { gap: 5px; }
  .forest-rpg .hero-picker b { font-size: 12px; }
  .forest-rpg .hero-picker small { font-size: 9px; }
  .forest-rpg .realm-tabs { gap: 4px; }
  .forest-rpg .realm-tabs button { font-size: 10px; }
  .forest-rpg .hero-switch button, .forest-rpg .realm-controls button { min-width: 44px; }
  .forest-rpg .rpg-quest-tracker { width: 47%; padding: 9px; }
  .forest-rpg .rpg-quest-tracker strong { font-size: 11px; }
  .forest-rpg .rpg-journal h2 { font-size: 23px; }
}
@media (min-width: 900px) and (min-height: 650px) {
  .forest-rpg #startScreen { justify-content: flex-start; padding-left: max(6vw, var(--safe-left)); background: linear-gradient(90deg, #08170dcc, #09171088 45%, #0d1d0d33); backdrop-filter: none; }
  .forest-rpg #startScreen .panel { margin: auto 0; max-width: 465px; }
  .forest-rpg .realm-top { max-width: 660px; }
  .forest-rpg .rpg-quest-tracker { top: calc(var(--rpg-topbar) + var(--safe-top) + 24px); right: calc(26px + var(--safe-right)); width: 245px; padding: 16px; }
  .forest-rpg .realm-controls, .forest-rpg .bottomhud { left: 16px; right: 16px; }
  .forest-rpg .rpg-topbar { padding-left: calc(26px + var(--safe-left)); padding-right: calc(26px + var(--safe-right)); }
  .forest-rpg .rpg-journal { max-height: min(820px, 100%); }
}
@media (orientation: landscape) and (max-height: 600px) {
  body.forest-rpg { --rpg-topbar: 54px; }
  .forest-rpg .rpg-topbar { padding-top: calc(4px + var(--safe-top)); padding-bottom: 4px; }
  .forest-rpg .rpg-brand { font-size: 15px; }
  .forest-rpg .rpg-brand small { font-size: 7px; }
  .forest-rpg .rpg-emblem { height: 33px; }
  .forest-rpg .overlay { padding-top: calc(var(--rpg-topbar) + var(--safe-top) + 9px); padding-bottom: calc(9px + var(--safe-bottom)); }
  .forest-rpg .overlay .panel { max-width: 680px; padding: 18px 24px; }
  .forest-rpg #startScreen h1 { font-size: 33px; margin: 12px 0 9px; }
  .forest-rpg #startScreen h1 br { display: none; }
  .forest-rpg #startScreen h1 span::before { content: " "; }
  .forest-rpg #startScreen .preview-row, .forest-rpg #startScreen .controls { display: none; }
  .forest-rpg .hero-picker button { min-height: 60px; padding: 8px 5px; }
  .forest-rpg .hero-picker small { margin-top: 5px; }
  .forest-rpg .rpg-journey { margin-bottom: 10px; }
  .forest-rpg .hud { padding-top: 6px; max-width: 56%; }
  .forest-rpg .hudright { gap: 6px; }
  .forest-rpg .hearts { font-size: 15px; }
  .forest-rpg .realm-top { padding-top: 5px; }
  .forest-rpg .realm-heading { max-width: 48%; }
  .forest-rpg .realm-vitals { top: 14px; max-width: 48%; }
  .forest-rpg .realm-tabs { max-width: 660px; margin-top: 4px; }
  .forest-rpg .realm-tabs button { min-height: 44px; }
  .forest-rpg .realm-controls { bottom: calc(6px + var(--safe-bottom)); padding-top: 4px; }
  .forest-rpg .realm-controls button, .forest-rpg .hero-switch button { min-height: 44px; }
  .forest-rpg #realmDash, .forest-rpg #realmAbility { height: 52px; }
  .forest-rpg .bottomhud { padding-top: 4px; }
  .forest-rpg #portalHint { top: calc(var(--rpg-topbar) + var(--safe-top) + 114px); }
  .forest-rpg #eliteBar { top: calc(var(--rpg-topbar) + var(--safe-top) + 111px); }
  .forest-rpg #socialPanel { top: calc(var(--rpg-topbar) + var(--safe-top) + 108px); bottom: calc(66px + var(--safe-bottom)); }
  .forest-rpg #realmNetworkWarning { top: calc(var(--rpg-topbar) + var(--safe-top) + 107px); }
  .forest-rpg #realmBuffs { top: 107px; }
  .forest-rpg .rpg-quest-tracker { top: calc(var(--rpg-topbar) + var(--safe-top) + 118px); width: 180px; max-width: 29%; padding: 8px 11px; gap: 3px; }
  .forest-rpg .rpg-quest-tracker strong { font-size: 11px; }
  .forest-rpg .rpg-quest-overlay { padding-top: calc(8px + var(--safe-top)); padding-bottom: calc(8px + var(--safe-bottom)); }
  .forest-rpg .rpg-journal { width: min(740px, 100%); padding: 16px 22px; }
  .forest-rpg .rpg-journal-heading { margin-bottom: 10px; }
  .forest-rpg .rpg-journal h2 { font-size: 25px; }
  .forest-rpg .rpg-npc-row { padding: 10px 0; }
  .forest-rpg .rpg-npc-portrait { width: 48px; height: 55px; flex-basis: 48px; font-size: 37px; }
  .forest-rpg .rpg-quest-list { gap: 10px; }
}
@media (pointer: fine) {
  .forest-rpg .realm-tabs button:hover, .forest-rpg .hero-picker button:hover { border-color: #e5c47e; }
}
@media (prefers-reduced-motion: reduce) {
  .forest-rpg *, .forest-rpg *::before, .forest-rpg *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* A quiet combat surface. Secondary information remains available in the menu. */
body.forest-rpg {
  --ink: #dde6dc;
  --muted: #a0b1a4;
  --gold: #c5c2a5;
  --mint: #9ab8a1;
  --panel: #172820f7;
  --line: #a0b3a329;
  --rpg-topbar: 48px;
}
.forest-rpg .rpg-topbar {
  min-height: calc(48px + var(--safe-top));
  padding: calc(2px + var(--safe-top)) calc(10px + var(--safe-right)) 2px calc(12px + var(--safe-left));
  gap: 8px;
  background: #14241cf2;
  border-bottom: 1px solid #a9baa51c;
  box-shadow: none;
}
.forest-rpg .rpg-brand { gap: 8px; color: #dce3d5; font: 650 13px/1.25 system-ui, sans-serif; letter-spacing: 0; }
.forest-rpg .rpg-brand > span:not(.rpg-emblem) { max-width: none; white-space: nowrap; }
.forest-rpg .rpg-brand .rpg-view-status { color: #91a493; font: 500 10px/1 system-ui, sans-serif; }
.forest-rpg .rpg-settings { gap: 4px; }
.forest-rpg .rpg-settings button { min-height: 44px; border: 0; box-shadow: none; background: transparent; color: #b8c8b7; border-radius: 9px; padding: 8px 10px; }
.forest-rpg .rpg-settings .rpg-quest-button { font-size: 11px; color: #c4d0bc; background: transparent; border: 0; }
.forest-rpg .rpg-settings .rpg-settings-button { width: 44px; min-width: 44px; font-size: 21px; padding: 8px; }
.forest-rpg .rpg-settings button[aria-expanded="true"] { background: #ffffff09; }
.forest-rpg .rpg-quest-badge { width: 15px; height: 15px; background: #93ad95; color: #15271e; font-size: 9px; }
.forest-rpg button:focus-visible, .forest-rpg select:focus-visible { outline-color: #b2ceb4; outline-width: 2px; }

.forest-rpg .hud {
  top: calc(var(--rpg-topbar) + var(--safe-top));
  padding: 2px calc(12px + var(--safe-right)) 12px calc(12px + var(--safe-left));
  max-width: 440px;
  background: linear-gradient(#122019b8, #12201960 78%, transparent);
}
.forest-rpg .topline { min-height: 44px; gap: 10px; }
.forest-rpg .hearts { color: #e2a394; font-size: 16px; letter-spacing: .2px; font-weight: 650; }
.forest-rpg .hudright { gap: 10px; }
.forest-rpg .timer { font-size: 13px; color: #c7d1c2; font-weight: 550; }
.forest-rpg .hud .iconbtn { width: 44px; height: 44px; border: 0; background: transparent; font-size: 16px; color: #bbcbbb; }
.forest-rpg .xp-label { margin: 0 0 4px; color: #a7b9a0; font-size: 9px; font-weight: 500; }
.forest-rpg .xp-label strong { color: #c4d4b9; font-weight: 650; }
.forest-rpg .xp-track { height: 3px; border: 0; background: #101d1780; }
.forest-rpg .xp-track i { background: #7d9c79; }
.forest-rpg #bossbar, .forest-rpg #eliteBar {
  position: static; inset: auto; margin: 8px 0 0; padding: 6px 8px;
  border: 0; border-radius: 6px; background: #1b2421cc;
}
.forest-rpg #bossbar .name, .forest-rpg #eliteBar b {
  color: #c6b8bb; font: 550 10px/1.3 system-ui, sans-serif;
  margin: 0 0 5px; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.forest-rpg #bossbar .track, .forest-rpg #eliteBar > div { height: 3px; border-radius: 3px; background: #444346; overflow: hidden; }
.forest-rpg #bossfill, .forest-rpg #eliteFill { background: #a58699; }

.forest-rpg .bottomhud, .forest-rpg .realm-controls {
  align-items: flex-end; gap: 6px; padding-top: 8px;
  background: linear-gradient(transparent, #12221970);
}
.forest-rpg .bottomhud { left: 0; right: 0; padding-left: calc(10px + var(--safe-left)); padding-right: calc(10px + var(--safe-right)); padding-bottom: calc(10px + var(--safe-bottom)); }
.forest-rpg .realm-controls { left: calc(10px + var(--safe-left)); right: calc(10px + var(--safe-right)); bottom: calc(10px + var(--safe-bottom)); }
.forest-rpg .hero-switch, .forest-rpg #realmHeroes { gap: 4px; margin-right: auto; }
.forest-rpg .hero-switch button, .forest-rpg .realm-controls button,
.forest-rpg #dash, .forest-rpg #ability, .forest-rpg #realmDash, .forest-rpg #realmAbility {
  min-width: 44px; min-height: 44px; width: 48px; height: 54px;
  border: 1px solid #a4b5a32c; border-radius: 12px;
  color: #becdbb; background: #192c24e8; box-shadow: none;
  font-size: 19px; font-weight: 550;
}
.forest-rpg .hero-switch button.selected, .forest-rpg #realmHeroes .selected {
  border-color: #819a7f; color: #dfebd6; background: #314738e8; box-shadow: inset 0 -2px 0 #91ac87;
}
.forest-rpg .hero-switch span, .forest-rpg .realm-controls button small { font-size: 9px; font-weight: 500; margin-top: 3px; }
.forest-rpg #dash, .forest-rpg #ability, .forest-rpg #realmDash, .forest-rpg #realmAbility { flex: 0 0 58px; width: 58px; height: 58px; }
.forest-rpg #ability, .forest-rpg #realmAbility { background: #29302fe8; border-color: #a6afb24d; color: #d0d0d8; }
.forest-rpg #ability:disabled, .forest-rpg #realmAbility:disabled,
.forest-rpg #dash:disabled, .forest-rpg #realmDash:disabled { background: #1b2825df; border-color: #91a09825; color: #abb5aa; opacity: 1; }
.forest-rpg #abilityGlyph, .forest-rpg #dash .glyph { font-size: 21px; line-height: 23px; }
.forest-rpg #abilityLabel, .forest-rpg #dash .label { max-width: 54px; font-size: 10px; letter-spacing: 0; line-height: 1.2; font-weight: 600; }
.forest-rpg #realmAbility { order: 1; }
.forest-rpg #realmDash { order: 2; }
.forest-rpg #version { display: none; }

.forest-rpg .realm-top { top: calc(var(--rpg-topbar) + var(--safe-top)); max-width: 480px; padding: 2px calc(12px + var(--safe-right)) 12px calc(12px + var(--safe-left)); background: linear-gradient(#122019b8, #12201960 78%, transparent); }
.forest-rpg .realm-heading { max-width: none; min-height: 44px; gap: 8px; }
.forest-rpg .realm-heading > b { margin-right: auto; color: #c6d2c1; font: 550 12px/1.3 system-ui, sans-serif; }
.forest-rpg .realm-tabs { display: flex; gap: 4px; margin: 0; max-width: none; }
.forest-rpg .realm-tabs button { min-width: 52px; width: auto; min-height: 44px; height: 44px; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: #aebfab; font-size: 11px; }
.forest-rpg .realm-tabs button.selected { background: #d6e2bb0b; color: #d7e1c8; border: 0; box-shadow: inset 0 -2px 0 #7d9978; }
.forest-rpg .realm-vitals { position: static; max-width: none; margin: 2px 0 0; min-height: 20px; }
.forest-rpg .realm-vitals > b { font-size: 14px; color: #e2a394; }
.forest-rpg #socialPanel { inset: calc(var(--rpg-topbar) + var(--safe-top) + 8px) calc(10px + var(--safe-right)) calc(10px + var(--safe-bottom)) calc(10px + var(--safe-left)); z-index: 5; max-width: 650px; width: auto; transform: none; border: 1px solid #a4b2a540; background: #182b22fc; border-radius: 15px; }
.forest-rpg .social-heading { background: #182b22; }
.forest-rpg .social-heading h2 { font-size: 20px; }
.forest-rpg .social-heading button { background: transparent; border-color: #a4b2a52b; }
.forest-rpg .social-card { border-color: #a1b3a134; background: #101f184f; }

/* Messages flow in one stack; none is anchored over the player. */
.forest-rpg .rpg-notices {
  position: absolute; z-index: 4; left: calc(12px + var(--safe-left)); right: calc(12px + var(--safe-right));
  bottom: calc(82px + var(--safe-bottom)); display: flex; flex-direction: column; align-items: center; gap: 5px;
  pointer-events: none;
}
.forest-rpg.rpg-shared #app > .rpg-notices { display: none; }
.forest-rpg .rpg-shared-notices { z-index: 2; }
.forest-rpg .rpg-notice-messages { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 100%; }
.forest-rpg .rpg-notice-actions { display: flex; align-items: stretch; justify-content: center; gap: 6px; width: 100%; max-width: 420px; }
.forest-rpg .rpg-notices .rpg-notice-actions > button { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.forest-rpg .rpg-notices #toast, .forest-rpg .rpg-notices #portalHint,
.forest-rpg .rpg-notices #lootNotice, .forest-rpg .rpg-notices #interact,
.forest-rpg .rpg-notices #realmNotice, .forest-rpg .rpg-notices #realmNetworkWarning {
  position: static; inset: auto; width: auto; max-width: min(100%, 420px); margin: 0; transform: none;
  border: 0; box-shadow: none; text-align: center; font-size: 11px; line-height: 1.4;
}
.forest-rpg .rpg-notices #toast { opacity: 1; }
.forest-rpg .rpg-notices #toast:not(.visible) { display: none; }
.forest-rpg .rpg-notices #toast strong,
.forest-rpg .rpg-notices #portalHint,
.forest-rpg .rpg-notices #realmNotice {
  padding: 7px 10px; border: 0; border-radius: 7px; background: #17291feb;
  color: #c4d0b9; font-size: 11px; font-weight: 500; box-shadow: none; line-height: 1.4;
}
.forest-rpg .rpg-notices #realmNetworkWarning { background: #362f25ef; color: #e0ceb0; border-radius: 7px; padding: 7px 10px; }
.forest-rpg .rpg-notices #lootNotice, .forest-rpg .rpg-notices #interact { pointer-events: auto; min-height: 44px; padding: 8px 14px; border: 1px solid #a5b29c4d; border-radius: 10px; background: #263d2df2; color: #d8e1c7; font-weight: 550; }
.forest-rpg #networkToast { top: calc(var(--rpg-topbar) + var(--safe-top) + 8px); bottom: auto; z-index: 20; width: calc(100% - 24px); max-width: 440px; border-color: #a8b39e44; background: #203127f7; box-shadow: none; color: #d5ddc6; font-size: 11px; }

/* Both dialogs use the same focus and input-blocking controller. */
.forest-rpg .rpg-quest-overlay { background: #08110ccb; backdrop-filter: blur(4px); }
.forest-rpg .rpg-journal { border-color: #a7b2a13b; background: #192b22; box-shadow: 0 18px 60px #0005; border-radius: 17px; padding: 22px; }
.forest-rpg .rpg-journal-heading { margin-bottom: 14px; }
.forest-rpg .rpg-journal h2 { margin: 0; color: #dbe3d3; font: 650 23px/1.3 system-ui, sans-serif; letter-spacing: -.4px; }
.forest-rpg .rpg-overline { color: #91a28e; font-size: 8px; margin-bottom: 6px; letter-spacing: 1.1px; }
.forest-rpg .rpg-close { border: 0; background: #ffffff05; color: #b8c7b2; border-radius: 10px; }
.forest-rpg .rpg-npc-row { gap: 12px; padding: 13px 0; border-color: #a2b39820; }
.forest-rpg .rpg-npc-portrait { width: 44px; height: 53px; flex-basis: 44px; font-size: 35px; background: #2c4131; border-color: #a2b39830; border-radius: 13px; box-shadow: none; }
.forest-rpg .rpg-npc-row p { color: #bac9b1; font-size: 13px; }
.forest-rpg .rpg-quest-card { background: #203228; border-color: #a1b3972b; }
.forest-rpg .rpg-quest-card h3 { font: 650 17px/1.3 system-ui, sans-serif; color: #d6e0cf; }
.forest-rpg .rpg-quest-card p { color: #aebfa5; }
.forest-rpg .rpg-quest-reward { color: #c4c5a3; }
.forest-rpg .rpg-quest-action, .forest-rpg .primary { color: #e1e8d7; border: 1px solid #8da28077; background: #496044; box-shadow: none; font-weight: 650; }
.forest-rpg .rpg-quest-ready { border-color: #91a97b7d; background: #283d2b; }
.forest-rpg .rpg-quest-ready .rpg-quest-state { color: #bed0a9; }
.forest-rpg .rpg-journal-status { border-color: #aab69438; background: #91a4720b; color: #c6d1b6; font-size: 12px; }
.forest-rpg .rpg-preferences { width: min(100%, 420px); padding: 18px; }
.forest-rpg .rpg-settings-group + .rpg-settings-group { border-top: 1px solid #a6b69b25; margin-top: 18px; padding-top: 16px; }
.forest-rpg .rpg-settings-group h3 { font: 550 11px/1.4 system-ui, sans-serif; color: #a8b7a0; margin: 0 0 10px; }
.forest-rpg .rpg-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; color: #ced9c6; font-size: 13px; }
.forest-rpg .rpg-preferences .rpg-view-button, .forest-rpg .rpg-preferences .rpg-quality { min-height: 44px; min-width: 90px; max-width: 150px; padding: 8px 12px; font-size: 12px; color: #d4e0c9; background: #2c4131; border: 1px solid #b1bd9a38; border-radius: 9px; }
.forest-rpg .rpg-preferences .rpg-view-button[aria-pressed="true"] { border-color: #91a381; background: #354c35; }
.forest-rpg .rpg-preferences .rpg-quality { width: 136px; }
.forest-rpg .rpg-preferences .rpg-view-button:disabled, .forest-rpg .rpg-preferences .rpg-quality:disabled { color: #91a18b; opacity: .7; }
.forest-rpg .rpg-preferences .rpg-render-notice { position: static; transform: none; width: auto; margin-top: 10px; padding: 9px 10px; color: #d8c6a4; background: #352e22; border-color: #a9996933; border-radius: 8px; font-size: 11px; }
.forest-rpg .rpg-preferences .subhud { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 0; }
.forest-rpg .rpg-preferences .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.forest-rpg .rpg-preferences .chip { padding: 6px 0; border: 0; background: transparent; font-size: 12px; font-weight: 500; color: #b2c3a8; }
.forest-rpg .rpg-preferences .chip b { color: #d1d7b9; }
.forest-rpg .rpg-preferences .smallcap { font-size: 10px; line-height: 1.4; color: #9cae92; letter-spacing: .4px; }
.forest-rpg .rpg-preferences #saveGame { width: 100%; min-height: 44px; height: auto; margin-top: 14px; border: 1px solid #a7b39230; border-radius: 9px; background: #283c2d; color: #c9d5bd; font-size: 12px; }
.forest-rpg .rpg-world-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.forest-rpg .rpg-world-actions button { min-height: 44px; padding: 8px; border: 1px solid #a6b69b30; border-radius: 9px; background: #24392b; color: #c6d4ba; font-size: 12px; }
.forest-rpg .rpg-preferences #realmStatus { display: block; margin-top: 14px; font-size: 11px; color: #a5b79a; line-height: 1.5; }
.forest-rpg .rpg-preferences #realmBuffs { position: static; max-width: none; margin-top: 8px; gap: 6px; }
.forest-rpg .rpg-preferences #realmBuffs span { border-color: #a6b49c30; background: #26392d; color: #c1cfb6; font-size: 11px; padding: 6px; }
.forest-rpg .rpg-preferences .rpg-quest-tracker { position: static; width: 100%; max-width: none; margin-top: 14px; padding: 12px; border: 1px solid #9dac8738; border-radius: 10px; background: #30412f; color: #c9d5bc; box-shadow: none; gap: 4px; }
.forest-rpg .rpg-quest-tracker small { color: #a8b793; letter-spacing: .7px; }
.forest-rpg .rpg-preferences .rpg-combat-note { margin: 0 0 12px; font-size: 11px; color: #c3b797; }
.forest-rpg .overlay .panel { background: #192d23f7; border-color: #a5b29840; box-shadow: 0 18px 60px #0005; }
.forest-rpg .panel::before, .forest-rpg .hero-picker button::before { display: none; }
.forest-rpg .hero-picker button { background: #24382b; border-color: #a5b29430; color: #bdceb2; }
.forest-rpg .hero-picker button.selected { background: #3c5137; border-color: #8da07a; color: #dce7cd; box-shadow: none; }
.forest-rpg .panel h1 { color: #dce5d4; text-shadow: none; }
.forest-rpg .panel h1 span { color: #b1c29c; }

/* Quiet rarity hierarchy: the type is written out, with one narrow color edge. */
.forest-rpg #upgradeScreen { align-items: safe center; }
.forest-rpg #upgradeScreen .panel { padding: 22px; max-width: 420px; }
.forest-rpg #upgradeScreen h2 { margin: 13px 0 9px; font: 650 24px/1.2 system-ui, sans-serif; letter-spacing: -.35px; color: #dce5d4; }
.forest-rpg #upgradeScreen .panel > p { color: #aebfa6; font-size: 12px; line-height: 1.5; }
.forest-rpg #upgradeScreen .choice-list { gap: 9px; margin: 15px 0 5px; }
.forest-rpg #upgradeScreen .choice[data-rarity] { border-radius: 11px; background: #22362a; }
.forest-rpg #upgradeScreen .choice[data-rarity] strong { color: #dbe4d0; }
.forest-rpg #upgradeScreen .choice[data-rarity]:hover { background: #2a3d2e; }
.forest-rpg #upgradeScreen .secondary { border-color: #a4b79b30; background: #a4cfac05; color: #b8c7af; }
@media (max-width: 370px) {
  .forest-rpg #upgradeScreen { padding-left: 12px; padding-right: 12px; }
  .forest-rpg #upgradeScreen .panel { padding: 18px; }
  .forest-rpg #upgradeScreen h2 { font-size: 22px; }
  .forest-rpg #upgradeScreen .choice[data-rarity] { padding: 10px; gap: 9px; }
}
@media (orientation: landscape) and (max-height: 600px) {
  .forest-rpg #upgradeScreen { padding: 8px 16px; }
  .forest-rpg #upgradeScreen .panel { max-width: 640px; padding: 14px 18px; }
  .forest-rpg #upgradeScreen h2 { margin: 6px 0; font-size: 20px; }
  .forest-rpg #upgradeScreen .panel > p { margin: 4px 0; font-size: 10px; }
  .forest-rpg #upgradeScreen .choice-list { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 9px 0 3px; gap: 8px; }
  .forest-rpg #upgradeScreen .choice[data-rarity] { min-height: 118px; }
  .forest-rpg #upgradeScreen .secondary { min-height: 44px; margin-top: 6px; }
}

@media (max-width: 370px) {
  .forest-rpg .rpg-topbar { padding-left: calc(9px + var(--safe-left)); padding-right: calc(7px + var(--safe-right)); gap: 5px; }
  .forest-rpg .rpg-brand { font-size: 12px; gap: 5px; }
  .forest-rpg .rpg-settings .rpg-quest-button { padding: 8px; font-size: 10px; }
  .forest-rpg .hud { padding-left: calc(10px + var(--safe-left)); padding-right: calc(10px + var(--safe-right)); }
  .forest-rpg .bottomhud { padding-left: calc(8px + var(--safe-left)); padding-right: calc(8px + var(--safe-right)); }
  .forest-rpg .hero-switch button, .forest-rpg #realmHeroes button { width: 44px; min-width: 44px; }
  .forest-rpg .realm-controls { left: calc(8px + var(--safe-left)); right: calc(8px + var(--safe-right)); }
  .forest-rpg .rpg-journal { padding: 16px; }
  .forest-rpg .rpg-journal h2 { font-size: 21px; }
  .forest-rpg .realm-heading > b { font-size: 11px; }
}
@media (orientation: landscape) and (max-height: 600px) {
  body.forest-rpg { --rpg-topbar: 48px; }
  .forest-rpg .rpg-brand { font-size: 13px; }
  .forest-rpg .hud { max-width: 350px; padding-top: 0; padding-bottom: 8px; }
  .forest-rpg .realm-top { max-width: 400px; padding-top: 0; }
  .forest-rpg .realm-heading { max-width: none; }
  .forest-rpg .realm-vitals { position: static; max-width: none; margin-top: 0; }
  .forest-rpg .bottomhud { padding-bottom: calc(7px + var(--safe-bottom)); padding-top: 4px; }
  .forest-rpg .realm-controls { bottom: calc(7px + var(--safe-bottom)); padding-top: 4px; }
  .forest-rpg .hero-switch button, .forest-rpg .realm-controls button { height: 48px; min-height: 44px; }
  .forest-rpg #dash, .forest-rpg #ability, .forest-rpg #realmDash, .forest-rpg #realmAbility { height: 52px; flex-basis: 60px; width: 60px; }
  .forest-rpg .rpg-notices { left: 28%; right: 20%; bottom: calc(69px + var(--safe-bottom)); gap: 4px; }
  /* Keep passive updates to the right in short views; two actions share one row.
     Even when all four notices are visible, their stack cannot cover the hero. */
  .forest-rpg #app > .rpg-notices { left: calc(12px + var(--safe-left)); right: calc(12px + var(--safe-right)); }
  .forest-rpg .rpg-notice-messages { position: absolute; bottom: 0; right: 0; width: min(28vw, 240px); align-items: stretch; }
  .forest-rpg .rpg-notice-actions { width: 40%; margin-left: 25%; margin-right: 35%; }
  .forest-rpg .rpg-shared-notices { left: auto; right: calc(12px + var(--safe-right)); width: min(28vw, 240px); }
  .forest-rpg .rpg-notices #toast strong, .forest-rpg .rpg-notices #portalHint, .forest-rpg .rpg-notices #realmNotice { font-size: 10px; padding: 5px 8px; }
  .forest-rpg .rpg-journal { width: min(650px, 100%); padding: 16px 20px; }
  .forest-rpg .rpg-preferences { width: min(500px, 100%); }
  .forest-rpg .rpg-journal h2 { font-size: 21px; }
  .forest-rpg #socialPanel { top: calc(var(--rpg-topbar) + var(--safe-top) + 6px); bottom: calc(7px + var(--safe-bottom)); }
}
