/* Shared quiet blue-hour UI, only for Amaharashi and Shiude.
   Card faces, geometry, game state, original Shonan and Kanazawa stay unchanged. */
html:is([data-environment="amaharashi"],[data-environment="shiude"]) {
  color-scheme: dark;
  --bg:#111a2b; --surface:#1b283c; --surface-deep:#152236; --panel:#1b283c;
  --line:#697b94; --ink:#f0eee9; --text:#f0eee9; --muted:#c0cad8;
  --gold:#e5bea2; --mint:#b4d1ca; --sea:#e9c4a8; --sea-light:#3b455b;
  --shadow:0 12px 32px #00000055;
  background:var(--bg);color:var(--ink);
}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) body {background:radial-gradient(ellipse at 80% 0,#192c46 0,transparent 55%),var(--bg);color:var(--ink)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.hand-panel,.side-card,.partner-card,.game-column>.recorder-card,.dialog,.table-menu,.table-menu .side-card,.start-shell .presentation-settings,.mode-options a,.exchange-panel,.exchange-pair,.exchange-description,.exchange-review,.match-score,.match-settings,.allocation-panel,.critical-status) {background:var(--surface);color:var(--ink);border-color:var(--line);box-shadow:var(--shadow)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.dialog,.table-menu)::backdrop {background:#091323cc}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.brand h1,.brand-mark,.start-hero h1,.side-card h2,.partner-card h2,.dialog h2,.my-seat h2,.seat h3,.seat p b,.round-result h2,.tools-disclosure>summary,.exchange-panel>summary,.exchange-heading,.presentation-settings h2,.mode-options strong) {color:var(--ink)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.brand p,.brand h1 span,.offline,.session-title strong,.my-seat p,.my-seat h2 span,.seat p,.table .seat .seat-label,.table .seat-top .seat-label,.partner-card>p,.team-summary,.team-summary span,.selection-row p,.hand-scroll-hint,.hand-scroll-hint span:last-child,.hand-pan-tip,.keyboard-help,.feedback,.decision-note,.baseline-note,.export-note,.recorder-legend,.recorder-wild,.footer,.menu-version,.menu-heading p,.dialog p,.dialog label,.dialog label span,.dialog .input-note,.input-note,.checkbox-label small,.rules-panel li,.prototype-note p,.exchange-summary-hint,.exchange-caption,.exchange-privacy,.exchange-direction,.online-message,.online-room-note,.online-room-bar,.online-lobby-seat span,.online-exchange-tile>span:first-child,.match-score>span,.round-result p,.round-result details,.round-result .result-order,.pack-label) {color:var(--muted)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.eyebrow,.match-score strong,.match-score .score-team b,.prototype-note strong,.match-rules summary,.partner-card p strong,.history .phase-entry,.round-result .result-levels,.recorder-rank.level-rank>b,.recorder-rank strong,.card-pack.locked .pack-label,.card-pack.locked .pack-label:before) {color:var(--gold)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.history li .history-player,.history li .history-action,.history li .history-action small,.history .empty-note,.history li.teammate .history-player) {color:var(--muted)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.team-summary,.baseline-note,.prototype-note,.controls,.presentation-settings,.history li,.online-seating) {border-color:var(--line)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.small-tag,.version-badge,.recorder-rank,.sort-group,.online-lobby-seat,.exchange-card-pending) {background:var(--surface-deep);color:var(--muted);border-color:var(--line)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.recorder-rank>b,.recorder-rank>span,.recorder-rank i) {color:var(--muted)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .recorder-rank.level-rank {background:#293348;border-color:#9e895e}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.button.outline,.button.subtle,.organize-button,.organize-button:first-child,.organize-panel .reset-hand,.table .seat .ask-count,.pause-button,.top-actions .pause-button,.avatar-options button,.online-exchange button) {background:#29394f;color:var(--ink);border-color:var(--line);box-shadow:none}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.text-button,.organize-controls .text-button,.icon-button,.home-link,.sort-button,.interpretations label,.tools-disclosure>summary:after) {color:#e9c4a8}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.button.primary,.controls .primary) {background:#3d5871;color:#fff6ed;border-color:#bda18b;box-shadow:0 3px 10px #00000033}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.sort-button.active,.organize-button[aria-pressed=true],.pause-button[aria-pressed=true],.top-actions .pause-button[aria-pressed=true],.avatar-options button[aria-pressed=true]) {background:#45536c;color:#ffffff;border-color:#e9c4a8}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .avatar-options button[aria-pressed=true] {outline-color:#e9c4a8}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.dialog input,.dialog select,.presentation-settings select,.interpretations select,.tempo-controls select,.online-lobby input) {color:var(--ink);background:#152236;border-color:#6b819d;accent-color:#e9c4a8}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) input::placeholder {color:#bac4d3;opacity:1}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.button:disabled,.button.primary:disabled,.controls .primary:disabled,.organize-button:disabled,.sort-button:disabled,.avatar-options button:disabled,.text-button:disabled,.ask-count:disabled) {background:#273448;color:#bac4d3;border-color:#697b94;opacity:1;box-shadow:none;cursor:not-allowed}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.count-alert,.feedback.warning,.round-result) {background:#3a302e;color:#f0ceb2;border-color:#b5977f}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.seat .count-low,.seat.finished p b,.footer #save-status.save-warning) {color:#f0ceb2}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .resume-dialog #resume-message {color:var(--muted)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .table .seat {background:transparent;border-color:transparent;box-shadow:none}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .table .seat.is-turn {border-color:#e9c4a8;box-shadow:0 0 0 1px #e9c4a855}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.table .seat .seat-heading,.table .seat .seat-count,.table .seat .seat-label) {text-shadow:0 1px 3px #091323,1px 0 3px #091323,0 -1px 3px #091323,-1px 0 3px #091323}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.trick-owner,.has-comparison .current-play .trick-owner,.trick-type,.beaten-owner,.beaten-type,.comparison-arrow,.turn-status,.turn-status.your-turn) {color:#f0eee9;text-shadow:0 1px 4px #091323,0 0 5px #091323}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .turn-status.your-turn {color:#e9c4a8}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .turn-status.your-turn:before {background:#e9c4a8;box-shadow:0 0 0 4px #3b455b}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .empty-trick {background:#152236e8;color:var(--muted);border-color:var(--line);box-shadow:none}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .seat-last {color:var(--gold)!important}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .seat-last small {color:var(--muted)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.avatar,.team-dot) {border-color:#697b94;box-shadow:0 0 0 1px #152236}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .allocation-choice[aria-pressed=true] {border-color:#e9c4a8;background:#3b455b}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.hand,.history,.beaten-play,.seat-left,.seat-right,.game-column .table-cards,.has-comparison .current-play .table-cards) {scrollbar-color:#6b819d #152236}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(button,a,input,select,summary,[tabindex]):focus-visible {outline:3px solid #e9c4a8;outline-offset:3px}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.button,.organize-button,.avatar-options button,.mode-options a):not(:disabled):hover {border-color:#e9c4a8}
/* Scenic captions stay transparent, with a local shadow rather than label strips. */
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.table .seat .seat-name,.table .seat .seat-label,.table .seat .seat-count,.table .seat .seat-last,.trick-owner,.has-comparison .current-play .trick-owner,.trick-type,.beaten-owner,.beaten-type,.comparison-arrow,.turn-status,.online-exchange-tile>span:first-child):not(:empty) {background:transparent;color:#f0eee9;text-shadow:0 1px 3px #091323;border-radius:0;box-shadow:none}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.table .seat .seat-count b,.table .seat .seat-count strong,.table .seat .seat-last small,.table .online-exchange-tile>span:first-child strong) {color:#f0eee9;text-shadow:inherit}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .table .seat .seat-last {color:#f0eee9!important}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .table .seat .count-low {color:#f0ceb2}

/* Scene variables are scoped independently from the shared dusk controls. */
html[data-environment="amaharashi"] {--blue-hour-scene:var(--amaharashi-scene);--blue-hour-landscape:var(--amaharashi-landscape)}
html[data-environment="shiude"] {--blue-hour-scene:var(--shiude-scene);--blue-hour-landscape:var(--shiude-landscape)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) body.viewport-game {
 background-color:var(--bg);
 background-image:linear-gradient(180deg,#101c2e10 30%,#101c2e20 58%,#101c2eab 100%),var(--blue-hour-scene);
 background-size:cover;background-position:center;
}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .viewport-game .viewport-stage {background:transparent}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .table {border-color:var(--line);box-shadow:var(--shadow)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .start-hero {background-image:linear-gradient(90deg,#111a2be8,#111a2b66),var(--blue-hour-landscape);border-color:var(--line)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.topbar,.footer) {background:#111a2bd9;border-color:#697b9444}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.audio-track-row select,.tempo-controls select) {background:var(--surface-deep);color:var(--ink);border-color:var(--line)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .table-audio-settings {border-color:var(--line)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) input:is([type=checkbox],[type=range]) {accent-color:var(--gold)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.viewport-hud,.viewport-stage .my-seat h2,.viewport-stage .my-seat h2 span,.viewport-stage .selection-row p,.viewport-stage .feedback,.viewport-stage .hand-scroll-hint,.viewport-stage .seat-play-badge,.viewport-stage .seat-play-caption,.viewport-stage .seat-play-detail) {color:#f0eee9;background:transparent;text-shadow:0 1px 3px #091323,0 0 3px #091323}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .viewport-stage>#allocation-panel {background:var(--surface);color:var(--ink);border-color:var(--line)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .viewport-stage>#round-result {background:linear-gradient(135deg,#1b283cfa,#152236fa);border-color:var(--line);color:var(--ink);box-shadow:var(--shadow)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .viewport-stage #round-result :is(h2,.eyebrow),html:is([data-environment="amaharashi"],[data-environment="shiude"]) .settlement-place,html:is([data-environment="amaharashi"],[data-environment="shiude"]) .settlement-levels b {color:var(--gold)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .settlement-player {background:#ffffff06;border-color:var(--line)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .settlement-player.first {background:#e5bea212;border-color:#b5977f}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.viewport-stage #round-result .settlement-detail,.settlement-player small) {color:var(--muted)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .viewport-stage .online-exchange-tile>span:first-child {color:var(--ink);text-shadow:0 1px 3px #091323}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .turn-reminder {background:#283448;color:#f0ceb2;border-color:#b5977f;box-shadow:0 2px 9px #0004}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) button:not(.card):not(:disabled):hover {filter:brightness(1.08)}
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .button kbd {opacity:1}
@media (prefers-contrast:more) {
 html:is([data-environment="amaharashi"],[data-environment="shiude"]) :is(.dialog,.table-menu,.side-card,.partner-card,.start-shell .presentation-settings,.mode-options a) {background:#152236;border-color:#bfcbdc}
 html:is([data-environment="amaharashi"],[data-environment="shiude"]) .turn-reminder {background:#152236;color:#fff6ed;border-color:#e9c4a8}
}
/* The organizing row floats on scenic blossoms: provide subdued button fills. */
html:is([data-environment="amaharashi"],[data-environment="shiude"]) .viewport-stage :is(.sort-button:not(.active),.organize-controls .text-button,.selection-row .text-button) {background:#29394f;color:#f0eee9;text-shadow:none}
