/* Spel365 Lounge — shared presentation only. Never style game pieces or world scenery. */
:root{
  --s365-bg:#0d1024;--s365-panel:#181c3a;--s365-raised:#282e58;--s365-deep:#090c1d;
  --s365-text:#fff8ee;--s365-muted:#c8c9dd;--s365-gold:#ffd166;--s365-line:#4c517c;
  --s365-coral:#ff6b7a;--s365-aqua:#55e6c1;--s365-violet:#a98bff;--s365-sky:#61b8ff;
  --s365-good:#a2e0c3;--s365-bad:#ffb4bb;--s365-warn:#ffdb9d;
  --s365-radius:16px;--s365-small-radius:10px;--s365-shadow:0 12px 32px #030c1633;
  --s365-font:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --s365-heading:Georgia,"Times New Roman",serif;
}
body[data-s365-theme="lounge"]{
  color-scheme:dark;color:var(--s365-text);background:
    radial-gradient(circle at 8% 0%,#a98bff2e,transparent 30rem),
    radial-gradient(circle at 92% 8%,#ff6b7a24,transparent 28rem),
    radial-gradient(circle at 55% 110%,#55e6c11c,transparent 38rem),var(--s365-bg);
  font-family:var(--s365-font);--spel365-focus:var(--s365-gold);--spel365-paper:var(--s365-panel);--spel365-line:var(--s365-line);
}
body[data-s365-theme] :where(h1,h2){color:var(--s365-text);font-family:var(--s365-heading);font-weight:400;letter-spacing:-.025em;line-height:1.2}
body[data-s365-theme] :where(.eyebrow,.goldline,.gold-line){color:var(--s365-gold)}
body[data-s365-theme] :where(.eyebrow){font-size:.8125rem;letter-spacing:.12em}
body[data-s365-theme] :where(a){text-underline-offset:4px}
body[data-s365-theme] :where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid var(--s365-gold)!important;outline-offset:3px!important}
body[data-s365-theme] :where(button,a.button,a.btn){font-family:var(--s365-font);touch-action:manipulation}
body[data-s365-theme] :where(input,select,textarea){accent-color:var(--s365-gold)}
body[data-s365-theme] :where(input,textarea)::placeholder{color:#a7b7c3;opacity:1}
body[data-s365-theme] :where(.spel365-brand-word){color:var(--s365-text)}
body[data-s365-theme] :where(.spel365-brand-word span){color:var(--s365-gold)}

/* One header treatment. Existing positioning, game dimensions and navigation remain. */
body[data-s365-theme]>header,
body[data-s365-theme] :where(.lounge-header,.studio-header,.duel-header,.sysop-topbar,.game-shell>.topbar){
  color:var(--s365-text);background:#112333f5;border-color:var(--s365-line);box-shadow:0 1px 0 #edc88e19;
}
body[data-s365-theme]>header :where(a,nav a,.brand,.brand span,.brand strong,.brand-title),
body[data-s365-theme] .game-shell>.topbar :where(a,.brand){color:var(--s365-text)}
body[data-s365-theme]>header :where(p,small,.brand small){color:var(--s365-muted)}
body[data-s365-theme]>header :where(img[src*="logo"]),
body[data-s365-theme] :where(.lobby-footer img,.login-panel>.logo){
  background:transparent;border:0;border-radius:0;padding:0;object-fit:contain;
}
/* The supplied full logo is 2:1. Keep it whole, including the ribbon and symbols. */
body[data-s365-theme] img:is([src*="spel365-logo.png"],[src*="/login/logo.png"]){object-fit:contain!important;object-position:center;background:transparent!important;border:0!important;border-radius:0!important;padding:0!important;height:auto!important;max-width:100%;aspect-ratio:2/1}
body[data-s365-theme]>header img:is([src*="spel365-logo.png"],[src*="/login/logo.png"]){width:144px!important;height:72px!important;max-height:72px!important;max-width:40vw!important}
body[data-s365-theme].homepage .lobby-footer img{width:184px;height:92px!important}
body[data-s365-theme].spel-lounge .brand{background:transparent;padding:0}
body[data-s365-theme][data-s365-surface="login"] .login-panel>img.logo{width:260px;max-width:100%;height:auto!important;max-height:none}
body[data-s365-theme].sysop-page .sysop-brand img{width:88px;height:44px!important;max-height:44px;flex-shrink:0}
body[data-s365-theme][data-s365-surface="service"]>header :where(img[src*="logo"]){width:144px;height:72px;max-width:40vw;max-height:72px}
@media(max-width:600px){body[data-s365-theme]>header img:is([src*="spel365-logo.png"],[src*="/login/logo.png"]){width:112px!important;height:56px!important;max-height:56px!important}}
body[data-s365-theme][data-s365-surface="service"]>header{height:auto;min-height:84px}
body[data-s365-theme][data-s365-surface="service"]>header .top{min-height:84px;max-width:1280px;width:100%;padding-block:12px}
body[data-s365-theme]>header :where(nav a){font-size:.9375rem;font-weight:600;border-radius:var(--s365-small-radius)}
body[data-s365-theme]>header :where(nav a:hover,nav a:focus-visible,nav a[aria-current="page"]){background:var(--s365-raised);color:var(--s365-gold)}
body[data-s365-theme] .spel365-menu-toggle{background:var(--s365-raised);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme] .ux-site-nav{border-color:var(--s365-line)}
body[data-s365-theme] .ux-site-nav.ux-open{background:var(--s365-panel)}
body[data-s365-theme] .ux-site-nav.ux-open a{background:var(--s365-raised);color:var(--s365-text)}
body[data-s365-theme] .ux-site-nav.ux-open a[aria-current="page"]{background:var(--s365-gold);color:var(--s365-deep)}

/* Account, contacts, parties, mailbox, chat and server-rendered help/settings. */
body[data-s365-theme][data-s365-surface="service"],body[data-s365-theme][data-s365-surface="control"]{
  --navy:var(--s365-text);--navy2:#26435a;--blue:#26435a;--gold:var(--s365-gold);--bg:var(--s365-bg);
  --text:var(--s365-text);--ink:var(--s365-text);--muted:var(--s365-muted);--paper:var(--s365-panel);
  --border:var(--s365-line);--line:var(--s365-line);--green:var(--s365-good);--danger:var(--s365-bad);--red:var(--s365-bad);
  font-size:calc(17px * var(--spel365-text-scale,1));line-height:1.55;
}
body[data-s365-theme][data-s365-surface="service"]>main{max-width:1240px;padding-top:32px}
body[data-s365-theme][data-s365-surface="service"] :where(main>h1,.intro h1){font-size:clamp(1.9rem,3.5vw,2.65rem)}
body[data-s365-theme]:is([data-s365-surface="service"],[data-s365-surface="control"]) :where(
  .panel,.profile-card,.list,.metric,.reward-card,.help-card,details.technical,.health-card,.mail-shell,.chat-shell,
  .preview-card,.controls-card,.privacy-request,.privacy-version,.help,.trusted-card,.queue-card,.invite-panel,.match-waiting,.options){
  background:var(--s365-panel);color:var(--s365-text);border-color:var(--s365-line);border-radius:var(--s365-radius);box-shadow:var(--s365-shadow);
}
body[data-s365-theme]:is([data-s365-surface="service"],[data-s365-surface="control"]) :where(
  .item,.match,.session,.privacy-history article,.note,.user-row,.audit-row,.definition,fieldset,blockquote,
  .message-row,.conversation,.conversation-head,.composer,.room,.person,.push-event-row,.push-help,.preview-stage,.formats){
  background:var(--s365-panel);color:var(--s365-text);border-color:var(--s365-line);
}
body[data-s365-theme]:is([data-s365-surface="service"],[data-s365-surface="control"]) :where(.item.unread,.item.turn,.match.turn,.message-row.unread){background:#2b3c49;border-left:3px solid var(--s365-gold)}
body[data-s365-theme]:is([data-s365-surface="service"],[data-s365-surface="control"]) :where(.list-head,th,.sidebar,.folders,.side-tabs,.list-tools,.type,.player,.category-head){background:var(--s365-deep);color:var(--s365-muted);border-color:var(--s365-line)}
body[data-s365-theme]:is([data-s365-surface="service"],[data-s365-surface="control"]) :where(p,small,.intro p,.hint,.empty,.help,.field-hint,.meta,.step){color:var(--s365-muted)}
body[data-s365-theme]:is([data-s365-surface="service"],[data-s365-surface="control"]) :where(h3,label,legend,.identity strong,.item strong,.match strong,.sender,.subject,.metric strong){color:var(--s365-text)}
body[data-s365-theme]:is([data-s365-surface="service"],[data-s365-surface="control"]) :where(a){color:var(--s365-gold)}
body[data-s365-theme]:is([data-s365-surface="service"],[data-s365-surface="control"]) :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),select,textarea){
  color:var(--s365-text);background:var(--s365-deep);border:1px solid var(--s365-line);border-radius:var(--s365-small-radius);font-family:var(--s365-font);
}
body[data-s365-theme]:is([data-s365-surface="service"],[data-s365-surface="control"]) :where(main>form,.panel form,.report-dialog form,.sysop-palette form){background:transparent;border-color:var(--s365-line)}
body[data-s365-theme]:is([data-s365-surface="service"],[data-s365-surface="control"]) :where(button,.button,.btn,.photo-button,.privacy-link){
  background:var(--s365-gold);color:var(--s365-deep);border:1px solid transparent;border-radius:var(--s365-small-radius);font-weight:650;text-decoration:none;
}
body[data-s365-theme]:is([data-s365-surface="service"],[data-s365-surface="control"]) :where(.secondary,.muted,.subnav a,.tabs a,.search button,.category-tabs button,.back,.room,.person,.message-row,.folders button,.side-tabs button){background:var(--s365-raised);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme]:is([data-s365-surface="service"],[data-s365-surface="control"]) :where(.tabs a.active,.subnav a.active,.side-tabs button.active,.folders button.active,.category-tabs button.active,.room.active){background:#3b4650;color:var(--s365-gold);border-color:var(--s365-gold)}
body[data-s365-theme]:is([data-s365-surface="service"],[data-s365-surface="control"]) :where(button:hover,.button:hover,.room:hover,.person:hover,.message-row:hover,tbody tr:hover){filter:brightness(1.12)}
body[data-s365-theme][data-s365-surface="service"] :where(.turn-card,.avatar,.bell){background:var(--s365-raised);color:var(--s365-gold)}
body[data-s365-theme][data-s365-surface="service"] :where(.bubble){background:var(--s365-raised);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme][data-s365-surface="service"] :where(.message.own .bubble,.message.me .bubble,.own .bubble,.mine .bubble,.bubble.mine){background:#304c58;border-color:#759b9d;color:#f4f4e7}
body[data-s365-theme][data-s365-surface="service"] :where(.bubble p,.bubble strong,.message-row .subject,.folders button span){color:inherit}
body[data-s365-theme][data-s365-surface="service"] :where(.preview-stage,.formats){background:#243a4d}
body[data-s365-theme][data-s365-surface="service"] .options button{background:var(--s365-panel);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme][data-s365-surface="service"] .options button[aria-selected="true"]{border-color:var(--s365-gold);box-shadow:0 0 0 2px var(--s365-gold)}

/* Shared dialogs and semantic feedback. Red/green remain meaningful. */
body[data-s365-theme] dialog{background:var(--s365-panel);color:var(--s365-text);border:1px solid var(--s365-line);border-radius:18px;box-shadow:0 24px 90px #0009}
body[data-s365-theme] dialog::backdrop{background:#07111cba;backdrop-filter:blur(4px)}
body[data-s365-theme] dialog :where(h2,h3,label,legend){color:var(--s365-text)}
body[data-s365-theme] dialog :where(p,small){color:var(--s365-muted)}
body[data-s365-theme] dialog :where(input:not([type="checkbox"]):not([type="radio"]),select,textarea){background:var(--s365-deep);color:var(--s365-text);border-color:var(--s365-line)}
/* Inner game-dialog surfaces must match their light foreground text too. */
body[data-s365-theme][data-s365-surface="game"] :is(dialog form,dialog .handoff,dialog .result,dialog .promotion,.modal-card){background:var(--s365-panel);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme][data-s365-surface="game"] :is(dialog,.modal-card) :is(h1,h2,h3,label,legend,strong){color:var(--s365-text)}
body[data-s365-theme][data-s365-surface="game"] :is(dialog,.modal-card) :is(p,small){color:var(--s365-muted)}
body[data-s365-theme][data-s365-surface="game"] :is(dialog,.modal-card) :is(fieldset,.options){background:var(--s365-deep);border-color:var(--s365-line);color:var(--s365-text)}
body[data-s365-theme][data-s365-surface="game"] dialog fieldset label>span{background:var(--s365-raised);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme][data-s365-surface="game"] :is(dialog,.modal-card) fieldset label{background:var(--s365-raised);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme][data-s365-surface="game"] :is(dialog,.modal-card) fieldset label :where(strong,small,span){color:inherit}
body[data-s365-theme][data-s365-surface="game"] dialog fieldset input:checked+span{background:#304859;border-color:var(--s365-gold)}
body[data-s365-theme][data-s365-surface="game"] dialog fieldset input:focus-visible+span{outline:3px solid var(--s365-gold);outline-offset:2px}
body[data-s365-theme][data-s365-surface="game"] .modal-card :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){background:var(--s365-panel);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme][data-s365-surface="game"] .modal-card :is(.mode-grid button,.mode-tabs button){background:var(--s365-raised);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme][data-s365-surface="game"] .modal-card .mode-tabs button.selected{background:#304859;border-color:var(--s365-gold)}
body[data-s365-theme][data-s365-surface="game"] .modal-card summary{color:var(--s365-text)}
body[data-s365-theme]:is(.game-backgammon365,.game-chess365) :is(.table-card,.board-panel,.side-panel>section,.players article){background:var(--s365-panel);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme]:is(.game-backgammon365,.game-chess365) .players article.active{background:var(--s365-raised);border-color:var(--s365-gold)}
body[data-s365-theme]:is(.game-backgammon365,.game-chess365) :is(.players small,.turn small,.message,.action-row span){color:var(--s365-muted)}
body[data-s365-theme][data-s365-surface] :where(.notice,.status,.connection.waiting,.save-state.busy,.phase-note,.loading){color:var(--s365-warn);background:#433c2b;border-color:#7c6848}
body[data-s365-theme][data-s365-surface] :where(.notice.ok,.status-pill,.connection:not(.error):not(.waiting)){color:var(--s365-good);background:#203e38;border-color:#497e67}
body[data-s365-theme][data-s365-surface] :where(.danger,.danger-button,.notice.error,.notice.err,.error,.status-pill.critical,.connection.error){color:var(--s365-bad);background:#4a2936;border-color:#ae6b79}
body[data-s365-theme][data-s365-surface] :where(.status-pill.warning,.type.important,.type.maintenance){color:var(--s365-warn);background:#433c2b}
body[data-s365-theme][data-s365-surface] :where(.danger-panel){background:#322633;border-color:#ae6b79}
body[data-s365-theme][data-s365-surface] :where(.danger-panel h2,.blocked){color:var(--s365-bad)}

/* Home and catalog share the same surfaces; keep the compact five-column catalog. */
body[data-s365-theme].homepage{--ink:var(--s365-text);--muted:var(--s365-muted);--paper:var(--s365-bg);--line:var(--s365-line);--teal:var(--s365-gold)}
body[data-s365-theme].homepage :where(.welcome-strip,.section,.continue-card,.game-card,.announcements,.news-card,.news-item,.contact-card,.score-details,.feature-showcase,.lobby-footer){background:var(--s365-panel);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme].homepage :where(.game-body,.game-go,.feature-copy,.announcement,.invite-dialog){background:var(--s365-panel);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme].homepage :where(.game-body p,.section-copy,.feature-copy p,.empty,.news-card p,.lobby-footer p,.contact-copy small){color:var(--s365-muted)}
body[data-s365-theme].homepage :where(.primary,.light){background:var(--s365-gold);color:var(--s365-deep)}
body[data-s365-theme].homepage :where(.secondary,.filter,.filters button,.row-arrow,.motion-toggle,.contact-invite){background:var(--s365-raised);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme].homepage :where(.filters button[aria-pressed="true"],.filter.active,.continue-card.priority){background:#303e48;color:var(--s365-gold);border-color:var(--s365-gold)}
body[data-s365-theme].homepage :where(.avatar,.mini-icon){background:var(--s365-raised);color:var(--s365-gold)}
body[data-s365-theme].spel-lounge{--ink:var(--s365-text);--muted:var(--s365-muted);--gold:var(--s365-gold)}
body[data-s365-theme].spel-lounge :where(.game,.gamebody,.game-actions){background:var(--s365-panel);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme].spel-lounge :where(.game h3,.lounge-intro h1){color:var(--s365-text)}
body[data-s365-theme].spel-lounge :where(.game p,.lounge-intro p,.lounge-footer){color:var(--s365-muted)}
body[data-s365-theme].spel-lounge :where(.play){background:var(--s365-gold);color:var(--s365-deep);border-color:var(--s365-gold)}
body[data-s365-theme].spel-lounge :where(.invite,.back-link){background:var(--s365-raised);color:var(--s365-text);border-color:var(--s365-line)}

/* Game chrome only. The cards, grids, canvases, pawns and world scenes are untouched. */
body[data-s365-theme][data-s365-surface="game"] :where(.info-strip,.game-heading,.game-titlebar,.game-head,.control-panel,.control-panel>section,.control-card,.side-panel,.side-panel>section,.side-card,.hud-panel,.help-card,.sound-card,.status-card,.power-card,.inventory-card,.inventory,.record-card,.settings-card,.panel,.sidebar>section,.table-panel,.table-card,.board-card,.player-card,.turn-banner,.board-message,.game-message,.hand-zone,.piece-stats>span,.round-stats>span){
  background:var(--s365-panel);color:var(--s365-text);border-color:var(--s365-line);
}
body[data-s365-theme][data-s365-surface="game"] :where(.info-strip,.game-heading,.game-titlebar,.game-head,.control-panel,.control-card,.side-panel,.side-card,.hud-panel,.help-card,.sound-card,.status-card,.power-card,.inventory-card,.inventory,.record-card,.settings-card,.panel,.sidebar>section,.table-panel,.table-card,.board-card,.player-card,.turn-banner,.board-message,.game-message,.hand-zone,.piece-stats>span,.round-stats>span) :where(h1,h2,h3,strong,label,legend,.mini-label,.eyebrow){color:var(--s365-text)}
body[data-s365-theme][data-s365-surface="game"] :where(.topbar,.studio-header,.duel-header,.info-strip,.game-heading,.game-titlebar,.sidebar,.control-panel,.control-card,.side-panel,.side-card,.hud-panel,.help-card,.sound-card,.status-card,.power-card,.inventory-card,.inventory,.record-card,.settings-card,.panel,.table-panel,.table-card,.board-card,.player-card,.turn-banner,.board-message,.game-message,.hand-zone,.piece-stats>span,.round-stats>span) :where(p,small,span,.help){color:var(--s365-muted)}
body[data-s365-theme][data-s365-surface="game"] :where(.player-card,.turn-banner,.board-message,.game-message) :where(strong,b){color:var(--s365-text)}
body[data-s365-theme][data-s365-surface="game"] :where(.rule-note){background:#433c2b!important;color:var(--s365-warn)!important;border-color:#7c6848!important}
body[data-s365-theme][data-s365-surface="game"] :where(.rule-note p,.rule-note small){color:inherit!important}
body[data-s365-theme][data-s365-surface="game"] :where(.btn,.button,.control,.text-btn,.top-actions button,.top-actions a,.actions>button,.direction-grid button,.suggestions button,.studio-header a,.duel-header>a:last-child){background:var(--s365-raised);color:var(--s365-text);border-color:var(--s365-line);border-radius:var(--s365-small-radius)}
body[data-s365-theme][data-s365-surface="game"] :where(.direction-grid button,.suggestions button) :where(span,strong){color:inherit}
body[data-s365-theme][data-s365-surface="game"] :where(.inventory>span,.hand-pips){background:var(--s365-raised);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme][data-s365-surface="game"] :where(.btn.primary,.button.primary,.control.primary,.primary-button){background:var(--s365-gold);color:var(--s365-deep);border-color:var(--s365-gold)}
body[data-s365-theme][data-s365-surface="game"] :where(.stats,.summary,.hud,.metrics,.status-row){color:var(--s365-text)}
body[data-s365-theme].duel-page .board .cell{min-height:0!important}
body[data-s365-theme].duel-page :where(.turn-bar strong,.sidebar h2,.player .score){color:var(--s365-gold)}
body[data-s365-theme].duel-page :where(.players .player){background:var(--s365-deep);border-color:var(--s365-line)}
body[data-s365-theme].duel-page .players .player.active{background:var(--s365-raised);border-color:var(--s365-gold)}

/* Spel365: thematic menus and cards around the game collection. */
body[data-s365-theme][data-s365-surface="world"] :where(
  .status-card,.places-card,.social-card,.social-notices,.world-menu-panel,.world-guide,.host-dialogue,
  .place-dialog-content,.audio-panel,.room-card,.tools,.venue-panel,.venue-card,.garden-card,.water-card,
  .coast-cards article,.housing-info,.quest,.npc,.collectible,.offer,.club,.new,.card,.stat,.event,.season,
  #trip article,#invitations article,.store-counter,.inside-balance,.district-list a,.world-loader){background:var(--s365-panel);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme][data-s365-surface="world"] :where(
  .status-card,.places-card,.social-card,.social-notices,.world-menu-panel,.world-guide,.host-dialogue,
  .place-dialog-content,.audio-panel,.tools,.venue-panel,.venue-card,.garden-card,.water-card,
  .coast-cards article,.housing-info,.quest,.npc,.collectible,.offer,.club,.new,.card,.stat,.event,.season,
  #trip article,#invitations article,.store-counter,.district-list a) :where(p,small,span){color:var(--s365-muted)}
body[data-s365-theme][data-s365-surface="world"] :where(.status-card,.places-card,.social-card,.tools,.world-menu-panel) :where(a,strong,h3,label){color:var(--s365-text)}
body[data-s365-theme][data-s365-surface="world"] :where(.soft-button,.exit,.primary,.primary-dialog-button,.dialog-actions button,.quick-messages button,.chat-form button,.place-buttons button,.quest button,.npc button,.offer button,.club button,.new button,.card button,.coast-cards button,.venue-panel>button,.host-actions button,.host-actions a,.tool-tabs button,.category-row button,.selection-bar button,header>a:last-child,header .top-actions>a,header .top-actions>button){background:var(--s365-raised);color:var(--s365-text);border-color:var(--s365-line);border-radius:var(--s365-small-radius)}
body[data-s365-theme][data-s365-surface="world"] :where(.primary,.primary-dialog-button,.quest button,.offer button,.card button,.host-actions button:first-child){background:var(--s365-gold);color:var(--s365-deep)}
body[data-s365-theme][data-s365-surface="world"] :where(.chat-messages,.chat-message,.notice-item,.chat-form textarea,.tool-panel input,.tool-panel select,.inventory-item,.category-row,.room-tabs button,.world-menu-panel a:hover){background:var(--s365-deep);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme][data-s365-surface="world"] :where(.room-tabs button.active,.tool-tabs button.active,.inventory-item.selected){background:var(--s365-raised);color:var(--s365-gold);border-color:var(--s365-gold)}
body[data-s365-theme][data-s365-surface="world"] :where(.chat-message p,.chat-message strong,.notice-item p){color:inherit}

/* Remaining shell surfaces, never the illustrated map, room or board. */
body[data-s365-theme][data-s365-surface="world"]>header{background:#112333f5!important;border-bottom-color:var(--s365-line)!important}
body[data-s365-theme][data-s365-surface="world"] :where(.hero,.welcome,main>aside,.hero>div:last-child,.zone-place-controls,.zone-door-list,.pavilion-controls){background:var(--s365-panel);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme][data-s365-surface="world"] :where(.hero,.welcome,main>aside) :where(p,small){color:var(--s365-muted)}
body[data-s365-theme][data-s365-surface="world"] :where(.quest,.npc,.collectible,.offer,.club,.new,.card,.stat,.event,.season,.venue-card,.coast-cards,.housing-info) :where(h3,strong,label){color:var(--s365-text)}
body[data-s365-theme][data-s365-surface="world"] :where(.zone-place-controls button,.zone-door-list button,.pavilion-controls button){background:var(--s365-raised);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme].homepage :where(.social-panel,.empty,.chat-feature){background:var(--s365-panel);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme].homepage .chat-feature>p:not(.eyebrow){color:var(--s365-muted)}
body[data-s365-theme].homepage :where(.person-copy small,.panel-description,.footer-note,.feature-details){color:var(--s365-muted)}
body[data-s365-theme].homepage :where(.categories button,.row-controls button,.invite-button){background:var(--s365-raised);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme].homepage .categories button[aria-pressed="true"]{background:var(--s365-gold);color:var(--s365-deep)}
body[data-s365-theme].homepage .invite-dialog :where(select){background:var(--s365-deep);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme].homepage .invite-dialog button[type="submit"]{background:var(--s365-gold);color:var(--s365-deep)}
body[data-s365-theme][data-s365-surface="service"] :where(.waiting-total,.match-counts span,.computer-choice,.relation-badge,.room-icon){background:var(--s365-raised);color:var(--s365-text)}
body[data-s365-theme][data-s365-surface="service"] :where(.badge,.side-tabs b,.folders .active b){background:var(--s365-gold);color:var(--s365-deep)}
body[data-s365-theme][data-s365-surface="game"] :where(.board-panel,.side-card){background:var(--s365-panel);border-color:var(--s365-line)}
body[data-s365-theme].atelier .board .cell{min-height:0!important}
body[data-s365-theme].sysop-page :where(p,input,select,textarea,button,.button,.mini,table,.metric span,.health-card span){font-size:.875rem}
body[data-s365-theme].sysop-page :where(.status-pill,th,.list-head,.sysop-table-count){font-size:.8125rem}

/* Authentication uses exactly the same palette before a session exists. */
body[data-s365-theme][data-s365-surface="login"] .login-panel{color:var(--s365-text)}
body[data-s365-theme][data-s365-surface="login"] :where(.login-panel>p,.hint,footer){color:var(--s365-muted)}
body[data-s365-theme][data-s365-surface="login"] :where(.login-panel a,.login-panel .eyebrow){color:var(--s365-gold)}
body[data-s365-theme][data-s365-surface="login"] input{background:var(--s365-deep);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme][data-s365-surface="login"] button{background:var(--s365-gold);color:var(--s365-deep);border-radius:var(--s365-small-radius)}
body[data-s365-theme][data-s365-surface="login"] button:hover{background:#ffdda5}

/* Keep the dense administration usable, with the same Spel365 identity. */
body[data-s365-theme].sysop-page{
  --sys-bg:var(--s365-bg);--sys-panel:var(--s365-panel);--sys-sidebar:var(--s365-deep);--sys-sidebar-2:#112333;
  --sys-text:var(--s365-text);--sys-muted:var(--s365-muted);--sys-line:var(--s365-line);--sys-accent:var(--s365-gold);
  --sys-good:var(--s365-good);--sys-warn:var(--s365-warn);--sys-bad:var(--s365-bad);font-size:calc(14px * var(--spel365-text-scale,1));
}
body[data-s365-theme].sysop-page :where(.sysop-brand,.sysop-topbar,.sysop-palette,.sysop-kbd){background:var(--s365-deep);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme].sysop-page .sysop-nav :where(a,button){color:var(--s365-muted);font-family:var(--s365-font);font-size:.875rem}
body[data-s365-theme].sysop-page .sysop-nav a.active{color:var(--s365-gold);background:var(--s365-raised)}
body[data-s365-theme].sysop-page :where(.sysop-iconbtn,.sysop-search input){background:var(--s365-panel);color:var(--s365-text);border-color:var(--s365-line)}
body[data-s365-theme].sysop-page :where(.sysop-flash){background:#203e38;color:var(--s365-good)}

/* Preference-safe contrast, motion and narrow-screen navigation. */
body[data-s365-theme].sysop-light{--s365-bg:#f1f3f4;--s365-panel:#fff;--s365-raised:#e3eaf0;--s365-deep:#fff;--s365-text:#173047;--s365-muted:#4c6172;--s365-gold:#765017;--s365-line:#a6b6c4;--sys-sidebar:#edf1f4;--sys-sidebar-2:#e0e7ed;color-scheme:light}
body[data-s365-theme].sysop-light :where(.sysop-nav a,.sysop-nav button,.sysop-brand){color:var(--s365-text)}
body[data-s365-theme].sysop-light :where(.sysop-live-label,.sysop-health .good){color:#206744}
html.spel365-high-contrast body[data-s365-theme]{--s365-bg:#07111d;--s365-panel:#102437;--s365-raised:#1c364d;--s365-deep:#07111d;--s365-text:#fff;--s365-muted:#e1eaf1;--s365-gold:#ffdda5;--s365-line:#a1b6c9;--sys-sidebar:#07111d;--sys-sidebar-2:#102437;color:var(--s365-text);color-scheme:dark}
html.spel365-high-contrast body[data-s365-theme] :where(.panel,input,select,textarea,button,.button){border-color:var(--s365-line)!important}
@media(max-width:860px){
  body[data-s365-theme][data-s365-surface="service"]>header{flex-wrap:wrap;gap:12px;padding-block:12px}
  body[data-s365-theme][data-s365-surface="service"]>header .top{flex-wrap:wrap;gap:12px}
  body[data-s365-theme][data-s365-surface="service"]>header :where(img[src*="logo"]){width:146px;height:50px}
}
@media(max-width:480px){
  body[data-s365-theme][data-s365-surface="service"]>main{padding-inline:16px}
  body[data-s365-theme] dialog{max-width:calc(100% - 24px)}
}
@media(prefers-reduced-motion:reduce){body[data-s365-theme] :where(button,a){transition:none}}
@media print{body[data-s365-theme]{--s365-bg:#fff;--s365-panel:#fff;--s365-raised:#eee;--s365-deep:#fff;--s365-text:#111;--s365-muted:#333;--s365-gold:#513400;color:#111;background:#fff;color-scheme:light}body[data-s365-theme] :where(main,.panel,.list,table,th,td){color:#111;background:#fff}}

/* 2026 lively compact refresh: richer identity, denser shells, unchanged game boards. */
body[data-s365-theme]>header,
body[data-s365-theme] :where(.lounge-header,.studio-header,.duel-header,.sysop-topbar,.game-shell>.topbar){
  background:linear-gradient(100deg,#111632f7,#201943f5 55%,#102d3cf5);
  box-shadow:0 1px 0 #ffd16640,0 10px 32px #05081745;
}
body[data-s365-theme]>header :where(nav a:hover,nav a:focus-visible,nav a[aria-current="page"]){
  background:linear-gradient(135deg,#ff6b7a26,#a98bff2b);color:#fff3bf;
}
body[data-s365-theme] :where(.panel,.profile-card,.list,.metric,.reward-card,.help-card,.health-card,.mail-shell,.chat-shell,.game-card,.continue-card,.social-panel,.side-card){
  box-shadow:0 10px 26px #03061142,0 1px 0 #ffffff0a inset;
}
body[data-s365-theme] :where(button,.button,.btn,.play,.primary-button){transition:transform .16s ease,filter .16s ease,box-shadow .16s ease}
body[data-s365-theme] :where(button,.button,.btn,.play,.primary-button):hover{transform:translateY(-1px)}
body[data-s365-theme]:is([data-s365-surface="service"],[data-s365-surface="control"]) :where(button,.button,.btn,.photo-button,.privacy-link),
body[data-s365-theme].homepage :where(.primary,.light),
body[data-s365-theme][data-s365-surface="game"] :where(.btn.primary,.button.primary,.control.primary,.primary-button){
  background:linear-gradient(135deg,var(--s365-gold),#ff9f68);box-shadow:0 7px 18px #ff8b5b25;color:var(--s365-deep);
}
body[data-s365-theme]:is([data-s365-surface="service"],[data-s365-surface="control"]) :where(.secondary,.muted,.subnav a,.tabs a,.search button,.category-tabs button,.back,.room,.person,.message-row,.folders button,.side-tabs button),
body[data-s365-theme][data-s365-surface="game"] :where(.btn,.button,.control,.top-actions button,.actions>button,.studio-header a,.duel-header>a:last-child){
  background:linear-gradient(135deg,#282e58,#213c57);border-color:#626999;
}
body[data-s365-theme]:is([data-s365-surface="service"],[data-s365-surface="control"]) :where(.tabs a.active,.subnav a.active,.side-tabs button.active,.folders button.active,.category-tabs button.active,.room.active){
  background:linear-gradient(135deg,#55355f,#294e65);color:#fff3bf;border-color:var(--s365-coral);
}
body[data-s365-theme][data-s365-surface="service"]{font-size:calc(16px * var(--spel365-text-scale,1));line-height:1.48}
body[data-s365-theme][data-s365-surface="service"]>header{min-height:72px}
body[data-s365-theme][data-s365-surface="service"]>header .top{min-height:72px;padding-block:8px}
body[data-s365-theme][data-s365-surface="service"]>main{max-width:1320px;padding-top:22px}
body[data-s365-theme][data-s365-surface="service"] :where(main>h1,.intro h1){font-size:clamp(1.75rem,3vw,2.35rem)}

body[data-s365-theme].homepage .hero{min-height:520px}
body[data-s365-theme].homepage .hero-copy{padding-top:66px;padding-bottom:108px}
body[data-s365-theme].homepage .hero h1{font-size:clamp(40px,4vw,64px);max-width:650px}
body[data-s365-theme].homepage .hero-shade{background:linear-gradient(90deg,#0b1026f2,#321b4fbb 36%,#10384d38 72%),linear-gradient(0deg,#071324c7,transparent 52%)}
body[data-s365-theme].homepage .atmosphere{background:radial-gradient(circle at 72% 13%,#ffd16638,transparent 33%),radial-gradient(circle at 83% 72%,#55e6c126,transparent 28%)}
body[data-s365-theme].homepage .lobby-content{max-width:1512px}
body[data-s365-theme].homepage :where(.welcome-bar,.section){padding-top:28px}
body[data-s365-theme].homepage .section-heading{margin-bottom:16px}
body[data-s365-theme].homepage .game-row{grid-auto-columns:calc((100% - 72px)/5);gap:18px}
body[data-s365-theme].homepage .game-card{border-color:#535b8b;border-radius:14px}
body[data-s365-theme].homepage .game-card{position:relative}
body[data-s365-theme].homepage .game-card:before{content:"";position:absolute;inset:0 0 auto;height:3px;z-index:3;background:linear-gradient(90deg,var(--s365-coral),var(--s365-gold),var(--s365-aqua),var(--s365-violet));opacity:.82}
body[data-s365-theme].homepage .game-card:hover{border-color:var(--s365-aqua);box-shadow:0 14px 28px #55e6c11a,0 0 0 1px #55e6c138}
body[data-s365-theme].homepage .game-cover:after{background:linear-gradient(0deg,#080b1dbd,transparent 58%)}
body[data-s365-theme].homepage .game-cover img{transform:none;object-position:center}
body[data-s365-theme].homepage .game-card:hover .game-cover img{transform:scale(1.045)}
body[data-s365-theme].homepage .game-tag{background:linear-gradient(135deg,#702e62ed,#263f75ed);border-color:#ffffff48}
body[data-s365-theme].homepage .categories button[aria-pressed="true"]{background:linear-gradient(135deg,var(--s365-coral),#a98bff);color:#100c24;box-shadow:0 6px 18px #ff6b7a30}
body[data-s365-theme].homepage .feature-showcase{grid-template-columns:1.55fr 1fr;background:linear-gradient(145deg,#22234b,#153b4d)}
body[data-s365-theme].homepage .feature-picture{min-height:360px}
body[data-s365-theme].homepage .feature-copy{padding:34px 32px}
body[data-s365-theme].homepage .feature-copy h2{font-size:clamp(38px,4vw,50px)}
body[data-s365-theme].homepage .chat-feature{background:linear-gradient(145deg,#34244d,#173f4c)}
body[data-s365-theme].homepage .atmosphere:before,
body[data-s365-theme].homepage .atmosphere:after{content:"";position:absolute;border-radius:50%;filter:blur(1px);pointer-events:none}
body[data-s365-theme].homepage .atmosphere:before{width:18px;height:18px;left:62%;top:22%;background:var(--s365-gold);box-shadow:90px 52px 0 -4px var(--s365-coral),210px -35px 0 -6px var(--s365-aqua),330px 115px 0 -5px var(--s365-violet),-120px 155px 0 -6px var(--s365-sky)}
body[data-s365-theme].homepage .atmosphere:after{width:8px;height:8px;left:73%;top:55%;background:#fff7;box-shadow:125px -165px 0 #fff5,-175px -80px 0 #fff6,260px 38px 0 #fff4,-75px 120px 0 #fff5}

body[data-s365-theme][data-s365-surface="login"] .login-layout{grid-template-columns:minmax(420px,1.05fr) minmax(390px,.95fr);width:100%;max-width:none}
body[data-s365-theme][data-s365-surface="login"] .world{padding:clamp(28px,4vw,60px)}
body[data-s365-theme][data-s365-surface="login"] .world:after{background:linear-gradient(0deg,#090d21ed,#20113c66 58%,#0d314833)}
body[data-s365-theme][data-s365-surface="login"] .world h1{font-size:clamp(2.35rem,3.7vw,4.1rem);margin:14px 0 18px}
body[data-s365-theme][data-s365-surface="login"] .world em{color:var(--s365-gold)}
body[data-s365-theme][data-s365-surface="login"] .login-panel{max-width:460px;padding:clamp(28px,4vw,52px)}
body[data-s365-theme][data-s365-surface="login"] .login-panel>img.logo{width:190px;margin-bottom:22px}
body[data-s365-theme][data-s365-surface="login"] .login-panel h2{font-size:2.05rem}
body[data-s365-theme][data-s365-surface="login"] form{margin-top:20px}
body[data-s365-theme][data-s365-surface="login"] label{margin-top:12px}
body[data-s365-theme][data-s365-surface="login"] input{min-height:46px;border-color:#5b6395;box-shadow:0 0 0 1px #ffffff08 inset}
body[data-s365-theme][data-s365-surface="login"] input:focus{border-color:var(--s365-aqua);box-shadow:0 0 0 3px #55e6c11e}
body[data-s365-theme][data-s365-surface="login"] button{min-height:48px;margin-top:18px;background:linear-gradient(135deg,var(--s365-gold),#ff826f);box-shadow:0 8px 22px #ff6b7a2b}
body[data-s365-theme][data-s365-surface="login"] button:hover{background:linear-gradient(135deg,#ffe08b,#ff947d)}
body[data-s365-theme][data-s365-surface="login"] footer{margin-top:28px}

@media(max-width:1100px){body[data-s365-theme].homepage .game-row{grid-auto-columns:calc((100% - 54px)/4)}}
@media(max-width:760px){
  body[data-s365-theme][data-s365-surface="login"] .login-layout{grid-template-columns:1fr}
  body[data-s365-theme][data-s365-surface="login"] .world{min-height:250px;padding:28px}
  body[data-s365-theme][data-s365-surface="login"] .world h1{font-size:2.35rem}
  body[data-s365-theme][data-s365-surface="login"] .login-panel{max-width:520px;padding:26px 24px 34px}
}
@media(max-width:600px){
  body[data-s365-theme].homepage .hero{min-height:510px}
  body[data-s365-theme].homepage .hero-copy{padding:120px 6% 105px}
  body[data-s365-theme].homepage .game-row{grid-auto-columns:72%}
  body[data-s365-theme].homepage .feature-picture{min-height:240px}
  body[data-s365-theme].homepage .feature-copy{padding:25px 23px}
}
@media(prefers-reduced-motion:no-preference){
  body[data-s365-theme].homepage .atmosphere:before{animation:s365-float-lights 8s ease-in-out infinite alternate}
  body[data-s365-theme].homepage .atmosphere:after{animation:s365-twinkle 4.5s ease-in-out infinite alternate}
  body[data-s365-theme].homepage .game-card:before{background-size:220% 100%;animation:s365-card-glow 7s linear infinite}
  @keyframes s365-float-lights{to{transform:translate(22px,-18px) rotate(8deg)}}
  @keyframes s365-twinkle{50%{opacity:.35;transform:scale(.8)}100%{opacity:1;transform:translateY(-12px) scale(1.15)}}
  @keyframes s365-card-glow{to{background-position:220% 0}}
}
