/* Temple of Football: an opt-in after-dark palette. The original white theme is unchanged. */
.theme-toggle{flex:none;display:inline-flex;align-items:center;justify-content:center;width:39px;height:39px;min-width:39px;min-height:39px;padding:7px;border:1px solid #9b846a;border-radius:50%;background:#faf7f1;color:#372d26;box-shadow:0 1px 6px #2e231513;cursor:pointer;transition:background-color .18s,color .18s,border-color .18s,transform .18s}
.theme-toggle:hover{transform:rotate(-12deg);background:#eadbc8;border-color:#85623c}
.theme-toggle:focus-visible{outline:3px solid #c5a16f;outline-offset:3px}
.theme-toggle svg{width:21px;height:21px;flex:none}
.theme-toggle .theme-sun{display:none}
html[data-theme="dark"] .theme-toggle{background:#f0e7d8;color:#1a1715;border-color:#d4b78e;box-shadow:0 0 0 2px #d9b17d23}
html[data-theme="dark"] .theme-toggle:hover{background:#fff6e8}
html[data-theme="dark"] .theme-toggle .theme-moon{display:none}
html[data-theme="dark"] .theme-toggle .theme-sun{display:block}
@media(max-width:680px){.theme-toggle{position:absolute;top:12px;right:14px;z-index:2;width:34px;height:34px;min-width:34px;min-height:34px;margin:0;padding:6px}.theme-toggle svg{width:19px;height:19px}}
@media(prefers-reduced-motion:reduce){.theme-toggle{transition:none}.theme-toggle:hover{transform:none}}

html[data-theme="dark"]{
  --peach:#161513;--peach-deep:#211e1a;--ink:#f5eee3;--text:#c8bcb0;
  --gold:#d3ad76;--gold-soft:#776144;
  --night-bg:#151513;--night-panel:#24211e;--night-panel-alt:#2c2722;
  --night-border:#56493b;--night-text:#f4eadb;--night-muted:#c6b5a3;
  background:#151513;color-scheme:dark;
}
html[data-theme="dark"] body{background:#151513;color:var(--night-text)}
html[data-theme="dark"] .skip-link{background:#26221d;color:#fff3e3}
html[data-theme="dark"] ::selection{background:#7c613e;color:#fff}

/* Persistent nav and its compact corner switch. */
html[data-theme="dark"] .site-nav{background:#181715;border-top-color:#ad8652;border-bottom-color:#433c34;box-shadow:0 7px 24px #0008}
html[data-theme="dark"] .site-nav-logo img{filter:brightness(0) invert(.91) sepia(.12)}
html[data-theme="dark"] .site-nav-edition{color:#bba385}
html[data-theme="dark"] .site-nav-edition span{color:#8c7152}
html[data-theme="dark"] .site-nav-link{color:#d4c4b0}
html[data-theme="dark"] .site-nav-link:hover,html[data-theme="dark"] .site-nav-link:focus-visible{color:#fff2df;background:#302a23}
html[data-theme="dark"] .site-nav-link[aria-current]{color:#f9eacb;background:#393127;border-bottom-color:#d0a769}
html[data-theme="dark"] .site-nav-register{background:#28221c;color:#e8d5bc;border-color:#8b7358}
html[data-theme="dark"] .site-nav-register:hover{background:#423425;border-color:#c29d6b}
html[data-theme="dark"] .site-nav-links{scrollbar-color:#715c45 #1a1715}
html[data-theme="dark"] .landing{background:radial-gradient(ellipse at 50% 55%,#25221d 0%,#171614 62%,#111110 115%)}
html[data-theme="dark"] .landing-footer{color:#b8a48b}

/* Home: survey invitation, leaderboard, book and player gallery. */
html[data-theme="dark"] .future-survey{background:linear-gradient(180deg,#191817,#201d19 47%,#171615);border-top-color:#493d30}
html[data-theme="dark"] .survey-invite h2,html[data-theme="dark"] .player-cards-shell h2,html[data-theme="dark"] .book-content h2,html[data-theme="dark"] .leaderboard-heading-wrap h2,html[data-theme="dark"] .house-preview h2{color:#f8efe1}
html[data-theme="dark"] .survey-invite>p:not(.survey-kicker):not(.survey-invite-note),html[data-theme="dark"] .player-cards-intro,html[data-theme="dark"] .book-description,html[data-theme="dark"] .leaderboard-heading-wrap>p:last-child,html[data-theme="dark"] .house-preview-intro{color:#cbbba9}
html[data-theme="dark"] .survey-kicker,html[data-theme="dark"] .survey-invite-note,html[data-theme="dark"] .leaderboard-eyebrow,html[data-theme="dark"] .book-eyebrow,html[data-theme="dark"] .player-cards-kicker,html[data-theme="dark"] .house-preview-eyebrow{color:#d4ad75}
html[data-theme="dark"] .leaderboard-section{background:radial-gradient(ellipse at 49% 20%,#29241d 0%,#1c1a17 65%,#151513 130%);border-top-color:#4d4032}
html[data-theme="dark"] .leaderboard-card{background:linear-gradient(130deg,#292622,#211f1e 53%,#30291f);border-color:#746049;box-shadow:0 24px 65px #0008}
html[data-theme="dark"] .leaderboard-card:before{background:radial-gradient(ellipse at 11% 20%,#e7ad4c16,transparent 38%),radial-gradient(ellipse at 85% 75%,#c49a4b0e,transparent 42%)}
html[data-theme="dark"] .leaderboard-card-header,html[data-theme="dark"] .leaderboard-card-footer{color:#c5b5a0}
html[data-theme="dark"] .leaderboard-header-divider,html[data-theme="dark"] .leaderboard-current-view span{color:#a9977e}
html[data-theme="dark"] .leaderboard-filter-bar{background:#26221e;border-color:#5a4d3c}
html[data-theme="dark"] .leaderboard-filter-label strong,html[data-theme="dark"] .leaderboard-current-view{color:#f4e9d9}
html[data-theme="dark"] .leaderboard-filter-label span,html[data-theme="dark"] .leaderboard-filter-fields label{color:#c5aa8b}
html[data-theme="dark"] .leaderboard-filter-fields select{background:#171615;border-color:#746049;color:#f0e2cf}
html[data-theme="dark"] .leaderboard-table-header{background:#42372a;border-color:#705c43;color:#f3e2c5}
html[data-theme="dark"] .leaderboard-row,html[data-theme="dark"] .leaderboard-row:nth-child(odd){background:linear-gradient(100deg,#2c2924,#24221f 50%,#2b2722);border-color:#524638;box-shadow:inset 0 1px #ffffff0a}
html[data-theme="dark"] .leaderboard-row .leaderboard-player-name{color:#f5ebdd}
html[data-theme="dark"] .leaderboard-row .leaderboard-country,html[data-theme="dark"] .leaderboard-gender-tag{color:#c9b8a4}
html[data-theme="dark"] .leaderboard-row .leaderboard-player-house.house-wind{color:#aec5ed}
html[data-theme="dark"] .leaderboard-row .leaderboard-player-house.house-ice{color:#91d2f3}
html[data-theme="dark"] .leaderboard-row .leaderboard-player-house.house-earth{color:#a3d7b7}
html[data-theme="dark"] .leaderboard-row .leaderboard-player-house.house-fire{color:#f1ac94}
html[data-theme="dark"] .leaderboard-row .leaderboard-ovr{background:#7e63402e;border-color:#9d7c4e;color:#e6c48f}
html[data-theme="dark"] .leaderboard-row:not(.leaderboard-gold):not(.leaderboard-silver):not(.leaderboard-bronze) .leaderboard-rank{background:#4b443b;color:#eadcc9;border-color:#776652}
html[data-theme="dark"] .leaderboard-empty{background:#24211e;border-color:#574c3d}
html[data-theme="dark"] .leaderboard-empty strong,html[data-theme="dark"] .leaderboard-empty-title{color:#f6ecdc}
html[data-theme="dark"] .leaderboard-empty span,html[data-theme="dark"] .leaderboard-empty-explanation{color:#cbbca8}
html[data-theme="dark"] .leaderboard-gate{background:linear-gradient(145deg,#302820,#211e1b);border-color:#bd9561;box-shadow:0 20px 65px #000b,0 0 0 5px #b9966024;color:#f8ecda}
html[data-theme="dark"] .leaderboard-gate-kicker,html[data-theme="dark"] .leaderboard-gate-footnote{color:#d9b37d}
html[data-theme="dark"] .leaderboard-gate>p:not(.leaderboard-gate-kicker){color:#d2c1ac}
html[data-theme="dark"] .player-cards-section{background:radial-gradient(ellipse at 50% 5%,#25211d 0%,#1c1917 64%,#151413 135%);border-top-color:#493d31}
html[data-theme="dark"] .player-cards-scroll-label,html[data-theme="dark"] .player-card-caption span:last-child{color:#c3a783}
html[data-theme="dark"] .player-card-caption{color:#e1cdb3}
html[data-theme="dark"] .player-cards-grid{scrollbar-color:#98764c #28231e}
html[data-theme="dark"] .book-section{background:radial-gradient(ellipse at 28% 48%,#25211c 0%,#1a1916 60%,#141413 135%);border-top-color:#493d31}
html[data-theme="dark"] .book-subtitle,html[data-theme="dark"] .book-price{color:#f4dfbc}
html[data-theme="dark"] .book-authors,html[data-theme="dark"] .book-format,html[data-theme="dark"] .book-cover-hint{color:#c6ac8a}
html[data-theme="dark"] .book-cover-frame .book-cover-back{background:#1a1714}

/* Main page house preview: retain each team's emblem and accent color. */
html[data-theme="dark"] .house-preview{background:radial-gradient(ellipse at 50% 8%,#27241f 0%,#1d1b18 70%,#151513 140%);border-top-color:#4b3c2b}
html[data-theme="dark"] .house-preview-card{background:linear-gradient(145deg,#292824,#1f2e25);border-color:#516151;color:#9ad1af}
html[data-theme="dark"] .house-preview-fire{background:linear-gradient(145deg,#292321,#3c2421);border-color:#71483e;color:#f0a898}
html[data-theme="dark"] .house-preview-ice{background:linear-gradient(145deg,#232b31,#1b3443);border-color:#526e7c;color:#a6d8f7}
html[data-theme="dark"] .house-preview-wind{background:linear-gradient(145deg,#24252a,#2c3345);border-color:#5c6884;color:#c8d5f2}
html[data-theme="dark"] .house-preview-visit,html[data-theme="dark"] .house-preview-note{color:#c9b08a}

/* Instagram invitation: velvet-charcoal treatment, not a bright patch. */
html[data-theme="dark"] .instagram-section{background:#1d1a19;border-top-color:#493b34;color:#f4e8e2}
html[data-theme="dark"] .instagram-shell h2{color:#f6ecdf}
html[data-theme="dark"] .instagram-eyebrow,html[data-theme="dark"] .instagram-stats span{color:#c8b4ad}
html[data-theme="dark"] .instagram-stats a{background:#2b2524;border-color:#5a4844;color:#f3e7df}
html[data-theme="dark"] .instagram-stats a:hover{background:#39302d;border-color:#99776a}
html[data-theme="dark"] .instagram-actions a{border-color:#baa397}
html[data-theme="dark"] .instagram-follow-button{background:#e9d4c3;color:#1f1a19}
html[data-theme="dark"] .instagram-follow-button:hover{background:#f7e7d7}
html[data-theme="dark"] .instagram-videos-button{color:#f1e3db;background:transparent}
html[data-theme="dark"] .instagram-videos-button:hover{background:#322a27}

/* Houses page and every house's expanded coaches and formations. */
html[data-theme="dark"] body.houses-page{--page-bg:#151513;--hero-glow:#24211d;--house-soft:#1e1c19;--house-ink:#f5ebdc;--theme-ink:#f5ebdc;--theme-muted:#c5b5a0;--theme-stroke:#534636;--panel-bg:#292520;--footer-bg:#171614;--name-bg:#29241f;--name-ink:#f9e8cf;--circle:#d4bd91;--circle-ink:#292114}
html[data-theme="dark"] body.houses-page[data-house="earth"]{--house-primary:#8bc49b;--house-secondary:#c6a270;--house-soft:#18221c;--panel-bg:#202b22;--footer-bg:#151d17}
html[data-theme="dark"] body.houses-page[data-house="fire"]{--house-primary:#e59b85;--house-secondary:#edc386;--house-soft:#2b1d1a;--panel-bg:#32231e;--footer-bg:#1c1514}
html[data-theme="dark"] body.houses-page[data-house="ice"]{--house-primary:#92c7e6;--house-secondary:#8dadcf;--house-soft:#18232c;--panel-bg:#202b35;--footer-bg:#131b23;--field-base:#204a63;--field-stripe:#1b425a;--field-line:#c9e9f27e}
html[data-theme="dark"] body.houses-page[data-house="wind"]{--house-primary:#b3c5e9;--house-secondary:#cfac75;--house-soft:#202430;--panel-bg:#242939;--footer-bg:#171a22;--field-base:#263448;--field-stripe:#202c40;--field-line:#d5e4fc71;--circle:#dfe7f5;--circle-ink:#253149}
html[data-theme="dark"] .house-option{background:linear-gradient(145deg,#232923,#1b3528);border-color:#435d4a;color:#a7d6b3}
html[data-theme="dark"] .house-option:after{border-color:#ffffff25}
html[data-theme="dark"] .house-option-fire{background:linear-gradient(145deg,#2a201f,#43221e);border-color:#7b4841;color:#f0a69b}
html[data-theme="dark"] .house-option-ice{background:linear-gradient(145deg,#1e2b32,#193b52);border-color:#496d87;color:#a3d5ef}
html[data-theme="dark"] .house-option-wind{background:linear-gradient(145deg,#262a34,#202841);border-color:#677692}
html[data-theme="dark"] .house-option-wind .house-option-name{color:#fff}
html[data-theme="dark"] .lineup-description,html[data-theme="dark"] .formation-note,html[data-theme="dark"] .house-switch-note{color:#d2bc9e}
html[data-theme="dark"] .coach-card,html[data-theme="dark"] .match-fact{background:var(--panel-bg);border-color:var(--theme-stroke);border-top-color:var(--house-primary)}
html[data-theme="dark"] .squad-switch{background:#28231e;border-color:var(--theme-stroke)}
html[data-theme="dark"] .squad-tab:not([aria-selected="true"]){color:#edd9bf}
html[data-theme="dark"] .squad-tab:hover:not([aria-selected="true"]){background:#494030}
html[data-theme="dark"] .squad-tab[aria-selected="true"]{background:var(--house-primary);color:#171411}
html[data-theme="dark"] .named-player{background:var(--name-bg);color:var(--name-ink)}
html[data-theme="dark"] .named-player-role,html[data-theme="dark"] .named-player-country{color:#d7c0a0}
html[data-theme="dark"] .named-player-rating{background:var(--house-primary);color:#171411}
html[data-theme="dark"] .named-player-rating.is-pending{background:#40382f;color:#f5e3c8}
html[data-theme="dark"] .bench-panel{background:linear-gradient(180deg,var(--panel-bg),var(--house-soft));border-color:var(--theme-stroke);border-top-color:var(--house-primary)}
html[data-theme="dark"] .bench-player{background:#ffffff0b;border-color:#ffffff26}
html[data-theme="dark"] .bench-player-info small,html[data-theme="dark"] .bench-header>span,html[data-theme="dark"] .lineup-footnote{color:#c7b59d}
html[data-theme="dark"] .formation-mark,html[data-theme="dark"] .pitch-panel{background:var(--panel-bg);border-color:var(--theme-stroke)}

/* Survey's many forms, chips, stars and expanding panels. */
html[data-theme="dark"] .survey-page-body{background:radial-gradient(ellipse 280px 240px at 1% 14%,#36252b 0%,transparent 100%),radial-gradient(ellipse 310px 310px at 100% 36%,#1f332c 0%,transparent 100%),radial-gradient(ellipse 260px 260px at 4% 79%,#232a42 0%,transparent 100%),#171615}
html[data-theme="dark"] .survey-page-intro h1,html[data-theme="dark"] .survey-question legend,html[data-theme="dark"] .survey-progress-label{color:#f3e9dd}
html[data-theme="dark"] .survey-page-intro>p:not(.survey-kicker),html[data-theme="dark"] .survey-helper,html[data-theme="dark"] .survey-progress-hint,html[data-theme="dark"] .survey-note{color:#cab9af!important}
html[data-theme="dark"] .survey-progress{background:#51453d}
html[data-theme="dark"] .survey-progress span{background:#d5aa79}
html[data-theme="dark"] .survey-question{background:#282421;border-color:#574b45;box-shadow:0 8px 30px #0004}
html[data-theme="dark"] .survey-question:focus-within{border-color:#9a827f;box-shadow:0 12px 30px #0005}
html[data-theme="dark"] .survey-number{background:#3f3732;color:#f1dcca}
html[data-theme="dark"] .survey-email input[type="email"],html[data-theme="dark"] .survey-writing textarea,html[data-theme="dark"] .survey-select,html[data-theme="dark"] .survey-short-answer,html[data-theme="dark"] .survey-search{background-color:#191819;border-color:#685954;color:#f6ece5}
html[data-theme="dark"] .survey-page :is(input,textarea)::placeholder{color:#aaa097}
html[data-theme="dark"] .survey-subquestion,html[data-theme="dark"] .survey-factor-name,html[data-theme="dark"] .survey-rank-list strong{color:#f1e5df}
html[data-theme="dark"] .survey-choice,html[data-theme="dark"] .survey-factor-row,html[data-theme="dark"] .survey-factor-row:nth-child(even),html[data-theme="dark"] .survey-rank-list li,html[data-theme="dark"] .survey-rank-list li:nth-child(2n){background:#342d2c;border-color:#60504c;color:#ead9d6}
html[data-theme="dark"] .survey-choice:hover,html[data-theme="dark"] .survey-bubble:hover span{background:#493739;border-color:#a57c83}
html[data-theme="dark"] .survey-choice:has(input:checked){background:#633d49;border-color:#d098a8;color:#fff1ef}
html[data-theme="dark"] .survey-choice input{background:#221e1d;border-color:#ad8d90}
html[data-theme="dark"] .survey-bubble span,html[data-theme="dark"] .survey-bubble:nth-child(2n) span,html[data-theme="dark"] .survey-bubble:nth-child(3n) span{background:#3c3438;border-color:#796368;color:#ecc6c0}
html[data-theme="dark"] .survey-bubble input:checked+span{background:#a86667;border-color:#d2968b;color:#fff}
html[data-theme="dark"] .survey-stars .star-glyph{color:#786e66}
html[data-theme="dark"] .survey-star-caption,html[data-theme="dark"] .character-group-title,html[data-theme="dark"] .survey-selection-summary small{color:#c8adae}
html[data-theme="dark"] .survey-house-options .house-earth{background:#273e34;color:#a9d1b3;border-color:#517a64}
html[data-theme="dark"] .survey-house-options .house-fire{background:#4d2c2a;color:#f0aea0;border-color:#85534d}
html[data-theme="dark"] .survey-house-options .house-ice{background:#263d50;color:#acd4f5;border-color:#5b7c97}
html[data-theme="dark"] .survey-house-options .house-wind{background:#33374f;color:#cdd6ef;border-color:#737b9f}
html[data-theme="dark"] .survey-house-options .survey-choice:has(input:checked){box-shadow:0 0 0 2px #caa47788}
html[data-theme="dark"] .survey-rank-list li{color:#f0e2d8}
html[data-theme="dark"] .rank-position{background:#624c49;color:#ffe2cf}
html[data-theme="dark"] .rank-arrows button{background:#332b2a;color:#e0b9c7;border-color:#82666d}
html[data-theme="dark"] .rank-arrows button:hover:not(:disabled){background:#523741}
html[data-theme="dark"] .survey-character-picker{background:#292226;border-color:#715b69}
html[data-theme="dark"] .survey-character-picker summary{color:#edcedc}
html[data-theme="dark"] .survey-character-picker[open] summary{border-bottom-color:#62505a}
html[data-theme="dark"] .character-pick{background:#3b303a;border-color:#6c5768;color:#f0dae4}
html[data-theme="dark"] .character-pick:hover{background:#544052}
html[data-theme="dark"] .character-pick[aria-pressed="true"]{background:#9d79b1;color:#fff;border-color:#c09bcf}
html[data-theme="dark"] .selected-character-list span{background:#453549;color:#e7cfea}
html[data-theme="dark"] .survey-confirmation{background:#41372c;color:#eed9b6;border-color:#947149}
html[data-theme="dark"] .survey-page-footer{border-top-color:#554a3e;color:#c6b09a}

/* Signup popup remains readable in the same theme as the page behind it. */
html[data-theme="dark"] .email-popup{background:#211e1b;color:#f5ebdb;border-color:#b59264;box-shadow:0 24px 100px #000a}
html[data-theme="dark"] .email-popup::backdrop{background:#000b}
html[data-theme="dark"] .dialog-content input{background:#131211;border-color:#80684a;color:#f6e6d2}
html[data-theme="dark"] .dialog-content input::placeholder{color:#a99888}
html[data-theme="dark"] .dialog-close:hover{background:#392f25}
html[data-theme="dark"] .form-note{color:#c6b09b}
html[data-theme="dark"] .form-message{background:#3b3022;color:#f9e7c8}
