:root {
  --bg: #11130f;
  --panel: #191c16;
  --panel-2: #20241d;
  --ink: #f5f2e8;
  --muted: #aaa69a;
  --line: #35382e;
  --accent: #f05a28;
  --accent-2: #55c7a4;
  --warn: #f2bf4a;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0 18px;
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

.brand-link:hover .eyebrow,
.brand-link:focus-visible .eyebrow {
  color: var(--ink);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 5vw, 3.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.stats {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 128px;
  justify-content: flex-end;
  font-size: 1.65rem;
  font-weight: 800;
}

.muted {
  color: var(--muted);
}

.toolbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 1.8fr) repeat(5, minmax(128px, 0.72fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

label span,
.field-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sort-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.sort-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 6px;
  min-width: 0;
}

.multi-filter {
  position: relative;
  min-width: 0;
}

.multi-filter summary {
  display: grid;
  gap: 6px;
  min-width: 0;
  list-style: none;
  cursor: pointer;
}

.multi-filter summary::-webkit-details-marker {
  display: none;
}

.multi-filter summary span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.multi-filter summary strong {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 34px 0 12px;
  color: var(--ink);
  background: #0f110e;
  font-size: 0.9rem;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-filter summary strong::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-65%) rotate(45deg);
}

.multi-filter[open] summary strong {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(85, 199, 164, 0.18);
}

.multi-options {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  display: grid;
  gap: 2px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #0f110e;
  box-shadow: var(--shadow);
}

.multi-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border-radius: 5px;
  padding: 5px 7px;
  cursor: pointer;
}

.multi-option:hover {
  background: var(--panel-2);
}

.multi-option input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--accent-2);
}

.multi-option span {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 550;
  letter-spacing: 0;
  text-transform: none;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #0f110e;
  outline: none;
}

input:focus,
select:focus,
button:focus-visible {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(85, 199, 164, 0.18);
}

.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
  padding: 12px 0 6px;
}

.filter-chip,
.genre-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0 9px;
  color: var(--ink);
  background: #171a14;
  font-size: 0.78rem;
  line-height: 1;
  white-space: nowrap;
}

.filter-chip {
  color: var(--accent-2);
  cursor: pointer;
}

.filter-chip::after {
  content: "×";
  margin-left: 6px;
  color: var(--muted);
}

button.genre-chip {
  appearance: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1;
  min-height: 26px;
  margin: 0;
  padding: 0 9px;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.tag-filter-button:hover {
  border-color: rgba(85, 199, 164, 0.58);
  color: var(--accent-2);
  background: #171f1a;
}

.genre-chip.is-selected {
  border-color: rgba(85, 199, 164, 0.62);
  color: var(--accent-2);
  background: rgba(85, 199, 164, 0.12);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  padding-top: 8px;
}

.game-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  text-align: left;
  background: var(--panel);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.game-card:hover {
  transform: translateY(-2px);
  border-color: rgba(240, 90, 40, 0.62);
  background: var(--panel-2);
}

.game-card:focus-visible {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(85, 199, 164, 0.18);
  outline: none;
}

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 460 / 215;
  background: #0f110e;
}

.poster {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.rating-pill {
  position: absolute;
  right: 8px;
  top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 28px;
  border: 1px solid rgba(245, 242, 232, 0.22);
  border-radius: 999px;
  padding: 0 8px;
  color: #11130f;
  background: var(--warn);
  font-size: 0.78rem;
  font-weight: 900;
}

.rating-excellent {
  color: #07130d;
  background: #42d18f;
}

.rating-good {
  color: #101407;
  background: #b7d96b;
}

.rating-mixed {
  color: #181006;
  background: var(--warn);
}

.rating-weak {
  color: #180909;
  background: #f06a5b;
}

.rating-empty {
  display: none;
}

.card-body {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 142px;
  padding: 12px;
}

.game-title {
  min-height: 42px;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.card-meta {
  min-height: 20px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  min-height: 58px;
}

.empty-state {
  margin: 36px auto;
  max-width: 460px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  background: var(--panel);
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 8, 6, 0.76);
}

.detail-shell {
  position: relative;
  width: min(1180px, 100%);
  max-height: min(880px, calc(100vh - 48px));
  contain: layout paint style;
  isolation: isolate;
}

.detail-panel {
  position: relative;
  width: 100%;
  max-height: inherit;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.close-button {
  z-index: 5;
}

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(17, 19, 15, 0.92);
  cursor: pointer;
}

.detail-close-button {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 5;
}

.sort-direction-button {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  color: var(--muted);
  background: #0f110e;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.sort-direction-button:hover {
  border-color: rgba(85, 199, 164, 0.58);
  color: var(--accent-2);
  background: #171f1a;
}

.sort-icon {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sort-icon-asc {
  display: none;
}

.sort-direction-button.is-asc .sort-icon-desc {
  display: none;
}

.sort-direction-button.is-asc .sort-icon-asc {
  display: block;
}

.close-button::before,
.close-button::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.close-button::before {
  transform: rotate(45deg);
}

.close-button::after {
  transform: rotate(-45deg);
}

.detail-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(420px, 1.35fr);
  gap: 24px;
  align-items: end;
  min-height: 0;
  overflow: hidden;
  padding: 58px 28px 24px;
  border-bottom: 1px solid var(--line);
}

.detail-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(17,19,15,0.12), rgba(17,19,15,0.95));
}

