/* Kontras lintas template: teks mengikuti tingkat terang permukaan, bukan warna body. */
body{
  --surface-bg:#fff;
  --surface-soft:#f6f8fa;
  --surface-fg:#172d3b;
  --surface-muted:#607583;
  --surface-line:#d7e0e5;
}

body:is(.theme-midnight_modern,.theme-neon_cyber,.theme-obsidian_gold,.theme-purple_galaxy){
  --surface-bg:#171a28;
  --surface-soft:#202438;
  --surface-fg:#f4f7fb;
  --surface-muted:#b4bfd0;
  --surface-line:#353b55;
}

/* Semua komponen yang tampak sebagai kartu harus mempunyai pasangan warna teks. */
.filters,.game-card,.auth-card,.panel,.empty,.message,.slot-focus,
.lobby-shortcuts,.quick-info{
  background:var(--surface-bg);
  color:var(--surface-fg);
  border-color:var(--surface-line);
}
.game-info h3,.auth-card h1,.panel h1,.panel h2,.empty h3,
.slot-focus b,.quick-info b,.shortcut-list b{
  color:var(--surface-fg);
}
.game-info p,.auth-card>p,.panel .muted,.empty p,.slot-focus p,
.quick-info small,.shortcut-list small{
  color:var(--surface-muted);
}
.auth-card a{
  color:color-mix(in srgb,var(--gold) 72%,var(--surface-fg));
  font-weight:800;
  text-decoration:underline;
  text-underline-offset:3px;
}
.stack label,.stack .helptext,.stack ul{
  color:var(--surface-fg);
}
.stack .helptext,.stack ul{color:var(--surface-muted)}

/* Field input selalu terang, sehingga teks dan placeholder selalu gelap. */
.filters input,.filters select,.stack input,.stack select,.stack textarea,
.search-field,.filters select{
  background:#fff;
  color:#172d3b;
  border-color:#c7d3da;
}
.filters input::placeholder,.stack input::placeholder,.stack textarea::placeholder{
  color:#71838e;
  opacity:1;
}
.filters select option,.stack select option{background:#fff;color:#172d3b}
.search-field i{color:#5e7481}

/* Provider selalu memakai permukaan gelap. */
.provider-wrap,.provider-strip{color:#f4f7fb}
.provider-strip a{color:#c6d2da}
.provider-strip a:hover,.provider-strip a.active{color:#fff}
.provider-title,.provider-title span,.provider-title small{color:#172512}
.provider-placeholder{color:#d4dee4}
body.theme-clean_light .provider-wrap{
  background:#fff;
  border:1px solid #c9dde5;
}
body.theme-clean_light .provider-strip,
body.theme-clean_light .provider-strip a{
  color:#294f60;
}
body.theme-clean_light .provider-strip a:hover,
body.theme-clean_light .provider-strip a.active{
  background:#e4f1f6;
  color:#123f52;
}
body.theme-clean_light .provider-strip a span{
  background:#edf6f9;
  border-color:#c8dee7;
  color:#245a70;
}
body.theme-clean_light .provider-strip a.active span{
  background:var(--gold);
  color:#fff;
}

/* Kepala katalog selalu berupa permukaan terang: judul tidak boleh mewarisi teks putih tema. */
.section-head{
  padding:13px 14px;
  border:1px solid #d7e0e5;
  border-radius:12px;
  background:#fff;
  color:#172d3b;
  box-shadow:0 5px 18px #102d3f0b;
}
.section-head>div:first-child{
  border-left-color:var(--gold);
}
.section-head h1,.section-head h2{color:#172d3b}
.section-head .eyebrow{color:#76550f}
.result-count{color:#607583}
.section-head>a{
  background:#f3f6f8;
  color:#4d3a13;
  border:1px solid #d7e0e5;
}

/* Header terang: hindari tombol/transaksi berwarna putih di atas putih. */
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) .topbar{
  color:#173846;
}
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) .login-btn,
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) .outline-btn{
  background:#fff;
  border:1px solid #9eb7c2;
  color:#173846;
}
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) .wallet-chip{
  background:#fff;
  border-color:#c5d7de;
}
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) .wallet-chip small,
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) .user-chip>span{
  color:#496875;
}
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) .user-chip b{
  color:#173846;
}

/* Hero terang pada template pastel harus menggunakan teks gelap. */
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) .hero,
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) .hero h1,
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) .hero p,
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) .hero-login,
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) .hero-stats span,
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) .hero-stats b{
  color:#173846;
  text-shadow:none;
}

/* Tabel: kepala terang selalu teks gelap; baris mengikuti permukaan kartu. */
.panel th{background:#edf2f5;color:#435966}
.panel td{color:var(--surface-fg);border-color:var(--surface-line)}
.status{color:#425762}
.status.success{background:#dff3e8;color:#126e41}
.status.failed{background:#f8e2e2;color:#a93434}
.status.unknown{background:#fff0ca;color:#805508}

/* Footer pastel/terang memakai teks gelap yang tetap terbaca. */
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) footer,
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) .footer-links,
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) .footer-inner>p,
body:is(.theme-clean_light,.theme-arctic_ice,.theme-rose_quartz) .footer-inner>small{
  color:#355866;
}
body.theme-rose_quartz footer,
body.theme-rose_quartz .footer-links,
body.theme-rose_quartz .footer-inner>p,
body.theme-rose_quartz .footer-inner>small{
  color:#603b4d;
}

/* Mobile dock tetap gelap pada semua template. */
.mobile-dock{background:#071521;color:#d1dce3}
.mobile-dock a:not(.dock-main){color:#d1dce3}

@media (max-width:780px){
  .filters .primary{color:#172d3b}
}
