/* Shared text/control contrast, scoped per theme. Colors only; no layout or behavior changes. */
html[data-theme=light]{--ui-control-bg:#ddcfb1;--ui-control-fg:#403628;--ui-disabled-bg:#cec5b1;--ui-disabled-fg:#494839;--ui-selected-fg:#403628;--ui-arrow-filter:brightness(.25);--ui-field-danger:#a33237;}
html[data-theme=parchment]{--ui-control-bg:#d0bd99;--ui-control-fg:#3d3025;--ui-disabled-bg:#c5b699;--ui-disabled-fg:#494032;--ui-selected-fg:#3d3025;--ui-arrow-filter:brightness(.25);--ui-field-danger:#a33237;}
html[data-theme=stone]{--ui-control-bg:#d9cdbb;--ui-control-fg:#3d3730;--ui-disabled-bg:#cbc0b1;--ui-disabled-fg:#48443d;--ui-selected-fg:#3d3730;--ui-arrow-filter:brightness(.25);--ui-field-danger:#a33237;}
html[data-theme=graphite]{--ui-control-bg:#343d41;--ui-control-fg:#e7edec;--ui-disabled-bg:#293034;--ui-disabled-fg:#b6c5c8;--ui-selected-fg:#d5f2e2;--ui-arrow-filter:none;--ui-field-danger:#ff9090;}
html[data-theme=slate]{--ui-control-bg:#c9d1d6;--ui-control-fg:#26343e;--ui-disabled-bg:#c0c8cd;--ui-disabled-fg:#3f515c;--ui-selected-fg:#172f3d;--ui-arrow-filter:brightness(.25);--ui-field-danger:#a33237;}
html[data-theme=browser]{--ui-control-bg:#d4dde1;--ui-control-fg:#263339;--ui-disabled-bg:#c3cdd1;--ui-disabled-fg:#3c515c;--ui-selected-fg:#ffffff;--ui-arrow-filter:brightness(.25);--ui-field-danger:#a33237;}
html[data-theme=old]{--ui-control-bg:#444444;--ui-control-fg:#fffd55;--ui-disabled-bg:#333333;--ui-disabled-fg:#dddddd;--ui-selected-fg:#fffd55;--ui-arrow-filter:none;--ui-field-danger:#ff9090;}
html[data-theme=old-memory]{--ui-control-bg:#f0fbf1;--ui-control-fg:#000000;--ui-disabled-bg:#d9e5cd;--ui-disabled-fg:#40582b;--ui-selected-fg:#000080;--ui-arrow-filter:brightness(.25);--ui-field-danger:#a33237;}
html[data-theme=old-night]{--ui-control-bg:#f0e6d1;--ui-control-fg:#000000;--ui-disabled-bg:#c5c2b9;--ui-disabled-fg:#384044;--ui-selected-fg:#f4d06e;--ui-arrow-filter:brightness(.25);--ui-field-danger:#a33237;}
html[data-theme=old-bronze]{--ui-control-bg:#4a3526;--ui-control-fg:#edc898;--ui-disabled-bg:#352a21;--ui-disabled-fg:#cda982;--ui-selected-fg:#ffe2ba;--ui-arrow-filter:none;--ui-field-danger:#ff9090;}

html[data-theme]:not([data-theme=dark]) #game :is(button,input,select,textarea,.combat-choice summary,.combat-choice-options){background:var(--ui-control-bg)!important;color:var(--ui-control-fg)!important;text-shadow:none!important;}
html[data-theme]:not([data-theme=dark]) #game :is(button,summary,select,input,textarea):disabled,html[data-theme]:not([data-theme=dark]) #game .combat-choice summary[aria-disabled=true]{background:var(--ui-disabled-bg)!important;color:var(--ui-disabled-fg)!important;opacity:1!important;}
html[data-theme]:not([data-theme=dark]) #game button :is(span,strong,small),html[data-theme]:not([data-theme=dark]) #game .combat-choice summary :is(span,strong,small){color:inherit!important;text-shadow:none!important;}
html[data-theme]:not([data-theme=dark]) #game nav.b_foot button{background:var(--ui-control-bg)!important;color:var(--ui-control-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game nav.b_foot button[aria-current=page]{background:var(--dg-active,#30383d)!important;color:var(--ui-selected-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game :is(#location-spells,#combat-content,:is(#player-interaction-controls,#npc-target-actions)) :is(button,summary){background:var(--ui-control-bg)!important;color:var(--ui-control-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game :is(#location-spells,#combat-content,:is(#player-interaction-controls,#npc-target-actions)) button:disabled{background:var(--ui-disabled-bg)!important;color:var(--ui-disabled-fg)!important;opacity:1!important;}
html[data-theme]:not([data-theme=dark]) #game :is(#location-spells,#combat-content,:is(#player-interaction-controls,#npc-target-actions)) .combat-choice summary[aria-disabled=true]{background:var(--ui-disabled-bg)!important;color:var(--ui-disabled-fg)!important;opacity:1!important;}
html[data-theme]:not([data-theme=dark]) #game :is(#location-spells,#combat-content,:is(#player-interaction-controls,#npc-target-actions)) .combat-choice-options button{background:var(--ui-control-bg)!important;color:var(--ui-control-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game :is(#location-spells,#combat-content,:is(#player-interaction-controls,#npc-target-actions)) .combat-choice-options button:is(:hover,:focus-visible,[aria-pressed=true]){background:var(--ui-disabled-bg)!important;color:var(--ui-disabled-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game :is(#location-spells,#combat-content,:is(#player-interaction-controls,#npc-target-actions)) .combat-choice summary::after{color:inherit!important;opacity:1!important;}
html[data-theme]:not([data-theme=dark]) #game :is(#location-spells,#combat-content,:is(#player-interaction-controls,#npc-target-actions)) .combat-choice summary.kit-empty{color:var(--ui-field-danger)!important;opacity:1!important;}
html[data-theme]:not([data-theme=dark]) #game #compass .direction,html[data-theme]:not([data-theme=dark]) #game #compass .compass-refresh{background:var(--ui-control-bg)!important;color:var(--ui-control-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game #compass .direction strong{color:inherit!important;}
html[data-theme]:not([data-theme=dark]) #game #compass .direction strong::before,html[data-theme]:not([data-theme=dark]) #game #compass .compass-refresh img{filter:var(--ui-arrow-filter)!important;opacity:1!important;}
html[data-theme]:not([data-theme=dark]) #game #compass .direction:disabled{background:var(--ui-disabled-bg)!important;color:var(--ui-disabled-fg)!important;opacity:1!important;}
html[data-theme]:not([data-theme=dark]) #game :is(input,textarea)::placeholder{color:var(--ui-disabled-fg)!important;opacity:1!important;}

html[data-theme=light]{--ui-text-fg:#403628;--ui-text-muted:#514634;--ui-text-link:#553719;--ui-text-red:#851b27;--ui-text-green:#15502c;--ui-text-blue:#164869;--ui-active-bg:#8a591b;--ui-selected-fg:#ffffff;--ui-field-danger:#781b25;}

html[data-theme=parchment]{--ui-text-fg:#3d3025;--ui-text-muted:#4c3c2e;--ui-text-link:#4c2e19;--ui-text-red:#781b25;--ui-text-green:#174729;--ui-text-blue:#143e59;--ui-active-bg:#8a591b;--ui-selected-fg:#ffffff;--ui-field-danger:#781b25;}

html[data-theme=stone]{--ui-text-fg:#3d3730;--ui-text-muted:#484239;--ui-text-link:#4f3924;--ui-text-red:#851b27;--ui-text-green:#15492b;--ui-text-blue:#17445e;--ui-active-bg:#8a591b;--ui-selected-fg:#ffffff;--ui-field-danger:#781b25;}

html[data-theme=graphite]{--ui-text-fg:#e7edec;--ui-text-muted:#b4c5c5;--ui-text-link:#a6dfc5;--ui-text-red:#ff9299;--ui-text-green:#95d9b2;--ui-text-blue:#b6d9f1;--ui-active-bg:#3c6657;--ui-selected-fg:#f0fff7;--ui-field-danger:#ff9090;}

html[data-theme=slate]{--ui-text-fg:#26343e;--ui-text-muted:#3b4f5b;--ui-text-link:#164967;--ui-text-red:#851b27;--ui-text-green:#174e2c;--ui-text-blue:#164967;--ui-active-bg:#a9bbc5;--ui-selected-fg:#172f3d;--ui-field-danger:#781b25;}

html[data-theme=browser]{--ui-text-fg:#263339;--ui-text-muted:#3b4f5b;--ui-text-link:#19495e;--ui-text-red:#851b27;--ui-text-green:#174e2c;--ui-text-blue:#19495e;--ui-active-bg:#476978;--ui-selected-fg:#ffffff;--ui-field-danger:#781b25;}

html[data-theme=old]{--ui-text-fg:#ffffff;--ui-text-muted:#dddddd;--ui-text-link:#fffd55;--ui-text-red:#ff9090;--ui-text-green:#74fe7a;--ui-text-blue:#a1c3ff;--ui-active-bg:#444444;--ui-selected-fg:#fffd55;--ui-field-danger:#ff9090;}

html[data-theme=old-memory]{--ui-text-fg:#000000;--ui-text-muted:#40582b;--ui-text-link:#000080;--ui-text-red:#851b27;--ui-text-green:#00551a;--ui-text-blue:#173e86;--ui-active-bg:#bcdc7c;--ui-selected-fg:#000080;--ui-field-danger:#781b25;}

html[data-theme=old-night]{--ui-text-fg:#ffffff;--ui-text-muted:#ceccb6;--ui-text-link:#f4d06e;--ui-text-red:#ff9090;--ui-text-green:#83df71;--ui-text-blue:#accfff;--ui-active-bg:#694a26;--ui-selected-fg:#fff0bb;--ui-field-danger:#781b25;}

html[data-theme=old-bronze]{--ui-text-fg:#ffe2ba;--ui-text-muted:#d3b28f;--ui-text-link:#edc898;--ui-text-red:#ffa48e;--ui-text-green:#b9e297;--ui-text-blue:#b6d2ed;--ui-active-bg:#6e4c33;--ui-selected-fg:#ffe2ba;--ui-field-danger:#ff9090;}

/* Body text, captions and item details in all game sections. */
html[data-theme]:not([data-theme=dark]) #game :is(p,small,strong,h1,h2,h3,h4,dt,dd,td,th,label,summary,span){color:var(--ui-text-fg)!important;text-shadow:none!important;}
html[data-theme]:not([data-theme=dark]) #game :is(.muted,small,.menu-value,.map-instruction,.map-current,.mail-delivery-status),html[data-theme]:not([data-theme=dark]) .game-version-footer{color:var(--ui-text-muted)!important;text-shadow:none!important;}
html[data-theme]:not([data-theme=dark]) #game a,html[data-theme]:not([data-theme=dark]) #game a :is(span,strong),html[data-theme]:not([data-theme=dark]) #game :is(.equipment-slot-details summary,.ore-name,.mine-name,.quest-npc-name){color:var(--ui-text-link)!important;}
html[data-theme]:not([data-theme=dark]) #game :is(#mine-dig,#ore-dig){color:var(--ui-text-link)!important;}
html[data-theme]:not([data-theme=dark]) #game #location-experience-label,html[data-theme]:not([data-theme=dark]) #game #location-experience-label span{color:var(--ui-text-muted)!important;}
html[data-theme]:not([data-theme=dark]) #game #location-experience-label .experience-remaining-number{color:var(--ui-text-red)!important;}
html[data-theme]:not([data-theme=dark]) #game :is(.stats-form label,.inventory-function-help,.inventory-help,.equipment-help,.clan-summary){background:transparent!important;color:var(--ui-text-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game :is(.experience-panel p,.equipment-slot-info span,.equipment-slot-info small,.equipment-item-card h4){color:var(--ui-text-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game :is(.location-combat-hit,.location-combat-death,.spell-mana-hint,.equipment-failure,.mining-exhausted,.nick-red){color:var(--ui-text-red)!important;}
html[data-theme]:not([data-theme=dark]) #game :is(.location-combat-magic,.equipment-success,.equipment-equipped,.status-online,.player-form-label,.clan-experience-bonus,.mail-receipt.is-read,.nick-green,.nickname-green,.nickname-color-green,.mining-chance){color:var(--ui-text-green)!important;}
html[data-theme]:not([data-theme=dark]) #game :is(.location-action-chat,.location-message,.location-message-row,.chat-message,.nick-blue){color:var(--ui-text-blue)!important;}
html[data-theme]:not([data-theme=dark]) #game :is(.location-combat-hit,.location-combat-death,.location-combat-magic,.location-action-chat,.location-message,.location-message-row,.chat-message) :is(span,strong,time){color:inherit!important;}
/* A cream button must not inherit white captions or green nickname colors. */
html[data-theme]:not([data-theme=dark]) #game button :is(span,strong,small),html[data-theme]:not([data-theme=dark]) #game button.mail-dialog :is(span,strong,small,a),html[data-theme]:not([data-theme=dark]) #game button.avatar-equipment-slot :is(span,strong,small){color:inherit!important;text-shadow:none!important;}
html[data-theme]:not([data-theme=dark]) #game button.mail-dialog :is(span,strong,small,a){color:var(--ui-control-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game nav.b_foot button[aria-current=page]{background:var(--ui-active-bg)!important;color:var(--ui-selected-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game nav.b_foot button :is(span,strong,small),html[data-theme]:not([data-theme=dark]) #game #character-nav-label{color:inherit!important;}
html[data-theme]:not([data-theme=dark]) #game :is(#location-spells,#combat-content,:is(#player-interaction-controls,#npc-target-actions)) .combat-choice summary.kit-empty{color:var(--ui-field-danger)!important;}
html[data-theme]:not([data-theme=dark]) #game :is(#location-spells,#combat-content,:is(#player-interaction-controls,#npc-target-actions)) .combat-choice-options button:disabled{background:var(--ui-disabled-bg)!important;color:var(--ui-disabled-fg)!important;opacity:1!important;}
html[data-theme]:not([data-theme=dark]) #game .mail-link-badge,html[data-theme]:not([data-theme=dark]) #game .mail-badge,html[data-theme]:not([data-theme=dark]) #game button.mail-dialog .mail-badge{background:#b21e31!important;color:#ffffff!important;}
html[data-theme]:not([data-theme=dark]) #game .resource .value{color:#ffffff!important;text-shadow:0 1px 1px #000000!important;}
html[data-theme=old] #game,html[data-theme=old] .page{background:#333333!important;}

html[data-theme]:not([data-theme=dark]) #game #stats-view .stats-form{background:var(--dg-panel,#292d30)!important;color:var(--ui-text-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game .ability-setting small{color:var(--ui-text-muted)!important;}
html[data-theme]:not([data-theme=dark]) #game :is(.gate-quest-npc a,.character-menu-row a,.craft-table a){color:var(--ui-text-link)!important;}
html[data-theme]:not([data-theme=dark]) #game :is(.menu-value,#stat-points-link){color:var(--ui-text-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game button.mail-dialog .player-nickname{color:var(--ui-control-fg)!important;}

html[data-theme]:not([data-theme=dark]) #game time{color:var(--ui-text-muted)!important;}
html[data-theme]:not([data-theme=dark]) #game .mining-skill-gain{color:var(--ui-text-red)!important;}
html[data-theme]:not([data-theme=dark]) .notice{background:var(--ui-control-bg)!important;color:var(--ui-field-danger)!important;}
html[data-theme]:not([data-theme=dark]) .notice.success{color:var(--ui-text-green)!important;}
html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory],[data-theme=old-night]) .notice.success{color:#15502c!important;}

html[data-theme]:not([data-theme=dark]) #game #clan-content>h3{color:var(--ui-text-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game .mail-bubble small{color:var(--ui-text-muted)!important;}
html[data-theme]:not([data-theme=dark]) #game .mail-bubble .mail-receipt.is-read{color:var(--ui-text-green)!important;}
html[data-theme]:not([data-theme=dark]) #game :is(.inventory-ore,.bank-balances,.crest-option,.monster-study,.elixir-description,.new-player-gift){background:var(--dg-panel,#292d30)!important;color:var(--ui-text-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game .crest-option:has(input:checked){background:var(--ui-disabled-bg)!important;}
html[data-theme]:not([data-theme=dark]) #game .building-sign{color:var(--ui-text-link)!important;}
html[data-theme]:not([data-theme=dark]) #game .title{color:var(--ui-text-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game :is(#bank-view,#hotel-view) .title{color:var(--ui-text-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game #world-player-position,html[data-theme]:not([data-theme=dark]) #game .world-map-legend{color:var(--ui-text-fg)!important;}
html[data-theme]:not([data-theme=dark]) #game #city-map .map-node small{color:inherit!important;}
html[data-theme]:not([data-theme=dark]) #game :is(.gate-quest-npc a,.ore-feature a,.gold-feature a){color:var(--ui-text-link)!important;}

html[data-theme]:not([data-theme=dark]) #game .building-entry a{color:var(--ui-text-link)!important;}
html[data-theme]:not([data-theme=dark]) #game button[class] :is(span,strong,small){color:inherit!important;}

html[data-theme=dark] #game .player-nickname.nick-gold{color:#ffd58b!important;}
html[data-theme=dark] #game .player-nickname.nick-purple{color:#dcb2ff!important;}
html[data-theme=dark] #game .player-nickname.nick-silver{color:#d4d9df!important;}
html[data-theme=dark] #game .player-nickname.nick-orange{color:#ffbd7a!important;}
html[data-theme=dark] #game .player-nickname.nick-cyan{color:#8bdee0!important;}
html[data-theme=light] #game .player-nickname.nick-gold{color:#61400e!important;}
html[data-theme=light] #game .player-nickname.nick-purple{color:#613085!important;}
html[data-theme=light] #game .player-nickname.nick-silver{color:#424b51!important;}
html[data-theme=light] #game .player-nickname.nick-orange{color:#7b3305!important;}
html[data-theme=light] #game .player-nickname.nick-cyan{color:#00545d!important;}
html[data-theme=parchment] #game .player-nickname.nick-gold{color:#61400e!important;}
html[data-theme=parchment] #game .player-nickname.nick-purple{color:#613085!important;}
html[data-theme=parchment] #game .player-nickname.nick-silver{color:#424b51!important;}
html[data-theme=parchment] #game .player-nickname.nick-orange{color:#7b3305!important;}
html[data-theme=parchment] #game .player-nickname.nick-cyan{color:#00545d!important;}
html[data-theme=stone] #game .player-nickname.nick-gold{color:#61400e!important;}
html[data-theme=stone] #game .player-nickname.nick-purple{color:#613085!important;}
html[data-theme=stone] #game .player-nickname.nick-silver{color:#424b51!important;}
html[data-theme=stone] #game .player-nickname.nick-orange{color:#7b3305!important;}
html[data-theme=stone] #game .player-nickname.nick-cyan{color:#00545d!important;}
html[data-theme=graphite] #game .player-nickname.nick-gold{color:#ffd58b!important;}
html[data-theme=graphite] #game .player-nickname.nick-purple{color:#dcb2ff!important;}
html[data-theme=graphite] #game .player-nickname.nick-silver{color:#d4d9df!important;}
html[data-theme=graphite] #game .player-nickname.nick-orange{color:#ffbd7a!important;}
html[data-theme=graphite] #game .player-nickname.nick-cyan{color:#8bdee0!important;}
html[data-theme=slate] #game .player-nickname.nick-gold{color:#61400e!important;}
html[data-theme=slate] #game .player-nickname.nick-purple{color:#613085!important;}
html[data-theme=slate] #game .player-nickname.nick-silver{color:#424b51!important;}
html[data-theme=slate] #game .player-nickname.nick-orange{color:#7b3305!important;}
html[data-theme=slate] #game .player-nickname.nick-cyan{color:#00545d!important;}
html[data-theme=browser] #game .player-nickname.nick-gold{color:#61400e!important;}
html[data-theme=browser] #game .player-nickname.nick-purple{color:#613085!important;}
html[data-theme=browser] #game .player-nickname.nick-silver{color:#424b51!important;}
html[data-theme=browser] #game .player-nickname.nick-orange{color:#7b3305!important;}
html[data-theme=browser] #game .player-nickname.nick-cyan{color:#00545d!important;}
html[data-theme=old] #game .player-nickname.nick-gold{color:#ffd58b!important;}
html[data-theme=old] #game .player-nickname.nick-purple{color:#dcb2ff!important;}
html[data-theme=old] #game .player-nickname.nick-silver{color:#d4d9df!important;}
html[data-theme=old] #game .player-nickname.nick-orange{color:#ffbd7a!important;}
html[data-theme=old] #game .player-nickname.nick-cyan{color:#8bdee0!important;}
html[data-theme=old-memory] #game .player-nickname.nick-gold{color:#61400e!important;}
html[data-theme=old-memory] #game .player-nickname.nick-purple{color:#613085!important;}
html[data-theme=old-memory] #game .player-nickname.nick-silver{color:#424b51!important;}
html[data-theme=old-memory] #game .player-nickname.nick-orange{color:#7b3305!important;}
html[data-theme=old-memory] #game .player-nickname.nick-cyan{color:#00545d!important;}
html[data-theme=old-night] #game .player-nickname.nick-gold{color:#ffd58b!important;}
html[data-theme=old-night] #game .player-nickname.nick-purple{color:#dcb2ff!important;}
html[data-theme=old-night] #game .player-nickname.nick-silver{color:#d4d9df!important;}
html[data-theme=old-night] #game .player-nickname.nick-orange{color:#ffbd7a!important;}
html[data-theme=old-night] #game .player-nickname.nick-cyan{color:#8bdee0!important;}
html[data-theme=old-bronze] #game .player-nickname.nick-gold{color:#ffd58b!important;}
html[data-theme=old-bronze] #game .player-nickname.nick-purple{color:#dcb2ff!important;}
html[data-theme=old-bronze] #game .player-nickname.nick-silver{color:#d4d9df!important;}
html[data-theme=old-bronze] #game .player-nickname.nick-orange{color:#ffbd7a!important;}
html[data-theme=old-bronze] #game .player-nickname.nick-cyan{color:#8bdee0!important;}
html[data-theme]:not([data-theme=dark]) #game .crest-option:has(input:checked) small{color:var(--ui-disabled-fg)!important;}

/* Old night navigation follows its dark panels, independent of cream form controls. */
html[data-theme=old-night]:not([data-theme=dark]) #game nav.b_foot button{background:#15242c!important;color:#f4d06e!important;border-color:#666666!important;}
html[data-theme=old-night]:not([data-theme=dark]) #game nav.b_foot button:is(:hover,:focus-visible){background:#263e4a!important;color:#fff0bb!important;}
html[data-theme=old-night]:not([data-theme=dark]) #game nav.b_foot button[aria-current=page]{background:#694a26!important;color:#fff0bb!important;border-color:#f4d06e!important;}
html[data-theme=old-night]:not([data-theme=dark]) #game nav.b_foot button :is(span,strong,small),html[data-theme=old-night]:not([data-theme=dark]) #game nav.b_foot #character-nav-label{color:inherit!important;}

#game .arena-heading{color:var(--ui-text-blue,#70bcff)!important}#npc-target-view{text-align:center}#npc-target-content{max-width:340px;margin:auto}#npc-target-content .npc-target-actions{display:flex;flex-direction:column;gap:8px;max-width:265px;margin:16px auto}#npc-target-content .npc-target-actions>button,#npc-target-content form{width:100%}#npc-target-content form{display:flex;flex-direction:column;gap:7px}#npc-target-content progress{width:100%}#npc-target-content .npc-target-name{color:var(--ui-text-red,#ff6262)}#npc-target-content .npc-target-dialogue{color:var(--ui-text-blue,#70bcff)}

#game a.rules-link,#game .title.rules-link{color:var(--ui-text-red,#ff6262)!important}#game a.rules-link{text-decoration:underline}

.inventory-sort{display:flex;gap:8px;align-items:center;justify-content:center;margin:10px 0}.inventory-sort select{max-width:200px}.inventory-order-actions{display:flex;gap:4px;justify-content:flex-end;grid-column:1/-1;margin-top:6px}.inventory-order-actions button{min-width:32px;padding:4px 8px}.inventory-order-actions button[draggable]{cursor:grab}#bank-storage-items form{display:flex;gap:8px;align-items:end;flex-wrap:wrap}#bank-storage-items input{width:90px}

/* Mine content keeps its layout without a surrounding frame. */
#game :is(#mine-view,#ore-view,#gem-view) > .b{border:0!important;box-shadow:none!important;}

/* Player names stay green inside red, blue and neutral log messages. */
#game :is(#location-view,#mine-view,#vein-view,#ore-view,#gem-view) .log-player-nickname{color:var(--ui-text-green,#70d48d)!important;font-weight:600;}

.api-recovery{max-width:700px;margin:8px auto;padding:10px;box-sizing:border-box;border:1px solid #94714c;text-align:center}.api-recovery p{margin:0 0 7px}.api-recovery button{max-width:100%}

.inventory-sort{flex-wrap:wrap}.inventory-kind-filter,.inventory-category-navigation{display:flex;align-items:center;justify-content:center;gap:7px;flex-wrap:wrap}.inventory-category-navigation{margin:10px auto}.inventory-category-navigation select{max-width:100%}

html{--log-magic:#c99aff;}html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]){--log-magic:#7132a3;}
#game :is(#location-view,#mine-view,#vein-view,#ore-view,#gem-view,#combat-view) .log-tone-magic,#game :is(#location-view,#mine-view,#vein-view,#ore-view,#gem-view,#combat-view) .log-tone-magic :is(span,strong,small,time):not(.log-player-nickname){color:var(--log-magic)!important;}
#game :is(#location-view,#mine-view,#vein-view,#ore-view,#gem-view,#combat-view) .log-tone-heal,#game :is(#location-view,#mine-view,#vein-view,#ore-view,#gem-view,#combat-view) .log-tone-heal :is(span,strong,small,time):not(.log-player-nickname){color:var(--ui-text-red,#ff6262)!important;}

.herb-name.herb-health{color:#ff7777!important}.herb-name.herb-mana{color:#78c6ff!important}.herb-name.herb-stamina{color:#6ddc88!important}.herb-name.herb-attack{color:#cf9cff!important}.herb-name.herb-defense{color:#d7a16a!important}.herb-name.herb-poison{color:#b8ef70!important}
body[data-theme="parchment"] .herb-name.herb-health,body.theme-light .herb-name.herb-health{color:#a82020!important}
.herbalism-block{text-align:center;margin:12px auto;max-width:100%}.herbalism-block button{margin:5px}.herbalism-block img{vertical-align:middle;width:32px;height:32px}.herbalism-block select{max-width:100%}

html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) .herb-health{color:#aa2323!important}
html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) .herb-mana{color:#125b96!important}
html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) .herb-stamina{color:#247135!important}
html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) .herb-attack{color:#7438a0!important}
html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) .herb-defense{color:#784622!important}
html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) .herb-poison{color:#466d13!important}

.inventory-mark-control{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}.inventory-mark-control label{flex:1 1 200px}.inventory-mark-control input{max-width:100%;width:100%;box-sizing:border-box}.inventory-sort input[type=search]{min-width:130px;max-width:100%;flex:1 1 180px}.inventory-active-elixir-bonuses{margin:10px auto;text-align:center}

/* Plant parameter colours must survive legacy theme text rules. */
html[data-theme] #game#game .herb-name.herb-health{color:#ff7777!important}
html[data-theme] #game#game .herb-name.herb-mana{color:#78c6ff!important}
html[data-theme] #game#game .herb-name.herb-stamina{color:#6ddc88!important}
html[data-theme] #game#game .herb-name.herb-attack{color:#cf9cff!important}
html[data-theme] #game#game .herb-name.herb-defense{color:#d7a16a!important}
html[data-theme] #game#game .herb-name.herb-poison{color:#b8ef70!important}
html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) #game#game .herb-name.herb-health{color:#aa2323!important}
html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) #game#game .herb-name.herb-mana{color:#125b96!important}
html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) #game#game .herb-name.herb-stamina{color:#247135!important}
html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) #game#game .herb-name.herb-attack{color:#7438a0!important}
html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) #game#game .herb-name.herb-defense{color:#784622!important}
html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) #game#game .herb-name.herb-poison{color:#466d13!important}

/* Compact harvest button; keep all other controls unchanged. */
#game#game [data-herb-gather]{min-height:32px!important;min-width:0!important;width:auto!important;max-width:100%;padding:4px 10px!important;font-size:13px!important;line-height:22px!important;margin:4px auto!important;}

/* Skill gains retain their red tone in logs and successful notices. Nickname colors remain separate. */
html[data-theme] #game#game .mining-skill-gain,
html[data-theme] #game#game .skill-gain-message{color:var(--ui-text-red,#ff7777)!important;}
html[data-theme] #notice .skill-gain-message{color:var(--ui-text-red,#ff7777)!important;}
html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) #notice .skill-gain-message{color:#a33237!important;}

/* Active effects and entry-only build label. */
.active-effects-under-kit{text-align:center;margin:8px auto;max-width:100%;}.active-effects-under-kit p{margin:5px 0;}.active-effect-clock{margin-left:8px;font-variant-numeric:tabular-nums;white-space:nowrap;}.game-version-footer{display:none;}body.page-auth .game-version-footer{display:block;}

#game#game .herb-reference-link{color:var(--ui-text-red,#ff7777)!important;font-weight:600;}html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) #game#game .herb-reference-link{color:#a33237!important;}.herb-reference-tools{display:flex;flex-wrap:wrap;gap:10px;}.herb-reference-tools label{flex:1 1 180px;min-width:0;}.herb-reference-tools input,.herb-reference-tools select{width:100%;box-sizing:border-box;}.herb-reference-table{width:100%;border-collapse:collapse;table-layout:fixed;}.herb-reference-table th,.herb-reference-table td{padding:9px 5px;vertical-align:top;text-align:left;border-bottom:1px solid var(--ui-border,#555);overflow-wrap:anywhere;}.herb-reference-table th:first-child{width:48%;}.herb-reference-table th:nth-child(2){width:28%;}.herb-reference-name{display:flex;align-items:center;gap:5px;}.herb-reference-name img{flex:none;}.herb-reference-name .herb-name{min-width:0;}.herb-reference-info{margin-top:5px;}.herb-reference-info>div{padding:8px 0;}.herb-reference-info p{font-size:13px;}@media(max-width:480px){.herb-reference-table td,.herb-reference-table th{font-size:12px;padding:8px 4px;}}

.avatar-choice-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:16px 0}.avatar-choice{display:flex;flex-direction:column;align-items:center;gap:6px;border:1px solid var(--ui-border,#666);border-radius:5px;padding:10px 5px;cursor:pointer;min-width:0}.avatar-choice:has(input:checked){outline:2px solid var(--ui-link,#a4d5f3);outline-offset:1px}.avatar-choice img{width:100%;max-width:132px;height:198px;object-fit:contain}.avatar-choice span{text-align:center}.avatar-choice input{width:auto!important}.avatar-choice-feedback{min-height:1.5em}.avatar-equipment-portrait,#character-avatar{object-fit:contain}@media(max-width:480px){.avatar-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

#game .inventory-reference-link{color:var(--ui-text-red,#ff7777)!important;font-weight:600}.inventory-reference-access{text-align:center;margin:12px 0}.inventory-reference-table{table-layout:fixed;width:100%}.inventory-reference-table td,.inventory-reference-table th{overflow-wrap:anywhere}.inventory-reference-table th:first-child{width:45%}.inventory-reference-table th:nth-child(2){width:15%}.inventory-reference-table details{margin-top:8px}.inventory-reference-table details>div{padding:8px 0}.inventory-reference-table .herb-reference-name{align-items:center;gap:8px}

.map-object-filters{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:14px 0}.map-object-filters label{display:block;text-align:left}.map-object-filters :is(input,select){width:100%;min-width:0;min-height:42px;margin-top:5px}.illustrated-map-panel #world-player-position{margin:12px 0;font-weight:600}.map-directory-row{display:flex;width:100%;align-items:center;justify-content:space-between;gap:12px;text-align:left;min-height:42px}.map-directory-row small{white-space:nowrap}#world-map-selection{overflow-wrap:anywhere}.illustrated-world{max-width:100%;height:auto}.world-map-toolbar{display:flex;justify-content:center;flex-wrap:wrap;gap:8px}.world-map-toolbar small{flex-basis:100%}@media(max-width:480px){.map-object-filters{grid-template-columns:1fr}.map-directory-row{font-size:13px}}

#map-view .world-map-legend span{color:var(--ui-text-red,#ff7777)!important}.inventory-reference-table td:nth-child(2),.inventory-reference-table th:nth-child(2){text-align:center;white-space:nowrap}

/* Daily announcements keep the herald blue and the announcement red in every theme. */
html[data-theme] #game#game .daily-bonus-news h2{color:var(--ui-text-red,#ff8585)!important;}
html[data-theme] #game#game .daily-bonus-news .release-news-body{color:var(--ui-text-green,#79d991)!important;}
html[data-theme] #game#game .daily-bonus-news .daily-bonus-announcer{color:var(--ui-text-blue,#77bfff)!important;font-weight:600;}

#game #language-settings{max-width:560px;margin:12px auto 20px;text-align:left;}#game #language-settings label{display:block;}#game #language-settings select{display:block;width:100%;margin:8px 0;min-height:40px;}#game #language-settings button{max-width:100%;}

/* Typing status: player name green, action red in every theme. */
html[data-theme] #game#game #mail-typing-status .mail-typing-nickname{color:var(--ui-text-green,#79d991)!important;}
html[data-theme] #game#game #mail-typing-status .mail-typing-action{color:var(--ui-text-red,#ff8585)!important;}

/* Current difficulty: keep the label neutral and color only its value. */
#character-difficulty .difficulty-current-mode[data-mode="easy"]{color:#79df8e!important}
#character-difficulty .difficulty-current-mode[data-mode="hard"]{color:#f2ce62!important}
#character-difficulty .difficulty-current-mode[data-mode="impossible"]{color:#ff7777!important}

html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) #character-difficulty .difficulty-current-mode[data-mode="easy"]{color:#176d2e!important}
html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) #character-difficulty .difficulty-current-mode[data-mode="hard"]{color:#806000!important}
html:is([data-theme=light],[data-theme=parchment],[data-theme=stone],[data-theme=slate],[data-theme=browser],[data-theme=old-memory]) #character-difficulty .difficulty-current-mode[data-mode="impossible"]{color:#ad222b!important}

.assembly-recipe-info td{padding:12px!important}.assembly-recipe-info p{line-height:1.65;white-space:normal}.assembly-recipe-info .item-info-large-icon{display:block;margin:8px auto}#inventory-reference-content>details{margin:12px 0}
