:root {
  --theme-deep:#090f16;
  --theme-raised:#16212b;
  --theme-highlight:#ffffff06;
  --theme-glow:#8de7ce18;
}
:root[data-theme="silver"] {
  color-scheme:dark;
  --bg:#101318;
  --panel:#191e25;
  --line:#38434f;
  --ink:#edf1f6;
  --muted:#a0acba;
  --mint:#b5cbe4;
  --orange:#d5b38a;
  --theme-deep:#10151c;
  --theme-raised:#242d38;
  --theme-highlight:#dfeaff0b;
  --theme-glow:#90b9ee19;
  --theme-border:#70849b;
  --theme-scrollbar-thumb:#70849b;
  --theme-scrollbar-track:#10151c;
  --theme-button:linear-gradient(135deg,#e2eaf5 0%,#b5c4d7 44%,#9aadc5 53%,#cfdeee 100%);
  --theme-button-ink:#18212d;
  --metal-face:linear-gradient(125deg,#151b23 0%,#222b36 22%,#384452 33%,#1b222c 43%,#151b23 68%,#252f3c 100%);
  --metal-edge:linear-gradient(125deg,#e3edfa 0%,#859bb6 18%,#354252 39%,#c6d7ec 62%,#566b83 82%,#aebfd3 100%);
  --metal-brush:#edf5ff07;
  --metal-glint:#ecf5ff80;
  --metal-text:linear-gradient(110deg,#93a9c2 0%,#f5f9ff 25%,#afc4dc 47%,#eaf3ff 64%,#9bafc8 100%);
  --metal-button:linear-gradient(115deg,#a4b3c6 0%,#f7fbff 18%,#c5d4e6 34%,#8e9eb2 49%,#e4edf8 64%,#aabbd0 82%,#dae6f5 100%);
}
:root[data-theme="gold"] {
  color-scheme:dark;
  --bg:#100f0c;
  --panel:#191710;
  --line:#403a27;
  --ink:#f1ecdc;
  --muted:#aaa18b;
  --mint:#d2b46b;
  --orange:#d4a37b;
  --theme-deep:#100f0b;
  --theme-raised:#292419;
  --theme-highlight:#ffe1a30a;
  --theme-glow:#c9a34c15;
  --theme-border:#88713e;
  --theme-scrollbar-thumb:#88713e;
  --theme-scrollbar-track:#100f0b;
  --theme-button:linear-gradient(135deg,#e3cd90 0%,#c2a25b 44%,#a98a45 53%,#d7bb75 100%);
  --theme-button-ink:#211a0c;
  --metal-face:linear-gradient(125deg,#17150f 0%,#242014 22%,#3d3220 33%,#1c1810 43%,#15120d 68%,#282213 100%);
  --metal-edge:linear-gradient(125deg,#f4e3b0 0%,#a5833d 18%,#4d3e22 39%,#dfc381 62%,#72572a 82%,#bd9e58 100%);
  --metal-brush:#ffe8af07;
  --metal-glint:#ffe4a775;
  --metal-text:linear-gradient(110deg,#b79750 0%,#fff0bf 25%,#ceb16b 47%,#f6e2a2 64%,#bd984c 100%);
  --metal-button:linear-gradient(115deg,#b38e44 0%,#fff0bf 18%,#d7bd7e 34%,#ae893e 49%,#efdb9f 64%,#bc984e 82%,#e1c982 100%);
}

.table-scroll{scrollbar-color:var(--theme-scrollbar-thumb,#4a645d) var(--theme-scrollbar-track,#111b23)}
.field-tooltip{scrollbar-color:var(--theme-scrollbar-thumb,#668b7e) var(--theme-scrollbar-track,#14212b)}
.table-scroll::-webkit-scrollbar{height:8px}
.field-tooltip::-webkit-scrollbar{width:8px}
.table-scroll::-webkit-scrollbar-thumb,.field-tooltip::-webkit-scrollbar-thumb{background:var(--theme-scrollbar-thumb,#4a645d);border-radius:8px}
.table-scroll::-webkit-scrollbar-track,.field-tooltip::-webkit-scrollbar-track{background:var(--theme-scrollbar-track,#111b23)}

/* Theme picker stays compact in the header; native radios support arrow keys. */
.theme-picker{position:relative;flex-shrink:0}
#theme-toggle{display:grid;place-items:center;color:var(--mint)}
#theme-toggle svg{width:17px;height:17px}
.theme-panel{position:absolute;z-index:1100;right:0;top:calc(100% + 12px);width:254px;padding:15px;background:var(--panel);border:1px solid var(--line);border-radius:7px;box-shadow:0 16px 45px #0009}
.theme-panel fieldset{border:0;margin:0;padding:0;min-width:0}
.theme-panel legend{padding:0 0 12px;color:var(--muted);font-size:10px;letter-spacing:1px}
.theme-choice{position:relative;display:flex;align-items:center;gap:12px;margin:0 0 7px;padding:11px;border:1px solid var(--line);border-radius:4px;cursor:pointer;background:var(--theme-deep)}
.theme-choice:last-child{margin-bottom:0}
.theme-choice:has(input:checked){border-color:var(--mint);background:var(--theme-raised)}
.theme-choice:has(input:checked)::after{content:'✓';margin-left:auto;color:var(--mint);font-size:14px}
.theme-choice:has(input:focus-visible){outline:2px solid var(--mint);outline-offset:3px}
.theme-choice input{position:absolute;width:1px;height:1px;padding:0;opacity:0}
.theme-choice strong{display:block;font-size:12px;font-weight:600}
.theme-swatch{display:block;flex-shrink:0;width:31px;height:31px;border-radius:50%;box-shadow:inset 0 1px 2px #ffffff55,0 2px 7px #0007}
.theme-swatch.mint{background:linear-gradient(135deg,#b3f7e3,#457f6c);border:1px solid #8de7ce}
.theme-swatch.silver{background:linear-gradient(135deg,#eff4fa,#8497ae 48%,#d1deed);border:1px solid #b8cbe0}
.theme-swatch.gold{background:linear-gradient(135deg,#ecdbab,#947031 48%,#dfc17e);border:1px solid #d2b46b}

/* Metallic palettes change chrome and surfaces; match colors retain their meaning. */
:root:is([data-theme="silver"],[data-theme="gold"]) .stars{background-image:radial-gradient(ellipse at 35% 0,var(--theme-glow),transparent 65%),radial-gradient(1px 1px at 13% 33%,var(--mint),transparent),radial-gradient(1px 1px at 82% 17%,#ddd9,transparent),radial-gradient(1px 1px at 75% 65%,#ddd8,transparent)}
:root:is([data-theme="silver"],[data-theme="gold"]) .game{background:linear-gradient(160deg,var(--theme-highlight),transparent 28%),var(--panel);box-shadow:inset 0 1px var(--theme-highlight)}
:root:is([data-theme="silver"],[data-theme="gold"]) .primary{background:var(--theme-button);color:var(--theme-button-ink);border:1px solid var(--theme-border);box-shadow:inset 0 1px #ffffff45,0 2px 9px #0003}
:root:is([data-theme="silver"],[data-theme="gold"]) .primary:hover{filter:brightness(1.1)}
:root:is([data-theme="silver"],[data-theme="gold"]) .mode-tabs{background:var(--theme-deep)}
:root:is([data-theme="silver"],[data-theme="gold"]) .mode-tabs button{color:var(--muted)}
:root:is([data-theme="silver"],[data-theme="gold"]) .mode-tabs button[aria-selected=true]{border-color:var(--theme-border);background:linear-gradient(135deg,var(--theme-highlight),transparent),var(--theme-raised);color:var(--mint);box-shadow:inset 0 1px var(--theme-highlight)}
:root:is([data-theme="silver"],[data-theme="gold"]) .searchbox{background:var(--theme-deep);border-color:var(--theme-border)}
:root:is([data-theme="silver"],[data-theme="gold"]) input::placeholder{color:var(--muted)}
:root:is([data-theme="silver"],[data-theme="gold"]) .search-hint button{border-color:var(--theme-border)}
:root:is([data-theme="silver"],[data-theme="gold"]) #suggestions,
:root:is([data-theme="silver"],[data-theme="gold"]) .field-tooltip,
:root:is([data-theme="silver"],[data-theme="gold"]) .search-hint [role="tooltip"],
:root:is([data-theme="silver"],[data-theme="gold"]) dialog{background:var(--theme-raised);border-color:var(--theme-border)}
:root:is([data-theme="silver"],[data-theme="gold"]) .suggestion.active,
:root:is([data-theme="silver"],[data-theme="gold"]) .suggestion:hover{background:var(--theme-highlight);box-shadow:inset 2px 0 var(--mint)}
:root:is([data-theme="silver"],[data-theme="gold"]) .shipcell{background:linear-gradient(135deg,var(--theme-highlight),transparent),var(--theme-raised)}
:root:is([data-theme="silver"],[data-theme="gold"]) .shipcell img{background:var(--theme-deep)}
:root:is([data-theme="silver"],[data-theme="gold"]) .placeholder td{background:var(--theme-deep);border-color:var(--line);color:var(--muted)}
:root:is([data-theme="silver"],[data-theme="gold"]) .briefing,
:root:is([data-theme="silver"],[data-theme="gold"]) .recruit-banner{background:linear-gradient(140deg,var(--theme-highlight),transparent 65%),var(--panel);border-color:var(--theme-border);box-shadow:inset 0 1px var(--theme-highlight)}
:root:is([data-theme="silver"],[data-theme="gold"]) .briefing li>span{border-color:var(--theme-border)}
:root:is([data-theme="silver"],[data-theme="gold"]) .recruit-links{border-color:var(--line)}
:root:is([data-theme="silver"],[data-theme="gold"]) .recruit-channel>span{color:var(--ink)}
:root:is([data-theme="silver"],[data-theme="gold"]) .daily-info,
:root:is([data-theme="silver"],[data-theme="gold"]) .newround{background:linear-gradient(135deg,var(--theme-highlight),transparent),var(--panel);border-color:var(--theme-border)}
:root:is([data-theme="silver"],[data-theme="gold"]) #result{background:var(--theme-raised);border-color:var(--theme-border)}
:root:is([data-theme="silver"],[data-theme="gold"]) .field-tooltip li{background:var(--theme-deep);border-color:var(--line);color:var(--ink)}
:root:is([data-theme="silver"],[data-theme="gold"]) .field-help-icon{border-color:var(--theme-border)}
:root:is([data-theme="silver"],[data-theme="gold"]) .online i,
:root:is([data-theme="silver"],[data-theme="gold"]) .dot{box-shadow:0 0 9px var(--theme-glow)}
:root:is([data-theme="silver"],[data-theme="gold"]) :is(.scanner-note,.database,.bottomline,.brand small,.legal-note p,.creator-credit,.daily-info small,.field-tooltip p,.recruit-copy p){color:var(--muted)}
:root:is([data-theme="silver"],[data-theme="gold"]) .legal-note a{color:var(--mint)}

/* Brushed metal faces, reflective bevels and narrow specular highlights. */
:root:is([data-theme="silver"],[data-theme="gold"]) :is(.game,.briefing,.recruit-banner,.daily-info,.theme-panel,dialog){
  border:1px solid transparent;
  background-image:repeating-linear-gradient(0deg,transparent 0 2px,var(--metal-brush) 2px 3px,transparent 3px 5px),var(--metal-face),var(--metal-edge);
  background-origin:border-box;
  background-clip:padding-box,padding-box,border-box;
  box-shadow:inset 0 1px #ffffff14,inset 0 -1px #0009,0 6px 20px #0003;
}
:root:is([data-theme="silver"],[data-theme="gold"]) header{border-bottom-color:transparent;border-image:var(--metal-edge) 1}
:root:is([data-theme="silver"],[data-theme="gold"]) :is(.brand .light,h1 em){
  background:var(--metal-text);
  background-clip:text;
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  filter:drop-shadow(0 1px 1px #0008);
}
:root:is([data-theme="silver"],[data-theme="gold"]) .brand-mark{filter:drop-shadow(0 1px 1px #0009) drop-shadow(0 0 4px var(--theme-glow))}
:root:is([data-theme="silver"],[data-theme="gold"]) .primary{
  background-image:linear-gradient(115deg,transparent 34%,#ffffff05 40%,#ffffff90 48%,#ffffff12 54%,transparent 62%),var(--metal-button);
  background-size:260% 100%,100% 100%;
  background-position:100% 0,0 0;
  border-color:var(--mint);
  border-top-color:var(--ink);
  border-bottom-color:var(--theme-border);
  box-shadow:inset 0 1px #ffffffa0,inset 0 -2px #0004,0 2px 6px #0007,0 0 14px var(--theme-glow);
  text-shadow:0 1px #ffffff40;
  transition:background-position .55s ease,filter .2s ease;
}
:root:is([data-theme="silver"],[data-theme="gold"]) .primary:hover{background-position:0 0,0 0;filter:brightness(1.06)}
:root:is([data-theme="silver"],[data-theme="gold"]) .primary:active{box-shadow:inset 0 2px 5px #0005,0 0 8px var(--theme-glow)}
:root:is([data-theme="silver"],[data-theme="gold"]) .mode-tabs{background:linear-gradient(180deg,#ffffff09,transparent 55%),var(--theme-deep);box-shadow:inset 0 1px #ffffff0d}
:root:is([data-theme="silver"],[data-theme="gold"]) .mode-tabs button[aria-selected=true],
:root:is([data-theme="silver"],[data-theme="gold"]) .newround{
  border:1px solid transparent;
  background-image:var(--metal-face),var(--metal-edge);
  background-origin:border-box;
  background-clip:padding-box,border-box;
  box-shadow:inset 0 1px #ffffff28,inset 0 -1px #0008,0 2px 5px #0003;
  text-shadow:0 1px 2px #000b;
}
:root:is([data-theme="silver"],[data-theme="gold"]) :is(.searchbox,.iconbutton){box-shadow:inset 0 1px 2px #0009,0 1px #ffffff16}
:root:is([data-theme="silver"],[data-theme="gold"]) .shipcell{
  background-image:repeating-linear-gradient(0deg,transparent 0 2px,var(--metal-brush) 2px 3px,transparent 3px 5px),linear-gradient(120deg,var(--theme-raised),var(--theme-deep));
  box-shadow:inset 0 1px #ffffff15;
}
:root:is([data-theme="silver"],[data-theme="gold"]) :is(.paneltop,.scanner-note){border-image:linear-gradient(90deg,transparent,var(--metal-glint),var(--line),transparent) 1}
:root:is([data-theme="silver"],[data-theme="gold"]) .theme-swatch.silver{background:radial-gradient(ellipse at 28% 18%,#ffffffd9,transparent 40%),linear-gradient(130deg,#b5c5d8,#eff7ff 28%,#758ba4 50%,#d9e7f8 70%,#8c9eb6)}
:root:is([data-theme="silver"],[data-theme="gold"]) .theme-swatch.gold{background:radial-gradient(ellipse at 28% 18%,#fff9d8db,transparent 40%),linear-gradient(130deg,#c5a158,#f9e5ab 28%,#8a6327 50%,#e8cc86 70%,#a98238)}
@media(max-width:1050px){header .online{display:none}}
@media(max-width:430px){
  header nav{gap:6px}
  header .brand{font-size:18px;gap:9px;letter-spacing:.5px}
  header .brand small{font-size:6px;letter-spacing:.65px}
  header .brand svg.brand-mark{width:30px;height:34px}
  header #language{max-width:76px}
  header .iconbutton{width:30px;height:30px}
}
@media(max-width:360px){
  header .brand{font-size:15px;gap:7px}
  header .brand svg.brand-mark{width:28px;height:30px}
  header .brand small{letter-spacing:.2px;font-size:5px}
  header #language{max-width:67px}
  header .iconbutton{width:27px;height:29px}
  .theme-panel{right:-33px;width:238px}
}
