:root {
  color-scheme: dark;
  --bg: #08090b;
  --panel: rgba(22, 24, 28, .78);
  --text: #f1f2f4;
  --muted: #969ba6;
  --line: rgba(255, 255, 255, .09);
  --accent: #c8d8f0;
  --field: rgba(0, 0, 0, .24);
  --glass: rgba(255, 255, 255, .055);
  --glass-hover: rgba(255, 255, 255, .11);
  --shadow: 0 16px 48px rgba(0, 0, 0, .18);
}
html[data-theme=light] {
  color-scheme: light;
  --bg: #f1f2f5;
  --panel: rgba(255, 255, 255, .85);
  --text: #20242c;
  --muted: #626977;
  --line: rgba(25, 35, 50, .12);
  --accent: #254c85;
  --field: rgba(255, 255, 255, .8);
  --glass: rgba(32, 42, 60, .045);
  --glass-hover: rgba(32, 42, 60, .09);
  --shadow: 0 16px 48px rgba(30, 40, 65, .05);
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 18% 0, rgba(100, 118, 158, .065), transparent 48%), var(--bg);
  color: var(--text);
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #778fb24d; color: var(--text); }
a { color: var(--accent); text-underline-offset: 4px; text-decoration-color: #8292aa66; }
a:hover { text-decoration-color: currentColor; }
header, nav, main, footer { width: min(100%, 1200px); margin: auto; padding: 24px 36px; }
header { display: flex; align-items: center; gap: 24px; min-height: 104px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 18px; font-weight: 650; text-decoration: none; letter-spacing: -.5px; }
.brand img { border-radius: 10px; box-shadow: 0 2px 12px #0003; }
.player-name { font-size: 19px; font-weight: 650; letter-spacing: -.5px; }
.trusted { margin-left: auto; font-size: 12px; color: var(--muted); }
.trusted::before { content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 8px 2px 0; border-radius: 50%; background: #81b39a; }
.header-actions, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.header-actions { gap: 14px; }
.header-actions a { font-size: 12px; }
nav { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 0; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
nav a { display: inline-flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 15px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 550; transition: background .18s, color .18s, border-color .18s; }
nav a:hover { background: var(--glass); color: var(--text); }
nav a[aria-current] { background: var(--glass-hover); border-color: var(--line); color: var(--text); box-shadow: inset 0 1px 0 #ffffff08; }
nav a[aria-current]::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
main { padding-top: 32px; padding-bottom: 64px; min-height: 72vh; }
h1 { margin: 0 0 24px; font-size: clamp(26px, 3vw, 34px); line-height: 1.25; font-weight: 620; letter-spacing: -1.1px; }
h2 { margin: 0 0 18px; font-size: 16px; font-weight: 600; letter-spacing: -.3px; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 10px 0 16px; color: var(--muted); }
main > h1 + p { margin-top: -12px; margin-bottom: 26px; }
strong { font-weight: 600; }
section { margin: 20px 0; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, #ffffff02, transparent 65%), var(--panel); box-shadow: var(--shadow), inset 0 1px 0 #ffffff03; }
.narrow { max-width: 420px; margin: clamp(32px, 9vh, 96px) auto; padding: 32px; }
.narrow h1 { font-size: 26px; }
.narrow button:not(.theme-toggle) { width: 100%; }
form { margin: 0; }
label { display: flex; flex-direction: column; gap: 8px; margin: 0 0 18px; font-size: 12px; font-weight: 550; color: var(--muted); }
input, select, button { font: inherit; min-height: 44px; border-radius: 10px; }
input, select { width: 100%; max-width: 100%; border: 1px solid var(--line); padding: 11px 13px; background: var(--field); color: var(--text); transition: border-color .18s, box-shadow .18s; }
input::placeholder { color: var(--muted); opacity: .65; }
input:hover, select:hover { border-color: #8793a542; }
input:focus, select:focus { border-color: #94a8c080; box-shadow: 0 0 0 3px #8ea4c010; outline: none; }
select option { background: var(--bg); color: var(--text); }
button, .button {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 17px; border: 1px solid #ffffff28; border-radius: 10px;
  background: linear-gradient(145deg, #ffffff16, #ffffff06), var(--glass-hover); color: var(--text);
  font: inherit; font-size: 12px; font-weight: 600; line-height: 1.4; text-align: center; text-decoration: none;
  box-shadow: inset 0 1px 0 #ffffff0a, 0 2px 6px #00000012;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); cursor: pointer;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
button:hover, .button:hover { transform: translateY(-1px); background: var(--glass-hover); border-color: #c1ccdc55; box-shadow: inset 0 1px 0 #ffffff0f, 0 5px 14px #00000020; }
button:active, .button:active { transform: translateY(0) scale(.98); box-shadow: inset 0 1px 3px #0002; }
button:disabled, .button[aria-disabled=true] { opacity: .45; cursor: not-allowed; transform: none; }
button.secondary, .button.secondary { background: var(--glass); border-color: var(--line); box-shadow: inset 0 1px 0 #ffffff04; }
button.secondary:hover, .button.secondary:hover { background: var(--glass-hover); border-color: #8d9aaf55; }
html[data-theme=light] button, html[data-theme=light] .button { border-color: #26354d2b; }
.danger, button.danger, .button.danger { background: #ed61700a; color: #f29ba3; border-color: #ed61702b; }
.danger:hover, button.danger:hover, .button.danger:hover { background: #ed617017; border-color: #ed61705c; }
html[data-theme=light] .danger { color: #a73442; }
:focus-visible { outline: 2px solid #92b5e4; outline-offset: 4px; }
.inline { display: inline-block; }
.inline + .inline { margin-left: 0; }
.fields { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; }
.fields label { flex: 1 1 170px; margin: 0; }
.fields button { flex: 0 0 auto; }
.fields .check-option { flex: 0 1 auto; min-height: 44px; padding: 0 8px; }
form + .button, form + .actions, section > .inline + form { margin-top: 18px; }
.notice { padding: 14px 18px; border: 1px solid #adc9f02b; border-radius: 12px; background: #adc9f008; color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.stats > div { min-width: 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(130deg, #ffffff04, transparent), var(--glass); }
dt { color: var(--muted); font-size: 12px; }
dd { margin: 10px 0 0; font-size: 34px; line-height: 1.2; font-weight: 550; letter-spacing: -1.3px; font-variant-numeric: tabular-nums; }
.row, .history-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 18px; padding: 24px 0; border-top: 1px solid var(--line); }
.row:first-of-type, .history-row:first-of-type { border-top: 0; }
.row:last-child, .history-row:last-child { padding-bottom: 4px; }
.row p, .history-row p { margin: 7px 0; font-size: 12px; }
.row strong, .history-row strong { font-size: 14px; }
.row > div:first-child, .history-row > div { min-width: 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; max-width: 100%; padding: 4px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--glass); color: var(--muted); font-size: 11px; line-height: 1.5; font-weight: 500; overflow-wrap: anywhere; }
.badge-active { color: #8ed9b3; background: #54cf8e0c; border-color: #54cf8e24; }
.badge-active::before { content: ''; flex-shrink: 0; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.badge-danger { color: #f29ba3; background: #ed61700c; border-color: #ed617024; }
.badge-priority { color: #d9be80; background: #e3bd5d0c; border-color: #e3bd5d24; }
html[data-theme=light] .badge-active { color: #267449; background: #36a86d0d; }
html[data-theme=light] .badge-danger { color: #a73442; }
html[data-theme=light] .badge-priority { color: #8a641b; }
.code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: -.25px; overflow-wrap: anywhere; }
.reward { flex-basis: 100%; white-space: pre-wrap; }
.invitation { font-size: 20px; color: var(--text); user-select: all; }
pre { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
article { overflow-wrap: anywhere; }
article + article { border-top: 1px solid var(--line); padding-top: 20px; }
.player-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.reward-preferences { flex-basis: 100%; padding-top: 20px; border-top: 1px solid var(--line); }
.check-option { flex-direction: row; align-items: center; gap: 10px; color: var(--text); }
.check-option input { width: 17px; height: 17px; min-height: 17px; accent-color: #a9bdd8; }
.account-card { align-items: flex-start; }
.account-controls { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.account-controls details { min-width: 0; }
.account-controls summary { cursor: pointer; list-style: none; }
.account-controls summary::-webkit-details-marker { display: none; }
.account-controls details[open] > summary { border-color: #8d9aaf55; background: var(--glass-hover); }
.control-panel { display: grid; gap: 14px; min-width: 230px; max-width: 100%; margin-top: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); }
.control-panel form { display: grid; gap: 10px; }
.control-panel label { margin: 0; }
.control-panel .inline { margin: 0; }
.muted { color: var(--muted); font-size: 12px; }
.theme-settings { display: flex; align-items: center; gap: 12px; }
.theme-settings > a { color: var(--muted); text-decoration: none; }
button.theme-toggle { position: relative; flex-shrink: 0; width: 66px; height: 36px; min-height: 36px; padding: 0 8px; justify-content: space-between; gap: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--field); box-shadow: inset 0 1px 4px #0002; isolation: isolate; }
.theme-toggle svg { position: relative; z-index: 1; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.theme-thumb { position: absolute; top: 3px; left: 3px; width: 28px; height: 28px; border: 1px solid #ffffff18; border-radius: 50%; background: #39414d; transform: translateX(30px); transition: transform .22s ease, background .22s ease; pointer-events: none; }
.theme-toggle .theme-moon { color: #eef2f9; }
html[data-theme=light] .theme-thumb { transform: translateX(0); background: #fff; box-shadow: 0 1px 4px #0001; }
html[data-theme=light] .theme-toggle .theme-sun { color: #86683d; }
html[data-theme=light] .theme-toggle .theme-moon { color: var(--muted); }
[data-worker-progress] { white-space: pre-line; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.8; }
[data-checker-logs] { max-height: 22rem; overflow: auto; }
.proxy-table { max-height: 32rem; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: var(--field); color: var(--muted); font-size: 11px; font-weight: 550; }
tbody tr:hover { background: var(--glass); }
.history-row { content-visibility: auto; contain-intrinsic-size: auto 130px; }
footer { margin-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
[hidden] { display: none !important; }
@media (min-width: 901px) { .account-controls { flex-basis: 100%; } }
@media (max-width: 700px) {
  header, nav, main, footer { padding-left: 20px; padding-right: 20px; }
  header { flex-wrap: wrap; min-height: 90px; gap: 14px; padding-top: 20px; padding-bottom: 18px; }
  .header-actions { gap: 8px; }
  .brand { font-size: 16px; }
  .trusted { font-size: 11px; }
  nav { gap: 2px; padding-bottom: 14px; }
  nav a { padding: 8px 11px; font-size: 12px; min-height: 40px; }
  main { padding-top: 26px; }
  section { padding: 20px; border-radius: 14px; }
  .narrow { padding: 26px; }
  .stats { gap: 8px; }
  .stats > div { padding: 16px 13px; border-radius: 12px; }
  dt { font-size: 11px; }
  dd { font-size: 27px; }
  .fields { gap: 14px; }
  .fields label { flex-basis: 100%; }
  .fields button { width: 100%; }
  .fields .check-option { flex-basis: 100%; padding: 0; min-height: auto; }
  .row, .history-row { align-items: flex-start; gap: 14px; padding: 22px 0; }
  .account-controls { width: 100%; }
  .account-controls > form, .account-controls > details { flex: 1 1 calc(50% - 8px); }
  .account-controls > form > button, .account-controls summary { width: 100%; }
  .control-panel { min-width: 0; }
  .theme-settings { gap: 8px; }
}
@media (max-width: 420px) {
  header { gap: 12px; }
  .trusted { margin-left: auto; }
  .header-actions { width: 100%; justify-content: flex-end; }
  .stats { grid-template-columns: 1fr; }
  .stats > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  dd { margin: 0; }
  .account-controls > details[open] { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  button:hover, .button:hover, button:active, .button:active { transform: none; }
}

.reward-status { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.reward-status p { margin: 6px 0; }
.reward-status p span { color: var(--text); }

.brand-block { display: flex; flex-direction: column; gap: 4px; }
.welcome { color: var(--muted); font-size: 12px; padding-left: 40px; }
