/* The structure every theme shares: page rhythm, navigation, section
   headings, the live board and the owner's sections. A theme sets the
   variables below (one tinted neutral ramp, one accent, the faction colours,
   its type) and adds its own hero; everything here stays quiet so the hero
   picture and the live board are what people look at.
   Spacing is on a 4px grid; one easing curve. */
:root {
  --bg: #0b0d14; --bg-2: #07080d; --card: #11141c; --raised: #1a1e28;
  --text: #eef0f5; --text-2: #a3a9b8; --muted: #7a8296;
  --line: color-mix(in srgb, var(--text) 8%, transparent);
  --line-2: color-mix(in srgb, var(--text) 14%, transparent);
  --accent: #f0b44c; --accent-ink: #0b0d14;
  --blue: #4c8dff; --red: #ef5350; --green: #3fbf7f;
  --font: 'Manrope', 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei', system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', 'JetBrains Mono', Menlo, Consolas, monospace;
  --display: var(--font);
  --radius: 16px;
  --pad: clamp(16px, 4vw, 48px);
  --max: 1360px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color: var(--text); font: 400 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { background: var(--bg); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
em { font-style: normal; color: var(--accent); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num, [data-f=players], [data-team], [data-f=sid], [data-total], [data-count], [data-online] { font-variant-numeric: tabular-nums; }

/* The page backdrop (kit.js backdrop()): fixed behind everything. */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.backdrop img { position: absolute; inset: -48px; width: calc(100% + 96px); height: calc(100% + 96px); object-fit: cover; transition: opacity .8s var(--ease); }
.backdrop canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.backdrop::after { content: ''; position: absolute; inset: 0; background: var(--backdrop-veil, linear-gradient(180deg, transparent, color-mix(in srgb, var(--bg) 60%, transparent))); }
#app { position: relative; z-index: 1; }
/* Navigation: name, the section links, the live count. */
.nav { position: fixed; inset: 0 0 auto; z-index: 20; height: 64px; display: flex; align-items: center; gap: 32px; padding: 0 var(--pad); transition: background-color .3s var(--ease), border-color .3s var(--ease); border-bottom: 1px solid transparent; }
.nav.scrolled { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }
.brand img { height: 28px; width: auto; border-radius: 6px; }
.mark { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 6px; background: var(--text); color: var(--bg); font: 600 12px/1 var(--font); }
.nav nav { display: flex; gap: 24px; margin-left: auto; font-size: 14px; color: var(--text-2); }
.nav nav a { transition: color .15s var(--ease); }
.nav nav a:hover { color: var(--text); }
.live { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.live b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }

/* The one live signal: a dot that is green only while the server answers. */
.live-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.on .live-dot, [data-live=on] .live .live-dot { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }

/* Buttons: one primary, one secondary. */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 10px; font-size: 15px; font-weight: 500; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .12s var(--ease); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--text); color: var(--bg); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:hover { background: color-mix(in srgb, var(--text) 88%, var(--bg)); }
.btn.secondary { background: var(--raised); border: 1px solid var(--line); color: var(--text); }
.btn.secondary:hover { border-color: var(--line-2); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; }

/* Sections and their headings. */
.sec { max-width: var(--max); margin: 0 auto; padding: 96px var(--pad); }
.sec-head { display: grid; gap: 12px; max-width: 720px; margin-bottom: 40px; }
.eyebrow { font-size: 13px; color: var(--accent); font-weight: 500; }
.h2 { font: 500 clamp(28px, 3.4vw, 40px)/1.15 var(--display); letter-spacing: -.02em; }
.sub { color: var(--text-2); font-size: 16px; max-width: 600px; }

/* ── Live board. ── */
.board { display: grid; gap: 16px; }
.board-lead { display: grid; gap: 16px; }
.board[data-size=two] .board-lead { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.board-rows { display: grid; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.board-rows:empty, .board-empty:empty { display: none; }
.board-empty { padding: 48px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }

.srv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 360px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.board[data-size=two] .srv { grid-template-columns: 1fr; grid-template-rows: 200px auto; }
.srv-photo { position: relative; margin: 0; background: var(--raised); }
.srv-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.srv:not(.on) .srv-photo img { filter: grayscale(1) brightness(.6); }
.srv-body { display: flex; flex-direction: column; gap: 4px; padding: 24px 28px; min-width: 0; }
.srv-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.srv-tag, .row-tag { padding: 2px 8px; border-radius: 6px; background: var(--raised); border: 1px solid var(--line); font-size: 12px; color: var(--text-2); }
.srv-name { margin-top: 12px; font: 500 24px/1.25 var(--display); letter-spacing: -.01em; }
.srv-map { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; color: var(--text-2); }
.srv-map [data-f=next] { color: var(--muted); }
.srv-text { font-size: 14px; color: var(--muted); }
.srv-count { display: flex; align-items: baseline; gap: 8px; margin-top: auto; padding-top: 24px; }
.srv-count b { font: 500 56px/1 var(--display); letter-spacing: -.03em; }
.srv-count span { font-size: 16px; color: var(--muted); }
.srv:not(.on) .srv-count b { color: var(--muted); }

/* The signature: one bar split by how many play on each side; empty seats are the track. */
.split { display: flex; gap: 2px; height: 6px; margin-top: 12px; border-radius: 3px; overflow: hidden; }
.split i { flex: 0 0 0; min-width: 0; transition: flex-grow .8s var(--ease); }
.split [data-split=blue] { background: var(--blue); }
.split [data-split=red] { background: var(--red); }
.split [data-split=green] { background: var(--green); }
.split [data-split=empty] { background: var(--raised); flex-grow: 1; }
.teams { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.teams div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 12px; border-radius: 8px; background: var(--raised); }
.teams dt { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.teams dt::before { content: ''; width: 8px; height: 8px; border-radius: 2px; }
.teams .blue dt::before { background: var(--blue); } .teams .red dt::before { background: var(--red); } .teams .green dt::before { background: var(--green); }
.teams dd { font: 500 18px/1 var(--mono); }
.srv-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.srv-clock { font: 400 13px var(--mono); color: var(--muted); }

/* Server id: a small chip that copies. */
.sid { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--raised); text-align: left; transition: border-color .15s var(--ease); }
.sid:hover { border-color: var(--line-2); }
.sid span { flex: none; font-size: 12px; color: var(--muted); }
.sid code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 13px var(--mono); color: var(--text); }
.sid svg { flex: none; width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 1.5; }

.row { display: grid; grid-template-columns: 8px minmax(160px, 1.4fr) minmax(160px, 1fr) 96px minmax(0, 220px); align-items: center; gap: 16px 24px; padding: 16px 24px; }
.row + .row { border-top: 1px solid var(--line); }
.row-main h3 { font-size: 15px; font-weight: 500; }
.row-main p { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 13px; color: var(--text-2); }
.row-split .split { margin-top: 0; }
.row-split p { display: flex; gap: 12px; margin-top: 6px; font: 400 12px var(--mono); color: var(--text-2); }
.row-split p b { font-weight: 400; }
.row-split p b::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 2px; vertical-align: 1px; }
.row-split [data-team=blue]::before { background: var(--blue); } .row-split [data-team=red]::before { background: var(--red); } .row-split [data-team=green]::before { background: var(--green); }
.row-count { text-align: right; }
.row-count b { font: 500 22px/1 var(--mono); }
.row-count span { margin-left: 4px; font: 400 13px var(--mono); color: var(--muted); }
.row .sid { justify-self: end; }
.row:not(.on) { color: var(--muted); }

/* ── The owner's sections. ── */
.g-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: border-color .15s var(--ease); }
.g-card:hover { border-color: var(--line-2); }
.g-card h3 { font-size: 17px; font-weight: 500; line-height: 1.4; }
.g-card p { margin-top: 8px; color: var(--text-2); font-size: 14px; }
.g-n { font: 400 12px/1 var(--mono); color: var(--muted); }
.g-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--raised); font-size: 12px; color: var(--text-2); }
.g-btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--line); background: var(--raised); color: var(--text); font-weight: 500; transition: border-color .15s var(--ease); }
.g-btn:hover { border-color: var(--line-2); }

