:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18211d;
  background: #f3f5f1;
  font-synthesis: none;
  --ink: #18211d;
  --muted: #6d7771;
  --line: #dfe5df;
  --surface: #ffffff;
  --green: #176b4d;
  --green-dark: #0d4d37;
  --green-soft: #e5f4ec;
  --amber: #a46618;
  --amber-soft: #fff2dc;
  --red: #a73e3e;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 8% -10%, #dfece4 0, transparent 28rem), #f3f5f1; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.page-shell { min-height: 100vh; }
.topbar { height: 72px; padding: 0 max(24px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(24, 33, 29, .09); background: rgba(255,255,255,.78); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--ink); color: #dff4e8; font-size: 12px; font-weight: 800; letter-spacing: .08em; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 10px; margin-top: 2px; text-transform: uppercase; letter-spacing: .08em; }
.topnav { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.7); }
.topnav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; }
.topnav a:hover, .topnav a.active { background: var(--ink); color: white; }
main { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 64px 0 80px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.eyebrow { margin: 0 0 10px; color: var(--green); font-size: 11px; line-height: 1; font-weight: 800; letter-spacing: .16em; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 6vw, 68px); line-height: .98; font-weight: 500; letter-spacing: -.045em; }
.hero-copy { max-width: 620px; margin: 18px 0 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.primary-button, .ghost-button, .table-button, .icon-button { border: 0; border-radius: 10px; transition: transform .15s ease, background .15s ease, opacity .15s ease; text-decoration: none; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; background: var(--green); color: white; font-weight: 700; box-shadow: 0 8px 24px rgba(23,107,77,.2); }
.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button:disabled, button:disabled { opacity: .55; cursor: wait; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 42px 0 20px; }
.stats article { display: flex; align-items: center; gap: 14px; padding: 18px 20px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 15px; }
.stats strong, .stats small { display: block; }
.stats strong { font-family: Georgia, serif; font-size: 29px; font-weight: 500; line-height: 1; }
.stats small { margin-top: 5px; color: var(--muted); font-size: 12px; }
.stat-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; font-size: 11px; font-weight: 800; }
.stat-icon.running { color: var(--green); background: var(--green-soft); }
.stat-icon.paused { color: var(--amber); background: var(--amber-soft); }
.stat-icon.source { color: #536a91; background: #eaf0fa; }
.registry-panel { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 60px rgba(38, 52, 44, .06); }
.toolbar { display: flex; align-items: center; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.search-box { flex: 1; display: flex; align-items: center; gap: 9px; min-width: 180px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8faf8; color: var(--muted); }
.search-box:focus-within { border-color: #74a891; box-shadow: 0 0 0 3px #e7f2ec; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.deleted-toggle { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.deleted-toggle input { accent-color: var(--green); }
.ghost-button { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); background: white; color: #4d5953; font-weight: 650; font-size: 13px; }
.ghost-button:hover { background: #f2f6f3; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 960px; }
.registry-table { table-layout: fixed; }
.registry-table .game-col { width: 23%; }
.registry-table .external-col { width: 19%; }
.registry-table .source-col { width: 24%; }
.registry-table .state-col { width: 11%; }
.registry-table .time-col { width: 12%; }
.registry-table .action-col { width: 11%; }
th { padding: 13px 18px; background: #fafbfa; color: #879089; font-size: 10px; text-align: left; text-transform: uppercase; letter-spacing: .1em; font-weight: 750; }
td { padding: 17px 18px; border-top: 1px solid #edf0ed; vertical-align: middle; font-size: 13px; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fbfcfb; }
.clickable-row { cursor: pointer; }
.clickable-row:focus-visible { outline: 2px solid #74a891; outline-offset: -2px; }
td strong, td small, td span { display: block; }
td strong { font-size: 13px; }
td small { margin-top: 5px; color: #929b95; font-size: 10px; }
.registry-table td strong, .registry-table td small, .registry-table td span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
td code { display: block; max-width: 290px; overflow: hidden; text-overflow: ellipsis; color: #57635c; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; white-space: nowrap; }
.registry-table td code { max-width: none; }
.status-badge { display: inline-flex; align-items: center; width: fit-content; padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 750; }
.status-badge.running { color: var(--green); background: var(--green-soft); }
.status-badge.paused { color: var(--amber); background: var(--amber-soft); }
.status-badge.deleted { color: #727a75; background: #ecefed; }
.status-badge.neutral { color: #66716b; background: #edf0ee; }
.status-badge.starting { color: #7451a5; background: #f0e9fa; }
.status-badge.ready, .status-badge.active { color: var(--green); background: var(--green-soft); }
.status-badge.idle { color: var(--amber); background: var(--amber-soft); }
.status-badge.failed { color: var(--red); background: #fbeeee; }
.time-cell { color: var(--muted); font-size: 11px; white-space: nowrap; }
.actions { text-align: right; white-space: nowrap; }
.table-button { padding: 7px 9px; margin-left: 4px; background: transparent; color: #59645e; font-size: 11px; font-weight: 700; }
.table-button:hover { background: #edf3ef; color: var(--green); }
.table-button.danger:hover { color: var(--red); background: #fbeeee; }
.play-link { display: inline-block; color: var(--green); }
tr[data-state="DELETED"] { opacity: .58; }
.empty-state { padding: 78px 24px; text-align: center; }
.empty-state div { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 16px; border-radius: 14px; background: var(--green-soft); color: var(--green); font-size: 24px; }
.empty-state h2 { margin: 0; font-family: Georgia, serif; font-size: 24px; font-weight: 500; }
.empty-state p { margin: 8px 0 20px; color: var(--muted); font-size: 13px; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-height: 64px; padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.pagination > span { margin-right: auto; }
.pagination label { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.pagination select { height: 36px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: white; color: var(--ink); }
.pagination .ghost-button { min-height: 36px; }
dialog { width: min(610px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 20px; box-shadow: 0 30px 100px rgba(12, 24, 18, .28); }
dialog::backdrop { background: rgba(18, 28, 23, .48); backdrop-filter: blur(4px); }
dialog form { padding: 28px; }
.detail-shell { padding: 28px; }
.detail-dialog { width: min(760px, calc(100% - 32px)); }
.detail-identity { margin: 12px 0 20px; color: var(--muted); font: 11px "SFMono-Regular", Consolas, monospace; }
.detail-status-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 10px; }
.detail-status-grid article { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #f8faf8; }
.detail-status-grid small, .detail-status-grid strong, .detail-status-grid span { display: block; }
.detail-status-grid small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.detail-status-grid strong { margin: 8px 0 4px; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.detail-status-grid span { overflow: hidden; color: #8d9690; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.detail-status-grid .runtime-status-card span { overflow: visible; line-height: 1.55; overflow-wrap: anywhere; text-overflow: clip; white-space: normal; }
.detail-list { margin: 20px 0 0; }
.detail-list div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-size: 11px; }
.detail-list dd { min-width: 0; margin: 0; font-size: 11px; }
.detail-list code, .detail-list a { display: block; overflow: hidden; color: var(--green-dark); text-overflow: ellipsis; white-space: nowrap; }
.detail-play { min-height: 40px; }
.detail-page { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 80px; }
.detail-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.detail-page-head h1 { font-size: clamp(38px, 5vw, 58px); }
.detail-head-actions { display: flex; align-items: flex-end; gap: 10px; }
.region-picker { display: grid; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.region-picker select { min-width: 190px; height: 40px; padding: 0 34px 0 11px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: white; color: var(--ink); font-size: 12px; font-weight: 700; text-transform: none; }
.region-picker select:focus { border-color: #74a891; box-shadow: 0 0 0 3px #e7f2ec; }
.back-link { display: inline-block; margin-bottom: 20px; color: var(--green); font-size: 12px; font-weight: 700; text-decoration: none; }
.detail-panel { padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 18px 60px rgba(38,52,44,.06); }
.runtime-section { margin-top: 22px; }
.runtime-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.runtime-section h2 { margin: 0; font-family: Georgia, serif; font-size: 25px; font-weight: 500; }
.runtime-note { color: var(--muted); font-size: 11px; }
.runner-list { display: grid; gap: 12px; }
.runner-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.runner-head { display: grid; grid-template-columns: minmax(180px, 1.6fr) repeat(5, minmax(70px, .5fr)); gap: 12px; padding: 14px 16px; background: #f8faf8; }
.runner-head strong, .runner-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runner-head strong { font: 11px "SFMono-Regular", Consolas, monospace; }
.runner-head span { color: var(--muted); font-size: 11px; }
.runner-meta { overflow: hidden; padding: 9px 16px; border-top: 1px solid var(--line); background: #fbfcfb; color: var(--muted); font: 9px "SFMono-Regular", Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.room-table { width: 100%; min-width: 580px; }
.room-table th, .room-table td { padding: 10px 16px; }
.player-detail-row > td { padding: 0 12px 14px 38px; background: #fbfcfb; }
.player-detail-row:hover { background: transparent; }
.player-table { min-width: 900px; border: 1px solid #e7ebe8; border-radius: 9px; background: white; }
.player-table th { padding: 9px 11px; font-size: 9px; }
.player-table td { padding: 10px 11px; font-size: 11px; white-space: nowrap; }
.player-table td:nth-child(3) { color: var(--muted); }
.player-table td:nth-child(5), .player-table td:nth-child(6) { max-width: 160px; overflow: hidden; font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; text-overflow: ellipsis; }
.player-status { display: inline-flex; width: fit-content; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 750; }
.player-status.online { color: var(--green); background: var(--green-soft); }
.player-status.reconnecting { color: var(--amber); background: var(--amber-soft); }
.player-status.left { color: #727a75; background: #ecefed; }
.kick-button { margin: 0; }
.empty-runtime { padding: 30px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; font-size: 12px; }
.launch-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.launch-card { width: min(620px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255,255,255,.92); box-shadow: 0 30px 100px rgba(30,48,39,.12); }
.launch-card h1 { margin: 0 0 14px; font-size: clamp(34px, 7vw, 54px); }
.launch-card > p:not(.eyebrow) { min-height: 24px; color: var(--muted); line-height: 1.6; }
.launch-spinner { width: 44px; height: 44px; margin-bottom: 28px; border: 4px solid #dce9e1; border-top-color: var(--green); border-radius: 50%; animation: spin 1s linear infinite; }
.launch-progress { overflow: hidden; height: 7px; margin: 24px 0; border-radius: 99px; background: #e9eeeb; }
.launch-progress i { display: block; width: 12%; height: 100%; border-radius: inherit; background: var(--green); transition: width .5s ease; }
.launch-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 28px; }
.launch-metrics div { padding: 12px; border-radius: 11px; background: #f4f7f5; }
.launch-metrics dt { color: var(--muted); font-size: 9px; }
.launch-metrics dd { margin: 5px 0 0; font-weight: 750; }
.launch-card > a { color: var(--green); font-size: 12px; }
.login-body { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.94); box-shadow: 0 30px 100px rgba(30,48,39,.13); }
.login-card .brand-mark { margin-bottom: 28px; }
.login-card h1 { font-size: 46px; }
.login-card > p:not(.eyebrow) { margin: 14px 0 26px; color: var(--muted); line-height: 1.6; }
.login-card form { display: grid; gap: 15px; }
.login-card label { display: grid; gap: 7px; color: #37423c; font-size: 11px; font-weight: 750; }
.login-card input { width: 100%; height: 45px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #fbfcfb; }
.login-card input:focus { border-color: #74a891; box-shadow: 0 0 0 3px #e7f2ec; }
.login-card .primary-button { width: 100%; }
@keyframes spin { to { transform: rotate(360deg); } }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-head h2 { margin: 0; font-family: Georgia, serif; font-size: 34px; font-weight: 500; letter-spacing: -.03em; }
.icon-button { width: 36px; height: 36px; background: #f0f3f0; color: #536059; font-size: 22px; }
.form-note { margin: 14px 0 22px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid label { display: grid; gap: 7px; color: #37423c; font-size: 11px; font-weight: 750; }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid em { margin-left: 5px; color: #9ba39e; font-size: 9px; font-style: normal; font-weight: 600; text-transform: uppercase; }
.form-grid input { width: 100%; height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; color: var(--ink); background: #fbfcfb; font-size: 13px; }
.form-grid input:focus { border-color: #74a891; box-shadow: 0 0 0 3px #e7f2ec; background: white; }
.identity-hint { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 12px; border-radius: 9px; background: #f2f6f3; color: var(--muted); font-size: 10px; }
.identity-hint span { flex: none; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.identity-hint code { overflow: hidden; text-overflow: ellipsis; color: var(--green-dark); white-space: nowrap; }
.form-error { min-height: 18px; margin: 10px 0 0; color: var(--red); font-size: 11px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; padding: 13px 17px; border-radius: 11px; background: #183c2f; color: white; box-shadow: 0 14px 40px rgba(15, 42, 32, .24); font-size: 12px; font-weight: 700; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast[data-tone="error"] { background: #8c3535; }

.dashboard-page { width: min(1320px, calc(100% - 48px)); }
.dashboard-hero { align-items: center; }
.dashboard-actions { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px; margin: 36px 0 28px; }
.dashboard-stats article { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.82); box-shadow: 0 12px 40px rgba(38,52,44,.04); }
.dashboard-stats small, .dashboard-stats strong, .dashboard-stats span { display: block; }
.dashboard-stats small { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.dashboard-stats strong { overflow: hidden; margin: 9px 0 6px; font-family: Georgia, serif; font-size: 30px; font-weight: 500; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-stats span { overflow: hidden; color: #8c958f; font-size: 10px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-section { margin-top: 28px; }
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-title .eyebrow { margin-bottom: 6px; }
.section-title h2 { margin: 0; font-family: Georgia, serif; font-size: 27px; font-weight: 500; letter-spacing: -.02em; }
.section-title > span, .section-title > a { color: var(--muted); font-size: 10px; text-decoration: none; }
.section-title > a:hover { color: var(--green); }
.region-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.region-grid[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.region-grid[data-count="2"], .region-grid[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.region-card { padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 14px 48px rgba(38,52,44,.05); }
.region-card.unavailable { border-color: #ecd2d2; background: #fffafa; }
.region-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.region-card-head strong, .region-card-head small { display: block; }
.region-card-head strong { font-size: 14px; }
.region-card-head small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.health-badge { padding: 5px 8px; border-radius: 99px; font-size: 9px; font-weight: 750; }
.health-badge.healthy { color: var(--green); background: var(--green-soft); }
.health-badge.failed { color: var(--red); background: #fbeeee; }
.region-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin: 16px 0 0; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.region-metrics div { min-width: 0; padding: 11px; background: #fafbfa; }
.region-metrics dt { color: var(--muted); font-size: 9px; }
.region-metrics dd { overflow: hidden; margin: 5px 0 0; font-size: 14px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.region-metrics .metric-note { display: block; min-height: 2.7em; margin-top: 4px; color: #9aa29d; font-size: 8px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
.region-observed { margin: 11px 0 0; color: #9aa29d; font-size: 9px; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, .75fr); gap: 16px; }
.dashboard-panel { overflow: hidden; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 14px 48px rgba(38,52,44,.05); }
.dashboard-game-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dashboard-game-toolbar .search-box { flex: 1; }
.dashboard-region-filter { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.dashboard-region-filter select { height: 40px; max-width: 180px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #f8faf8; color: var(--ink); }
.dashboard-table-wrap { overflow-x: auto; }
.dashboard-table { min-width: 660px; }
.dashboard-table th { padding: 10px 12px; }
.dashboard-table td { max-width: 220px; padding: 13px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-table td:not(:first-child) { color: var(--muted); font-size: 11px; }
.dashboard-game-pagination { min-height: 54px; margin: 8px -20px -20px; }
.issue-list { display: grid; gap: 9px; }
.event-history-panel { margin-top: 16px; }
.event-toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.event-toolbar label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.event-toolbar select { height: 36px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--ink); }
.event-table td:first-child { min-width: 280px; max-width: 560px; }
.event-table td:first-child a { display: block; color: var(--ink); font-weight: 700; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-table td:first-child a:hover { color: var(--accent); }
.event-culprit { display: block; margin-top: 4px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-level { font-weight: 700; text-transform: uppercase; }
.event-level.fatal, .event-level.error { color: #b42318; }
.event-level.warning { color: #b54708; }
.event-pagination { margin: 8px -20px -20px; }
.issue-item { padding: 12px; border: 1px solid #efdede; border-radius: 11px; background: #fffafa; }
.issue-item > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.issue-item strong { color: var(--red); font-size: 10px; }
.issue-item span, .issue-item small { color: var(--muted); font-size: 9px; }
.issue-item p { margin: 7px 0; color: #5f4646; font-size: 11px; line-height: 1.5; }
.dashboard-empty { grid-column: 1 / -1; padding: 38px 20px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; font-size: 11px; }
.dashboard-empty.success { border-color: #cde3d6; color: var(--green); background: #f7fbf8; }

.analytics-page { padding-bottom: 72px; }
.range-select { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.range-select select { height: 40px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: 0; background: rgba(255,255,255,.86); color: var(--ink); }
.range-select select:focus { border-color: #74a891; box-shadow: 0 0 0 3px #e7f2ec; }
.metrics-summary { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.metrics-summary article { position: relative; overflow: hidden; padding-right: 58px; }
.metrics-summary .metric-icon { position: absolute; top: 16px; right: 16px; display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; font-size: 16px; font-weight: 700; }
.metric-icon.players { color: #196647; background: #e0f1e8; }
.metric-icon.visits { color: #3f6495; background: #e8f0fa; }
.metric-icon.games { color: #805d19; background: #f8efd8; }
.metric-icon.rooms { color: #78538c; background: #f1e8f6; }
.metric-icon.runners { color: #a1483a; background: #f8e9e5; }
.metric-icon.duration { color: #8a5525; background: #faeee0; }
.metric-icon.average { color: #28677a; background: #e4f1f4; }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-panel { min-height: 340px; }
.chart-panel.wide { grid-column: 1 / -1; min-height: 390px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; min-height: 24px; margin: -2px 0 12px; color: var(--muted); font-size: 10px; }
.chart-legend button { display: inline-flex; align-items: center; gap: 6px; padding: 3px 0; border: 0; outline: 0; background: none; color: inherit; font: inherit; cursor: pointer; transition: opacity .16s ease; }
.chart-legend button:hover { color: var(--ink); }
.chart-legend button:focus-visible { border-radius: 4px; box-shadow: 0 0 0 3px #e7f2ec; }
.chart-legend button[aria-pressed="false"] { opacity: .35; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 99px; }
.legend-dot.joined { background: #2e8b62; }
.legend-dot.left { background: #d17b5f; }
.legend-dot.room { background: #6d78bc; }
.legend-dot.room-destroyed { background: #a7acd0; }
.legend-dot.runner { background: #9b6ab1; }
.legend-dot.runner-destroyed { background: #d2b5dd; }
.legend-dot.players { background: #2e8b62; }
.legend-dot.sessions { background: #4f82ba; }
.legend-dot.duration { background: #cf7b3b; }
.legend-dot.average { background: #58a5a2; }
.line-chart { position: relative; display: flex; min-height: 250px; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.line-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid-line { stroke: #e9edea; stroke-width: 1; }
.chart-axis-label { fill: #929c96; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 9px; }
.chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-line.joined { stroke: #2e8b62; }
.chart-line.left { stroke: #d17b5f; }
.chart-line.room { stroke: #6d78bc; }
.chart-line.room-destroyed { stroke: #a7acd0; }
.chart-line.runner { stroke: #9b6ab1; }
.chart-line.runner-destroyed { stroke: #d2b5dd; }
.chart-line.players { stroke: #2e8b62; }
.chart-line.sessions { stroke: #4f82ba; }
.chart-line.duration { stroke: #cf7b3b; }
.chart-line.average { stroke: #58a5a2; }
.chart-point { stroke: white; stroke-width: 1.5; cursor: default; }
.chart-point.players { fill: #2e8b62; }
.chart-point.sessions { fill: #4f82ba; }
.chart-point.room { fill: #6d78bc; }
.chart-point.duration { fill: #cf7b3b; }
.chart-point.average { fill: #58a5a2; }
.chart-hover-guide { visibility: hidden; stroke: #77827c; stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.chart-hover-guide.visible { visibility: visible; }
.chart-hover-overlay { fill: transparent; cursor: crosshair; }
.chart-tooltip { position: absolute; top: 18px; z-index: 2; display: grid; min-width: 150px; gap: 7px; padding: 11px 12px; border: 1px solid rgba(38,52,44,.12); border-radius: 10px; background: rgba(255,255,255,.96); box-shadow: 0 12px 32px rgba(28,43,35,.14); transform: translateX(12px); pointer-events: none; }
.chart-tooltip[hidden] { display: none; }
.chart-tooltip.align-right { transform: translateX(calc(-100% - 12px)); }
.chart-tooltip strong { color: var(--ink); font-size: 10px; }
.chart-tooltip span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 600; }
.chart-tooltip b { font-weight: 650; }
.chart-empty { border: 1px dashed var(--line); border-radius: 12px; background: #fafbfa; }
.bar-list { display: grid; gap: 18px; padding-top: 8px; }
.bar-row > div:first-child { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 7px; font-size: 11px; }
.bar-row span { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-track { overflow: hidden; height: 8px; border-radius: 99px; background: #edf1ee; }
.bar-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3b8c68, #80baa0); transition: width .35s ease; }
.metrics-game-table { min-width: 780px; }
.metrics-game-table td:nth-child(2) { max-width: 260px; font-weight: 700; }
.metrics-game-table td:nth-child(2) a { display: block; overflow: hidden; color: var(--ink); text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.metrics-game-table td:nth-child(2) a:hover { color: var(--green); text-decoration: underline; }

@media (max-width: 720px) {
  .topbar { padding: 0 18px; }
  main { width: min(100% - 28px, 1240px); padding-top: 38px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .hero .primary-button { width: 100%; }
  .stats { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-wrap: wrap; }
  .search-box { flex-basis: 100%; }
  .pagination { align-items: stretch; flex-wrap: wrap; }
  .pagination > span { flex-basis: 100%; margin-right: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label.full { grid-column: auto; }
  dialog form { padding: 22px; }
  .detail-status-grid { grid-template-columns: 1fr 1fr; }
  .detail-status-grid .runtime-status-card { grid-column: 1 / -1; }
  .detail-list div { grid-template-columns: 1fr; gap: 5px; }
  .launch-card { padding: 28px; }
  .detail-page { width: min(100% - 28px, 1240px); padding-top: 28px; }
  .detail-page-head { align-items: stretch; flex-direction: column; }
  .detail-head-actions { align-items: stretch; flex-wrap: wrap; }
  .region-picker { flex: 1 0 100%; }
  .region-picker select { width: 100%; }
  .runner-head { grid-template-columns: 1fr 1fr; }
  .topbar { height: auto; min-height: 72px; gap: 12px; }
  .brand small { display: none; }
  .topnav a { padding: 7px 9px; }
  .dashboard-page { width: min(100% - 28px, 1320px); }
  .dashboard-hero { align-items: flex-start; }
  .dashboard-actions { width: 100%; justify-content: space-between; }
  .dashboard-stats { grid-template-columns: 1fr 1fr; }
  .region-grid, .dashboard-columns { grid-template-columns: 1fr; }
  .dashboard-game-toolbar { align-items: stretch; flex-direction: column; }
  .dashboard-region-filter { justify-content: space-between; }
  .dashboard-region-filter select { flex: 1; max-width: none; }
  .metrics-summary { grid-template-columns: 1fr 1fr; }
  .metrics-summary article:last-child { grid-column: 1 / -1; }
  .analytics-grid { grid-template-columns: 1fr; }
  .chart-panel.wide { grid-column: auto; }
  .range-select { flex: 1; }
  .range-select select { flex: 1; min-width: 0; }
}

@media (min-width: 721px) and (max-width: 1080px) {
  .dashboard-stats { grid-template-columns: repeat(3, 1fr); }
  .metrics-summary { grid-template-columns: repeat(3, 1fr); }
  .region-grid { grid-template-columns: 1fr; }
  .dashboard-columns { grid-template-columns: 1fr; }
}
