:root {
  color-scheme: dark;
  --bg: #08110f;
  --bg-deep: #050b0a;
  --panel: #0e1916;
  --panel-raised: #13211d;
  --panel-soft: #101c19;
  --text: #edf7f3;
  --muted: #93a9a0;
  --faint: #637a71;
  --line: #243a33;
  --line-strong: #36564b;
  --mint: #54f0c8;
  --mint-dark: #08251c;
  --accent: #ffb648;
  --accent-hot: #ff8a4c;
  --danger: #ff8078;
  --info: #7cc4ff;
  --radius: 14px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .25);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(rgba(84, 240, 200, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(84, 240, 200, .022) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: var(--mint); text-decoration: none; }
a:hover { color: #a2ffe6; }
button { color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }
::selection { background: rgba(84, 240, 200, .25); color: #fff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.site-main:focus { outline: none; }

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 16px;
  top: -80px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #1c1305;
  font-weight: 800;
}
.skip-link:focus { top: 12px; color: #1c1305; }

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid rgba(54, 86, 75, .65);
  background: rgba(8, 17, 15, .92);
  backdrop-filter: blur(16px);
  padding-top: env(safe-area-inset-top);
}
.header-inner {
  width: min(1220px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 30px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.brand:hover { color: var(--mint); }
.brand img { border-radius: 11px; }
.brand-copy { display: grid; line-height: 1.1; }
.brand-copy strong { color: var(--text); font-size: 18px; letter-spacing: .045em; font-weight: 900; }
.brand-copy strong span { color: var(--mint); }
.brand-copy small { color: var(--faint); font-size: 10px; letter-spacing: .12em; margin-top: 6px; }
.desktop-nav { display: flex; align-self: stretch; gap: 4px; margin-left: 22px; }
.desktop-nav a {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 78px;
  padding: 0 13px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}
.desktop-nav a::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 3px;
  background: var(--mint);
  transform: scaleX(0);
  transform-origin: left;
}
.desktop-nav a:hover, .desktop-nav a.active { color: var(--text); }
.desktop-nav a.active::after { transform: scaleX(1); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.auth-area { display: flex; align-items: center; gap: 8px; }
.auth-loading { color: var(--faint); font-size: 13px; }
.user-summary { display: flex; align-items: center; gap: 9px; padding-right: 4px; }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid rgba(84, 240, 200, .35);
  border-radius: 10px;
  background: rgba(84, 240, 200, .09);
  color: var(--mint);
  font-size: 13px;
  font-weight: 850;
}
.user-summary span:last-child { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.text-button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  font-size: 13px;
}
.text-button:hover { color: var(--mint); }

.site-main { width: min(1220px, calc(100% - 40px)); min-height: calc(100vh - 220px); margin: 0 auto; padding: 48px 0 72px; }
.site-footer {
  width: min(1220px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 calc(34px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  color: var(--faint);
  font-size: 12px;
}
.site-footer strong { color: var(--muted); letter-spacing: .16em; }
.site-footer p { margin: 6px 0 0; max-width: 680px; }
.site-footer a { white-space: nowrap; }
.mobile-nav { display: none; }

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 10px 18px;
  font-weight: 760;
  font-size: 14px;
  line-height: 1.3;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background-color .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: wait; opacity: .72; }
.btn-primary { background: var(--mint); color: #052219; }
.btn-primary:hover { background: #83f8da; color: #052219; }
.btn-accent { background: var(--accent); color: #271903; }
.btn-accent:hover { background: #ffc86f; color: #271903; }
.btn-ghost { border-color: var(--line-strong); background: rgba(14, 25, 22, .65); color: var(--text); }
.btn-ghost:hover { border-color: var(--mint); color: var(--mint); }
.btn-danger { border-color: rgba(255, 128, 120, .4); background: rgba(255, 128, 120, .08); color: #ffaaa4; }
.btn-danger:hover { border-color: var(--danger); color: #ffc4c0; }
.btn-small { min-height: 40px; padding: 8px 13px; font-size: 12px; }
.btn-block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.eyebrow { display: block; color: var(--mint); font-size: 11px; font-weight: 800; letter-spacing: .19em; text-transform: uppercase; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-head h1 { margin: 6px 0 4px; font-size: clamp(30px, 4vw, 46px); line-height: 1.15; letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--muted); }
.section-title { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 46px 0 18px; }
.section-title h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.section-title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.section-index { color: var(--accent); font-size: 11px; letter-spacing: .16em; font-weight: 800; }

.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: 54px; align-items: center; padding: 34px 0 42px; }
.hero-copy h1 { margin: 16px 0 20px; font-size: clamp(46px, 6.4vw, 80px); line-height: 1.04; letter-spacing: -.055em; max-width: 750px; }
.hero-copy h1 em { color: var(--accent); font-style: normal; }
.hero-copy > p { max-width: 620px; margin: 0 0 28px; color: #b5c8c0; font-size: 17px; line-height: 1.85; }
.hero-note { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 12px; margin-top: 20px; }
.hero-note::before { content: "i"; display: grid; place-items: center; flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--mint); font-size: 11px; font-weight: 800; }
.hero-visual { position: relative; min-height: 360px; display: grid; place-items: center; }
.arena-orbit {
  position: relative;
  width: min(330px, 88vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(84, 240, 200, .08), transparent 62%);
}
.arena-orbit::before, .arena-orbit::after { content: ""; position: absolute; border-radius: 50%; border: 1px dashed rgba(84, 240, 200, .22); inset: 34px; }
.arena-orbit::after { inset: 76px; border-style: solid; border-color: rgba(255, 182, 72, .23); }
.vs-core { position: relative; z-index: 2; color: var(--text); font-size: 72px; font-weight: 950; font-style: italic; letter-spacing: -.09em; transform: skew(-5deg); }
.vs-core::after { content: "MATCH / ORGANIZE / RECORD"; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%) skew(5deg); width: max-content; color: var(--mint); font-size: 8px; font-style: normal; letter-spacing: .18em; }
.orbit-label { position: absolute; z-index: 3; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--panel); color: var(--muted); font-size: 11px; font-weight: 700; box-shadow: var(--shadow); }
.orbit-label.one { top: 20px; left: -5px; }
.orbit-label.two { right: -12px; top: 44%; }
.orbit-label.three { bottom: 22px; left: 24px; color: var(--accent); }
.hero-rule { position: absolute; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; color: var(--faint); font-size: 10px; letter-spacing: .12em; }

.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: rgba(14, 25, 22, .7); overflow: hidden; }
.stat-item { position: relative; padding: 22px 24px; }
.stat-item + .stat-item { border-left: 1px solid var(--line); }
.stat-item strong { display: block; font-size: 29px; line-height: 1.2; letter-spacing: -.04em; }
.stat-item span { color: var(--muted); font-size: 12px; }
.stat-item.live strong { color: var(--mint); }
.stat-item.live strong::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 8px 4px 0; border-radius: 50%; background: var(--mint); }

.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step-card { padding: 24px; border-top: 2px solid var(--line-strong); background: linear-gradient(180deg, rgba(19, 33, 29, .8), transparent); }
.step-card:nth-child(2) { border-top-color: var(--mint); }
.step-card:nth-child(3) { border-top-color: var(--accent); }
.step-card b { display: block; color: var(--faint); font-size: 12px; letter-spacing: .16em; }
.step-card h3 { margin: 22px 0 8px; font-size: 18px; }
.step-card p { margin: 0; color: var(--muted); font-size: 13px; }
.boundary-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; margin-top: 40px; padding: 24px 26px; border: 1px solid rgba(255, 182, 72, .26); border-radius: var(--radius); background: rgba(255, 182, 72, .045); }
.boundary-mark { color: var(--accent); font-size: 24px; font-weight: 900; }
.boundary-card h2 { margin: 0 0 4px; font-size: 16px; }
.boundary-card p { margin: 0; color: var(--muted); font-size: 13px; }

.filter-panel, .quick-panel, .room-list-section, .leaderboard-panel, .platform-card, .room-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(14, 25, 22, .9);
}
.filter-panel { padding: 20px; margin-bottom: 14px; }
.filter-form { display: grid; grid-template-columns: 1fr 1fr .8fr auto auto; gap: 12px; align-items: end; }
.field { min-width: 0; margin-bottom: 16px; }
.filter-form .field, .quick-form .field { margin: 0; }
.field label, .field-label { display: block; margin-bottom: 7px; color: #c1d1ca; font-size: 13px; font-weight: 650; }
.field small { display: block; margin-top: 6px; color: var(--faint); font-size: 11px; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #0a1411;
  color: var(--text);
  padding: 10px 12px;
}
input::placeholder, textarea::placeholder { color: #60776d; }
input:hover, select:hover, textarea:hover { border-color: #527366; }
input:focus, select:focus, textarea:focus { border-color: var(--mint); }
input:disabled, select:disabled, textarea:disabled { opacity: .5; }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
.field-full { grid-column: 1 / -1; }
.form-note { padding: 12px 14px; border-left: 2px solid var(--accent); background: rgba(255, 182, 72, .05); color: var(--muted); font-size: 12px; }
.form-error { padding: 10px 12px; border-radius: 7px; background: rgba(255, 128, 120, .1); color: #ffaaa4; font-size: 13px; }

.quick-panel { position: relative; padding: 20px; margin-bottom: 24px; border-color: rgba(255, 182, 72, .28); background: linear-gradient(105deg, rgba(255, 182, 72, .055), rgba(14, 25, 22, .92) 50%); }
.quick-panel::before { content: ""; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 3px; background: var(--accent); }
.quick-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.quick-head h2 { margin: 0; font-size: 17px; }
.quick-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.quick-tag { color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .15em; }
.quick-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
.code-join { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.code-join label { color: var(--muted); font-size: 12px; white-space: nowrap; }
.code-join input { width: 130px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .16em; }
.code-join .btn { flex: 0 0 auto; }

.room-list-section { overflow: hidden; }
.room-list-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.room-list-head h2 { margin: 0; font-size: 16px; }
.room-list-head span { color: var(--faint); font-size: 12px; }
.room-row { display: grid; grid-template-columns: minmax(220px, 1.6fr) minmax(160px, 1fr) minmax(145px, .85fr) auto; gap: 20px; align-items: center; padding: 20px; border-bottom: 1px solid var(--line); }
.room-row:last-child { border-bottom: 0; }
.room-row:hover { background: rgba(84, 240, 200, .018); }
.room-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.room-title-line h3 { margin: 0; font-size: 16px; }
.room-code { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; letter-spacing: .1em; }
.room-meta, .room-owner { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.room-game strong { display: block; font-size: 14px; }
.room-game span { color: var(--muted); font-size: 12px; }
.room-capacity strong { display: block; font-size: 18px; }
.room-capacity span { color: var(--muted); font-size: 11px; }
.room-action { display: flex; justify-content: flex-end; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }
.badge.waiting { color: var(--mint); border-color: rgba(84, 240, 200, .35); background: rgba(84, 240, 200, .06); }
.badge.playing { color: var(--accent); border-color: rgba(255, 182, 72, .35); background: rgba(255, 182, 72, .06); }
.badge.finished { color: var(--info); border-color: rgba(124, 196, 255, .3); }
.badge.closed { color: var(--danger); }

.state-block { padding: 54px 24px; text-align: center; color: var(--muted); }
.state-block strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }
.state-block p { margin: 0 auto 16px; max-width: 500px; font-size: 13px; }
.state-symbol { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 14px; border: 1px solid var(--line-strong); border-radius: 13px; color: var(--mint); font-size: 21px; }
.error-state .state-symbol { color: var(--danger); border-color: rgba(255, 128, 120, .35); }
.page-loading { min-height: 45vh; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.loader-mark { width: 34px; height: 34px; border: 2px solid var(--line-strong); border-top-color: var(--mint); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton-list { padding: 20px; display: grid; gap: 12px; }
.skeleton { height: 76px; border-radius: 8px; background: linear-gradient(100deg, var(--panel-raised) 20%, #1a2b25 40%, var(--panel-raised) 60%); background-size: 220% 100%; animation: shimmer 1.5s linear infinite; }
@keyframes shimmer { to { background-position-x: -220%; } }

.room-breadcrumb { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; color: var(--faint); font-size: 12px; }
.room-breadcrumb a { display: inline-flex; min-height: 44px; align-items: center; }
.sync-status { display: inline-flex; align-items: center; gap: 7px; }
.sync-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--mint); }
.room-hero { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 22px; }
.room-hero h1 { margin: 7px 0 8px; font-size: clamp(27px, 4vw, 42px); line-height: 1.2; letter-spacing: -.03em; }
.room-hero p { margin: 0; color: var(--muted); }
.room-hero .eyebrow { color: var(--accent); }
.code-copy { display: flex; align-items: center; gap: 10px; }
.code-copy strong { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 23px; letter-spacing: .13em; }
.room-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 18px; align-items: start; }
.room-column { display: grid; gap: 18px; min-width: 0; }
.room-panel { padding: 20px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-head span { color: var(--faint); font-size: 11px; }
.player-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.player-slot { min-height: 86px; display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-soft); }
.player-slot.empty { border-style: dashed; background: transparent; color: var(--faint); justify-content: center; font-size: 12px; }
.player-info { min-width: 0; }
.player-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.player-info small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.player-info small.ready { color: var(--mint); }
.player-info small.owner { color: var(--accent); }
.room-actions { display: grid; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.room-actions .button-row { align-items: stretch; }
.room-actions .button-row .btn { flex: 1 1 auto; }
.action-hint { margin: 0; color: var(--muted); font-size: 12px; }
.match-result { padding: 17px; border: 1px solid rgba(255, 182, 72, .26); border-radius: 10px; background: rgba(255, 182, 72, .045); }
.match-result strong { display: block; color: var(--accent); font-size: 19px; }
.match-result p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.result-players { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.result-players span { padding: 4px 8px; border-radius: 6px; background: rgba(255, 255, 255, .035); color: var(--muted); font-size: 11px; }
.result-players .win { color: var(--mint); }
.chat-panel { padding-bottom: 14px; }
.chat-messages { height: 430px; overflow-y: auto; overscroll-behavior: contain; padding: 2px 4px 12px 0; scrollbar-color: var(--line-strong) transparent; }
.message { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; margin: 13px 0; }
.message .avatar { width: 30px; height: 30px; border-radius: 8px; font-size: 11px; }
.message-head { display: flex; align-items: baseline; gap: 8px; }
.message-head strong { font-size: 12px; }
.message-head time { color: var(--faint); font-size: 10px; }
.message p { margin: 3px 0 0; color: #c7d8d1; font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.mine .message-head strong { color: var(--mint); }
.chat-empty { height: 100%; display: grid; place-content: center; text-align: center; color: var(--faint); font-size: 13px; }
.chat-form { border-top: 1px solid var(--line); padding-top: 13px; }
.chat-form label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.chat-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.chat-input-row input { min-width: 0; }
.chat-note { margin: 9px 0 0; color: var(--faint); font-size: 10px; }

.leaderboard-panel { overflow: hidden; }
.leaderboard-info { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.leaderboard-info p { margin: 0; color: var(--muted); font-size: 12px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 16px 20px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--faint); background: rgba(5, 11, 10, .35); font-size: 11px; font-weight: 650; letter-spacing: .05em; }
td { color: var(--muted); font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.self { background: rgba(84, 240, 200, .035); }
.rank { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); font-weight: 850; }
.rank.top { background: rgba(255, 182, 72, .1); color: var(--accent); }
.player-cell { display: flex; align-items: center; gap: 10px; color: var(--text); }
.score-cell { color: var(--accent); font-size: 17px; font-weight: 850; }
.win-rate { color: var(--mint); }

.platform-intro { max-width: 720px; margin: -10px 0 28px; color: var(--muted); }
.platform-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.platform-card { position: relative; padding: 24px; overflow: hidden; }
.platform-card::after { content: attr(data-short); position: absolute; right: 14px; top: 4px; color: rgba(84, 240, 200, .045); font-size: 64px; font-weight: 950; letter-spacing: -.06em; pointer-events: none; }
.platform-card h2 { position: relative; z-index: 1; margin: 0 0 4px; font-size: 20px; }
.platform-card .platform-type { color: var(--mint); font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.platform-card p { position: relative; z-index: 1; margin: 18px 0 0; color: var(--muted); font-size: 13px; }
.platform-card ol { position: relative; z-index: 1; margin: 14px 0 0; padding-left: 20px; color: #c2d4cc; font-size: 13px; }
.platform-card li + li { margin-top: 5px; }
.platform-card.switch { border-color: rgba(255, 182, 72, .25); }
.platform-card.switch .platform-type { color: var(--accent); }
.install-guide { margin-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 24px; border: 1px solid rgba(84, 240, 200, .25); border-radius: var(--radius); background: rgba(84, 240, 200, .04); }
.install-guide h2 { margin: 0 0 4px; font-size: 18px; }
.install-guide p { margin: 0; color: var(--muted); font-size: 13px; }

.dialog {
  width: min(480px, calc(100% - 28px));
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .6);
  overflow-y: auto;
}
.dialog-wide { width: min(620px, calc(100% - 28px)); }
.dialog-compact { width: min(420px, calc(100% - 28px)); }
.dialog::backdrop { background: rgba(2, 7, 6, .78); backdrop-filter: blur(5px); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.dialog-head h2 { margin: 4px 0 0; font-size: 23px; line-height: 1.3; }
.dialog-close { width: 44px; height: 44px; flex: 0 0 auto; margin: -9px -9px 0 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 26px; cursor: pointer; }
.dialog-close:hover { background: var(--panel-raised); color: var(--text); }
.dialog-intro { margin: -5px 0 22px; color: var(--muted); font-size: 13px; }
.dialog-foot { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.confirm-message { color: var(--muted); }
.result-choice { display: flex; gap: 16px; margin: 0 0 18px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; }
.result-choice legend { padding: 0 6px; color: var(--muted); font-size: 12px; }
.result-choice label { display: flex; align-items: center; gap: 7px; min-height: 36px; font-size: 13px; }
.result-choice input { width: 18px; min-height: 18px; accent-color: var(--mint); }

.toast-region { position: fixed; z-index: 500; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 9px; width: min(360px, calc(100% - 40px)); pointer-events: none; }
.toast { padding: 13px 16px; border: 1px solid var(--line-strong); border-left: 3px solid var(--mint); border-radius: 9px; background: #13211d; color: var(--text); box-shadow: var(--shadow); font-size: 13px; animation: toast-in .2s ease-out; }
.toast.error { border-left-color: var(--danger); }
.toast.accent { border-left-color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1050px) {
  .header-inner { gap: 14px; }
  .desktop-nav { margin-left: 4px; }
  .desktop-nav a { min-width: 64px; padding: 0 8px; }
  .hero { gap: 24px; }
  .filter-form { grid-template-columns: repeat(3, 1fr); }
  .filter-form .btn { width: 100%; }
  .quick-form { grid-template-columns: repeat(3, 1fr); }
  .quick-form .btn { grid-column: 1 / -1; }
  .room-row { grid-template-columns: minmax(210px, 1.4fr) 1fr auto; }
  .room-capacity { display: none; }
  .room-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}

@media (max-width: 820px) {
  .site-header { position: relative; }
  .header-inner { width: min(100% - 28px, 1220px); min-height: 68px; }
  .desktop-nav { display: none; }
  .brand-copy small { display: none; }
  .user-summary span:last-child { display: none; }
  .site-main { width: min(100% - 28px, 1220px); padding: 26px 0 54px; }
  .site-footer { width: min(100% - 28px, 1220px); margin-bottom: 70px; }
  .mobile-nav {
    position: fixed;
    z-index: 120;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-strong);
    background: rgba(8, 17, 15, .97);
    backdrop-filter: blur(16px);
  }
  .mobile-nav a { min-height: 52px; display: grid; place-content: center; justify-items: center; gap: 1px; border-radius: 8px; color: var(--muted); font-size: 10px; }
  .mobile-nav a.active { color: var(--mint); background: rgba(84, 240, 200, .055); }
  .nav-symbol { font-size: 20px; line-height: 1.1; }
  .hero { grid-template-columns: 1fr; padding-top: 18px; }
  .hero-copy h1 { max-width: 620px; }
  .hero-visual { min-height: 320px; }
  .arena-orbit { width: 280px; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .stat-item:nth-child(3) { border-left: 0; }
  .stat-item:nth-child(n+3) { border-top: 1px solid var(--line); }
  .steps-grid { grid-template-columns: 1fr; }
  .step-card { padding: 20px; }
  .step-card h3 { margin-top: 10px; }
  .boundary-card { grid-template-columns: auto 1fr; }
  .boundary-card .btn { grid-column: 1 / -1; }
  .room-layout { grid-template-columns: 1fr; }
  .chat-messages { height: 380px; }
  .toast-region { bottom: calc(82px + env(safe-area-inset-bottom)); }
}

@media (max-width: 620px) {
  .header-inner { width: calc(100% - 24px); }
  .brand img { width: 36px; height: 36px; }
  .brand-copy strong { font-size: 15px; }
  .header-actions { gap: 3px; }
  #install-button { display: none !important; }
  .btn-small { padding: 8px 10px; }
  .site-main { width: calc(100% - 24px); }
  .site-footer { width: calc(100% - 24px); flex-direction: column; gap: 14px; }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 31px; }
  .page-head p { font-size: 12px; }
  .page-head > .btn { flex: 0 0 auto; padding: 10px 12px; }
  .hero-copy h1 { font-size: clamp(43px, 14vw, 62px); }
  .hero-copy > p { font-size: 15px; }
  .hero-visual { min-height: 290px; }
  .orbit-label.two { right: 0; }
  .orbit-label.one { left: 0; }
  .stats-strip { margin: 0 -2px; }
  .stat-item { padding: 17px; }
  .stat-item strong { font-size: 25px; }
  .section-title { margin-top: 34px; }
  .boundary-card { padding: 20px; }
  .filter-form, .quick-form { grid-template-columns: 1fr; }
  .filter-form .btn, .quick-form .btn { grid-column: auto; }
  .quick-head { align-items: flex-start; }
  .quick-tag { display: none; }
  .code-join { flex-wrap: wrap; }
  .code-join label { width: 100%; }
  .code-join input { flex: 1; width: auto; }
  .room-row { grid-template-columns: 1fr auto; gap: 14px; padding: 17px; }
  .room-game { grid-column: 1; }
  .room-action { grid-column: 2; grid-row: 1 / span 2; }
  .room-action .btn { padding: 9px 12px; }
  .room-owner { max-width: 200px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .room-hero { flex-direction: column; gap: 14px; }
  .code-copy strong { font-size: 21px; }
  .room-breadcrumb { align-items: flex-start; }
  .sync-status { text-align: right; max-width: 170px; }
  .player-grid { grid-template-columns: 1fr; }
  .room-panel { padding: 16px; }
  .chat-messages { height: 350px; }
  .platform-grid { grid-template-columns: 1fr; }
  .install-guide { align-items: flex-start; flex-direction: column; }
  .leaderboard-info { align-items: flex-start; }
  th, td { padding: 13px 14px; }
  .dialog { padding: 21px; }
  .result-choice { flex-direction: column; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
