/* Theme gallery is GLOBAL. Cards keep their own contrast across all appearances. */
.theme-tiles {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:13px;
  margin:14px 0 24px;
}
#preferences-appearance .theme-tiles-description {
  font-size:12px;
  line-height:1.55;
  color:var(--muted);
  margin:5px 0 0;
}
.theme-tile {
  --tile-accent:#93c5c7;
  position:relative;
  min-width:0;
  height:133px;
  padding:6px 7px 10px;
  border:1px solid rgba(178,177,203,.34);
  border-radius:17px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  color:#faf6fd;
  background:linear-gradient(155deg,rgba(44,44,63,.96),rgba(25,27,43,.98));
  box-shadow:inset 0 1px rgba(255,255,255,.11),0 5px 16px rgba(0,0,0,.14);
  transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease,filter .16s ease;
  overflow:hidden;
  isolation:isolate;
}
.theme-tile:hover {
  transform:translateY(-2px);
  filter:brightness(1.08);
  border-color:var(--tile-accent);
  box-shadow:0 8px 19px rgba(0,0,0,.23),inset 0 1px rgba(255,255,255,.18);
}
.theme-tile[aria-checked="true"]{
  border:2px solid var(--tile-accent);
  padding:5px 6px 9px;
  box-shadow:0 0 0 1px color-mix(in srgb,var(--tile-accent) 25%,transparent),
    0 0 18px color-mix(in srgb,var(--tile-accent) 36%,transparent),
    inset 0 1px rgba(255,255,255,.22);
}
.theme-tile:focus-visible{
  outline:2px solid var(--tile-accent);
  outline-offset:3px;
}
.theme-tile-art{
  display:grid;
  place-items:center;
  width:100%;
  flex:1;
  min-height:65px;
  position:relative;
}
.theme-tile-name{
  display:block;
  width:100%;
  text-align:center;
  font-size:12px;
  line-height:1.15;
  letter-spacing:-.015em;
  font-weight:760;
  overflow-wrap:break-word;
  text-shadow:0 1px 4px rgba(0,0,0,.5);
}
.theme-tile-check{
  display:grid;
  place-items:center;
  position:absolute;
  top:7px;
  right:7px;
  width:24px;
  height:24px;
  border:1px solid rgba(255,255,255,.5);
  border-radius:50%;
  background:var(--tile-accent);
  color:#1d1930;
  font-size:15px;
  font-weight:900;
  opacity:0;
  transform:scale(.8);
  transition:opacity .14s ease,transform .14s ease;
}
.theme-tile[aria-checked="true"] .theme-tile-check{opacity:1;transform:scale(1)}
.theme-tile[data-theme="system"]{--tile-accent:#b3c4dd;background:linear-gradient(135deg,#505069,#212538)}
.theme-tile[data-theme="system"] .theme-tile-art{color:#e6e9f4}
.theme-tile[data-theme="day"]{--tile-accent:#ffc66d;background:linear-gradient(145deg,#8b675e,#51424f 67%,#2b2b46)}
.theme-tile[data-theme="day"] .theme-tile-art{color:#ffce6d}
.theme-tile[data-theme="night"]{--tile-accent:#80c7ff;background:linear-gradient(155deg,#313f70,#1e2545 67%,#171b33)}
.theme-tile[data-theme="night"] .theme-tile-art{color:#90d6ff}
.theme-tile[data-theme="echo"]{--tile-accent:#92f2c8;background:linear-gradient(148deg,#244b4a,#1b2933 72%)}
.theme-tile[data-theme="arc"]{--tile-accent:#e1cab0;background:linear-gradient(145deg,#352d34,#1b1826 70%,#171421)}
.theme-tile[data-theme="gta"]{
  --tile-accent:#f38aba;
  background:linear-gradient(170deg,rgba(33,14,49,.24),rgba(32,13,38,.87)),
    url('/gta-leonida-sunset.webp') 60% 50%/cover,#332339;
}
.theme-tile[data-theme="arc"] .theme-tile-art,
.theme-tile[data-theme="gta"] .theme-tile-art{padding:10px 4px 0}
.theme-tile-logo{
  display:block;
  max-height:65px;
  width:100%;
  max-width:125px;
  object-fit:contain;
  filter:drop-shadow(0 2px 5px rgba(0,0,0,.3));
}
/* Full Steam shortcut icon: the four diagonal rainbow bands JOIN the actual
   two-line, intentionally notched ARC Raiders lettering; no text reconstruction. */
.theme-tile[data-theme="arc"] .theme-tile-art {
  padding:0;
  min-height:0;
  overflow:hidden;
  border-radius:9px;
}
.theme-tile[data-theme="arc"] .theme-tile-logo {
  width:min(100%,94px);
  height:min(100%,94px);
  max-width:94px;
  max-height:94px;
  object-fit:contain;
  object-position:center;
  /* Keep the Steam icon's true near-black, saturated rainbow and warm letter colors. */
  mix-blend-mode:normal;
  filter:none;
  opacity:1;
  transform:none;
  border-radius:9px;
}
.theme-tile[data-theme="gta"] .theme-tile-logo{max-width:104px;max-height:78px}
@media(max-width:690px){
  .theme-tiles{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
  .theme-tile{height:122px}
  .theme-tile[data-theme="arc"] .theme-tile-logo{
    width:76px;height:76px;max-width:76px;max-height:76px;
  }
}
@media(max-width:420px){
  .theme-tiles{gap:9px}
  .theme-tile{height:118px;border-radius:14px}
  .theme-tile-name{font-size:11px}
  .theme-tile[data-theme="arc"] .theme-tile-logo{
    width:70px;height:70px;max-width:70px;max-height:70px;
  }
}
:root[data-reduce-motion="true"] .theme-tile,
:root[data-reduce-motion="true"] .theme-tile-check{transition:none!important}
@media(prefers-reduced-motion:reduce){
  .theme-tile,.theme-tile-check{transition:none!important}
  .theme-tile:hover{transform:none}
}


/* Day and Night are illustrated mini-scenes, not default single-stroke icons. */
.theme-tile[data-theme="day"]{
  --tile-accent:#FFC98A;
  background:linear-gradient(155deg,#76516B 0%,#554057 54%,#302B46 100%);
}
.theme-tile[data-theme="night"]{
  --tile-accent:#A9D6FF;
  background:linear-gradient(155deg,#31375F 0%,#272A4C 59%,#1C1D37 100%);
}
.theme-tile[data-theme="day"] .theme-tile-art,
.theme-tile[data-theme="night"] .theme-tile-art{
  padding:0;
}
.theme-tile[data-theme="arc"]{
  background:linear-gradient(155deg,#292334 0%,#191724 70%,#161321 100%);
}
.theme-tile[data-theme="arc"] .theme-tile-logo{
  mix-blend-mode:normal;
  filter:none;
  opacity:1;
}
.theme-tile[data-theme="arc"]:hover{filter:brightness(1.025)}


/* Day and light-system appearance: keep controls legible without the
   dark-theme glow. Do not affect the other five selectable appearances. */
:root[data-theme="day"] #preferences-appearance .theme-tile {
  color:#263f36;
  background:#eaf0f1;
  border-color:#b6c9c7;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.9),
    0 5px 15px rgba(35,63,58,.11);
}
:root[data-theme="day"] #preferences-appearance .theme-tile:hover {
  filter:none;
  background:#e2eced;
  border-color:#678d7e;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.92),
    0 7px 18px rgba(35,63,58,.15);
}
:root[data-theme="day"] #preferences-appearance .theme-tile[aria-checked="true"] {
  border-color:#246b4f;
  box-shadow:0 0 0 1px rgba(36,107,79,.25),
    0 6px 18px rgba(35,63,58,.12);
}
:root[data-theme="day"] #preferences-appearance .theme-tile-name {
  color:#253d35;
  text-shadow:none;
}
:root[data-theme="day"] #preferences-appearance .theme-tile-check {
  color:#163d2d;
  border-color:#598a74;
  background:#a7d7bf;
}
/* The header SVG contains fixed pale mint/white presentation attributes.
   Scope the replacement to day so Night/Echo/ARC/GTA remain untouched. */
:root[data-theme="day"] .topbar .brand-mark svg path {
  stroke:#268257;
}
:root[data-theme="day"] .topbar .brand-mark svg text {
  fill:#24513d;
}
:root[data-theme="day"] .topbar .brand-dot {
  color:#23794f;
}

/* Footer stays intentionally quiet, but should not disappear on light gray. */
:root[data-theme="day"] .footer {
  color:#526a62;
}
:root[data-theme="day"] .footer .footer-actions button {
  color:#345c4d;
}

/* Approved four theme illustrations; shared brand assets and card geometry stay unchanged. */
.theme-tile-art > .theme-tile-image {
  display:block;
  width:80px;
  height:80px;
  max-width:100%;
  object-fit:contain;
  flex:none;
}
@media(max-width:690px){
  .theme-tile-art > .theme-tile-image{width:74px;height:74px}
}
@media(max-width:420px){
  .theme-tile-art > .theme-tile-image{width:70px;height:70px}
}
