/* Account-controlled theme. No image inversion, map filtering or layout changes. */
html[data-wos-theme=night]{color-scheme:dark;--wos-night-bg:#171e25;--wos-night-soft:#212c35;--wos-night-line:#46525e;--wos-night-text:#e0e7ed;--wos-night-muted:#b4c0ca;--wos-night-link:#8ac9ff;--wos-night-gold:#efc36b;--wos-night-home:#203e34;--wos-night-away:#462c34;--wos-orange:#efc36b;--wos-ink:#e0e7ed;--wos-green:#a9dcba;--wos-line:#46525e;--wos-cream:#353023;background-color:#090d12}
html[data-wos-theme=night] body{color:var(--wos-night-text);background-color:#090d12}
html[data-wos-theme=night] :is(main,dialog,.panel,#battle-report,.report-share-dialog,.message-report-dialog){background:var(--wos-night-bg)!important;color:var(--wos-night-text)!important;border-color:var(--wos-night-line)!important}
html[data-wos-theme=night] main :where(p,label,legend,dt,dd,summary,li,.empty,.town-help,.building-locked,.breadcrumb,.attack-breadcrumb,.account-profile,.profile-facts,.profile-facts h3,.profile-facts .profile-blue:first-child th,.wos-page-heading p,.qg-intro p){color:var(--wos-night-text)!important}
html[data-wos-theme=night] :where(main,dialog,#official-notices) a,html[data-wos-theme=night] main :is(.more,.office-links button,.qg-mail button,.clan-chat>button,#edit-profile){color:var(--wos-night-link)!important}
html[data-wos-theme=night] main :is(h1,h2,h3,.wos-page-heading h1,.qg-intro h1){color:var(--wos-night-gold)!important}
html[data-wos-theme=night] :is(.account-form,.qg-mail,.building-option,.tree-row:nth-child(even),.compose-panel form,.clan-page form,.mail-table-wrap,.profile-presentation pre,.guide-content,.ribbon,.office-links,.clan-chat,.rank-search,.ranking-search,.search-form,.interactions,.interaction-list,.map-info,.village-info,.profile-clan-slot,.profile-facts tr:nth-child(odd),.profile-facts tr:nth-child(even)){background:var(--wos-night-soft)!important;color:var(--wos-night-text)!important;border-color:var(--wos-night-line)!important}
html[data-wos-theme=night] :is(.game-header,body[data-period=day] .game-header){background:#10263d url('/assets/game/bandeau-nuit.png') repeat-x left top!important;background-size:auto 100%!important;color:#ecf3f9!important}
html[data-wos-theme=night] .game-header :is(.identity,.identity h1,.identity span,.profile-link,.profile-name){color:#ecf3f9!important}
html[data-wos-theme=night] .game-header .player-stats{background:#172633e8!important;color:var(--wos-night-text)!important}
html[data-wos-theme=night] .player-stats :is(dt,dd){color:var(--wos-night-text)!important}
html[data-wos-theme=night] .stock-bar{background:linear-gradient(#29343e,#1b242e)!important;color:var(--wos-night-muted)!important}
html[data-wos-theme=night] .stock-bar b{color:var(--wos-night-text)!important}
html[data-wos-theme=night] :is(.stock-bar,.qg-mail,.qg-army,.battle-army) :is(.resource-icon,.mail-envelope){mix-blend-mode:normal!important}
html[data-wos-theme=night] .resource-icon{background:#e6e9eb;border-radius:2px}
html[data-wos-theme=night] main :is(table,th,td){color:var(--wos-night-text)!important;border-color:var(--wos-night-line)!important}
html[data-wos-theme=night] main table{background:var(--wos-night-bg)!important}
html[data-wos-theme=night] main th{background:var(--wos-night-soft)!important}
html[data-wos-theme=night] main :is(td,tr){background-color:transparent!important}
html[data-wos-theme=night] main tbody tr:nth-child(even){background-color:#202a33!important}
html[data-wos-theme=night] main tr[aria-current],html[data-wos-theme=night] main tr.current-player{background-color:#3c3525!important}
html[data-wos-theme=night] main :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=submit]),textarea,select),html[data-wos-theme=night] dialog :is(input,textarea,select){background:#101820!important;color:var(--wos-night-text)!important;border-color:#647181!important}
html[data-wos-theme=night] :is(input,textarea)::placeholder{color:var(--wos-night-muted)!important;opacity:1}
html[data-wos-theme=night] :is(input[type=checkbox],input[type=radio]){accent-color:#54b89a}
html[data-wos-theme=night] :is(main,dialog) button:not(.town-plot):not(.wall-slot):not(.office-hotspot):not(.town-zone):not(.zone){background:#2a3541!important;color:var(--wos-night-text)!important;border-color:#687484!important}
html[data-wos-theme=night] main :is(.build-action,button[type=submit],#send-army){background:linear-gradient(#55462a,#3d3425)!important;color:#ffe1a0!important;border-color:#a98a50!important}
html[data-wos-theme=night] :is(main,dialog) button:disabled{opacity:.6}
html[data-wos-theme=night] :is(.panel h2,.panel.orange h2){background:linear-gradient(#36434e,#222d37)!important;color:var(--wos-night-gold)!important}
html[data-wos-theme=night] .qg-army{background:linear-gradient(#294a3d,#22352d 40px,#1d302a)!important;border-color:#426554!important;box-shadow:0 0 0 12px #202a30!important}
html[data-wos-theme=night] .qg-army h2{color:#d5e9da!important}
html[data-wos-theme=night] .qg-army :is(thead tr:first-child th,.qg-food td){background:var(--wos-night-home)!important;color:#c8eed4!important}
html[data-wos-theme=night] .qg-army .qg-food strong{color:#c8eed4!important}
html[data-wos-theme=night] .qg-army :is(.army-unit-headings th,tbody tr:first-child){background:var(--wos-night-soft)!important}
html[data-wos-theme=night] .qg-army :is(.mission-away,.mission-row-away) :is(th,td){background:var(--wos-night-away)!important}
html[data-wos-theme=night] .qg-army .mission-table :is(thead tr:first-child th,.mission-footer td){background:var(--wos-night-away)!important}
html[data-wos-theme=night] .qg-army .mission-returning :is(thead tr:first-child th,.mission-footer td){background:#263e51!important}
html[data-wos-theme=night] .qg-army .received-support :is(thead tr:first-child th,.mission-footer td){background:var(--wos-night-home)!important}
html[data-wos-theme=night] .qg-army .mission-countdown{color:#ffb6ac!important}
html[data-wos-theme=night] .qg-army .mission-food{color:var(--wos-night-text)!important}
html[data-wos-theme=night] :is(#qg-genin,#qg-chunin,#qg-jounin,[data-ninja-count],.away-unit-count){color:var(--wos-night-text)!important}
html[data-wos-theme=night] .qg-mail :is(.mail-label,.mail-count){color:var(--wos-night-link)!important}
html[data-wos-theme=night] #battle-report *{color:var(--wos-night-text)!important}
html[data-wos-theme=night] #battle-report :is(.battle-army th,.battle-army td){background:var(--wos-night-bg)!important;border-color:var(--wos-night-line)!important}
html[data-wos-theme=night] #battle-report .battle-army .unit-labels th{background:var(--wos-night-soft)!important}
html[data-wos-theme=night] #battle-report :is(.battle-army.attacker .side-title th,.battle-army .loot th,.battle-army .loot td){background:var(--wos-night-away)!important}
html[data-wos-theme=night] #battle-report .battle-army.defender .side-title th{background:var(--wos-night-home)!important}
html[data-wos-theme=night] #battle-report .battle-army.attacker .side-title th:first-child{color:#ffb8b3!important}
html[data-wos-theme=night] #battle-report .battle-army.defender .side-title th:first-child{color:#b1e7c4!important}
html[data-wos-theme=night] #battle-report .battle-army a{color:var(--wos-night-link)!important}
html[data-wos-theme=night] :is(.report-share-preview-frame,.message-report-dialog form){background:var(--wos-night-soft)!important}
html[data-wos-theme=night] .report-share-dialog :is(h2,p,label),html[data-wos-theme=night] .message-report-dialog :is(h2,p,label){color:var(--wos-night-text)!important}
html[data-wos-theme=night] :is(.profile-blue,.unit-defense td[data-stat]){color:#8bcaff!important}
html[data-wos-theme=night] :is(.profile-green,.building-available,.unit-attack td[data-stat]){color:#afe0a9!important}
html[data-wos-theme=night] .profile-gold{color:var(--wos-night-gold)!important}
/* Preserve semantic colours after the general table/link/text overrides. */
html[data-wos-theme=night] .player-stats div:nth-child(3) :is(dt,dd),
html[data-wos-theme=night] main :is(.profile-green,.clan-inhabitants,.clan-information-inhabitants),
html[data-wos-theme=night] main :is(.profile-green,.clan-inhabitants,.clan-information-inhabitants) :is(th,td,a,strong,span),
html[data-wos-theme=night] main .rank-players :is(th,td):nth-child(6),
html[data-wos-theme=night] main .rank-players :is(th,td):nth-child(6) a{color:#afe0a9!important}
html[data-wos-theme=night] .player-stats div:nth-child(4) :is(dt,dd),
html[data-wos-theme=night] main :is(.profile-blue,.clan-points,.clan-information-points,.rank-points),
html[data-wos-theme=night] main :is(.profile-blue,.clan-points,.clan-information-points,.rank-points) :is(th,td,a,strong,span),
html[data-wos-theme=night] main .rank-players :is(th,td):nth-child(7),
html[data-wos-theme=night] main .rank-players :is(th,td):nth-child(7) a{color:#8bcaff!important}
html[data-wos-theme=night] main .profile-gold :is(th,td,a,strong,span){color:var(--wos-night-gold)!important}
html[data-wos-theme=night] main .mail-table a.report-attack_sent,
html[data-wos-theme=night] main .mail-table a.report-attack_sent strong{color:#afe0a9!important}
html[data-wos-theme=night] main .mail-table a.report-attack_received,
html[data-wos-theme=night] main .mail-table a.report-attack_received strong{color:#ffb0ab!important}
html[data-wos-theme=night] main .mail-table a.report-withdrawal{color:var(--wos-night-gold)!important}
/* Multiply blending makes the dark resource sprites disappear on dark panels. */
html[data-wos-theme=night] .resource-icon{mix-blend-mode:normal!important;background:#e6e9eb!important}
/* Explicit dark text on legacy components must follow the selected theme. */
html[data-wos-theme=night] main :is(#mail-body,.job-row strong,.training-value,.tree-requirements strong,.map-information dd,.clan-rules-content,.clan-overview>.clan-presentation,.rules){color:var(--wos-night-text)!important}
html[data-wos-theme=night] main :is(.job-row em,.rank-pagination span,#profile-length,#avatar-upload-note,.gift-help){color:var(--wos-night-muted)!important}
html[data-wos-theme=night] main :is(.help-paper,.help-contents,.ticket-gifts,.ticket-gift-content form,.map-information,.rank-tabs){background:var(--wos-night-soft)!important;color:var(--wos-night-text)!important;border-color:var(--wos-night-line)!important}
html[data-wos-theme=night] main .ticket-gift-content label{color:var(--wos-night-gold)!important}
html[data-wos-theme=night] main :is(.upgrade-box h2,.help-section h3){color:var(--wos-night-gold)!important}
html[data-wos-theme=night] main.rapaces-page #building-description{color:var(--wos-night-text)!important}
html[data-wos-theme=night] main :is(.profile-facts .profile-blue:first-child th,.mail-tabs a[aria-current]){color:var(--wos-night-link)!important}
/* Current levels keep a distinct highlight without the legacy cream gradient. */
html[data-wos-theme=night] main .building-reference{background:var(--wos-night-soft)!important;color:var(--wos-night-text)!important}
html[data-wos-theme=night] main .building-reference caption{background:#29473f!important;color:#d6eee4!important}
html[data-wos-theme=night] main :is(.building-reference,.training-grid) tr:is(.building-current,.bonus-current){background:#4b391e!important;outline:2px solid #e5ac52;outline-offset:-2px}
html[data-wos-theme=night] main :is(.building-reference,.training-grid) tr:is(.building-current,.bonus-current)>:is(th,td){background:#4b391e!important;color:#ffe5ae!important;font-weight:700}
html[data-wos-theme=night] .profile-facts progress{background:var(--wos-night-soft)!important;border-color:var(--wos-night-line)!important}
html[data-wos-theme=night] .profile-facts progress::-webkit-progress-bar{background:var(--wos-night-soft)}
html[data-wos-theme=night] :is(.wos-footer,.wos-footer a,#official-notices){color:var(--wos-night-muted)!important}
html[data-wos-theme=night] #official-notices{background:var(--wos-night-soft)!important;border-color:var(--wos-night-line)!important}
html[data-wos-theme=night] :is(#map-status,#night-status,#account-status){color:var(--wos-night-gold)!important}
/* Legacy pages use their own cream panels: keep their text and forms legible too. */
html[data-wos-theme=night] :is(#login-form,.upgrade-surround,.upgrade-box,.training-stat,.raptor-panel,.bonus-current,.rank-grid,.rank-panel,.clan-overview,.clan-recap,.clan-community,.clan-request-card,.clan-empty-state,.clan-join-section,.clan-information,.clan-rules,.clan-chat-message,.commerce-overview,.commerce-card,.commerce-slot,.commerce-reward-option,.commerce-block-reason,.commerce-feedback,.commerce-event,.commerce-empty,.commerce-badge,.commerce-route-seal,.event-card,.event-note,#ticket-purchases,#ticket-purchases .ticket-pack,.bonus-row:nth-child(odd),#avatar-frames-panel,#choose-profile-avatar,.mail-shortcuts,.map-footer,.map-preferences,.attack-availability){background:var(--wos-night-soft)!important;color:var(--wos-night-text)!important;border-color:var(--wos-night-line)!important}
html[data-wos-theme=night] main :is(.training-panel h2,.training-stat h3,.rank-panel h2,.player-card h1,.player-card h2,.clan-information>h2,.clan-rules>h2){background:var(--wos-night-soft)!important;color:var(--wos-night-gold)!important}
/* The legacy village frame has pale inset side strips, independent of its border. */
html[data-wos-theme=night] .player-view{box-shadow:none!important;border-color:var(--wos-night-line)!important}
html[data-wos-theme=night] .player-position,
html[data-wos-theme=night] .player-position span{color:var(--wos-night-text)!important}
html[data-wos-theme=night] #commerce-panel{--trade-ink:#e0e7ed;--trade-green:#77cfb3;--trade-gold:#efc36b;color:var(--wos-night-text)}
html[data-wos-theme=night] main :is(.clan-tabs button[aria-selected=true],.commerce-tabs button[aria-pressed=true],.rank-tabs a[aria-current],.commerce-reward-option.is-selected){background:var(--wos-night-home)!important;border-color:#77ba98!important;color:#d1f0de!important}
/* Preference layout is shared by both themes. */
[data-wos-page=compte] .display-options{display:flex;flex-wrap:wrap;align-items:center;gap:12px 30px}
[data-wos-page=compte] .display-options label{display:inline-flex;align-items:center;gap:10px;margin:0;min-height:32px}
[data-wos-page=compte] .display-options input[type=checkbox]{width:auto;display:inline-block;margin:0;flex-shrink:0}
[data-wos-page=compte] #map-status:empty,[data-wos-page=compte] #night-status:empty{display:none}
@media(max-width:620px){html[data-wos-theme=night] .qg-army{box-shadow:0 0 0 6px #202a30!important}[data-wos-page=compte] .display-options label{min-height:44px}}

/* Inbox shortcuts keep their unread signal and blend into the night page. */
.qg-mail .mail-envelope-vector{display:none}
html[data-wos-theme=night] #qg-content .qg-mail{background:transparent!important;border:0!important;box-shadow:none!important}
html[data-wos-theme=night] .qg-mail :is(#open-messages,#open-reports){background:transparent!important;border:0!important;box-shadow:none!important;text-shadow:none!important;color:var(--wos-night-link)!important}
html[data-wos-theme=night] .qg-mail :is(.mail-label,.mail-count){background:transparent!important;text-shadow:none!important}
html[data-wos-theme=night] .qg-mail .mail-envelope{display:none!important}
html[data-wos-theme=night] .qg-mail .mail-envelope-vector{display:block;width:20px;height:16px;background:transparent;color:inherit}
html[data-wos-theme=night] :is(#open-messages,#open-reports).has-unread,
html[data-wos-theme=night] :is(#open-messages,#open-reports).has-unread :is(.mail-label,.mail-count),
html[data-wos-theme=night] .mail-shortcuts a.has-unread,
html[data-wos-theme=night] .mail-shortcuts a.has-unread b,
html[data-wos-theme=night] :is(#message-alert,#report-alert){color:#ff8585!important}

/* Resource cutouts: retain original PNG colors; day and night display. */
html img.resource-icon[src*="assets/game/pierre.png"],html img[src*="assets/game/pierre.png"]{background:transparent!important;border-radius:0!important;clip-path:polygon(33.333% 11.111%,77.778% 11.111%,93.333% 25.000%,94.444% 41.667%,88.889% 54.444%,75.000% 69.444%,60.000% 83.333%,33.333% 83.333%,22.222% 72.222%,5.556% 72.222%,5.556% 38.889%,11.111% 30.556%,22.222% 19.444%);mix-blend-mode:normal!important}
html img.resource-icon[src*="assets/game/bois.png"],html img[src*="assets/game/bois.png"]{background:transparent!important;border-radius:0!important;clip-path:polygon(16.667% 11.111%,33.333% 11.111%,38.889% 16.667%,53.333% 19.444%,61.111% 30.556%,75.556% 37.222%,77.778% 58.333%,83.333% 66.667%,94.444% 75.000%,94.444% 83.333%,80.556% 88.889%,50.000% 88.889%,38.889% 80.556%,33.333% 63.889%,27.778% 50.000%,22.222% 38.889%,22.222% 27.778%,16.667% 22.222%);mix-blend-mode:normal!important}
html img.resource-icon[src*="assets/game/fer.png"],html img[src*="assets/game/fer.png"]{background:transparent!important;border-radius:0!important;clip-path:polygon(50.000% 16.667%,83.333% 16.667%,83.333% 25.000%,94.444% 30.556%,94.444% 44.444%,83.333% 50.000%,77.778% 55.556%,66.667% 66.667%,55.556% 77.778%,44.444% 88.889%,11.111% 88.889%,5.556% 83.333%,5.556% 63.889%,16.667% 52.778%,27.778% 41.667%,38.889% 30.556%,44.444% 25.000%);mix-blend-mode:normal!important}
html img.resource-icon[src*="assets/game/nourriture.png"],html img[src*="assets/game/nourriture.png"]{background:transparent!important;border-radius:0!important;clip-path:polygon(33.333% 11.111%,50.000% 11.111%,55.556% 16.667%,61.111% 16.667%,66.667% 25.000%,66.667% 44.444%,72.222% 47.222%,72.222% 63.889%,77.778% 66.667%,83.333% 66.667%,88.889% 75.000%,88.889% 83.333%,83.333% 88.889%,66.667% 88.889%,61.111% 77.778%,55.556% 72.222%,44.444% 72.222%,33.333% 66.667%,25.000% 61.111%,16.667% 55.556%,16.667% 27.778%,22.222% 22.222%,27.778% 16.667%);mix-blend-mode:normal!important}

/* Population costs: retain original image pixels and the white clock face. */
html img.resource-icon[src*="assets/game/habitant.png"],html img[src*="assets/game/habitant.png"]{background:transparent!important;border-radius:0!important;clip-path:polygon(40% 5%,55% 5%,65% 10%,75% 20%,75% 35%,80% 50%,80% 55%,90% 60%,90% 75%,85% 80%,75% 80%,70% 75%,65% 75%,55% 85%,45% 90%,25% 90%,15% 85%,10% 75%,5% 70%,5% 50%,10% 40%,20% 35%,20% 20%,30% 10%);mix-blend-mode:normal!important}

/* Clan management and applications follow the selected night theme. */
html[data-wos-theme=night] .clan-page .clan-application-row{background:var(--wos-night-bg)!important;color:var(--wos-night-text)!important;border-color:var(--wos-night-line)!important}
html[data-wos-theme=night] .clan-page .clan-join-section>h2{border-color:var(--wos-night-line)!important}
html[data-wos-theme=night] .clan-page .clan-note{color:var(--wos-night-muted)!important}
html[data-wos-theme=night] #clan-content .clan-danger{color:#ffb0ab!important}

/* Public pages: match panel surfaces to the account-selected night theme. */
html[data-wos-theme=night] main .intro>aside>dl{background:var(--wos-night-soft)!important;color:var(--wos-night-text)!important;border-color:var(--wos-night-line)!important}
html[data-wos-theme=night] main .intro>aside>dl .online{color:#a9dcba!important}
html[data-wos-theme=night] .world-events-column{background:var(--wos-night-bg)!important;border-color:var(--wos-night-line)!important}
html[data-wos-theme=night] .world-event{background:var(--wos-night-soft)!important;color:var(--wos-night-text)!important}
html[data-wos-theme=night] .world-event:nth-child(even){background:var(--wos-night-bg)!important}
html[data-wos-theme=night] .world-event time{color:var(--wos-night-gold)!important}
html[data-wos-theme=night] .world-event strong{color:var(--wos-night-link)!important}
html[data-wos-theme=night] .activity .world-events-status{color:var(--wos-night-muted)!important}
html[data-wos-theme=night] .registration-page .village-choice{background:var(--wos-night-soft)!important;color:var(--wos-night-text)!important;border-color:var(--wos-night-line)!important}
html[data-wos-theme=night] .registration-page .village-choice span{background:transparent!important;color:var(--wos-night-text)!important}
html[data-wos-theme=night] .registration-page .village-choice:hover{border-color:var(--wos-night-gold)!important}
html[data-wos-theme=night] .registration-page .village-choice:has(input:checked){background:#353023!important;border-color:var(--wos-night-gold)!important}
html[data-wos-theme=night] .registration-page .village-choice:has(input:focus-visible){outline:2px solid var(--wos-night-link);outline-offset:2px}
/* Suppress white image pixels at display time; keep the original RGB artwork. */
html[data-wos-theme=night] .registration-page .village-choice img{background:transparent!important;filter:url("/village-symbol-cutout-b4a6ee5ad926.svg#white-cutout")!important}
html[data-wos-theme=night] .sanctions-list>li{background:var(--wos-night-soft)!important;color:var(--wos-night-text)!important;border-color:var(--wos-night-line)!important;border-top-color:var(--wos-night-gold)!important}
html[data-wos-theme=night] .sanctions-list>li h2{border-color:var(--wos-night-line)!important}
html[data-wos-theme=night] .sanctions-list .sanction-type{color:var(--wos-night-gold)!important}
html[data-wos-theme=night] .sanctions-list .sanction-period,html[data-wos-theme=night] .sanctions-intro{color:var(--wos-night-muted)!important}
