:root {
  --bg: #222222;
  --card: #2f2f2f;
  --muted: #3e3e3e;
  --theme-1: #D62828;
  --theme-1-rgb: 214, 40, 40;
  --theme-2: #d69c28;
  --theme-2-rgb: 214, 156, 40;
  --theme-3: #159D49;
  --theme-3-rgb: 21, 157, 73;

  --text: #ffffff;
  --text-rgb: 255, 255, 255;
  --text-muted: #fcfcec;
  --text-dim: #CACABD;
  --text-weak: #97978d;
  --border: #444444;
  --active: #444444;
  --overlay: rgba(0,0,0,0.55);
  --radius: 4px;
  --radius-sm: 2px;
  --max-width: 1200px;
  --space-xs: 2px;
  --space-sm: 4px;
  --space-md: 8px;
  --space-lg: 16px;
  --cell: 48px;
  --btn-height: 44px;
  --z-sticky: 100;
  --z-header: 101;
  --z-modal: 2000;
  --z-toast: 1001;

  --state-upcoming: var(--text-weak);
  --state-live: var(--theme-2);
  --state-paused: var(--text-weak);
  --state-soon: var(--theme-2);
  --state-time: var(--theme-2);

  --text-2xs: 10px;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 22px;
  --text-3xl: 28px;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; min-height: 100vh; touch-action: manipulation; }
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { display: none; }
body { overflow-x: hidden; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: var(--bg); color: var(--text); font-size: var(--text-base); font-weight: 500; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }

.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-lg); }

.btn, .btn-primary {
  height: var(--btn-height);
  padding: 0 var(--space-lg);
  color: var(--text);
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover, .btn-primary:hover { filter: brightness(1.08); }
.btn:active, .btn-primary:active { transform: scale(0.97); filter: brightness(0.88); }
.btn-primary { background: var(--theme-2); }
.btn-primary:disabled { background: var(--muted); opacity: 0.6; cursor: not-allowed; }
.btn-primary:disabled:hover { filter: none; }
.btn-primary:disabled:active { transform: none; filter: none; }

.loading { display: none; flex-direction: column; align-items: center; padding: var(--space-lg); color: var(--text-weak); font-size: var(--text-sm); gap: var(--space-xs); }
.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--theme-1); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.error-toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--theme-1); color: var(--text); padding: var(--space-xs) var(--space-md); border-radius: var(--radius-sm); z-index: var(--z-toast); display: none; font-size: var(--text-base); font-weight: 600; }
.error-toast.show { display: block; }

.table-empty { padding: var(--space-lg); text-align: center; color: var(--text-weak); font-size: var(--text-base); }

.page-header { position: sticky; top: 0; z-index: var(--z-header); padding: var(--space-xs) 0; background: var(--bg); transition: padding 0.3s ease; box-shadow: none; min-height: 42px; }
.page-header.scrolled { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); }
.list-page-header { position: relative; box-shadow: none; padding: var(--space-xs) 0; }
.list-page-header.scrolled { padding: var(--space-xs) 0; min-height: 42px; box-shadow: none; }
.list-page-header.scrolled .page-brand h1 { font-size: var(--text-2xl); }
.page-header-inner { display: flex; align-items: center; justify-content: space-between; position: relative; min-height: inherit; }
.page-brand { cursor: pointer; }
.page-brand h1 { font-size: var(--text-2xl); font-weight: 800; letter-spacing: -0.02em; color: var(--theme-1); }
.theme-2 { color: var(--theme-2); }
.theme-3 { color: var(--theme-3); }

.match-state {
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1;
}
.match-state.upcoming,
.match-state.upcoming .state-label,
.sticky-state.upcoming,
.sticky-state.upcoming .state-label { color: var(--state-upcoming); }
.match-state.live,
.match-state.live .state-label,
.sticky-state.live,
.sticky-state.live .state-label { color: var(--state-live); }
.match-state.paused,
.match-state.paused .state-label,
.sticky-state.paused,
.sticky-state.paused .state-label { color: var(--state-paused); }
.match-state.soon,
.match-state.soon .state-label,
.sticky-state.soon,
.sticky-state.soon .state-label { color: var(--state-soon); }
.match-state.live .state-label,
.sticky-state.live .state-label { color: var(--theme-1); }
.match-state.live .state-time,
.sticky-state.live .state-time { color: var(--theme-2); }
.match-state.paused .state-label,
.sticky-state.paused .state-label { color: var(--theme-3); }
.match-state.paused .state-time,
.sticky-state.paused .state-time { color: var(--text-weak); }
.match-state .state-time,
.sticky-state .state-time { color: inherit; }

.cell { display: flex; align-items: center; justify-content: center; height: var(--cell); cursor: pointer; border-radius: var(--radius-sm); background: transparent; }
.cell:hover, .cell:active, .cell.pressing, .cell.clicked { background: var(--active); }
@media (hover: none) { .cell:hover { background: transparent; } }
.cell.clicked { animation: flash 0.35s ease; }
.cell:active .cell-label, .cell.pressing .cell-label, .cell.clicked .cell-label,
.cell:active .cell-hc, .cell.pressing .cell-hc, .cell.clicked .cell-hc { color: var(--text); }
.cell.locked { cursor: default; opacity: 0.5; }
.cell.locked:hover { background: transparent; }

.cell-label, .matrix-layout .name-cell, .cell-hc { font-size: var(--text-base); font-weight: 500; line-height: 1; color: var(--text-muted); }
.cell.has-label { flex-direction: column; gap: var(--space-xs); }
.cell.has-label .cell-label { text-align: center; white-space: nowrap; max-width: 100%; }
.cell.hc-inline { flex-direction: row; align-items: center; padding: 0 var(--space-md); gap: var(--space-sm); }
.cell.hc-inline .cell-hc { flex: 1; text-align: right; }
.cell.hc-inline .cell-odds { flex: 1; text-align: left; }
.cell-odds { font-size: var(--text-base); font-weight: 500; color: var(--theme-2); white-space: nowrap; line-height: 1; }
.cell-odds.locked { color: var(--text-weak); font-weight: 600; }
.lock-icon { width: 14px; height: 14px; display: inline-block; vertical-align: middle; }

.header-item { flex: 1; text-align: center; font-size: var(--text-base); font-weight: 600; color: var(--text); padding: var(--space-sm) var(--space-xs); }
.header-bar { display: grid; grid-template-columns: repeat(var(--cols, 1), 1fr); align-items: center; background: var(--muted); min-height: 24px; }

.team-logo-placeholder { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; background: var(--muted); color: var(--text-weak); border-radius: 50%; font-size: var(--text-xs); font-weight: 700; }

@keyframes flash {
  0%   { background: var(--active); }
  100% { background: transparent; }
}