.detail-hero-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-hero.no-media {
  grid-template-columns: 1fr;
  min-height: 280px;
  padding-top: 154px;
}

.detail-title-wrap {
  position: relative;
  z-index: 2;
  max-width: none;
  padding-top: 0;
}

.detail-title {
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-media-stage {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
  min-width: 0;
  contain: layout paint;
}

.detail-main {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 0.75fr);
  gap: 24px;
  padding: 24px 28px 30px;
  contain: layout paint;
}

.detail-section {
  content-visibility: auto;
  contain-intrinsic-size: 260px;
  margin-bottom: 24px;
}

.detail-section h3 {
  margin-bottom: 10px;
  color: var(--accent-2);
  font-size: 0.86rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.description {
  color: #ddd7ca;
  line-height: 1.65;
}

.description.is-collapsed {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.description-toggle {
  margin-top: 8px;
}

.screenshot-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 10px;
  contain: layout paint;
}

.preview-button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.screenshot-strip img,
.preview-button img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f110e;
}

.detail-video-player .video-frame {
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
}

.detail-panel.is-scrolling .detail-video-player .video-frame {
  box-shadow: none;
}

.image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 56px 20px 24px;
  background: rgba(7, 8, 6, 0.88);
}

.image-preview-overlay img {
  width: min(1280px, 100%);
  max-height: calc(100vh - 96px);
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070806;
  box-shadow: var(--shadow);
}

.preview-close-button {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 42;
}

.preview-nav-button,
.detail-nav-button {
  position: fixed;
  top: 50%;
  width: 46px;
  height: 46px;
  transform: translateY(-50%);
}

.preview-nav-button {
  z-index: 42;
}

.detail-nav-button {
  z-index: 23;
}

.preview-prev-button,
.detail-prev-button {
  left: 18px;
}

.preview-next-button,
.detail-next-button {
  right: 18px;
}

.preview-nav-button::before,
.detail-nav-button::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
}

.preview-prev-button::before,
.detail-prev-button::before {
  transform: translate(-35%, -50%) rotate(135deg);
}

.preview-next-button::before,
.detail-next-button::before {
  transform: translate(-65%, -50%) rotate(-45deg);
}

.side-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.side-list div {
  display: grid;
  gap: 3px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.side-list dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

.side-list dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel);
  text-decoration: none;
}

.tiny-button {
  min-height: 26px;
  padding: 0 8px;
  font-size: 0.76rem;
  white-space: nowrap;
}

.text-button:hover {
  border-color: var(--accent);
}

.video-player {
  position: relative;
  contain: layout paint;
}

.video-speed-control {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.video-speed-control select {
  width: 66px;
  min-height: 30px;
  border-color: rgba(245, 242, 232, 0.18);
  padding: 0 7px;
  color: var(--ink);
  background: rgba(15, 17, 14, 0.94);
  font-size: 0.78rem;
  font-weight: 750;
}

.video-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070806;
}

.compact-toolbar {
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(132px, 180px)) minmax(130px, 150px);
}

.matches-shell {
  width: min(1680px, calc(100vw - 32px));
}

.matches-topbar {
  align-items: center;
}

.match-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.match-review-summary {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.summary-card {
  display: grid;
  gap: 5px;
  min-height: 100px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.summary-card:hover,
.summary-card.is-active {
  transform: translateY(-1px);
  border-color: rgba(85, 199, 164, 0.58);
  background: var(--panel-2);
}

.summary-card span,
.summary-card small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.summary-card strong {
  font-size: 1.8rem;
  line-height: 1;
}

.summary-card--danger strong {
  color: #ff8068;
}

.summary-card--warn strong {
  color: var(--warn);
}

.summary-card--info strong {
  color: #7ec5ff;
}

.summary-card--manual strong {
  color: #d9a6ff;
}

.summary-card--ok strong {
  color: var(--accent-2);
}

.summary-card--attention strong {
  color: var(--accent);
}

.match-toolbar {
  margin-bottom: 14px;
}

.match-local-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #0f110e;
  white-space: nowrap;
}

.match-local-state strong {
  color: var(--accent-2);
  font-size: 0.88rem;
  line-height: 1;
}

.match-local-state span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.match-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 14px;
  align-items: start;
}

