/* SK Storm — shared appearance for the uploaded server browser. */
:root,
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #edf5ff;
  --surface: #fff;
  --surface-muted: #f5f9ff;
  --tint: #edf5ff;
  --tint-strong: #ddecff;
  --line: #d8e5f4;
  --line-strong: #b9cfe7;
  --text: #172f4d;
  --text-soft: #3b5978;
  --muted: #58728e;
  --faint: #657f99;
  --accent: #176bc3;
  --accent-strong: #1156a2;
  --accent-soft: #e4f0ff;
  --on-accent: #fff;
  --ok: #0c7e5c;
  --ok-soft: #e3f5ed;
  --danger: #b93350;
  --danger-soft: #fff0f3;
  --warn: #895305;
  --warn-soft: #fff7e9;
  --warn-line: #eace9b;
  --shadow: 0 3px 8px #24518105, 0 16px 45px #24518108;
  --radius: 14px;
  --gutter: max(24px, calc((100vw - 1500px) / 2));
  --header-fill: #f7fbffe8;
  --storm-wash: #c8e1fb;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #080f1b;
  --surface: #101b2c;
  --surface-muted: #142237;
  --tint: #152841;
  --tint-strong: #19385b;
  --line: #23354d;
  --line-strong: #365372;
  --text: #e5effb;
  --text-soft: #bfd1e5;
  --muted: #9aafc7;
  --faint: #90a8c2;
  --accent: #71baff;
  --accent-strong: #a4d3ff;
  --accent-soft: #183656;
  --on-accent: #081a2c;
  --ok: #7dd9b5;
  --ok-soft: #143c32;
  --danger: #ffa8b9;
  --danger-soft: #402432;
  --warn: #efc57e;
  --warn-soft: #392f21;
  --warn-line: #655236;
  --shadow: 0 4px 10px #0001, 0 18px 48px #0002;
  --header-fill: #0b1523e8;
  --storm-wash: #122d4d;
}

html { scroll-behavior: smooth; }
body { min-width: 300px; min-height: 100vh; -webkit-font-smoothing: antialiased; }
body, header, .detail, .room, dialog, .btn, .search, .download-banner {
  transition: background-color .2s, border-color .2s, color .2s;
}
button, a, input, select { touch-action: manipulation; }
select { border-radius: 9px; }
button:disabled { cursor: wait; }

.backdrop {
  background: radial-gradient(ellipse at 12% 15%, var(--storm-wash), transparent 52%), var(--bg);
}
.planet { display: none; }
.orbit {
  top: 110px;
  inset-inline-start: 30%;
  width: 1100px;
  height: 900px;
  border-color: color-mix(in srgb, var(--accent) 10%, transparent);
  opacity: .35;
}
header {
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
  min-height: 100px;
  height: auto;
  gap: 18px 26px;
  padding-block: 20px;
  background: var(--header-fill);
  border-color: var(--line);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; text-align: start; }
