:root {
  color-scheme: dark;
  --background: #121019;
  --panel: #1b1825;
  --panel-hover: #252031;
  --edge: #373043;
  --text: #f6f2fb;
  --muted: #b7afc5;
  --lime: #dcfb89;
  --lime-ink: #242c15;
  --violet: #bfadff;
  --danger: #ff9dba;
  --ticker-positive: #a6e6a2;
  --ticker-negative: #ff9a94;
  --primary-fill: #dcfb89;
  --primary-hover: #efffb4;
  --placeholder: #9a90a9;
  --accent-edge: #4f426b;
  --board-bg: #1c172a;
  --board-glow: #33244f;
  --progress-track: #342b44;
  --tile-hover-edge: #8775ad;
  --tile-icon-bg: #352a49;
  --complete-bg: #22291c;
  --complete-hover: #2b3622;
  --complete-edge: #64774e;
  --confirmed-bg: #1e2519;
  --confirmed-edge: #485c37;
  --confirmed-frame: #394a2c;
  --confirmed-tile: #141a11;
  --confirmed-accent: #abd07d;
  --complete-caption: #c4d7ad;
  --complete-icon-bg: #dcfb89;
  --complete-icon-text: #242c15;
  --notice-bg: #2b213d;
  --dialog-edge: #625278;
  --backdrop: #0c0914cf;
  --radius: 16px;
  font: 16px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --background: #f5f2fa;
  --panel: #ffffff;
  --panel-hover: #eee7f7;
  --edge: #d8cde4;
  --text: #24192f;
  --muted: #61546e;
  --lime: #3a5612;
  --violet: #6347a3;
  --danger: #8d244a;
  --ticker-positive: #2b632e;
  --ticker-negative: #a22629;
  --primary-fill: #d8f293;
  --primary-hover: #c5e47a;
  --placeholder: #736780;
  --accent-edge: #c9b8dd;
  --board-bg: #fbf8ff;
  --board-glow: #eadffd;
  --progress-track: #e0d5ed;
  --tile-hover-edge: #967bbd;
  --tile-icon-bg: #ede6f8;
  --complete-bg: #f0f8df;
  --complete-hover: #e8f3d1;
  --complete-edge: #a7b793;
  --confirmed-bg: #e7eddc;
  --confirmed-edge: #718654;
  --confirmed-frame: #5d713f;
  --confirmed-tile: #dce5cc;
  --confirmed-accent: #395921;
  --complete-caption: #4c5d38;
  --complete-icon-bg: #3a5612;
  --complete-icon-text: #ffffff;
  --notice-bg: #f3edff;
  --dialog-edge: #ae99c6;
  --backdrop: #25153991;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; background: var(--background); color: var(--text); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
}
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
.container { width: min(100% - 3rem, 1152px); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--edge); }
.header-inner { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .45rem; font-size: .88rem; font-weight: 800; letter-spacing: .085em; white-space: nowrap; }
.brand > span:last-child { color: var(--muted); }
.brand-mark { width: 22px; height: 22px; display: inline-block; margin-right: .35rem; border-radius: 4px;
  background:
    linear-gradient(var(--lime), var(--lime)) 0 0/9px 9px,
    linear-gradient(var(--violet), var(--violet)) 100% 0/9px 9px,
    linear-gradient(var(--violet), var(--violet)) 0 100%/9px 9px,
    linear-gradient(var(--violet), var(--violet)) 100% 100%/9px 9px;
  background-repeat: no-repeat;
}
.header-actions, .account { display: flex; align-items: center; min-width: 0; gap: .65rem; }
.theme-toggle { flex: 0 0 auto; gap: .45rem; }
.theme-toggle > span:first-child { font-size: 1.15rem; line-height: 1; }
.account-name { color: var(--muted); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 14rem; }
main { padding-block: 44px 56px; }
main:focus { outline: none; }
.loading { margin-bottom: 1rem; color: var(--muted); }
.muted { color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .5rem .85rem;
  border: 1px solid var(--edge); border-radius: 10px; background: var(--panel); color: var(--text);
  line-height: 1.27; font-size: .9rem; font-weight: 700; text-align: center;
}
.button:hover:not(:disabled) { background: var(--panel-hover); border-color: var(--violet); }
.button.primary { background: var(--primary-fill); color: var(--lime-ink); border-color: var(--primary-fill); padding-inline: 1.1rem; }
.button.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.button.quiet { background: transparent; }
.button.danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.button.danger:hover:not(:disabled) { border-color: var(--danger); }
.account .button { flex: 0 0 auto; }