.match-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.match-table-head div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.match-table-head strong {
  font-size: 1rem;
}

.match-table-head span {
  color: var(--muted);
  font-size: 0.86rem;
}

.match-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.match-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.match-table th,
.match-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.match-table th {
  color: var(--accent-2);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.match-table td {
  color: var(--ink);
}

.match-table small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.match-row {
  border-left: 4px solid transparent;
  cursor: pointer;
  transition: background 120ms ease;
}

.match-row:hover,
.match-row.is-selected {
  background: rgba(255, 255, 255, 0.035);
}

.match-row--local {
  background: rgba(85, 199, 164, 0.055);
  box-shadow: inset 3px 0 0 rgba(85, 199, 164, 0.72);
}

.match-row--local:hover,
.match-row--local.is-selected {
  background: rgba(85, 199, 164, 0.09);
}

.match-row--danger {
  border-left-color: #ff8068;
}

.match-row--warn {
  border-left-color: var(--warn);
}

.match-row--info {
  border-left-color: #7ec5ff;
}

.match-row--manual {
  border-left-color: #d9a6ff;
}

.match-row--ok {
  border-left-color: var(--accent-2);
}

.match-row--muted {
  border-left-color: var(--muted);
}

.status-pill,
.reason-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.status-pill--danger {
  border-color: rgba(255, 128, 104, 0.56);
  color: #ffb1a3;
  background: rgba(255, 128, 104, 0.1);
}

.status-pill--warn {
  border-color: rgba(242, 191, 74, 0.56);
  color: #f7d98d;
  background: rgba(242, 191, 74, 0.1);
}

.status-pill--info {
  border-color: rgba(126, 197, 255, 0.5);
  color: #b8dcff;
  background: rgba(126, 197, 255, 0.1);
}

.status-pill--manual {
  border-color: rgba(217, 166, 255, 0.52);
  color: #e7c8ff;
  background: rgba(217, 166, 255, 0.1);
}

.status-pill--ok {
  border-color: rgba(85, 199, 164, 0.54);
  color: #a6e9d5;
  background: rgba(85, 199, 164, 0.1);
}

.status-pill--local {
  display: flex;
  width: fit-content;
  margin-top: 5px;
  border-color: rgba(85, 199, 164, 0.64);
  color: #c9f4e8;
  background: rgba(85, 199, 164, 0.16);
}

.status-pill--muted {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.reason-list {
  max-width: 300px;
}

.reason-chip {
  margin: 0 4px 4px 0;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.match-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.match-links a {
  color: var(--accent-2);
}

.match-empty-state {
  margin: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.match-drawer {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.match-drawer h2 {
  margin-bottom: 0;
  font-size: 1.3rem;
  line-height: 1.08;
}

.match-drawer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.match-drawer-meta span:not(.status-pill) {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.match-form {
  display: grid;
  gap: 10px;
}

.match-form textarea {
  width: 100%;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #0f110e;
  resize: vertical;
  outline: none;
}

.match-form textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(85, 199, 164, 0.18);
}

.match-drawer-actions .text-button.is-saved {
  border-color: rgba(85, 199, 164, 0.58);
  color: #c9f4e8;
  background: rgba(85, 199, 164, 0.12);
}

.drawer-links,
.match-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.override-preview {
  max-height: 260px;
  overflow: auto;
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: #d9f3e9;
  background: #0b0d0a;
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1260px) {
  .match-review-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .match-workspace {
    grid-template-columns: 1fr;
  }

  .match-drawer {
    position: static;
    max-height: none;
  }
}

@media (max-width: 980px) {
  .toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .detail-main {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .detail-media-stage {
    order: 1;
  }

  .detail-title-wrap {
    order: 2;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1480px);
    padding-top: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats {
    justify-content: flex-start;
  }

  .toolbar {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .match-review-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .matches-topbar,
  .match-table-head,
  .match-table-head div {
    align-items: flex-start;
    flex-direction: column;
  }

  .match-actions {
    justify-content: flex-start;
  }

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

  .detail-overlay {
    padding: 0;
  }

  .detail-shell {
    width: 100%;
    max-height: 100vh;
  }

  .detail-panel {
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
  }

  .detail-hero {
    padding: 54px 18px 18px;
    gap: 16px;
  }

  .detail-main {
    padding: 20px 18px 26px;
  }

  .preview-nav-button,
  .detail-nav-button {
    width: 40px;
    height: 40px;
  }

  .preview-prev-button,
  .detail-prev-button {
    left: 8px;
  }

  .preview-next-button,
  .detail-next-button {
    right: 8px;
  }
}
