:root {
  --bg: #07111f;
  --bg-elevated: rgba(11, 26, 46, 0.84);
  --bg-panel: rgba(8, 18, 33, 0.9);
  --line: rgba(144, 191, 255, 0.18);
  --text: #eef4ff;
  --muted: #9bb0cf;
  --accent: #e53935;
  --accent-2: #f7c948;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --body-font: "Inter", sans-serif;
  --display-font: "Barlow Condensed", sans-serif;
  --page-background:
    radial-gradient(circle at top left, rgba(247, 201, 72, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(229, 57, 53, 0.22), transparent 24%),
    linear-gradient(180deg, #0a1730 0%, #07111f 48%, #050b14 100%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--body-font);
  color: var(--text);
  background: var(--page-background);
}

.page-shell {
  width: min(1920px, calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  display: flex;
  align-items: center;
  min-height: 88px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 220px;
  gap: 3px;
  margin-left: auto;
}

.hero-utility-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: 100%;
}

.theme-control,
.share-control { position: relative; }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #7f94b6;
  background: transparent;
  font: 700 0.78rem/1 var(--display-font);
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible,
.theme-toggle[aria-expanded="true"] {
  border-color: rgba(144, 191, 255, 0.24);
  color: var(--accent-2);
  background: rgba(144, 191, 255, 0.08);
}

.theme-toggle-mark { color: var(--accent-2); font-size: 0.8rem; }

.share-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #7f94b6;
  background: transparent;
  font: 700 0.78rem/1 var(--display-font);
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.share-toggle:hover,
.share-toggle:focus-visible,
.share-toggle[aria-expanded="true"] {
  border-color: rgba(144, 191, 255, 0.24);
  color: var(--accent-2);
  background: rgba(144, 191, 255, 0.08);
}

.share-menu {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(7, 17, 31, 0.98);
  box-shadow: var(--shadow);
  transform-origin: top right;
  animation: theme-menu-in 150ms ease both;
}

.share-menu > p {
  margin: 0 0 9px;
  color: var(--muted);
  font: 700 0.72rem/1 var(--display-font);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.share-url-row { display: flex; gap: 6px; }

.share-url-row input {
  min-width: 0;
  flex: 1;
  height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(144, 191, 255, 0.2);
  border-radius: 8px;
  color: var(--text);
  background: rgba(144, 191, 255, 0.06);
  font: 500 0.7rem/1 var(--body-font);
}

.share-url-row button {
  min-width: 54px;
  padding: 0 10px;
  border: 1px solid rgba(247, 201, 72, 0.48);
  border-radius: 8px;
  color: var(--accent-2);
  background: rgba(247, 201, 72, 0.08);
  font: 700 0.78rem/1 var(--display-font);
  cursor: pointer;
}

.share-url-row button:hover,
.share-url-row button:focus-visible { background: rgba(247, 201, 72, 0.18); }

.share-copy-status {
  display: block;
  min-height: 14px;
  margin-top: 6px;
  color: var(--accent-2);
  font: 700 0.66rem/1 var(--display-font);
  letter-spacing: 0.05em;
}

.theme-menu {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  right: 0;
  width: 326px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(7, 17, 31, 0.98);
  box-shadow: var(--shadow);
  transform-origin: top right;
  animation: theme-menu-in 150ms ease both;
}

.theme-menu > p {
  margin: 0 0 9px;
  color: var(--muted);
  font: 700 0.72rem/1 var(--display-font);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.theme-option {
  display: flex;
  align-items: center;
  min-height: 38px;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid rgba(144, 191, 255, 0.15);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(144, 191, 255, 0.045);
  font: 700 0.76rem/1 var(--display-font);
  letter-spacing: 0.03em;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease, transform 150ms ease;
}

.theme-option:hover,
.theme-option:focus-visible,
.theme-option.is-active {
  border-color: var(--accent-2);
  color: var(--text);
  background: rgba(247, 201, 72, 0.1);
  transform: translateY(-1px);
}

.theme-swatch {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.is-scry-night { background: linear-gradient(135deg, #07111f 48%, #e53935 49%, #f7c948); }
.is-arctic-signal { background: linear-gradient(135deg, #071521 48%, #38bdf8 49%, #d7f3ff); }
.is-crimson-forge { background: linear-gradient(135deg, #190b0d 48%, #ef4444 49%, #fbbf24); }
.is-violet-void { background: linear-gradient(135deg, #110a23 48%, #a855f7 49%, #67e8f9); }
.is-verdant-rift { background: linear-gradient(135deg, #061812 48%, #34d399 49%, #f7c948); }
.is-rose-quartz { background: linear-gradient(135deg, #1b0c18 48%, #fb7185 49%, #f9a8d4); }
.is-solar-flare { background: linear-gradient(135deg, #201607 48%, #f59e0b 49%, #fde68a); }
.is-mono-terminal { background: linear-gradient(135deg, #080d0a 48%, #4ade80 49%, #d1fae5); }

@keyframes theme-menu-in {
  from { opacity: 0; transform: translateY(-5px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Theme skins change the visual language only; the layout remains shared. */
html[data-theme="arctic-signal"] {
  --bg: #071521; --bg-elevated: rgba(10, 31, 47, 0.88); --bg-panel: rgba(6, 22, 35, 0.92);
  --line: rgba(125, 211, 252, 0.27); --text: #ecfeff; --muted: #9dc9dc; --accent: #38bdf8; --accent-2: #d7f3ff;
  --body-font: "DM Sans", sans-serif; --display-font: "Rajdhani", sans-serif;
  --page-background: radial-gradient(circle at 8% 0%, rgba(56, 189, 248, 0.22), transparent 27%), radial-gradient(circle at 94% 7%, rgba(215, 243, 255, 0.16), transparent 22%), linear-gradient(180deg, #0a2436 0%, #071521 50%, #030b11 100%);
}
html[data-theme="crimson-forge"] {
  --bg: #190b0d; --bg-elevated: rgba(42, 14, 18, 0.9); --bg-panel: rgba(29, 8, 11, 0.94);
  --line: rgba(251, 113, 133, 0.28); --text: #fff4ee; --muted: #dcb1b4; --accent: #ef4444; --accent-2: #fbbf24;
  --body-font: "Sora", sans-serif; --display-font: "Rajdhani", sans-serif;
  --page-background: radial-gradient(circle at 8% 0%, rgba(239, 68, 68, 0.23), transparent 27%), radial-gradient(circle at 94% 7%, rgba(251, 191, 36, 0.17), transparent 22%), linear-gradient(180deg, #310e13 0%, #190b0d 50%, #090506 100%);
}
html[data-theme="violet-void"] {
  --bg: #110a23; --bg-elevated: rgba(29, 13, 53, 0.9); --bg-panel: rgba(17, 7, 34, 0.94);
  --line: rgba(192, 132, 252, 0.28); --text: #f7f0ff; --muted: #c9b8df; --accent: #a855f7; --accent-2: #67e8f9;
  --body-font: "Space Mono", monospace; --display-font: "Rajdhani", sans-serif;
  --page-background: radial-gradient(circle at 8% 0%, rgba(168, 85, 247, 0.24), transparent 26%), radial-gradient(circle at 94% 7%, rgba(103, 232, 249, 0.14), transparent 22%), linear-gradient(180deg, #211142 0%, #110a23 51%, #06030d 100%);
}
html[data-theme="verdant-rift"] {
  --bg: #061812; --bg-elevated: rgba(7, 37, 27, 0.9); --bg-panel: rgba(4, 23, 16, 0.94);
  --line: rgba(74, 222, 128, 0.27); --text: #effff4; --muted: #a9d5ba; --accent: #34d399; --accent-2: #f7c948;
  --body-font: "DM Sans", sans-serif; --display-font: "Rajdhani", sans-serif;
  --page-background: radial-gradient(circle at 8% 0%, rgba(52, 211, 153, 0.2), transparent 28%), radial-gradient(circle at 94% 7%, rgba(247, 201, 72, 0.14), transparent 22%), linear-gradient(180deg, #0b3024 0%, #061812 50%, #020906 100%);
}
html[data-theme="rose-quartz"] {
  --bg: #1b0c18; --bg-elevated: rgba(46, 19, 42, 0.9); --bg-panel: rgba(28, 10, 27, 0.94);
  --line: rgba(251, 113, 133, 0.28); --text: #fff5fb; --muted: #dbb3cc; --accent: #fb7185; --accent-2: #f9a8d4;
  --body-font: "Libre Baskerville", serif; --display-font: "Sora", sans-serif;
  --page-background: radial-gradient(circle at 8% 0%, rgba(251, 113, 133, 0.21), transparent 28%), radial-gradient(circle at 94% 7%, rgba(249, 168, 212, 0.17), transparent 22%), linear-gradient(180deg, #33132f 0%, #1b0c18 50%, #090309 100%);
}
html[data-theme="solar-flare"] {
  --bg: #201607; --bg-elevated: rgba(47, 33, 10, 0.91); --bg-panel: rgba(31, 20, 4, 0.94);
  --line: rgba(251, 191, 36, 0.3); --text: #fff8e7; --muted: #d9c18c; --accent: #f59e0b; --accent-2: #fde68a;
  --body-font: "Sora", sans-serif; --display-font: "Rajdhani", sans-serif;
  --page-background: radial-gradient(circle at 8% 0%, rgba(245, 158, 11, 0.23), transparent 28%), radial-gradient(circle at 94% 7%, rgba(253, 230, 138, 0.13), transparent 22%), linear-gradient(180deg, #3d290a 0%, #201607 50%, #0d0802 100%);
}
html[data-theme="mono-terminal"] {
  --bg: #080d0a; --bg-elevated: rgba(10, 23, 14, 0.92); --bg-panel: rgba(5, 13, 8, 0.96);
  --line: rgba(74, 222, 128, 0.28); --text: #d1fae5; --muted: #8fc4a4; --accent: #22c55e; --accent-2: #86efac;
  --body-font: "IBM Plex Mono", monospace; --display-font: "IBM Plex Mono", monospace;
  --page-background: radial-gradient(circle at 8% 0%, rgba(34, 197, 94, 0.16), transparent 26%), linear-gradient(180deg, #102318 0%, #080d0a 50%, #010302 100%);
}

html[data-theme] .page-shell :is(p, span, a, button, time, strong, small) { font-family: var(--body-font); }
html[data-theme] .page-shell :is(h1, h2, h3, .toggle-button, .scry-wordmark, .site-status, .ltools-link, .theme-toggle, .theme-option) { font-family: var(--display-font); }
html[data-theme] .hero,
html[data-theme] .controls-panel,
html[data-theme] .calendar-section,
html[data-theme] .resources,
html[data-theme] .chat-card,
html[data-theme] .live-match-card { border-color: var(--line); }

.ltools-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #7f94b6;
  background: transparent;
  font: 700 0.78rem/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.05em;
  text-decoration: none;
  justify-content: center;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.ltools-link:hover,
.ltools-link:focus-visible {
  border-color: rgba(144, 191, 255, 0.24);
  color: var(--accent-2);
  background: rgba(144, 191, 255, 0.08);
}

.ltools-icon { width: 14px; height: 14px; }

.site-status {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  min-height: 36px;
  width: 100%;
  margin-left: 0;
  padding: 9px 13px;
  border: 1px solid rgba(155, 176, 207, 0.28);
  border-radius: 999px;
  color: #93a4be;
  background: rgba(10, 23, 43, 0.7);
  font: 700 0.86rem/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.035em;
  white-space: nowrap;
  cursor: help;
}

.site-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.site-status.is-live { color: #34d399; border-color: rgba(52, 211, 153, 0.48); }
.site-status.is-live .site-status-dot { box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.14), 0 0 14px rgba(52, 211, 153, 0.9); animation: status-pulse 1.8s ease-in-out infinite; }
.site-status.is-upcoming { color: var(--accent-2); border-color: rgba(247, 201, 72, 0.42); }
.site-status.is-warning { color: #f59e0b; border-color: rgba(245, 158, 11, 0.52); }
.site-status.is-error { color: #fb7185; border-color: rgba(251, 113, 133, 0.58); }

.mobile-chat-only-toggle,
.mobile-chat-only-controls {
  display: none;
}

.site-status-detail {
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  right: 28px;
  width: min(300px, calc(100vw - 48px));
  padding: 10px 12px;
  border: 1px solid rgba(155, 176, 207, 0.26);
  border-radius: 10px;
  color: var(--muted);
  background: #0a172b;
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.site-status:hover + .site-status-detail,
.site-status:focus-visible + .site-status-detail { opacity: 1; transform: translateY(0); }

@keyframes status-pulse {
  50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0), 0 0 18px rgba(52, 211, 153, 0.95); }
}

.eyebrow,
.control-title,
.resource-tag,
.status-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  color: var(--accent-2);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3,
.toggle-button {
  font-family: var(--display-font);
}

h1 {
  font-size: clamp(2.35rem, 4vw, 3.35rem);
  line-height: 1;
  letter-spacing: 0.02em;
}

.hero-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.scry-mark {
  display: inline-block;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  background-image: url("assets/scry-wolf-mark.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  image-rendering: pixelated;
}

.scry-wordmark {
  color: var(--accent-2);
  font: 700 clamp(1.5rem, 2.35vw, 2.25rem)/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.1em;
}

.scry-wordmark i {
  display: inline-block;
  margin-left: 0.16em;
  color: rgba(239, 245, 255, 0.5);
  font-style: normal;
  font-size: 1.42em;
  line-height: 0.65;
  vertical-align: -0.12em;
}

.scry-beta {
  position: relative;
  top: -0.58em;
  margin-left: 0.08em;
  color: var(--accent);
  font-size: 0.42em;
  font-weight: 700;
  letter-spacing: 0;
}

.league-logo {
  width: auto;
  height: 0.86em;
  flex: 0 0 auto;
  color: var(--text);
  fill: currentColor;
  filter: drop-shadow(0 0 8px rgba(247, 201, 72, 0.16));
}

.dashboard {
  margin-top: 22px;
  display: grid;
  gap: 22px;
}

.controls-panel,
.resources,
.calendar-section {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}

.controls-panel {
  order: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 12px 16px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.viewer-mode-control {
  margin-inline-start: 0 !important;
  order: initial;
}

.mobile-chat-visibility-control { display: none; }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle-button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.toggle-button:hover,
.toggle-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(247, 201, 72, 0.5);
}

.toggle-button.is-active {
  color: #07111f;
  background: linear-gradient(135deg, var(--accent-2), #ffdb72);
  border-color: transparent;
}

.add-panel-control {
  position: relative;
}

.add-panel-button span {
  display: inline-grid;
  place-items: center;
  width: 1.05em;
  height: 1.05em;
  margin-right: 0.16em;
  border-radius: 50%;
  background: rgba(247, 201, 72, 0.18);
  color: var(--accent-2);
  font-size: 1.16em;
  line-height: 1;
}

.add-panel-menu {
  position: absolute;
  z-index: 12;
  top: auto;
  bottom: calc(100% + 10px);
  right: 0;
  display: grid;
  width: min(260px, calc(100vw - 32px));
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(144, 191, 255, 0.34);
  border-radius: 14px;
  background: #0b1a2e;
  box-shadow: var(--shadow);
}

.add-panel-menu[hidden] { display: none; }
.add-panel-menu p { margin: 3px 6px 7px; color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.add-panel-menu button { border: 0; border-radius: 9px; padding: 9px 10px; background: transparent; color: var(--text); cursor: pointer; font: 600 0.86rem "Inter", sans-serif; text-align: left; }
.add-panel-menu button:hover, .add-panel-menu button:focus-visible { background: rgba(247, 201, 72, 0.14); color: var(--accent-2); }
.add-panel-menu button:disabled { opacity: 0.4; cursor: not-allowed; }

.embed-note,
.chat-hint,
.resource-card p {
  color: var(--muted);
  line-height: 1.6;
}

.viewer-grid {
  order: 1;
  display: grid;
  grid-template-columns: minmax(0, 2.25fr) minmax(320px, 0.95fr);
  gap: 22px;
  align-items: start;
  position: relative;
}

.calendar-section {
  order: 3;
}

.resources {
  order: 4;
}

.viewer-grid.is-both-chats {
  grid-template-columns: var(--player-width, minmax(420px, 1.15fr)) minmax(560px, 1fr);
}

/* Keep a grab handle available with one chat too. This lets viewers choose a
   narrower player frame instead of forcing the wide default layout. */
.viewer-grid.is-resizable:not(.is-both-chats) {
  grid-template-columns: var(--player-width, minmax(420px, 2.25fr)) minmax(360px, 0.95fr);
}

.viewer-focus-toolbar {
  display: none;
}

.stream-frame,
.chat-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: var(--bg-panel);
  box-shadow: var(--shadow);
}

.stream-frame {
  min-height: 620px;
  position: relative;
}

.stream-frame iframe {
  width: 100%;
  height: 100%;
  min-height: 620px;
  border: 0;
}

.stream-recovery {
  position: absolute;
  z-index: 3;
  inset: 50% auto auto 50%;
  width: min(440px, calc(100% - 36px));
  transform: translate(-50%, -50%);
  display: grid;
  gap: 10px;
  padding: 22px;
  border: 1px solid rgba(247, 201, 72, 0.4);
  border-radius: 18px;
  background: rgba(8, 22, 39, 0.96);
  box-shadow: var(--shadow);
}

.stream-recovery[hidden] {
  display: none;
}

.stream-recovery-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
}

.stream-recovery-close:hover,
.stream-recovery-close:focus-visible { background: rgba(255, 255, 255, 0.1); color: var(--text); }

.stream-recovery strong { font: 700 1.5rem "Barlow Condensed", sans-serif; }
.stream-recovery p { margin: 0; color: var(--muted); line-height: 1.45; }
.stream-recovery form { display: flex; gap: 8px; }
.stream-recovery input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #07111f; color: var(--text); font: inherit; }
.stream-recovery button { border: 0; border-radius: 10px; padding: 10px 12px; background: var(--accent-2); color: #07111f; cursor: pointer; font: 800 0.85rem "Inter", sans-serif; white-space: nowrap; }
.stream-recovery-status { min-height: 1.2em; font-size: 0.82rem; }

.chzzk-fullscreen-button {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background: rgba(5, 13, 26, 0.88);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0.48rem 0.72rem;
  opacity: 0;
  transition: opacity 160ms ease, background 160ms ease, transform 160ms ease;
}

.stream-frame:hover .chzzk-fullscreen-button,
.chzzk-fullscreen-button:focus-visible {
  opacity: 1;
}

.chzzk-fullscreen-button:hover {
  background: rgba(20, 45, 73, 0.96);
  transform: translateY(-1px);
}

.stream-frame iframe:fullscreen {
  width: 100vw;
  height: 100vh;
  border: 0;
  object-fit: contain;
  background: #000;
}

.chat-panel,
.chat-stack {
  display: grid;
  gap: 18px;
}

.viewer-grid.is-both-chats .chat-stack {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.viewer-resizer {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: calc(var(--player-width) + 3px);
  width: 18px;
  cursor: col-resize;
  touch-action: none;
}

.viewer-resizer::after {
  position: absolute;
  top: 38%;
  bottom: 38%;
  left: 8px;
  width: 2px;
  border-radius: 999px;
  background: rgba(247, 201, 72, 0.7);
  box-shadow: 0 0 14px rgba(247, 201, 72, 0.38);
  content: "";
  transition: background 160ms ease, bottom 160ms ease, top 160ms ease;
}

.viewer-resizer:hover::after,
.viewer-resizer:focus-visible::after,
.viewer-resizer.is-dragging::after {
  top: 12%;
  bottom: 12%;
  background: var(--accent-2);
}

body.is-viewer-focus {
  overflow: hidden;
}

body.is-viewer-focus .page-shell {
  width: 100%;
  max-width: none;
  padding: 0;
}

body.is-viewer-focus .hero,
body.is-viewer-focus .dashboard > :not(.viewer-grid) {
  display: none;
}

body.is-viewer-focus .dashboard {
  display: block;
  margin: 0;
}

body.is-viewer-focus .viewer-grid {
  min-height: 100dvh;
  height: 100dvh;
  gap: 12px;
}

body.is-viewer-focus .viewer-resizer {
  left: calc(var(--player-width) - 2px);
}

body.is-viewer-focus .stream-frame,
body.is-viewer-focus .stream-frame iframe,
body.is-viewer-focus .chat-panel,
body.is-viewer-focus .chat-stack,
body.is-viewer-focus .chat-card {
  min-height: 0;
  height: 100%;
}

body.is-viewer-focus .chat-card {
  display: flex;
  flex-direction: column;
}

/* Focus mode must preserve the normal chat selection instead of revealing inactive provider cards. */
body.is-viewer-focus .chat-card.is-hidden {
  display: none;
}

/* Native hidden panels must stay hidden too; otherwise Focus mode resurrects an empty secondary-chat card. */
body.is-viewer-focus .chat-card[hidden] {
  display: none;
}

body.is-viewer-focus .chat-card iframe {
  min-height: 0;
  height: auto;
  flex: 1 1 auto;
}

body.is-viewer-focus .viewer-grid.is-both-chats.is-focus-chats-stacked .chat-stack {
  grid-template-columns: 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

body.is-viewer-focus .viewer-focus-toolbar {
  position: fixed;
  z-index: 10;
  top: -84px;
  left: 16px;
  width: max-content;
  max-width: calc(100vw - 32px);
  display: block;
  height: 76px;
  padding: 16px;
  pointer-events: none;
  transition: top 160ms ease;
}

body.is-viewer-focus .viewer-focus-toolbar.is-visible,
body.is-viewer-focus .viewer-focus-toolbar:focus-within {
  top: 0;
  pointer-events: auto;
}

.viewer-focus-escape-hint {
  display: none;
}

body.is-viewer-focus .viewer-focus-escape-hint {
  position: fixed;
  z-index: 9;
  top: 16px;
  left: 16px;
  display: block;
  margin: 0;
  padding: 9px 13px;
  border: 1px solid rgba(144, 191, 255, 0.3);
  border-radius: 999px;
  background: rgba(5, 13, 26, 0.92);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

body.is-viewer-focus .viewer-focus-escape-hint.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.viewer-focus-escape-hint kbd {
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-2);
  font: 700 0.72rem "Inter", sans-serif;
}

.viewer-focus-exit,
.viewer-layout-button {
  border: 1px solid rgba(247, 201, 72, 0.68);
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.92);
  color: var(--accent-2);
  padding: 10px 14px;
  font: 700 1rem "Inter", sans-serif;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.viewer-focus-exit {
  position: relative;
}

.viewer-focus-exit::after {
  position: absolute;
  top: calc(100% + 9px);
  left: 0;
  width: max-content;
  max-width: min(260px, calc(100vw - 32px));
  padding: 7px 10px;
  border: 1px solid rgba(144, 191, 255, 0.3);
  border-radius: 8px;
  background: rgba(5, 13, 26, 0.96);
  color: var(--text);
  content: attr(data-tooltip);
  font: 600 0.75rem/1.2 "Inter", sans-serif;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.viewer-focus-exit:hover::after,
.viewer-focus-exit:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.costream-modal[hidden] { display: none; }
.costream-modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; }
.costream-modal-backdrop { position: absolute; inset: 0; background: rgba(2, 7, 14, 0.78); backdrop-filter: blur(8px); }
.costream-modal-card { position: relative; width: min(760px, 100%); max-height: min(760px, calc(100vh - 48px)); overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: #0b1a2e; box-shadow: var(--shadow); }
.costream-modal-header { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.costream-modal-header h2 { margin-right: auto; font-size: 2rem; }
.costream-modal-card > p { color: var(--muted); }
.costream-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 18px; }
.costream-option { display: grid; gap: 8px; padding: 16px; border: 1px solid rgba(144, 191, 255, 0.24); border-radius: 16px; background: rgba(255,255,255,0.04); color: var(--text); text-align: left; cursor: pointer; }
.costream-option:hover, .costream-option:focus-visible { border-color: var(--accent-2); background: rgba(247,201,72,0.12); }
.costream-option strong { font-size: 1.25rem; }
.costream-option-footer { display: flex; align-items: center; gap: 9px; min-height: 28px; }
.costream-viewers { margin-left: auto; color: var(--accent-2); font: 700 0.86rem/1 "Barlow Condensed", sans-serif; letter-spacing: 0.03em; white-space: nowrap; }
.costream-platform-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; overflow: hidden; border-radius: 8px; color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.26); }
.costream-platform-icon svg,
.costream-platform-icon img { width: 19px; height: 19px; fill: currentColor; object-fit: contain; }
.costream-platform-icon.is-twitch { background: #9146ff; }
.costream-platform-icon.is-youtube { background: #ff0033; }
.costream-platform-icon.is-soop { background: #071c40; }
.costream-platform-icon.is-soop img { width: 25px; height: 25px; transform: scale(1.25); filter: saturate(1.25) brightness(1.32); }
.costream-platform-icon.is-chzzk { background: #050807; }
.costream-platform-icon.is-chzzk img { width: 24px; height: 24px; transform: scale(1.14); }
.costream-language-flag { width: 20px; height: 15px; border-radius: 2px; object-fit: cover; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }

.viewer-focus-exit:hover,
.viewer-focus-exit:focus-visible,
.viewer-layout-button:hover,
.viewer-layout-button:focus-visible,
.viewer-layout-button.is-active {
  background: var(--accent-2);
  color: #07111f;
}

.viewer-focus-chat-layout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
  padding: 4px 6px 4px 12px;
  border: 1px solid rgba(144, 191, 255, 0.24);
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.92);
  color: var(--muted);
  font-size: 0.82rem;
  box-shadow: var(--shadow);
}

.viewer-focus-chat-layout[hidden] {
  display: none;
}

.viewer-layout-button {
  padding: 7px 10px;
  font-size: 0.82rem;
  box-shadow: none;
}

.chat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.chat-card-header h2 {
  font-size: 1.6rem;
  letter-spacing: 0.03em;
}

.chat-source-tag {
  display: inline-block;
  margin-left: 7px;
  padding: 3px 7px;
  border: 1px solid rgba(247, 201, 72, 0.45);
  border-radius: 999px;
  color: var(--accent-2);
  font: 700 0.68rem "Inter", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.chat-source-tag[hidden] {
  display: none;
}

.chat-card-header a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
}

.chat-mod-view-link {
  color: var(--muted) !important;
  font-size: 0.78rem;
}

.chat-mod-view-link:hover,
.chat-mod-view-link:focus-visible {
  color: var(--accent-2) !important;
}

.chat-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid rgba(144, 191, 255, 0.22);
  border-radius: 999px;
  background: rgba(144, 191, 255, 0.05);
  color: var(--muted) !important;
  cursor: pointer;
  font: 700 0.72rem/1 "Inter", sans-serif;
  text-decoration: none;
  white-space: nowrap;
}

.chat-action-icon {
  display: inline-grid;
  min-width: 1em;
  place-items: center;
  color: currentColor;
  font: 800 0.88rem/1 "Inter", sans-serif;
}

.chat-action.chat-popout-link,
.chat-action:hover,
.chat-action:focus-visible,
.chat-action.is-active {
  border-color: rgba(247, 201, 72, 0.58);
  color: var(--accent-2);
}

.chat-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chat-icon-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(144, 191, 255, 0.3);
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 700 1.2rem/1 "Inter", sans-serif;
}

.chat-icon-button:hover,
.chat-icon-button:focus-visible {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.live-match-card { min-height: 480px; }
.live-match-content { display: grid; gap: 16px; min-height: 480px; padding: 16px; background: linear-gradient(145deg, rgba(31, 86, 153, 0.12), rgba(189, 45, 66, 0.1)); }
.live-match-empty { margin: auto; color: var(--muted); text-align: center; line-height: 1.5; }
.live-match-draft { display: grid; gap: 11px; margin: auto; padding: 22px; border: 1px solid rgba(247, 201, 72, 0.28); border-radius: 16px; background: rgba(7, 17, 31, 0.62); text-align: center; }
.live-match-draft span { color: var(--accent-2); font: 700 0.72rem "Inter", sans-serif; letter-spacing: 0.1em; text-transform: uppercase; }
.live-match-draft strong { font: 700 1.5rem "Barlow Condensed", sans-serif; }
.live-match-draft i { color: var(--muted); font-style: normal; }
.live-match-draft p { margin: 0; color: var(--muted); font-size: 0.84rem; line-height: 1.45; }
.live-match-teams { display: flex; align-items: center; justify-content: center; gap: 10px; }
.live-match-teams b,
.live-match-team-name { display: inline-flex; align-items: center; gap: 7px; }
.live-match-teams img,
.live-match-team-name img { width: 23px; height: 23px; object-fit: contain; }
.live-match-draft-events { margin-top: -4px; }
.live-match-draft-events .live-match-event { grid-template-columns: 42px minmax(0, 1fr); }
.live-match-event p strong { color: var(--accent-2); }
.live-match-event p span { color: var(--muted); font-size: 0.78rem; }
.live-match-scoreboard { display: grid; gap: 10px; padding: 14px; border: 1px solid rgba(144, 191, 255, 0.26); border-radius: 14px; background: rgba(7, 17, 31, 0.65); }
.live-match-probability-label { color: var(--muted); font: 700 0.68rem "Inter", sans-serif; letter-spacing: 0.09em; text-transform: uppercase; }
.live-match-scoreboard > div:not(.live-match-probability) { display: flex; justify-content: space-between; gap: 12px; }
.live-match-scoreboard strong { font: 700 1.25rem "Barlow Condensed", sans-serif; }
.live-match-scoreboard span { color: var(--accent-2); font-weight: 800; }
.live-match-probability { height: 8px; overflow: hidden; border-radius: 999px; background: #7c2432; }
.live-match-probability i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4cb1ff, #2367d8); }
.viewer-focus-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 13px;
}

.viewer-focus-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.viewer-focus-toggle-label { white-space: nowrap; }
.live-match-events { display: grid; gap: 8px; align-content: start; max-height: 400px; overflow: auto; }
.live-match-event { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 9px; padding: 9px 10px; border-left: 3px solid #8fa1b8; border-radius: 8px; background: rgba(7, 17, 31, 0.65); }
.live-match-event.is-blue { border-left-color: #4cb1ff; }
.live-match-event.is-red { border-left-color: #fb7185; }
.live-match-event time { color: var(--accent-2); font: 700 0.8rem "Barlow Condensed", sans-serif; }
.live-match-event p { margin: 0; color: var(--text); font-size: 0.82rem; line-height: 1.38; }

.chat-card iframe {
  display: block;
  width: 100%;
  height: 480px;
  border: 0;
  background: #0c111b;
}

/* The Twitch embed and the Scry-native Minimalist view are mutually exclusive.
   This must win over the generic iframe display rule above. */
.chat-card iframe[hidden],
.twitch-minimalist-panel[hidden] {
  display: none !important;
}

.twitch-minimalist-panel {
  display: flex;
  flex-direction: column;
  height: 480px;
  background: linear-gradient(160deg, #081323, #0b1728);
}

.twitch-minimalist-status {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(144, 191, 255, 0.18);
  color: var(--muted);
  font: 700 0.68rem "Inter", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.twitch-minimalist-status span:last-child {
  color: var(--accent-2);
}

.twitch-minimalist-messages {
  display: grid;
  align-content: start;
  gap: 2px;
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 10px 13px 14px;
  scrollbar-color: rgba(144, 191, 255, 0.4) transparent;
}

.twitch-minimalist-message {
  overflow-wrap: anywhere;
  padding: 3px 1px;
  color: #dce8f8;
  font: 0.86rem/1.45 "Inter", sans-serif;
}

.twitch-minimalist-name {
  margin-right: 5px;
  font-weight: 800;
}

.twitch-minimalist-emote {
  height: 1.45em;
  margin: -0.18em 0.1em -0.22em;
  vertical-align: middle;
}


/* Twitch treats a clipped moderator-capable iframe as obscured. Keep this card visually rounded without clipping the frame. */
#twitch-chat-card {
  overflow: visible;
}

#twitch-chat-card .chat-card-header {
  border-radius: 24px 24px 0 0;
}


.chzzk-chat-tip,
.soop-chat-tip,
.twitch-chat-moderator-tip {
  margin: 0;
  padding: 13px 16px 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  background: rgba(20, 45, 73, 0.2);
}

.chzzk-chat-tip strong,
.soop-chat-tip strong,
.twitch-chat-moderator-tip strong {
  color: var(--accent-2);
}

#youtube-chat:not([src]) {
  display: none;
}

#secondary-chat:not([src]) {
  display: none;
}

.youtube-chat-panel[hidden] {
  display: none;
}

.youtube-chat-panel {
  display: grid;
  gap: 12px;
  padding: 18px 16px;
  min-height: 220px;
  align-content: center;
  background:
    linear-gradient(145deg, rgba(229, 57, 53, 0.12), rgba(247, 201, 72, 0.06)),
    rgba(255, 255, 255, 0.03);
}

.youtube-chat-panel strong {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.7rem;
  line-height: 1.05;
}

.chat-open-button {
  justify-self: start;
  border: 1px solid rgba(247, 201, 72, 0.38);
  border-radius: 999px;
  background: rgba(247, 201, 72, 0.14);
  color: var(--accent-2);
  font-weight: 800;
  padding: 10px 14px;
  text-decoration: none;
}

.chat-hint {
  padding: 12px 16px 16px;
  font-size: 0.92rem;
}

.section-heading {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.03em;
}

.section-text,
.schedule-source {
  color: var(--muted);
  line-height: 1.6;
}

.schedule-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

.calendar-view-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-view-button {
  border: 1px solid rgba(144, 191, 255, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  font: 700 0.86rem "Inter", sans-serif;
  padding: 8px 12px;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.calendar-view-button:hover,
.calendar-view-button:focus-visible {
  border-color: rgba(247, 201, 72, 0.6);
  color: var(--text);
}

.calendar-view-button.is-active {
  border-color: transparent;
  background: var(--accent-2);
  color: #07111f;
}

.schedule-updated {
  display: block;
  margin-top: 2px;
  color: #d7e7ff;
  font-size: 0.74rem;
  font-weight: 600;
  text-align: right;
  opacity: 0.78;
}

.refresh-button {
  border: 1px solid rgba(247, 201, 72, 0.36);
  border-radius: 999px;
  background: rgba(247, 201, 72, 0.12);
  color: var(--accent-2);
  cursor: pointer;
  font: 700 0.88rem "Inter", sans-serif;
  padding: 9px 14px;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.refresh-button:hover,
.refresh-button:focus-visible {
  background: rgba(247, 201, 72, 0.18);
  border-color: rgba(247, 201, 72, 0.6);
  transform: translateY(-1px);
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.match-day {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    rgba(8, 18, 33, 0.86);
}

.match-day.is-featured {
  background:
    linear-gradient(145deg, rgba(229, 57, 53, 0.16), rgba(247, 201, 72, 0.08)),
    rgba(8, 18, 33, 0.92);
}

.match-day-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
}

.match-day-header h3 {
  margin-top: 4px;
  font-size: 1.55rem;
  letter-spacing: 0.03em;
}

.match-day-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--accent-2);
}

.match-badge {
  white-space: nowrap;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(247, 201, 72, 0.14);
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 700;
}

.match-list {
  display: grid;
  gap: 8px;
}

.match-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 76px;
  padding: 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.match-row.is-complete {
  background: linear-gradient(135deg, rgba(247, 201, 72, 0.08), rgba(255, 255, 255, 0.03));
}

.match-row.is-live {
  background: linear-gradient(135deg, rgba(229, 57, 53, 0.22), rgba(247, 201, 72, 0.08));
  border: 1px solid rgba(229, 57, 53, 0.36);
}

.match-row.is-team-highlight {
  border: 1px solid rgba(247, 201, 72, 0.72);
  background: linear-gradient(135deg, rgba(247, 201, 72, 0.2), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 0 0 1px rgba(247, 201, 72, 0.12);
}

.match-time {
  display: inline-flex;
  justify-content: center;
  padding: 7px 8px;
  border-radius: 10px;
  background: rgba(144, 191, 255, 0.12);
  color: #d7e7ff;
  font-weight: 700;
  font-size: 0.82rem;
}

.match-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.team-line {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.team-line {
  border-radius: 12px;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.team-line[data-team-code] {
  cursor: default;
}

.team-line.is-team-highlight {
  background: rgba(247, 201, 72, 0.14);
  box-shadow: 0 0 0 1px rgba(247, 201, 72, 0.58), 0 0 18px rgba(247, 201, 72, 0.2);
  transform: translateY(-1px);
}

.team-line.is-team-highlight .team-logo-shell {
  border-color: rgba(247, 201, 72, 0.85);
}

.calendar-empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
}

.team-line.is-away {
  grid-template-columns: minmax(0, 1fr) 60px;
  text-align: right;
}

.team-line.is-away .team-logo-shell {
  grid-column: 2;
  grid-row: 1;
}

.team-line.is-away .team-identity {
  grid-column: 1;
  grid-row: 1;
}

.team-logo-shell {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
}

.team-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.team-logo.needs-contrast {
  filter:
    brightness(1.07)
    contrast(1.14)
    saturate(1.02)
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.46))
    drop-shadow(0 0 2px rgba(255, 255, 255, 0.16));
}

.team-identity {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.team-identity strong {
  font-size: 1.34rem;
  line-height: 1;
  min-width: 0;
  white-space: nowrap;
}

.team-name {
  color: var(--muted);
  display: none;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-record {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.match-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-left: 0;
  text-align: center;
}

.match-score,
.match-versus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  padding: 7px 9px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.08);
}

.match-status {
  color: var(--muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.62rem;
}

.match-format {
  color: #d7e7ff;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.schedule-source {
  margin-top: 16px;
  font-size: 0.92rem;
}

.schedule-source a {
  color: var(--accent-2);
  text-decoration: none;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.resource-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
}

.resource-card h3 {
  margin-top: 8px;
  margin-bottom: 10px;
  font-size: 1.55rem;
  letter-spacing: 0.03em;
}

.feedback-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent-2);
  font: 700 0.82rem "Inter", sans-serif;
  text-decoration: none;
}

.feedback-link:hover,
.feedback-link:focus-visible {
  text-decoration: underline;
}

.feature-card {
  background: linear-gradient(145deg, rgba(229, 57, 53, 0.14), rgba(247, 201, 72, 0.08));
}

.is-hidden {
  display: none;
}

@media (max-width: 1120px) {
  .viewer-grid,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .stream-frame,
  .stream-frame iframe {
    min-height: 540px;
  }

  .chat-card iframe {
    height: 420px;
  }
}

@media (max-width: 1249px) {
  .viewer-grid.is-both-chats {
    grid-template-columns: 1fr;
  }

  .viewer-grid.is-resizable:not(.is-both-chats) {
    grid-template-columns: 1fr;
  }

  .viewer-grid.is-both-chats .chat-stack {
    grid-template-columns: 1fr;
  }

  .viewer-resizer {
    display: none;
  }
}

@media (max-width: 700px) {
  .page-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 20px;
    padding-bottom: 32px;
  }

  .hero,
  .controls-panel,
  .resources,
  .calendar-section {
    padding: 18px;
    border-radius: 20px;
  }

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
    min-height: 70px;
    padding: 12px 18px;
  }

  .hero-copy {
    grid-column: 1 / -1;
  }

  .hero-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 48px minmax(0, 1.75fr) minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
    gap: 10px;
    margin-left: 0;
  }

  .hero-utility-row {
    grid-column: 1;
    grid-row: 1;
    width: 48px;
  }

  .theme-control,
  .share-control { display: none; }

  .hero-title {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .scry-mark {
    width: 46px;
    height: 46px;
  }

  .scry-wordmark {
    font-size: 1.7rem;
    white-space: nowrap;
  }

  .league-logo {
    height: 0.74em;
  }

  .site-status {
    grid-column: 2;
    min-height: 48px;
    justify-content: center;
    margin-left: 0;
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .ltools-link {
    width: 48px;
    min-height: 48px;
    padding: 0;
    border-color: rgba(113, 148, 197, 0.52);
    border-radius: 50%;
    background: rgba(10, 23, 43, 0.7);
    justify-content: center;
  }

  .ltools-link .ltools-label {
    display: none;
  }

  .ltools-link .ltools-icon {
    width: 22px;
    height: 22px;
  }

  .mobile-chat-only-toggle {
    display: inline-flex;
    grid-column: 3;
    grid-row: 1;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 8px 11px;
    border: 1px solid rgba(247, 201, 72, 0.42);
    border-radius: 999px;
    color: var(--accent-2);
    background: rgba(10, 23, 43, 0.7);
    font: 700 0.78rem/1 "Barlow Condensed", sans-serif;
    letter-spacing: 0.04em;
  }

  .mobile-chat-only-toggle.is-active {
    color: #081323;
    background: var(--accent-2);
    border-color: var(--accent-2);
  }

  .mobile-chat-only-controls {
    display: grid;
    gap: 9px;
    margin: 12px 0 0;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--bg-panel);
  }

  .mobile-chat-only-controls[hidden] { display: none; }

  .mobile-chat-only-controls p {
    margin: 0;
    color: var(--accent-2);
    font: 700 0.72rem/1 "Inter", sans-serif;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  /* Focus View has no hover on touch devices: keep a clear, reachable exit
     button on-screen instead of relying on the desktop reveal toolbar. */
  body.is-viewer-focus .viewer-focus-toolbar {
    position: fixed;
    z-index: 40;
    top: max(12px, env(safe-area-inset-top));
    right: 12px;
    left: auto;
    width: auto;
    max-width: calc(100vw - 24px);
    height: auto;
    padding: 0;
    pointer-events: auto;
    transition: none;
  }

  body.is-viewer-focus .viewer-focus-toolbar:not([hidden]) {
    display: block;
  }

  body.is-viewer-focus .viewer-focus-toolbar .viewer-focus-exit {
    min-height: 42px;
    padding: 10px 14px;
    background: rgba(5, 13, 26, 0.94);
  }

  body.is-viewer-focus .viewer-focus-exit::after,
  body.is-viewer-focus .viewer-focus-escape-hint {
    display: none;
  }

  /* A fixed bottom sheet keeps Add Panel above the mobile browser chrome and
     prevents the menu from being clipped by a short viewport. */
  .add-panel-menu:not([hidden]) {
    position: fixed;
    z-index: 50;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    max-height: min(420px, calc(100dvh - 24px));
    overflow: auto;
    padding: 12px;
    border-radius: 18px;
  }

  .add-panel-menu button {
    min-height: 44px;
    padding: 12px;
  }

  body.is-chat-only .dashboard > :not(.viewer-grid) {
    display: none;
  }

  body.is-chat-only .viewer-grid {
    display: block;
    min-height: calc(100dvh - 190px);
    margin-top: 12px;
  }

  body.is-chat-only .stream-frame,
  body.is-chat-only .viewer-resizer,
  body.is-chat-only .viewer-focus-toolbar,
  body.is-chat-only .viewer-focus-escape-hint {
    display: none !important;
  }

  body.is-chat-only .chat-panel,
  body.is-chat-only .chat-stack,
  body.is-chat-only .chat-card:not(.is-hidden) {
    min-height: calc(100dvh - 190px);
    height: calc(100dvh - 190px);
  }

  body.is-chat-only .chat-stack {
    display: block;
  }

  body.is-chat-only .chat-card:not(.is-hidden) {
    display: flex;
    flex-direction: column;
  }

  body.is-chat-only .chat-card.is-hidden,
  body.is-chat-only .chat-card[hidden] {
    display: none;
  }

  body.is-chat-only .chat-card iframe,
  body.is-chat-only .twitch-minimalist-panel {
    min-height: 0;
    height: auto;
    flex: 1 1 auto;
  }

  body.is-chat-only .twitch-chat-moderator-tip,
  body.is-chat-only .chzzk-chat-tip,
  body.is-chat-only .soop-chat-tip,
  body.is-chat-only .chat-hint {
    display: none;
  }

  .site-status-detail { right: 18px; }

  .controls-panel,
  .control-group {
    align-items: flex-start;
  }

  .controls-panel {
    display: grid;
    gap: 12px;
  }

  .mobile-chat-visibility-control {
    display: flex;
  }

  .mobile-chat-visibility-toggle,
  .viewer-focus-toggle {
    min-height: 42px;
    padding-inline: 14px;
  }

  .viewer-mode-control,
  .viewer-focus-toggle {
    width: 100%;
  }

  .viewer-focus-toggle {
    justify-content: center;
  }

  body.is-mobile-chat-hidden .chat-panel {
    display: none !important;
  }

  body.is-mobile-chat-hidden .viewer-grid {
    grid-template-columns: 1fr !important;
  }

  .control-group {
    display: grid;
    gap: 8px;
  }

  .viewer-mode-control {
    margin-left: 0;
  }

  .stream-frame,
  .chat-card {
    border-radius: 20px;
  }

  .stream-frame,
  .stream-frame iframe {
    min-height: 320px;
  }

  .chat-card iframe {
    height: 360px;
  }

  .twitch-minimalist-panel {
    height: 360px;
  }

  .chat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
  }

  .chat-card-header h2 {
    font-size: 1.45rem;
    white-space: nowrap;
  }

  .chat-header-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .chat-action {
    width: 30px;
    min-height: 30px;
    justify-content: center;
    padding: 0;
  }

  .chat-action-icon {
    font-size: 0.84rem;
  }

  .chat-action-label {
    display: none;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .match-row {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 8px;
  }

  .match-time {
    justify-self: start;
  }

  .match-detail {
    grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
    gap: 5px;
  }

  .team-line {
    grid-template-columns: 40px minmax(28px, 1fr);
    gap: 5px;
  }

  .team-line.is-away {
    grid-template-columns: minmax(28px, 1fr) 40px;
  }

  .team-logo-shell {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    padding: 3px;
  }

  .team-identity strong {
    font-size: 0.98rem;
  }

  .team-record {
    display: none;
  }

  .match-score,
  .match-versus {
    min-width: 48px;
    padding: 6px 7px;
  }

  .match-status {
    font-size: 0.56rem;
    letter-spacing: 0.08em;
  }

  .match-format {
    font-size: 0.62rem;
  }
}