.login-layout { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; margin-bottom: 18px; }
.login-hero { position: relative; isolation: isolate; display: flex; align-items: center; overflow: hidden; min-height: 406px;
  padding: clamp(1.7rem, 5vw, 4.2rem); border-radius: var(--radius); border: 1px solid #4f426b;
  background: radial-gradient(ellipse at 100% 0, #47347a, transparent 78%), #211932;
}
.hero-copy { position: relative; z-index: 1; }
.login-hero h1 { color: #f8f2ff; font-size: clamp(2.9rem, 6.7vw, 6rem); line-height: .91; letter-spacing: -.075em;
  font-weight: 850; white-space: nowrap;
}
.login-hero h1 span { color: #dcfb89; }
.login-hero p { color: #e0d4f1; margin-top: 1.4rem; font-size: clamp(1rem, 2vw, 1.15rem); }
.hero-grid { position: absolute; z-index: 0; right: -98px; bottom: -58px; width: 365px; display: grid;
  grid-template-columns: repeat(5, 1fr); gap: 8px; transform: rotate(-14deg); opacity: .63;
  mask-image: linear-gradient(120deg, transparent 5%, #000 62%);
}
.hero-grid span { aspect-ratio: 1; border: 1px solid #937abd; border-radius: 9px; background: #160f2877; }
.hero-grid span:nth-child(6n), .hero-grid span:nth-child(4), .hero-grid span:nth-child(21) { background: #b8a4f955; }
.hero-grid span:nth-child(9), .hero-grid span:nth-child(17) { background: #defc8566; border-color: #dafa8c; }
.login-panel { border: 1px solid var(--edge); border-radius: var(--radius); background: var(--panel);
  padding: clamp(1.2rem, 4vw, 2.75rem); align-content: center;
}
.auth-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px;
  margin-bottom: 1rem; border: 1px solid var(--edge); border-radius: 10px; background: var(--background);
}
.auth-switch button { min-height: 44px; padding: .4rem; border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: var(--muted); font-size: .9rem; font-weight: 700;
}
.auth-switch button:hover { color: var(--text); }
.auth-switch button[aria-pressed="true"] { color: var(--lime); background: var(--panel-hover); border-color: var(--edge); }
.login-panel .form { margin-top: 1.4rem; }
.form { display: grid; gap: .9rem; min-width: 0; }
.form .primary, .form .danger { width: 100%; }
.form-field { display: grid; gap: .4rem; min-width: 0; font-size: .93rem; font-weight: 650; }
.form-field input, .form-field textarea, .form-field select { min-width: 0; width: 100%; border: 1px solid var(--edge); border-radius: 9px;
  padding: .7rem .8rem; background: var(--background); color: var(--text); font-size: 1rem;
}
.form-field input::placeholder { color: var(--placeholder); }
.form-field textarea { resize: vertical; }
.form-field select { appearance: none; padding-right: 2.2rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.2rem) center, calc(100% - .9rem) center;
  background-size: .3rem .3rem; background-repeat: no-repeat;
}
.player-fields { display: grid; gap: .65rem; min-inline-size: 0; margin: 0;
  padding: .65rem; border: 1px solid var(--edge); border-radius: 9px;
}
.player-fields legend { color: var(--muted); padding-inline: .25rem; font-size: .875rem; }
.player-names { overflow-wrap: anywhere; }
.settings-form { max-width: 24rem; padding: 1rem; }
.checkbox-field { display: flex; align-items: center; gap: .55rem; min-height: 44px; font-size: .93rem; }
.checkbox-field input { width: 18px; height: 18px; margin: 0; accent-color: var(--violet); }
.form-field input[type="file"] { padding: .45rem; text-overflow: ellipsis; }
input::file-selector-button { padding: .5rem .6rem; border: 1px solid var(--edge); border-radius: 6px;
  background: var(--panel-hover); color: var(--text); margin-right: .55rem; cursor: pointer;
}
.field-hint, .error, .upload-message { font-size: .875rem; overflow-wrap: anywhere; }
.field-hint, .upload-message { color: var(--muted); }
.error { color: var(--danger); font-weight: 650; }
.error:empty, .upload-message:empty { display: none; }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 24px; }
.page-heading h1 { font-size: clamp(2rem, 6vw, 3.65rem); line-height: 1.05; letter-spacing: -.065em; overflow-wrap: anywhere; }
.page-heading p { margin-top: .35rem; overflow-wrap: anywhere; }
.board-heading { padding: clamp(1rem, 4vw, 2rem); border: 1px solid var(--accent-edge); border-radius: var(--radius);
  background: radial-gradient(ellipse at 0 0, var(--board-glow), transparent 68%), var(--board-bg);
}
.board-progress { width: min(36%, 18rem); }
.progress-label { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; margin-bottom: .35rem;
  color: var(--muted); font-size: .875rem;
}
.progress-label strong { color: var(--lime); font-size: 1.35rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
progress { display: block; width: 100%; height: 8px; overflow: hidden; border: 0; border-radius: 99px; appearance: none;
  background: var(--progress-track); color: var(--lime); accent-color: var(--lime);
}
progress::-webkit-progress-bar { background: var(--progress-track); }
progress::-webkit-progress-value { background: var(--lime); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--lime); border-radius: 99px; }
progress:not([value]) { appearance: auto; }
.board-toolbar { display: flex; align-items: start; gap: .65rem; margin-bottom: 14px; }
.board-toolbar > .button { margin-left: auto; }
.rules { min-width: 0; background: var(--panel); border: 1px solid var(--edge); border-radius: 10px; }
.board-toolbar .rules { flex: 1; }
.rules summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 42px; padding: .5rem .9rem;
  cursor: pointer; font-size: .9rem; font-weight: 700; list-style: none;
}
.rules summary::-webkit-details-marker { display: none; }
.rules summary::after { content: ''; width: 7px; height: 7px; margin-right: 3px; margin-bottom: 4px;
  border-right: 2px solid var(--violet); border-bottom: 2px solid var(--violet); transform: rotate(45deg);
}
.rules[open] summary::after { transform: rotate(225deg); margin-bottom: 0; }
.rules ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: .4rem 1.25rem;
  padding: .1rem 1rem .5rem 2rem; margin: .3rem 0 .65rem; color: var(--muted);
}
.bingo-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.bingo-tile { display: flex; flex-direction: column; gap: .5rem; min-height: 143px; min-width: 0; padding: .8rem;
  text-align: left; border: 1px solid var(--edge); border-radius: 12px; background: var(--panel); color: var(--text);
}
.bingo-tile:hover { border-color: var(--tile-hover-edge); background: var(--panel-hover); }
.bingo-tile.inactive:hover { border-color: var(--edge); background: var(--panel); }
.bingo-tile.completed { background: var(--complete-bg); border-color: var(--complete-edge); }
.bingo-tile.completed:hover { background: var(--complete-hover); border-color: var(--lime); }
.bingo-tile.completed.confirmed { background: var(--confirmed-tile); border-color: var(--confirmed-frame); }
.bingo-tile.completed.confirmed:hover { border-color: var(--confirmed-edge); }
.tile-status { display: inline-flex; align-items: center; gap: .25rem; flex-shrink: 0; }
.tile-star, .review-label { color: var(--confirmed-accent); font-weight: 750; }
.tile-top { display: flex; align-items: center; justify-content: space-between; }
.tile-number { font: 700 .875rem/1.3 ui-monospace, Consolas, monospace; color: var(--violet); letter-spacing: .04em; }
.tile-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  background: var(--tile-icon-bg); color: var(--violet); font-size: 1.15rem; font-weight: 700; line-height: 1;
}
.completed .tile-number { color: var(--lime); }
.completed .tile-icon { background: var(--complete-icon-bg); color: var(--complete-icon-text); }
.tile-title { color: var(--text); font-weight: 750; line-height: 1.24; overflow-wrap: anywhere; }
.tile-preview { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 125px;
  overflow: hidden; border-radius: 7px; background: var(--background);
}
.tile-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.preview-play { position: absolute; left: .4rem; bottom: .4rem; display: grid; place-items: center;
  width: 29px; height: 29px; border-radius: 50%; background: #121019db; color: white;
}
.preview-play::after { content: ''; margin-left: 2px; border-style: solid; border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent currentColor;
}
.preview-fallback { display: grid; place-items: center; height: 100%; padding: .25rem; color: var(--muted);
  font-size: .8rem; text-align: center;
}
.tile-foot { margin-top: auto; color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.completed .tile-foot { color: var(--complete-caption); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: .2rem;
  padding: clamp(.65rem, 2.7vw, 1.25rem); min-height: 100px; background: var(--panel);
  border: 1px solid var(--edge); border-radius: 12px; overflow-wrap: anywhere;
}
.stat strong { color: var(--lime); font-size: clamp(1.45rem, 4vw, 2.3rem); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); line-height: 1.25; font-size: .875rem; }
.admin-panel { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); overflow: hidden; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 13px 16px; border-bottom: 1px solid var(--edge); }
.section-header h2 { font-size: 1.2rem; }
.team-list { margin: 0; padding: 0; list-style: none; }
.ranking-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); align-items: center;
  gap: .75rem 1.2rem; padding: 12px 16px; color: var(--text); text-decoration: none;
}
.ranking-item + .ranking-item { border-top: 1px solid var(--edge); }
.ranking-row:hover, .ranking-row:focus-visible { background: var(--panel-hover); }
.ranking-row.completed { background: var(--complete-bg); box-shadow: inset 3px 0 0 var(--lime); }
.ranking-row.completed:hover, .ranking-row.completed:focus-visible { background: var(--complete-hover); }
.ranking-row:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
.ranking-note { padding: .75rem 1rem; color: var(--muted); font-size: .875rem; border-bottom: 1px solid var(--edge); }
.team-name { min-width: 0; font-weight: 750; overflow-wrap: anywhere; }
.team-name span { display: block; font-weight: 400; font-size: .875rem; }
.team-name .ranking-players { display: inline; color: var(--muted); }
.team-name .rank-label { display: table; margin-top: .25rem; border-radius: 6px; padding: .1rem .4rem;
  background: var(--complete-bg); color: var(--lime); font-weight: 750;
}
.team-progress { display: flex; align-items: center; gap: .75rem; min-width: 0; font-size: .875rem; color: var(--muted); white-space: nowrap; }
.team-time { display: grid; gap: .08rem; color: var(--muted); font-size: .875rem; line-height: 1.35; }
.team-time time { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.completion-label { margin-top: .35rem; }
.bingo-tile.rejected { border-color: var(--danger); }
.bingo-tile.rejected .tile-icon, .rejected-label { color: var(--danger); font-weight: 750; }
.bingo-tile.rejected .tile-icon { border: 1px solid var(--danger); background: transparent; }
.submission-time { display: grid; gap: .1rem; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.elapsed { font-variant-numeric: tabular-nums; }
.game-duration { display: flex; flex-wrap: wrap; gap: .2rem .8rem; margin-top: .3rem; color: var(--muted); font-size: .875rem; }
.game-duration .elapsed { color: var(--text); font-weight: 700; }
.detail-heading .team-time { margin-top: .7rem; }
.team-profile-edit { padding: 0; border: 0; background: none; color: inherit; text-align: start;
  font: inherit; letter-spacing: inherit; min-height: 44px; overflow-wrap: anywhere;
}
.team-profile-edit:hover { text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .13em; }
.team-roster-edit { color: var(--muted); }
.team-edit-icon { color: var(--violet); margin-inline-start: .45rem; font: 600 1rem/1 system-ui, sans-serif; }
.ranking-time { grid-column: 1 / -1; }
.ranking-times { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); align-items: start; gap: .3rem 1.2rem; }
.ranking-times .game-duration { margin: 0; overflow-wrap: anywhere; }
.chart-section-header { flex-wrap: wrap; }
.upload-times { padding: clamp(.85rem, 3vw, 1.5rem); }
.upload-filter { max-width: 20rem; margin-top: 1rem; }
.upload-figure { margin: 1rem 0 .5rem; text-align: center; color: var(--muted); font-size: .87rem; }
.upload-figure canvas { display: block; width: 100%; height: clamp(220px, 45vw, 400px); }
.upload-legend { display: flex; flex-wrap: wrap; gap: .45rem 1.2rem; margin: .9rem 0; padding: 0; list-style: none;
  font-size: .875rem; overflow-wrap: anywhere;
}
.upload-key { display: inline-block; vertical-align: middle; width: 1.3rem; margin-inline-end: .45rem;
  border-top: 3px solid currentColor;
}
.upload-times-data { border-top: 1px solid var(--edge); padding-top: .65rem; }
.upload-times-data summary { cursor: pointer; }
.upload-table-wrap { overflow-x: auto; margin-top: .5rem; }
.upload-table-wrap table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.upload-table-wrap :is(th, td) { padding: .45rem .65rem; border-bottom: 1px solid var(--edge); text-align: left; }
.upload-table-wrap time, .upload-table-wrap td:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.submission-log { display: grid; gap: .5rem; list-style: none; margin: .9rem 0 0; padding: 0;
  font-size: .875rem; color: var(--muted);
}
.submission-log li { display: flex; gap: .5rem 1rem; justify-content: space-between; flex-wrap: wrap;
  padding: .45rem 0; border-top: 1px solid var(--edge);
}
.submission-log time { color: var(--text); }
.empty { margin: 0; padding: 1.25rem 1rem; color: var(--muted); }
.back-row { margin-bottom: 1rem; }
.admin-board .section-header { padding-inline: 0; border: 0; margin-bottom: .3rem; }
.archive-view { margin-top: 1rem; }
.archive-view .bingo-grid { padding: .65rem; }
.settings-panels { display: grid; gap: 1rem; }
.settings-rules { display: grid; gap: .4rem; padding: 0 1rem 0 2rem; margin: .9rem 0;
  color: var(--muted); overflow-wrap: anywhere;
}
.settings-row { display: flex; justify-content: space-between; align-items: center; gap: .55rem 1rem;
  flex-wrap: wrap; padding: .65rem 1rem; color: var(--text);
}
.settings-row + .settings-row { border-top: 1px solid var(--edge); }
.upload-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.upload-options .file-choice { position: relative; cursor: pointer; overflow: hidden; }
@media (max-width: 620px) {
  .upload-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-options .file-choice:first-child { grid-column: 1 / -1; }
}
.file-choice input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-choice:focus-within { outline: 2px solid var(--violet); outline-offset: 2px; }
.admin-dashboard { display: grid; grid-template-columns: minmax(0, 2fr) minmax(15rem, 1fr);
  gap: 1rem; align-items: start;
}
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-list li { border-bottom: 1px solid var(--edge); border-inline-start: 3px solid transparent; }
.activity-content { display: grid; gap: .1rem; padding: .75rem 1rem; overflow-wrap: anywhere;
  width: 100%; border: 0; background: transparent; text-align: start; cursor: pointer;
  font-size: .875rem; color: var(--text);
}
.activity-content:hover strong { text-decoration: underline; }
.activity-content:focus-visible { outline: 2px solid var(--violet); outline-offset: -2px; }
.ticker-heading { color: inherit; text-underline-offset: .2em; }
.ticker-heading:hover { color: var(--violet); }
.activity-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--edge);
}
.history-controls:has(button:not([hidden])) { padding: .8rem 1rem; border-top: 1px solid var(--edge); }
.back-row a.button { text-decoration: none; }
.activity-positive { --activity-color: var(--ticker-positive); }
.activity-rejected { --activity-color: var(--ticker-negative); }
.activity-list :is(.activity-positive, .activity-rejected) {
  border-inline-start-color: var(--activity-color);
  background: color-mix(in srgb, var(--activity-color) 9%, var(--panel));
}
.activity-list :is(.activity-positive, .activity-rejected) strong { color: var(--activity-color); }
.activity-list li.activity-confirmed { --activity-color: var(--confirmed-accent);
  background: var(--confirmed-bg); border-inline-start-color: var(--confirmed-edge);
}
.activity-list li:last-child { border-bottom: 0; }
.activity-list span, .activity-list time { color: var(--muted); }
.activity-list time { font-size: .8rem; }
.activity-dialog-details { display: grid; gap: .25rem; margin-bottom: .8rem; }
.activity-dialog-details time { color: var(--muted); }
.activity-status { font-weight: 650; }
.activity-status.status-confirmed { color: var(--confirmed-accent); }
.activity-status.status-rejected { color: var(--ticker-negative); }
@media (max-width: 800px) {
  .admin-dashboard { grid-template-columns: minmax(0, 1fr); }
}
.field-name { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.drag-handle { flex: 0 0 44px; font-size: 1.3rem; cursor: grab; touch-action: none; user-select: none; }
.settings-row.dragging { background: var(--panel-hover); outline: 2px solid var(--violet); outline-offset: -2px; }
.dragging .drag-handle { cursor: grabbing; }
.archived-fields[open] > summary { border-bottom: 1px solid var(--edge); }
.archived-fields .team-list { display: block; padding: 0; margin: 0; }

dialog { width: min(100% - 2rem, 590px); max-height: calc(100% - 2rem); border: 1px solid var(--dialog-edge); border-radius: var(--radius);
  padding: 0; background: var(--panel); color: var(--text); box-shadow: 0 16px 64px #0008; }
dialog::backdrop { background: var(--backdrop); }
.dialog-inner { padding: clamp(1rem, 4vw, 1.6rem); }
.dialog-header { display: flex; justify-content: space-between; align-items: start; gap: .7rem; margin-bottom: 1rem; }
.dialog-header h2 { font-size: clamp(1.25rem, 4vw, 1.65rem); line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
.evidence-media { display: block; width: 100%; max-height: 48vh; object-fit: contain; background: #100d16;
  border-radius: 8px; margin-bottom: .7rem; }
dialog.lightbox { width: min(100% - 1.25rem, 1200px); max-height: calc(100dvh - 1.25rem); }
.lightbox .evidence-media { max-height: min(75vh, 900px); max-height: min(75dvh, 900px); }
.lightbox-details { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: .65rem 1.25rem; }
.lightbox-caption { flex: 1 1 18rem; min-width: 0; overflow-wrap: anywhere; }
.lightbox-caption .submission-log { margin-top: .35rem; }
.current-submission { margin-top: .25rem; }
.submission-history { margin-top: .55rem; color: var(--muted); font-size: .875rem; }
.submission-history summary { cursor: pointer; width: fit-content; padding: .25rem 0; }
.replace-hint { margin-bottom: .9rem; }
.upload-progress { height: 10px; }
.notice { position: fixed; z-index: 5; right: 1rem; bottom: 1rem; max-width: calc(100% - 2rem); border: 1px solid var(--edge);
  border-radius: 10px; padding: .75rem 1rem; background: var(--notice-bg); color: var(--text); box-shadow: 0 6px 24px #0007; font-size: .93rem;
}
.notice:empty { visibility: hidden; }

@media (max-width: 1000px) {
  .bingo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 790px) {
  main { padding-block: 30px 44px; }
  .login-hero { padding: 1.5rem; }
  .hero-grid { right: -145px; }
  .bingo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .container { width: min(100% - 1.5rem, 1152px); }
  .header-inner { min-height: 59px; }
  .header-actions { gap: .4rem; }
  .theme-toggle { min-width: 44px; padding-inline: .5rem; }
  .theme-label { display: none; }
  .account-name { display: none; }
  .brand { font-size: .8rem; gap: .35rem; }
  main { padding-block: 19px 36px; }
  .login-layout { grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
  .login-hero { min-height: 215px; }
  .login-hero h1 { font-size: clamp(2.4rem, 10.6vw, 4.7rem); }
  .login-hero p { margin-top: 1rem; }
  .hero-grid { width: 285px; right: -75px; bottom: -94px; }
  .page-heading { align-items: stretch; flex-direction: column; margin-bottom: 16px; }
  .board-progress { width: 100%; }
  .bingo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .bingo-tile { min-height: 138px; padding: .65rem; }
  .rules ul { grid-template-columns: 1fr; }
  .stats, .ranking-row, .ranking-times { gap: .45rem; }
}
@media (max-width: 350px) {
  .brand-mark { margin-right: 0; }
  .tile-foot { font-size: .82rem; }
}
