/* Shared presentation layer; page layout and data controls remain unchanged. */
:root {
  --bg: #18181b;
  --surface: #202023;
  --surface2: #27272a;
  --line: #38383d;
  --text: #f0f0f2;
  --muted: #b2b2ba;
  --cyan: #b8a4dd;
  --violet: #c4b5dc;
  --green: #94c5a5;
  --yellow: #d5b67b;
  --red: #df9a9e;
  font-size: 14px;
  line-height: 1.45;
  color-scheme: dark;
}
body { background: var(--bg); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .6; }
.sidebar {
  width: 240px;
  padding: 20px 12px;
  background: var(--bg);
  backdrop-filter: none;
  overflow-y: auto;
}
.brand { padding: 0 12px 20px; letter-spacing: normal; font-size: 15px; font-weight: 600; }
.side-nav { gap: 2px; }
.side-nav a { min-height: 36px; padding: 8px 12px; gap: 8px; border-radius: 4px; font-size: 13px; }
.side-nav a.active { background: var(--surface2); border-color: var(--line); color: var(--text); }
.side-nav a:hover { background: var(--surface2); }
.side-nav i { display: none; }
.workspace { width: calc(100% - 240px); margin-left: 240px; min-width: 0; }
.workspace-head { position: sticky; top: 0; z-index: 10; min-height: 52px; height: auto; padding: 10px 24px; gap: 12px; background: var(--bg); }
.crumb { font-size: 13px; letter-spacing: normal; text-transform: none; }
.head-actions { gap: 8px; font-size: 12px; flex-wrap: wrap; justify-content: flex-end; }
.content { width: 100%; max-width: 1800px; padding: 24px; }
.page-intro, .page-intro.compact { align-items: center; gap: 16px; margin-bottom: 20px; }
.page-intro h1, .detail-hero h1 { font-size: 24px; line-height: 1.25; letter-spacing: -.02em; font-weight: 600; }
.page-intro p { margin: 8px 0 0; font-size: 13px; line-height: 1.5; }
.button, .news-action, .icon-button {
  min-height: 32px; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 4px; background: var(--surface2); color: var(--text); font-size: 12px;
}
.button:hover, .news-action:hover, .icon-button:hover { background: #333337; border-color: #66666e; }
.button.primary { background: var(--cyan); color: #211b2a; border-color: var(--cyan); font-weight: 600; }
.search, .mapping-form input:not([type=checkbox]), .news-meta-form input,
.news-meta-form textarea, .auth-panel input:not([type=checkbox]), .auth-panel select, .evolution-controls select {
  padding: 7px 10px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; font-size: 13px;
}
input[type=checkbox] { accent-color: var(--cyan); }
.news-filters, .news-filters .search, .news-filter { font-size: 13px; }
.news-filters { flex-wrap: wrap; gap: 8px; }
.search { min-width: 180px; max-width: 100%; }
.kpis { display: flex; flex-wrap: wrap; gap: 0; border-block: 1px solid var(--line); margin-bottom: 20px; }
.kpi { flex: 1 1 150px; padding: 12px 16px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; }
.kpi:last-child { border-right: 0; }
.kpi-top { font-size: 12px; letter-spacing: normal; text-transform: none; }
.kpi-top i { display: none; }
.kpi strong { font-size: 23px; margin-top: 4px; letter-spacing: normal; font-variant-numeric: tabular-nums; }
.kpi small { margin-top: 2px; font-size: 11px; }
.grid { gap: 16px; }
.panel, .game-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: none; }
.panel { padding: 16px; }
.panel-head { align-items: center; margin-bottom: 12px; }
.panel-head h2 { font-size: 15px; font-weight: 600; letter-spacing: normal; }
.section-description { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.text-link { font-size: 12px; }
.text-link:hover, td a:hover, .news-link:hover { text-decoration: underline; }
.game-card:hover { transform: none; border-color: #66666e; }
.game-card img { background: var(--surface2); }
.game-card > .game-cover { padding: 0; }
.game-cover {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 460 / 215;
  overflow: hidden;
  background: var(--surface2);
  color: var(--muted);
}
.game-cover span { font-size: 24px; font-weight: 600; letter-spacing: .08em; }
.game-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
}
.game-cover.show-placeholder img { display: none; }
.game-card > div { padding: 10px; }
.game-card small { font-size: 12px; margin-top: 4px; }
.table-wrap { max-width: 100%; }
table { font-size: 13px; font-variant-numeric: tabular-nums; }
th { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: normal; text-transform: none; }
th, td { padding: 8px; line-height: 1.4; }
td { color: var(--text); }
tbody tr:hover { background: var(--surface2); }
code, .technical { font-family: ui-monospace, Consolas, monospace; font-size: .95em; font-variant-numeric: tabular-nums; }
.empty-server-address { display: inline-flex; align-items: center; gap: 8px; }
.empty-server-address .country-flag,
.empty-server-address .country-flag-placeholder { flex: 0 0 24px; margin: 0; vertical-align: initial; }
.empty-group-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.empty-location-filter {
  min-height: 32px;
  padding: 6px 28px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface2);
  color: var(--text);
  font-size: 12px;
}
.tag, .pill { padding: 2px 5px; border-radius: 3px; font-size: 11px; }
.tag.good { background: #273a2e; }
.tag.warn { background: #3a3325; }
.tag.event { background: #342d40; }
.bars { gap: 10px; }
.bar-label, .bar-label b { font-size: 12px; }
.bar-label em { color: var(--muted); font-size: 11px; }
.bar-track, .bar-track span { border-radius: 0; }
.bar-track { height: 4px; background: var(--line); }
.bar-track span { background: var(--cyan); }
.provider-row { padding: 9px 0; }
.provider-row b, .provider-row strong { font-size: 13px; }
.provider-row small, .provider-row em { font-size: 11px; color: var(--muted); }
.provider-row:hover { background: var(--surface2); }
.detail-hero { gap: 16px; margin-bottom: 20px; }
.game-workspace { position: relative; isolation: isolate; }
.game-backdrop {
  position: fixed;
  inset: 0 0 auto 240px;
  z-index: -1;
  width: calc(100% - 240px);
  height: 620px;
  object-fit: cover;
  object-position: center top;
  opacity: .28;
  mask-image: linear-gradient(to bottom, #000 0%, #0009 45%, transparent 100%);
  pointer-events: none;
}
.game-workspace .workspace-head,
.game-workspace .panel,
.game-workspace .detail-hero {
  background: rgb(32 32 35 / 72%);
  border-color: rgb(255 255 255 / 12%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.game-workspace .detail-hero { padding: 16px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 6px; }
.game-workspace .chart-controls button.active,
.game-workspace .chart-controls button:hover,
.game-workspace .provider-row:hover,
.game-workspace tbody tr:hover { background: rgb(255 255 255 / 7%); }
@media (prefers-reduced-transparency: reduce) {
  .game-workspace .workspace-head,
  .game-workspace .panel,
  .game-workspace .detail-hero {
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
.detail-hero img { width: 112px; border-radius: 4px; box-shadow: none; }
.hero-statline { gap: 16px; margin-top: 8px; font-size: 13px; }
.hero-statline b { font-size: 14px; font-variant-numeric: tabular-nums; }
.steam-store-link { display: inline-block; margin-top: 10px; }
.back { margin-bottom: 12px; font-size: 13px; }
.event-item { font-size: 13px; }
.event-item span, .event-item em { font-size: 12px; }
.evolution-head, .evolution-row { grid-template-columns: minmax(130px, 1fr) minmax(160px, 2fr) 90px 110px; gap: 12px; }
.evolution-head { color: var(--muted); font-size: 12px; letter-spacing: normal; text-transform: none; }
.evolution-row { font-size: 13px; }
.evolution-row small { font-size: 11px; }
.evolution-months { gap: 0; }
.evolution-months span { border: 0; border-right: 1px solid var(--line); border-radius: 0; background: none; padding: 4px 10px; }
.evolution-months small, .evolution-months b { font-size: 12px; }
.change.up, .change.down, .change.flat { color: var(--text); }
.chart-controls, .sub-tabs { gap: 0; flex-wrap: wrap; }
.chart-controls button, .sub-tabs button { padding: 7px 10px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; font-size: 12px; }
.chart-controls button.active, .sub-tabs button.active { border-bottom-color: var(--cyan); color: var(--text); background: var(--surface2); }
.chart-controls button:hover, .sub-tabs button:hover { background: var(--surface2); }
.chart-area { fill: var(--cyan); opacity: .06; }
.chart-grid text, .chart-axis text { fill: var(--muted); font-size: 11px; }
.chart-grid line, .stop-chart-grid line { stroke: var(--line); }
.line { stroke-width: 2; }
.legend, .stop-chart-legend { font-size: 12px; flex-wrap: wrap; }
.stop-line-chart svg { height: 260px; }
.stop-line-chart .stop-chart-legend { order: 1; }
.stop-line { stroke-width: 2; }
.stop-axis { stroke: var(--line); }
.stop-line.stop-color-0 { stroke: var(--cyan); }
.stop-point.stop-color-0, .stop-chart-legend i.stop-color-0 { fill: var(--cyan); background: var(--cyan); }
.stop-line.stop-color-1 { stroke: var(--violet); }
.stop-point.stop-color-1, .stop-chart-legend i.stop-color-1 { fill: var(--violet); background: var(--violet); }
.provider-evolution-toolbar { display: flex; justify-content: flex-end; margin: -4px 0 10px; }
.provider-series {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
}
.provider-series label,
.provider-table-select {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.provider-series label:has(input:checked),
.provider-table-select:has(input:checked) { color: var(--text); }
.provider-series input,
.provider-table-select input { width: 13px; height: 13px; margin: 0; }
.provider-series i,
.provider-table-select i { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 2px; }
.provider-evolution-chart { height: 280px; margin: 12px 0; }
.provider-evolution-chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.provider-evolution-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.provider-evolution-point { stroke: var(--surface); stroke-width: 1.5; }
.provider-evolution-line.stop-color-0 { stroke: var(--cyan); }
.provider-evolution-line.stop-color-1 { stroke: var(--violet); }
.provider-evolution-line.stop-color-2 { stroke: var(--green); }
.provider-evolution-line.stop-color-3 { stroke: var(--yellow); }
.provider-evolution-line.stop-color-4 { stroke: var(--red); }
.provider-evolution-line.stop-color-5 { stroke: #c49aba; }
.provider-evolution-line.stop-color-6 { stroke: #91a9c5; }
.provider-evolution-line.stop-color-7 { stroke: #a7b08a; }
.provider-evolution-point.stop-color-0 { fill: var(--cyan); }
.provider-evolution-point.stop-color-1 { fill: var(--violet); }
.provider-evolution-point.stop-color-2 { fill: var(--green); }
.provider-evolution-point.stop-color-3 { fill: var(--yellow); }
.provider-evolution-point.stop-color-4 { fill: var(--red); }
.provider-evolution-point.stop-color-5 { fill: #c49aba; }
.provider-evolution-point.stop-color-6 { fill: #91a9c5; }
.provider-evolution-point.stop-color-7 { fill: #a7b08a; }
.provider-series .stop-color-0, .provider-table-select .stop-color-0 { background: var(--cyan); }
.provider-series .stop-color-1, .provider-table-select .stop-color-1 { background: var(--violet); }
.provider-series .stop-color-2, .provider-table-select .stop-color-2 { background: var(--green); }
.provider-series .stop-color-3, .provider-table-select .stop-color-3 { background: var(--yellow); }
.provider-series .stop-color-4, .provider-table-select .stop-color-4 { background: var(--red); }
.provider-series .stop-color-5, .provider-table-select .stop-color-5 { background: #c49aba; }
.provider-series .stop-color-6, .provider-table-select .stop-color-6 { background: #91a9c5; }
.provider-series .stop-color-7, .provider-table-select .stop-color-7 { background: #a7b08a; }
.provider-evolution-table th:not(:first-child),
.provider-evolution-table td:not(:first-child) { text-align: right; }
.provider-evolution-table th button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.provider-evolution-table th button:hover { color: var(--text); }
.provider-evolution-table th button.active { color: var(--text); }
.provider-evolution-table th button.active::after { margin-left: 5px; color: var(--muted); content: '↑'; }
.provider-evolution-table th button.active[data-direction=desc]::after { content: '↓'; }
.provider-evolution-table td:first-child { width: 34%; }
.provider-evolution-table td:last-child { width: 20%; min-width: 160px; }
.provider-table-select span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.provider-evolution-table .sparkline { display: inline-block; width: min(190px, 100%); }
.provider-evolution-table .change.up { color: var(--green); }
.provider-evolution-table .change.down { color: var(--red); }
.provider-evolution-table .change.flat { color: var(--muted); }
.gsp-sample-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.gsp-sample-chart { height: 260px; min-height: 0; background: none; border: 0; border-radius: 0; }
.gsp-sample-chart text { fill: var(--muted); font-size: 11px; }
.gsp-sample-chart > line { stroke: var(--line); }
.gsp-sample-chart .line { stroke: var(--cyan); }
.gsp-sample-chart .chart-area { stroke: none; }
.gsp-sample-hover:focus { stroke: var(--cyan); }
.gsp-sample-chart circle { fill: var(--cyan); }
.gsp-sample-chart .gsp-sample-cursor { stroke: var(--muted); }
.callout, .bulk-form, .news-feed-item { border-color: var(--line); background: var(--surface); border-radius: 4px; padding: 12px; font-size: 13px; }
.news-feed { gap: 12px; }
.news-sections { gap: 16px; }
.news-feed-item p { color: var(--text); font-size: 13px; }
.news-analysis summary, .news-source summary, .news-meta summary, .news-link { font-size: 12px; }
.news-analysis-body, .news-source-body { color: var(--text); font-size: 13px; }
.news-analysis-body strong, .news-source-body strong, .impact-values b { font-size: 13px; }
.news-analysis-body small, .news-source-body p, .impact-values small { color: var(--muted); font-size: 12px; }
.mapping-form label, .mapping-help, .empty-total { font-size: 13px; }
.mapping-form .button { font-size: 12px; }
.dashboard-toast, .dashboard-toast.error { border-radius: 4px; background: var(--surface2); box-shadow: 0 2px 8px #0003; }
.dashboard-toast.compact {
  right: 16px;
  bottom: 16px;
  max-width: 280px;
  padding: 8px 10px;
  border-color: var(--line);
  border-left: 2px solid var(--yellow);
  color: var(--text);
  background: var(--surface2);
  box-shadow: 0 2px 8px #0004;
  font-size: 12px;
}
.empty, .loading-screen { min-height: 140px; }
.error { min-height: 240px; }
.error h1 { font-size: 22px; }
.auth-panel { max-width: 100%; }
@media (max-width: 1200px) {
  .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content { padding: 16px; }
  .mapping-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar .brand { justify-content: flex-start; padding: 0 8px 8px; }
  .side-nav { display: flex; justify-content: flex-start; flex-wrap: wrap; margin: 0; }
  .side-nav a { padding: 6px 8px; font-size: 12px; }
  .workspace { width: 100%; margin: 0; }
  .game-backdrop { left: 0; width: 100%; }
  .workspace-head { padding: 10px 16px; }
  .page-intro { flex-wrap: wrap; }
  .detail-grid { grid-template-columns: 1fr; }
  .span-3 { grid-column: 1 / -1; }
  .evolution-list { overflow-x: auto; }
  .evolution-head, .evolution-row { min-width: 560px; }
  .provider-evolution-table { min-width: 980px; }
  .news-filters { width: 100%; }
}
@media (max-width: 560px) {
  .overview-grid { grid-template-columns: 1fr; }
  .span-1, .span-2, .span-3 { grid-column: 1 / -1; }
  .mapping-form { grid-template-columns: 1fr; }
  .kpi { flex-basis: 50%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
