.tcg-import-card { max-width: 760px; margin: 0 auto 1.15rem; }
.tcg-import-card.has-manual-results { width: 100%; max-width: none; }
.tcg-work-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.15rem; align-items: start; }
.tcg-link-list { display: grid; gap: 0.65rem; margin: 0; padding: 0; list-style: none; }
.tcg-game-settings { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 0.85rem; margin-top: 1rem; }
.tcg-link-list a { display: grid; gap: 0.25rem; padding: 0.85rem; border: 1px solid var(--border); border-radius: 0.65rem; color: var(--text); text-decoration: none; }
.tcg-link-list a:hover, .tcg-link-list a:focus-visible { border-color: var(--accent-strong); background: var(--panel-raised); }
.tcg-link-list + .tcg-link-list { margin-top: 0.65rem; }
.tcg-event-card.has-logo { grid-template-columns: minmax(0, 1fr) 4rem; column-gap: 0.85rem; align-items: center; }
.tcg-event-card-details { display: grid; min-width: 0; gap: 0.25rem; color: var(--text); font-size: 1rem; }
.tcg-event-card-logo { display: block; width: 4rem; height: 4rem; object-fit: contain; justify-self: end; }
.tcg-standings-access { max-width: 32rem; }
.tcg-standings-access p { margin-top: 0; }
.tcg-results-table .tcg-empty-results { white-space: normal; }
.tcg-review-table th label { display: block; margin-top: 0.65rem; font-size: 0.8rem; white-space: normal; }
.tcg-review-table th select { width: 100%; min-width: 0; }
.tcg-link-list span, .field-hint { color: var(--muted); font-size: 0.88rem; }
.tcg-section { margin-bottom: 1.15rem; }
.tcg-event-rules > summary { cursor: pointer; font-weight: 700; }
.tcg-event-rules > p { margin: 0.75rem 0; color: var(--muted); }
.tcg-rule-values { max-width: 46rem; margin: 1rem 0 0; }
.tcg-rule-values > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(4ch, max-content); align-items: baseline; gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--border); }
.tcg-rule-values > div:first-child { border-top: 1px solid var(--border); }
.tcg-rule-values dt { min-width: 0; overflow-wrap: anywhere; color: var(--muted); }
.tcg-rule-values dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.eyebrow { margin: 0 0 0.45rem; color: var(--accent-strong); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.validation { padding: 0.75rem 0.85rem; border: 1px solid var(--border); border-radius: 0.55rem; }
.validation-error { border-color: var(--danger); background: var(--danger-panel); color: #ffc8c8; }
.validation-warning { border-color: #a58a54; background: rgb(91 65 45 / 45%); color: #efd397; }
.tcg-player-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.8rem; }
.player-picker { display: grid; gap: 0.35rem; min-width: 0; align-content: start; }
.player-picker :is(input, select) { min-width: 0; width: 100%; }
.player-search-results { display: grid; gap: 0.25rem; }
.player-search-results button { width: 100%; justify-content: start; text-align: start; overflow-wrap: anywhere; }
.player-search-results:empty, .player-picker .field-hint:empty, .selected-player:empty { display: none; }
.tcg-player-grid > [hidden] { display: none; }
.tcg-player-card { min-width: 0; padding: 0.9rem; border: 1px solid rgb(199 185 174 / 18%); border-radius: 0.65rem; background: rgb(33 26 24 / 32%); }
.tcg-player-card { overflow-wrap: anywhere; }
.tcg-player-card h3 { margin-top: 0; }
.tcg-player-card form { grid-template-columns: minmax(0, 1fr); }
.mapping-ok { color: var(--success); }
.tcg-settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
.tcg-results-table-wrap { min-width: 0; max-width: 100%; overflow-x: auto; }
.tcg-results-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tcg-results-table th, .tcg-results-table td { padding: 0.7rem 0.55rem; border-bottom: 1px solid rgb(199 185 174 / 16%); text-align: left; white-space: nowrap; }
.tcg-results-table thead th { color: var(--muted); font-size: 0.8rem; }
.tcg-results-table input[type="checkbox"] { width: 1.2rem; min-height: 1.2rem; }
.tcg-results-table input[type="number"] { min-width: 6rem; }
.tcg-review-table { min-width: 68rem; table-layout: fixed; }
[data-tcg-manual-results] { min-width: 48rem; }
[data-tcg-manual-results] th:first-child { width: 16rem; }
[data-tcg-manual-results] th:nth-child(2) { width: 24rem; }
[data-tcg-manual-results] th:last-child { width: 8rem; }
.tcg-manual-editor { min-width: 68rem; }
.tcg-manual-editor th:nth-child(3) { width: 20rem; }
.tcg-manual-editor td { white-space: normal; vertical-align: top; }
.tcg-manual-editor td > label { display: grid; gap: 0.35rem; margin-bottom: 0.75rem; }
.tcg-manual-editor .field-hint { display: block; margin-bottom: 0.5rem; }
@media (max-width: 900px) {
	.tcg-manual-editor { display: block; min-width: 0; table-layout: auto; }
	.tcg-manual-editor thead { display: none; }
	.tcg-manual-editor tbody { display: grid; gap: 1rem; }
	.tcg-manual-editor tr { display: grid; min-width: 0; padding: 0.75rem; border: 1px solid var(--border); border-radius: 0.65rem; }
	.tcg-manual-editor td { display: block; min-width: 0; padding: 0.4rem 0; border: 0; }
	.tcg-manual-editor .tcg-result-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tcg-manual-editor :is(input, select) { min-width: 0; max-width: 100%; width: 100%; }
}
.tcg-review-table .tcg-review-player-column { width: 9rem; }
.tcg-review-table .tcg-review-result-column { width: 22rem; }
.tcg-review-table .tcg-review-notes-column { width: 23rem; }
.tcg-review-table .tcg-review-shard-column { width: 6rem; }
.tcg-review-table .tcg-review-packs-column { width: 8rem; }
.tcg-result-inputs { display: grid; grid-template-columns: repeat(4, minmax(4.5rem, 1fr)); gap: 0.45rem; }
.tcg-result-inputs label { color: var(--muted); font-size: 0.72rem; }
.tcg-result-inputs input[type="number"] { min-width: 4.5rem; }
.tcg-total-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.tcg-total-grid > div { display: grid; gap: 0.25rem; padding: 0.9rem; border: 1px solid var(--border); border-radius: 0.6rem; background: rgb(33 26 24 / 35%); }
.tcg-total-grid span { color: var(--muted); font-size: 0.82rem; }
.tcg-total-grid strong { color: var(--accent-strong); font-size: 1.3rem; }
.tcg-confirm-card { border-color: var(--accent); }
.standings-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.standings-artwork-page { isolation: isolate; }
.standings-page-background { position: fixed; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: 0.22; pointer-events: none; }
.standings-artwork-page .public-standings > .card { background: rgb(53 40 35 / 82%); }
.standings-branding { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem; margin-bottom: 1.25rem; }
.standings-game-logo { display: block; width: auto; height: auto; max-width: min(100%, 15rem); max-height: 5rem; object-fit: contain; }
.standings-otter-logo { display: block; width: min(100%, 15rem); height: auto; margin-left: auto; }
.standings-game-logo.logo-white-glow, .tcg-event-card-logo.logo-white-glow { filter: drop-shadow(0 0 2px white) drop-shadow(0 0 5px white); }
.league-grid > .card { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.league-grid h2, .league-grid p { overflow-wrap: anywhere; }
.league-grid .button { margin-top: auto; }
.prize-progress { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem 2rem; align-items: center; margin-bottom: 1.15rem; }
.prize-progress h2, .prize-progress p { margin-bottom: 0.25rem; }
.prize-progress p { color: var(--muted); }
.prize-progress > strong { color: var(--accent-strong); font-size: clamp(1.6rem, 4vw, 2.5rem); }
.prize-progress > strong span { color: var(--muted); font-size: 0.9rem; }
.prize-progress progress { grid-column: 1 / -1; width: 100%; height: 0.9rem; accent-color: var(--accent-strong); }
.public-standings-table th:nth-child(2), .public-standings-table td:nth-child(2) { white-space: nowrap; overflow-wrap: normal; }
.public-standings-table :is(th, td):not(:nth-child(2), .tcg-empty-results),
.tcg-event-results-table :is(th, td):not(:nth-child(2), [colspan]),
.tcg-results-table .tcg-numeric,
.table-scroll .tcg-numeric { font-family: Lekton, Consolas, monospace; text-align: right; }
.public-standings-table .standings-achievement { color: var(--accent-strong); background: rgb(178 130 112 / 9%); font-weight: 800; }
.standings-revision { color: var(--muted); font-family: Lekton, Consolas, monospace; font-size: 0.76rem; text-align: right; }
@media (max-width: 760px) {
	.tcg-work-list, .tcg-settings-grid, .tcg-total-grid, .prize-progress { grid-template-columns: 1fr; }
	.standings-heading { display: grid; }
}

@media (max-width: 420px) {
	.tcg-event-card.has-logo { grid-template-columns: minmax(0, 1fr) 3rem; }
	.tcg-event-card-logo { width: 3rem; height: 3rem; }
}

.tcg-event-date-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 0.75rem;
}
.tcg-event-date-controls input {
	min-width: 0;
	flex: 1 1 10rem;
}
.tcg-event-date-controls [hidden] { display: none; }
.tcg-event-date-controls button {
	flex: 0 0 auto;
}

.tcg-results-page { display: grid; gap: 1.15rem; }
.tcg-results-page > .page-heading, .tcg-results-page > .tcg-section, .tcg-results-page > .tcg-import-card { margin-bottom: 0; }


/* Wide staff review tables use the available screen, retaining local scrolling. */
.page.tcg-review-page { width: calc(100% - clamp(1rem, 2vw, 3rem)); max-width: none; }
.tcg-review-player-name { display: block; white-space: normal; overflow-wrap: anywhere; }
.tcg-review-player-handle { display: block; white-space: normal; overflow-wrap: anywhere; }

.league-page { margin-block: 1.25rem; }
.league-page > .card-stack { margin-block: 0; }
.league-heading { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr) auto; align-items: center; gap: 1rem; }
.league-home-link { display: block; border-radius: 50%; }
.league-home-link img { display: block; width: 100%; height: auto; }
.league-heading-copy { min-width: 0; }
.league-heading-copy .eyebrow { color: var(--muted); text-decoration: none; }
.league-heading-copy h1 { margin: 0.25rem 0; font-size: clamp(1.65rem, 3vw, 2.4rem); line-height: 1.15; overflow-wrap: anywhere; }
.league-heading-copy p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.league-heading .league-heading-logo { width: 12rem; height: 4rem; object-fit: contain; }
.league-heading-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.league-heading-actions:empty { display: none; }
.league-heading-actions p { margin: 0; }
@media (max-width: 600px) {
	.league-heading { grid-template-columns: 2.75rem minmax(0, 1fr); gap: 0.75rem; }
	.league-heading .league-heading-logo { grid-column: 2; width: min(100%, 10rem); height: 3rem; }
}
.league-games { gap: 1rem; margin: 0; }
.league-game { min-width: 0; padding: 1.25rem; gap: 0.65rem; isolation: isolate; }
.league-game-background { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: 0; pointer-events: none; transition: opacity 240ms ease; }
.league-game:focus-within > .league-game-background { opacity: 0.22; }
@media (hover: hover) { .league-game:hover > .league-game-background { opacity: 0.22; } }
@media (prefers-reduced-motion: reduce) { .league-game-background { transition: none; } }
.league-game h2, .league-game .league-prize { margin: 0; }
.league-game .standings-game-logo { max-height: 4rem; }
.league-game h2, .league-game p { overflow-wrap: anywhere; }
.league-game h2 a { color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 0.2em; }
.league-game h2 a:hover { color: var(--accent-strong); }
.league-highlights { display: grid; width: 100%; min-width: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 0.65rem; margin: 0.25rem 0; }
.league-highlight { display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.75rem; border: 1px solid rgb(216 181 112 / 28%); border-radius: 0.8rem; background: linear-gradient(125deg, rgb(216 181 112 / 12%), rgb(216 181 112 / 3%)); }
.league-highlight > div { min-width: 0; }
.league-highlight h3 { margin: 0 0 0.45rem; color: #e5c68e; font-size: 0.75rem; letter-spacing: 0.07em; text-transform: uppercase; }
.league-highlight ul { display: grid; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.league-highlight li { font-size: 1.2rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.league-highlight p { margin: 0.4rem 0 0; color: var(--muted); font-size: 0.8rem; }
.league-highlight-icon { display: grid; place-items: center; flex: 0 0 2.4rem; height: 2.4rem; border-radius: 50%; color: #e5c68e; background: rgb(216 181 112 / 12%); font-size: 1.5rem; line-height: 1; }
.league-highlight-winner { border-color: rgb(123 196 187 / 25%); background: linear-gradient(125deg, rgb(123 196 187 / 10%), rgb(123 196 187 / 2%)); }
.league-highlight-winner h3, .league-highlight-winner .league-highlight-icon { color: #9fd5cb; }
.league-highlight-winner .league-highlight-icon { background: rgb(123 196 187 / 12%); }
@media (max-width: 600px) { .league-highlights { grid-template-columns: minmax(0, 1fr); } }
.tcg-player-matches {
	display: grid;
	gap: .75rem;
	list-style: none;
	padding: 0;
}

.tcg-player-matches button {
	max-width: 100%;
	white-space: normal;
	overflow-wrap: anywhere;
}

/* Keep the editable ISO date visible; the calendar is a progressive enhancement. */
.tcg-date-calendar {
	width: min(26rem, calc(100vw - 2rem));
	max-height: calc(100dvh - 2rem);
	padding: 1rem;
	border: 1px solid var(--border);
	border-radius: 0.75rem;
	background: var(--panel);
	color: var(--text);
}
.tcg-manual-fields { display: grid; gap: 0.9rem; border: 0; margin: 0; padding: 0; min-width: 0; }
.tcg-date-calendar::backdrop { background: rgb(0 0 0 / 55%); }
.tcg-date-calendar h2 { margin: 0 0 1rem; }
.tcg-calendar-navigation { display: grid; grid-template-columns: auto minmax(0, 1fr) 5.5rem auto; align-items: end; gap: 0.5rem; }
.tcg-calendar-navigation label { min-width: 0; }
.tcg-calendar-navigation button { padding-inline: 0.7rem; }
.tcg-calendar-navigation :is(input, select) { min-width: 0; padding-inline: 0.4rem; }
.tcg-calendar-heading { margin: 1rem 0 0.25rem; font-weight: 700; }
.tcg-calendar-help { font-size: 0.8rem; color: var(--muted); }
.tcg-date-calendar table { width: 100%; table-layout: fixed; margin-block: 0.75rem; }
.tcg-date-calendar :is(th, td) { padding: 0.1rem; text-align: center; border: 0; }
.tcg-date-calendar abbr { text-decoration: none; }
.tcg-date-calendar td button { width: 100%; min-height: 2.5rem; padding: 0.25rem; }
.tcg-date-calendar [aria-selected="true"] button { background: var(--accent-strong); color: var(--page); }
.tcg-date-calendar [aria-current="date"] { text-decoration: underline; text-underline-offset: 0.2em; }
.tcg-date-calendar button:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 1px; }

.game-hub:has([data-game-view="stats"]),
[data-game-view="stats"],
[data-game-view="stats"] > .card {
	grid-template-columns: minmax(0, 1fr);
}

.event-format-form select { min-width: 9rem; }
[data-event-format-detail] { max-width: 22rem; }
[data-event-format-detail] form { gap: 0.35rem; margin-block: 0.55rem 0; }
[data-format-status]:not(:empty) { display: block; margin-top: 0.25rem; font-size: 0.85rem; }

.event-type-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; border: 0; padding: 0; }
.event-type-filters legend { margin-bottom: 0.35rem; padding: 0; }
.event-type-filters .toggle-row { max-width: 100%; overflow-wrap: anywhere; }