.g-about { display: grid; gap: 32px; }
.g-about.has-img { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 48px; }
.g-about-text { font-size: 17px; line-height: 1.8; color: var(--text-2); max-width: 680px; }
.g-about-text em { color: var(--text); }
.g-about-img { margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.g-about-img img { width: 100%; height: 100%; object-fit: cover; }
.g-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.g-stats div { padding-top: 16px; border-top: 1px solid var(--line); }
.g-stats dt { font-size: 13px; color: var(--muted); }
.g-stats dd { margin-top: 4px; font: 500 32px/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.g-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.g-feature img { width: calc(100% + 48px); margin: -24px -24px 20px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.g-feature h3 { margin-top: 24px; }
.g-news { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.g-news-item header { display: flex; align-items: center; gap: 8px; }
.g-news-item time { font: 400 12px var(--mono); color: var(--muted); }
.g-news-item h3 { margin-top: 12px; }
.g-more { display: inline-block; margin-top: 12px; color: var(--text); font-size: 14px; font-weight: 500; }
.g-gallery { columns: 3 280px; column-gap: 16px; }
.g-shot { position: relative; margin: 0 0 16px; break-inside: avoid; border-radius: 12px; overflow: hidden; }
.g-shot img { width: 100%; }
.g-shot figcaption { padding: 8px 2px 0; color: var(--muted); font-size: 13px; }
.g-team { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 16px; }
.g-member { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 16px; }
.g-avatar { grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--raised); color: var(--text-2); font-size: 17px; font-weight: 500; }
.g-member h3 { font-size: 15px; }
.g-role { font-size: 13px; color: var(--muted); }
.g-member p { grid-column: 1 / -1; margin-top: 12px; }
.g-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.g-plan { display: flex; flex-direction: column; }
.g-plan.is-hot { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.g-hot { position: absolute; top: 20px; right: 20px; font-size: 12px; color: var(--accent); }
.g-price { margin: 12px 0 0 !important; color: var(--text) !important; }
.g-price b { font: 500 36px/1 var(--display); letter-spacing: -.02em; }
.g-price span { color: var(--muted); margin-left: 4px; font-size: 14px; }
.g-plan ul { list-style: none; margin: 20px 0; display: grid; gap: 8px; flex: 1; font-size: 14px; color: var(--text-2); }
.g-plan li { position: relative; padding-left: 20px; }
.g-plan li::before { content: ''; position: absolute; left: 2px; top: .55em; width: 8px; height: 4px; border: solid var(--muted); border-width: 0 0 1.5px 1.5px; transform: rotate(-45deg); }
.g-plan .g-btn { justify-content: center; }
.g-steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.g-steps h3 { margin-top: 20px; }
.g-rules { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 0 40px; }
.g-rules li { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.g-rules .g-n { line-height: 1.9; }
.g-rules p { color: var(--text); }
.g-faq { display: grid; gap: 8px; max-width: 860px; }
.g-faq details { border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; }
.g-faq summary { display: flex; align-items: center; gap: 16px; padding: 16px 20px; cursor: pointer; list-style: none; font-weight: 500; }
.g-faq summary::-webkit-details-marker { display: none; }
.g-faq summary i { margin-left: auto; width: 12px; height: 12px; position: relative; flex: none; }
.g-faq summary i::before, .g-faq summary i::after { content: ''; position: absolute; left: 0; right: 0; top: 5px; height: 1.5px; background: var(--muted); transition: transform .2s var(--ease); }
.g-faq summary i::after { transform: rotate(90deg); }
.g-faq details[open] summary i::after { transform: rotate(0); }
.g-faq-a { overflow: hidden; }
.g-faq-a p { padding: 0 20px 20px; color: var(--text-2); line-height: 1.8; }
.g-links { display: flex; flex-wrap: wrap; gap: 12px; }

.final { display: grid; gap: 16px; justify-items: start; padding: 48px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.final h2 { font: 500 clamp(28px, 3.4vw, 40px)/1.15 var(--display); letter-spacing: -.02em; }
.final p { color: var(--text-2); }
.final .g-links { margin-top: 8px; }

.foot { max-width: var(--max); margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 32px var(--pad) 48px; color: var(--muted); font-size: 13px; }

.g-banner { position: fixed; left: 16px; bottom: 16px; z-index: 80; display: flex; align-items: center; gap: 12px; max-width: min(520px, calc(100vw - 32px)); padding: 8px 8px 8px 16px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line-2); color: var(--text); font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.g-banner i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.g-banner button { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); font-size: 18px; }
.g-banner button:hover { background: var(--card); color: var(--text); }

#toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; translate: -50% 8px; padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), translate .3s var(--ease); }
#toast.show { opacity: 1; translate: -50% 0; }

/* One entrance: a short fade and rise, staggered a little. */
.js .rv { opacity: 0; transform: translateY(8px); transition: opacity .4s var(--ease), transform .4s var(--ease); transition-delay: calc(var(--i, 0) * 50ms); }
.js .rv.in { opacity: 1; transform: none; }

[data-f][hidden] { display: none !important; }
#boot.closed { color: var(--muted); }

@media (max-width: 1000px) {
  .row { grid-template-columns: 8px minmax(0, 1fr) 80px; }
  .row-split, .row .sid { grid-column: 2 / -1; justify-self: stretch; }
}
@media (max-width: 760px) {
  .nav nav { display: none; }
  .live { margin-left: auto; }
  .sec { padding: 64px var(--pad); }
  .srv, .board[data-size=two] .srv { grid-template-columns: 1fr; grid-template-rows: 180px auto; }
  .board[data-size=two] .board-lead { grid-template-columns: 1fr; }
  .srv-body { padding: 20px; }
  .g-about.has-img { grid-template-columns: 1fr; }
  .final { padding: 28px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } .js .rv { opacity: 1; transform: none; } }