.brand > img, .brand-logo, .brand-emblem { width: 50px; height: 50px; object-fit: contain; border: 1px solid #3e6a9566; border-radius: 15px; background: #030c17; }
.brand-name { color: var(--text); font-size: 28px; font-style: normal; letter-spacing: 3px; line-height: 1.05; }
.brand-sub { color: var(--muted); font-size: 8px; letter-spacing: 1.7px; margin-top: 7px; }
.header-center { min-width: 360px; max-width: 840px; }
.compact-status { font-size: 9px; letter-spacing: 1px; margin-bottom: 3px; }
.header-right { flex-wrap: wrap; gap: 12px; }
.connection { font-size: 9px; letter-spacing: .6px; }
.navigation { gap: 14px; }
.regions { gap: 5px; }
.regions button { padding: 8px 11px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; }
.regions button.active { border-color: var(--line-strong); background: var(--accent-soft); color: var(--accent); }
.regions span { padding: 2px 6px; margin-inline-start: 7px; border-radius: 999px; font-size: 10px; }
.language-picker { padding: 7px 10px; border-radius: 999px; margin-inline: auto 2px; }
.language-picker select { min-width: 71px; font-size: 11px; }
.refresh { gap: 8px; }
.refresh button { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 16px; }
.btn { border-radius: 999px; padding: 11px 16px; letter-spacing: .6px; }
.btn-primary { border-radius: 13px; }
.btn-outline { background: var(--surface); }

.appearance-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.appearance-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.appearance-controls button:hover { border-color: var(--accent); color: var(--accent); }
.appearance-controls button[aria-pressed='true'] { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.appearance-controls button i { font-size: 13px; }

main { padding-top: 24px; }
.identity-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(250px, .85fr);
  align-items: center;
  gap: 16px;
  min-height: 310px;
  padding: 30px 44px;
  overflow: hidden;
  border: 1px solid #315a82;
  border-radius: 28px;
  background: #020a16;
  color: #eaf4ff;
  box-shadow: 0 18px 45px #09284c19;
}
.identity-hero::before {
  content: '';
  position: absolute;
  inset: -40px;
  z-index: -2;
  background: linear-gradient(90deg, #030b19 5%, #030b19e8 38%, #020b1a33 100%), url('../assets/sk-emblem-poster.png') 88% 46% / 650px auto no-repeat;
  opacity: .65;
  filter: blur(4px);
}
.identity-hero::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 70% 70%, #0d4d8e22, transparent 55%), linear-gradient(150deg, transparent 55%, #54a9f20a 55%, #54a9f20a 55.4%, transparent 55.4%);
}
.identity-copy { position: relative; z-index: 2; max-width: 610px; }
.identity-copy .eyebrow { color: #8ac5ff; letter-spacing: 2.8px; font-size: 10px; }
.identity-copy h1 { margin: 16px 0 13px; max-width: 560px; color: #f2f8ff; font: 700 clamp(30px, 3.3vw, 48px)/1.1 var(--font-display); letter-spacing: -.8px; }
.identity-copy h1 span { color: #7cc3ff; }
.identity-copy p { max-width: 490px; margin: 0; color: #a7c1dd; font-size: 12px; line-height: 1.9; }
.identity-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.identity-actions .btn { background: #e6f3ff; border-color: #e6f3ff; color: #164d7d; padding: 11px 16px; }
.identity-actions .btn:hover { background: #cfe8ff; border-color: #cfe8ff; color: #0d395e; }
.identity-actions .btn + .btn { background: #0d223a; border-color: #315577; color: #b5d5f5; }
.identity-actions .btn + .btn:hover { background: #183955; color: #d9edff; }
.identity-art { position: relative; display: flex; align-items: center; justify-content: center; justify-self: center; width: min(100%, 265px); aspect-ratio: 1; }
.identity-art::before { content: ''; position: absolute; inset: 10%; border-radius: 50%; box-shadow: 0 0 65px 35px #1a6dbf19; }
.identity-art::after { content: ''; position: absolute; inset: -4%; border: 1px solid #64b7ff17; border-radius: 32%; transform: rotate(18deg); pointer-events: none; }
.identity-art img[data-brand-media] { position: relative; display: block; width: 100%; height: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 24%; background: #000; box-shadow: 0 14px 50px #0005; }
.identity-badge { position: absolute; right: -2px; bottom: -1px; z-index: 3; padding: 7px 12px; border: 1px solid #315577; border-radius: 999px; background: #0b2038; color: #b6d9fc; font: 500 9px var(--font-display); letter-spacing: 1px; }
.identity-badge::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-inline-end: 6px; border-radius: 50%; background: #80bfff; box-shadow: 0 0 8px #80bfff80; }
:root[data-theme='light'] .identity-hero { border-color: #204f7b; box-shadow: 0 18px 45px #154b7d15; }

.modes { gap: 7px; margin: 22px 0; padding: 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); }
.modes button { padding: 10px 17px; border-radius: 999px; border: 1px solid transparent; font-size: 12px; }
.modes button.active { border-color: var(--line-strong); background: var(--accent-soft); color: var(--accent); }
.modes .share-room { margin-inline-start: auto; border-color: var(--line-strong); }
.workspace { grid-template-columns: minmax(280px, .72fr) minmax(0, 1.7fr); gap: 24px; min-height: 600px; margin-bottom: 32px; }
.list-panel { min-width: 0; }
.list-tools { gap: 10px; }
.search { min-height: 43px; padding: 10px 14px; border-radius: 999px; box-shadow: var(--shadow); }
.search input { font-size: 12px; }
.open-only { font-size: 11px; }
.list-caption { margin: 19px 4px 12px; font-size: 10px; }
.list-caption select { border-radius: 999px; padding: 6px 9px; font-size: 10px; }
.rooms { min-height: 300px; max-height: 680px; padding: 2px 5px 4px 1px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.room { margin-bottom: 10px; padding: 21px 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.room:last-child { border-bottom: 1px solid var(--line); }
.room:hover { border-color: var(--line-strong); background: var(--surface-muted); }
.room.selected { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); background: linear-gradient(120deg, var(--tint-strong), var(--surface)); }
.room.selected::before { inset-inline-start: 0; top: 25px; bottom: 25px; width: 3px; border-radius: 3px; }
.room h3 { font-size: 19px; letter-spacing: .2px; margin-bottom: 10px; }
.room-bottom { gap: 8px; }
.age, .badge { border-radius: 999px; }
.age { padding: 4px 8px; }
.mode-label { font-size: 11px; }
.clan-hint { font-size: 10px; }
.clan-badge { border-radius: 7px; }
.detail { min-height: 600px; border-radius: 24px; }
.welcome { min-height: 600px; padding: 30px; }
.radar { background: radial-gradient(circle, transparent 44%, color-mix(in srgb, var(--accent) 10%, transparent) 45%, transparent 47%); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.radar::before, .radar::after { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.coordinates { color: var(--faint); font-size: 9px; }
.detail-head { margin-inline: 26px; padding-block: 28px 22px; }
.detail-head h2 { font-size: 26px; letter-spacing: .3px; }
.detail-counters span { padding: 6px 10px; border-radius: 999px; }
.notice { border-radius: 14px; }
.distribution { height: 25px; border-radius: 9px; }
.actions .btn-primary { flex: 1; }
.data-note, .score-caption { line-height: 1.8; }

.download-banner { gap: 20px; padding: 23px 28px; margin-block: 22px 0; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.download-banner::before, .download-banner::after { border-color: color-mix(in srgb, var(--accent) 10%, transparent); }
.banner-icon { width: 55px; height: 55px; border-radius: 17px; background: var(--accent-soft); color: var(--accent); font-size: 27px; }
.banner-kicker { background: var(--accent-soft); color: var(--accent); font-size: 9px; letter-spacing: 1.3px; }
.banner-title { font-size: 22px; margin-block: 9px 5px; }
.banner-text p { color: var(--muted); font-size: 11px; line-height: 1.8; }
.btn-download { padding: 12px 18px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; box-shadow: none; }
.btn-download:hover { color: var(--accent-strong); box-shadow: none; }
.btn-download i { font-size: 16px; }
.zip-pill { background: var(--surface); color: var(--text-soft); }
.banner-help, .banner-help:hover { color: var(--muted); font-size: 10px; }
.banner-status { color: var(--accent); font-size: 10px; }
.download-banner :focus-visible { outline-color: var(--accent); }
footer { padding-block: 23px; background: var(--header-fill); }
.footer-dim { color: var(--muted); }
dialog { max-height: min(85vh, 780px); border-radius: 24px; box-shadow: 0 26px 90px #0005; }
dialog::backdrop { background: #020a17b3; backdrop-filter: blur(8px); }
.dialog-heading { padding: 22px 25px; }
.dialog-heading h2 { font-size: 20px; letter-spacing: .3px; }
.dialog-heading button { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-muted); font-size: 15px; }
.share-input { border-radius: 12px; }
.leaderboard-scroll { border-radius: 14px; }
.leaderboard-table tbody tr:nth-child(-n+3) { background: var(--tint); }
:root[data-theme='dark'] .clan-badge,
:root[data-theme='dark'] .clan-names { --clan-ink: color-mix(in srgb, var(--clan) 32%, #d7edff); }
:root[data-theme='dark'] .clan-badge { background: color-mix(in srgb, var(--clan) 10%, var(--surface)); border-color: color-mix(in srgb, var(--clan) 35%, #617b96); }
:root[data-theme='dark'] .badge-open { border-color: #417e6a; }
:root[data-theme='dark'] .badge-closed { border-color: #835062; }

@media (min-width: 1600px) {
  .identity-hero { min-height: 335px; padding-inline: 52px; }
  .identity-art { width: 280px; }
}
@media (max-width: 1400px) {
  header { gap: 17px 20px; }
  .header-right { gap: 9px; }
  .appearance-controls button { font-size: 10px; padding-inline: 9px; }
  .header-center { min-width: 320px; }
  .connection { display: none; }
}
@media (max-width: 1100px) {
  header { padding-block: 17px 13px; }
  .header-center { min-width: 0; }
  .header-right { margin-inline-start: auto; }
  .header-right .connection { display: inline-flex; }
  .identity-hero { padding: 28px 32px; grid-template-columns: 1fr 240px; }
  .identity-art { width: 225px; }
  .workspace { gap: 20px; grid-template-columns: minmax(270px, .85fr) minmax(0, 1.5fr); }
  .room h3 { font-size: 18px; }
  .modes { gap: 4px; }
  .modes button { padding-inline: 13px; }
}
@media (max-width: 850px) {
  :root { --gutter: 22px; }
  .identity-hero { gap: 12px; padding: 28px; grid-template-columns: minmax(0, 1fr) 220px; }
  .identity-art { width: 205px; }
  .identity-copy h1 { font-size: 34px; }
  .identity-copy p { font-size: 11px; }
  .workspace { grid-template-columns: minmax(240px, .9fr) minmax(0, 1.2fr); gap: 18px; }
  .room { padding: 18px 15px; }
  .detail-head { margin-inline: 20px; }
  .players-area { padding-inline: 20px; }
  .modes { border-radius: 18px; }
  .modes button { padding-inline: 11px; font-size: 11px; }
}
@media (max-width: 650px) {
  :root { --gutter: 18px; }
  header { gap: 16px; padding-top: 16px; }
  .brand { gap: 9px; }
  .brand > img, .brand-logo, .brand-emblem { width: 43px; height: 43px; border-radius: 13px; }
  .brand-name { font-size: 25px; }
  .brand-sub { font-size: 7px; letter-spacing: 1px; }
  .header-right .connection { display: none; }
  .header-right { flex-shrink: 1; min-width: 0; }
  .appearance-controls { gap: 5px; justify-content: flex-end; }
  .appearance-controls button { font-size: 10px; padding-inline: 9px; min-height: 34px; }
  .appearance-controls button i { font-size: 12px; }
  .header-center { margin-top: 0; }
  .navigation { gap: 6px; }
  .language-picker { margin-inline-start: auto; }
  .regions button { padding: 8px 9px; font-size: 12px; }
  .regions span { margin-inline-start: 5px; padding-inline: 6px; }
  .refresh { margin-inline-start: 0; }
  .compact-status { margin-bottom: 8px; font-size: 9px; }
  .identity-hero { min-height: 0; gap: 26px; grid-template-columns: 1fr; padding: 30px 25px 25px; border-radius: 24px; text-align: center; }
  .identity-hero::before { background-position: center, center 75%; background-size: auto, 600px; opacity: .4; }
  .identity-copy { max-width: 100%; }
  .identity-copy h1 { margin: 14px auto 11px; max-width: 440px; font-size: 35px; }
  .identity-copy p { margin-inline: auto; max-width: 400px; font-size: 11px; }
  .identity-actions { justify-content: center; margin-top: 21px; gap: 8px; }
  .identity-actions .btn { padding: 10px 14px; font-size: 10px; }
  .identity-art { width: 205px; }
  .identity-badge { inset-inline-end: -7px; bottom: -3px; font-size: 8px; }
  .workspace { grid-template-columns: 1fr; gap: 22px; }
  .modes { margin-block: 20px; gap: 4px; padding: 6px; }
  .modes button { padding: 9px 12px; }
  .modes .share-room { margin-inline-start: 2px; }
  .rooms { min-height: 180px; max-height: 440px; }
  .room { padding: 19px 17px; border-radius: 18px; }
  .room h3 { font-size: 19px; }
  .room-bottom { flex-direction: row; }
  .list-tools { flex-wrap: nowrap; }
  .search { flex-basis: auto; }
  .detail { border-radius: 22px; min-height: 400px; }
  .welcome { min-height: 400px; padding: 25px; }
  .detail-head { margin-inline: 20px; padding-block: 23px 20px; }
  .detail-head h2 { font-size: 23px; }
  .players-area { padding-inline: 20px; }
  .actions { padding-inline: 20px; }
  .clan-row { flex-wrap: wrap; }
  .download-banner { padding: 22px; gap: 17px; }
  .banner-title { font-size: 22px; }
  .banner-actions { align-items: center; }
  .btn-download { justify-content: center; padding: 12px 18px; }
  .banner-text p { font-size: 11px; }
  .dialog-heading { padding: 19px; }
}
@media (max-width: 430px) {
  :root { --gutter: 14px; }
  header { gap: 13px 8px; }
  .brand > img, .brand-logo, .brand-emblem { width: 37px; height: 37px; border-radius: 11px; }
  .brand { gap: 7px; }
  .brand-name { font-size: 22px; letter-spacing: 2px; }
  .brand-sub { font-size: 6px; letter-spacing: .6px; }
  .appearance-controls { max-width: 182px; gap: 5px; }
  .appearance-controls button { font-size: 9px; padding: 7px 8px; gap: 5px; min-height: 32px; }
  .appearance-controls button i { font-size: 11px; }
  .regions { gap: 2px; }
  .regions button { padding: 8px 5px; font-size: 11px; }
  .regions span { padding-inline: 4px; margin-inline-start: 3px; font-size: 9px; }
  .language-picker { padding: 6px; }
  .language-picker select { min-width: 61px; font-size: 10px; }
  .refresh button { width: 28px; height: 28px; font-size: 14px; }
  .navigation { gap: 5px; }
  main { padding-top: 18px; }
  .identity-hero { padding: 27px 19px 24px; gap: 25px; border-radius: 23px; }
  .identity-copy .eyebrow { font-size: 8px; letter-spacing: 2px; }
  .identity-copy h1 { font-size: 31px; letter-spacing: -.4px; }
  .identity-copy p { font-size: 11px; }
  .identity-art { width: 190px; }
  .modes { border-radius: 16px; }
  .modes button { padding: 9px 11px; font-size: 10px; }
  .list-caption { font-size: 9px; letter-spacing: .7px; }
  .open-only { font-size: 10px; }
  .room h3 { font-size: 18px; }
  .room-bottom { flex-wrap: wrap; gap: 9px; }
  .room { padding: 18px 15px; }
  .player-count { font-size: 11px; }
  .detail-head { margin-inline: 17px; }
  .players-area { padding-inline: 17px; }
  .detail-meta { font-size: 10px; }
  .clan-names { font-size: 12px; }
  .welcome h2 { font-size: 25px; }
  .coordinates { letter-spacing: 1px; }
}

:root[data-animation='off'] *,
:root[data-animation='off'] *::before,
:root[data-animation='off'] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
:root[data-animation='off'] { scroll-behavior: auto; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Identity copy and caption follow the same rounded storm frame. */
.identity-copy .identity-badge { position: static; display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; color: #a8d6ff; font-size: 9px; letter-spacing: 1.7px; }
.identity-copy .identity-badge::before { display: none; }
.identity-copy .identity-badge i { font-size: 11px; }
.identity-actions .btn { flex: 0 0 auto; }
.identity-download { display: inline-flex; align-items: center; gap: 7px; padding: 9px 2px; color: #a6c6e5; font-size: 10px; text-decoration: underline; text-underline-offset: 4px; }
.identity-download:hover { color: #e1f1ff; }
.identity-art-caption { position: absolute; bottom: -16px; left: 50%; transform: translateX(-50%); color: #8eaeca; font: 500 7px var(--font-display); letter-spacing: 1.5px; white-space: nowrap; }
#heroDownloadStatus { margin-top: 12px; color: #b6d7f6; font-size: 10px; }
:root[data-theme='light'] { --faint: #58728e; }
@media (max-width: 650px) { .identity-art { margin-bottom: 15px; } .identity-copy .identity-badge { font-size: 8px; letter-spacing: 1.2px; } .identity-download { padding: 8px 4px; } }
@media (max-width: 430px) { .identity-art-caption { font-size: 6px; letter-spacing: 1.1px; } }
.identity-art-caption { bottom: -22px; padding: 6px 10px; border: 1px solid #294967; border-radius: 999px; background: #091a2c; color: #a3c4e4; }
#heroDownloadStatus:empty { display: none; margin: 0; }

/* Mode buttons are independent toggles; player search shows its coverage. */
.modes button[data-mode].active::after { content: '✓'; margin-inline-start: 5px; font: 700 11px var(--font-body); }
.mode-help { margin: -9px 7px 22px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.search-status { margin: 10px 4px 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.player-match { display: flex; align-items: flex-start; gap: 6px; margin-top: 12px; color: var(--accent); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.player-match i { flex-shrink: 0; }
.player-match span { min-width: 0; }
@media (max-width: 650px) { .mode-help { margin-block: -7px 19px; font-size: 10px; } }
