/* Pretendard v1.3.9, SIL OFL 1.1: /assets/fonts/Pretendard-OFL.txt */
@font-face {
  font-family: "Pretendard Variable";
  src: url("/assets/fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #100d1b;
  --bg-raised: #151020;
  --surface: #1a1529;
  --surface-strong: #251d38;
  --surface-soft: #15111f;
  --line: #3c304f;
  --line-soft: #2a2237;
  --text: #f4f0fa;
  --text-dim: #b8aec8;
  --text-faint: #9485a7;
  --acid: #b18bfa;
  --acid-soft: rgba(177, 139, 250, 0.13);
  --cyan: #62f4e8;
  --cyan-soft: rgba(98, 244, 232, 0.12);
  --amber: #ffbd52;
  --red: #ff6b62;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #9085e9;
  --series-8: #e66767;
  --radius: 10px;
  --page-title-size: clamp(1.5rem, 2.4vw, 2rem);
  --sans: "Pretendard Variable", Pretendard, system-ui, sans-serif;
  --mono: var(--sans);
  color-scheme: dark;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body { min-width:320px; min-height:100vh; margin:0; color:var(--text); background:var(--bg); }

button,
input,
select,
textarea {
  font: inherit;
}

pre, code, kbd, samp {
  font-family: var(--sans);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

::selection {
  color: #050b1d;
  background: var(--acid);
}

:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  color: #050b1d;
  background: var(--acid);
  border-radius: 6px;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--text-dim);
  background: var(--bg);
}

.boot-screen p {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.boot-line {
  width: 180px;
  height: 2px;
  overflow: hidden;
  background: var(--line);
}

.boot-line span {
  display: block;
  width: 45%;
  height: 100%;
  background: var(--acid);
  animation: boot-scan 1.1s ease-in-out infinite;
}

@keyframes boot-scan {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(330%); }
}

.brand-mark { display:grid; place-items:center; width:47px; aspect-ratio:1; height:auto; padding:0; overflow:hidden; flex:0 0 auto; box-sizing:border-box; background:transparent; border:0; border-radius:0; box-shadow:none; }

.brand-mark img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0;
}

.brand-mark--large {
  width: 72px;
  padding: 0;
}

.brand-mark--small {
  width: clamp(32px, 3vw, 39px);
  padding: 0;
}

/* Chungnam Hackathon editorial identity. */
.event-edition { color:var(--text-dim); font:500 .73rem var(--mono); letter-spacing:.16em; margin:0 0 30px; }
.event-tagline { color:var(--text-dim); margin:28px 0 0; font-size:1.05rem; }
.title-period { color:var(--cyan); }
.event-stag { position:absolute; width:clamp(260px,36vw,560px); right:-14%; bottom:-28%; opacity:.28; z-index:-1; pointer-events:none; }

/* Login */
.login-layout {
  position: relative;
  display: grid;
  min-height: 100vh;
  grid-template-columns:minmax(0,1fr) min(45%,494px);
  background: var(--bg);
}

.login-intro { position:relative; display:flex; min-height:100vh; padding:clamp(20px,2vw,32px); overflow:hidden; flex-direction:column; justify-content:space-between; background:radial-gradient(ellipse at 75% 65%,#35204666,transparent 65%),#14101f; border-right:1px solid var(--line-soft); }
.login-emblem { display:none; }
.login-dark-stag { position:absolute; z-index:1; bottom:-24px; right:-95px; width:min(76%,480px); height:auto; pointer-events:none; opacity:.8; }
.login-intro .login-copy { z-index:2; margin:120px 0 auto; padding:0; }
.login-intro .login-signal { position:relative; z-index:2; max-width:360px; }
.login-panel { z-index:3; }


.login-brandline,
.app-brand {
  display: flex;
  z-index: 1;
  align-items: center;
  gap: 13px;
}

.login-brandline strong,
.app-brand strong {
  display: block;
  font-family:var(--sans);
  font-size:.96rem;
  letter-spacing:-.025em;
}

.login-brandline div > span,
.app-brand div > span {
  display: block;
  margin-top: 1px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.69rem;
  letter-spacing: 0.12em;
}

.login-copy {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: auto 0;
  padding: 8vh 0;
}

.section-kicker { display:none; }

.section-kicker::before { content:none; }


.login-signal {
  z-index: 1;
  display: grid;
  grid-template-columns:auto minmax(20px,1fr) auto;
  align-items: center;
  gap: 12px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}

.login-signal span:first-child {
  color: var(--acid);
}

.login-signal i {
  height: 1px;
  background: var(--line);
}

.login-panel { position:relative; display:grid; padding:clamp(20px,2vw,32px); place-items:center; background:var(--bg); }
.login-card { width:min(100%,430px); min-width:0; padding:24px 0; background:transparent; border:0; box-shadow:none; }

.status-chip,
.score-legend {
  display:none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
}

.status-chip i,
.score-legend i {
  width: 7px;
  height: 7px;
  background: var(--acid);
  border-radius: 50%;
  box-shadow:none;
}

.login-heading {
  margin: 47px 0 20px;
}

.login-heading > span {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.71rem;
  letter-spacing: 0.16em;
}

.login-heading h2 {
  margin: 8px 0 8px;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
}

.login-heading p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.91rem;
}

#login-form {
  display: grid;
  gap: 10px;
}

#login-form label {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 0.83rem;
  font-weight: 650;
}

.input-shell {
  display: grid;
  min-height: 52px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  background: #15111f;
  border: 1px solid var(--line);
  border-radius: 7px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-shell:focus-within {
  border-color: rgba(177, 139, 250, 0.72);
  box-shadow:none;
}

.input-shell input {
  min-width: 0;
  height: 50px;
  padding: 0 14px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.password-toggle {
  height: 36px;
  margin-right: 7px;
  padding: 0 9px;
  color: var(--text-dim);
  font-size: 0.75rem;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--text);
  background: var(--surface-strong);
}

.primary-button {
  display: flex;
  width: 100%;
  min-height: 54px;
  margin-top: 20px;
  padding: 0 18px 0 22px;
  align-items: center;
  justify-content: space-between;
  color: #050b1d;
  font-weight: 800;
  background: var(--acid);
  border: 0;
  border-radius:999px;
  cursor: pointer;
  transition: transform 160ms ease, filter 160ms ease;
}

.primary-button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  filter: saturate(0.3);
  transform: none;
}

.primary-button b {
  font-size: 1.2rem;
}

.form-message,
.setup-message {
  margin: 3px 0 0;
  padding: 10px 12px;
  color: #ffaaa5;
  font-size: 0.82rem;
  background: rgba(255, 107, 98, 0.08);
  border-left: 2px solid var(--red);
}

.setup-message {
  color: var(--amber);
  background: rgba(255, 189, 82, 0.08);
  border-left-color: var(--amber);
}

.login-footnote {
  display: flex;
  margin-top: 27px;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
  font-size: 0.77rem;
}

.login-footnote span {
  color: var(--acid);
  font-size: 0.55rem;
}

/* Application shell */
.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  min-height: 68px;
  padding: 0 24px;
  grid-template-columns: minmax(260px,1fr) auto minmax(190px,1fr);
  align-items: center;
  background:rgba(16,13,27,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.app-brand {
  justify-self: start;
}

.main-nav {
  display: flex;
  height: 68px;
  align-items: stretch;
  gap: 4px;
}

.main-nav a {
  position: relative;
  display: grid;
  min-width:62px;
  padding:0 12px;
  place-items: center;
  color: var(--text-dim);
  font-size: 0.87rem;
  font-weight: 650;
  transition: color 160ms ease, background 160ms ease;
}

.main-nav a[hidden] { display:none; }

.main-nav a:hover {
  color: var(--text);
  background: rgba(177, 139, 250, 0.035);
}

.main-nav a.active {
  color: var(--text);
}

.main-nav a.active::after {
  position: absolute;
  right: 17px;
  bottom: -1px;
  left: 17px;
  height: 2px;
  content: "";
  background: var(--acid);
  box-shadow:none;
}

.topbar-actions {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 14px;
}

.icon-definitions { position:absolute; overflow:hidden; pointer-events:none; }
.person-icon {
  display:block; width:20px; height:20px; fill:none; stroke:currentColor;
  stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;
}
.profile-avatar .person-icon { width:30px; height:30px; }
.profile-member-avatar .person-icon { width:18px; height:18px; }

.viewer-menu {
  display: flex;
  align-items: center;
  gap: 9px;
  padding:4px 6px;
  color:var(--text);
  border-radius:6px;
  cursor:pointer;
  transition:background 150ms ease;
}

.viewer-menu:hover,
.viewer-menu:focus-visible { background:rgba(255,255,255,.045); }

.viewer-menu > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--cyan-soft);
  border: 1px solid rgba(98, 244, 232, 0.26);
  border-radius: 5px;
}

.viewer-menu strong,
.viewer-menu small {
  display: block;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-menu strong {
  font-size: 0.78rem;
}

.viewer-menu small {
  color: var(--text-faint);
  font-size: 0.69rem;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--red);
  border-color: rgba(255, 107, 98, 0.45);
}

.connection-banner {
  position: sticky;
  top: 68px;
  z-index: 90;
  display: flex;
  min-height: 46px;
  padding: 9px 24px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #241800;
  font-size: 0.82rem;
  background: var(--amber);
}

.connection-banner button {
  padding: 5px 9px;
  color: #241800;
  font-size: 0.75rem;
  font-weight: 800;
  background: transparent;
  border: 1px solid rgba(36, 24, 0, 0.45);
  border-radius: 4px;
  cursor: pointer;
}

.workspace {
  display: grid;
  min-height: calc(100vh - 68px);
  grid-template-columns: minmax(0, 1fr);
}

.context-rail {
  display: none !important;
  position: sticky;
  top: 68px;
  display: flex;
  height: calc(100vh - 68px);
  padding: 28px 20px 22px;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid var(--line);
  background: rgba(16,13,27,.72);
}

.rail-label {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.17em;
  writing-mode: vertical-rl;
}

.rail-clock {
  display: flex;
  margin-top: 32px;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.rail-clock span {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: -0.04em;
  writing-mode: vertical-rl;
}

.rail-clock small {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.58rem;
}

.rail-divider {
  width: 1px;
  height: 44px;
  margin: 24px 0;
  background: var(--line);
}

.rail-stats {
  display: grid;
  width: 100%;
  margin: 0;
  gap: 20px;
  text-align: center;
}

.rail-stats div {
  display: grid;
  gap: 2px;
}

.rail-stats dt {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.12em;
}

.rail-stats dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.79rem;
}

.rail-coordinate {
  display: grid;
  margin-top: auto;
  gap: 2px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.52rem;
  text-align: center;
}

.content {
  min-width:0;
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: clamp(20px, 2vw, 28px) clamp(22px, 4vw, 68px) 72px;
}

.page-view {
  min-width:0;
  animation: view-in 220ms ease both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-header { display:flex; min-height:0; margin-bottom:24px; align-items:center; justify-content:space-between; gap:24px; }

.page-header h1 { margin:0; font-size:var(--page-title-size); font-weight:850; line-height:1.2; letter-spacing:-.065em; }

.page-header p {
  margin: 8px 0 0;
  color: var(--text-dim);
  font-size: 0.91rem;
}

.sync-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.sync-state {
  display: flex;
  min-width: 150px;
  padding: 10px 13px;
  align-items: center;
  gap: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.sync-state > span {
  width: 9px;
  height: 9px;
  background: var(--acid);
  border: 2px solid rgba(177, 139, 250, 0.28);
  border-radius: 50%;
  box-shadow:none;
}

.sync-state.is-stale > span {
  background: var(--amber);
  box-shadow:none;
}

.sync-state.is-offline > span {
  background: var(--red);
  box-shadow:none;
}

.sync-state small + small {
  margin-top: 3px;
}

.sync-state b,
.sync-state small {
  display: block;
}

.sync-state b {
  font-size: 0.76rem;
}

.sync-state small {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.metric-grid { display:grid; margin-bottom:40px; grid-template-columns:repeat(4,minmax(0,1fr)); gap:24px; overflow:hidden; background:transparent; border:0; border-radius:0; }

.metric-card { position:relative; min-height:138px; padding:20px 0; overflow:hidden; background:transparent; }

.metric-card--accent::after { content:none; }

.metric-card--personal { order:-1; background:transparent; color:var(--cyan); }

.metric-card > span {
  display: block;
  color: var(--text-dim);
  font-size: 0.79rem;
  font-weight: 650;
}

.metric-card strong { display:block; margin:14px 0 12px; font-family:var(--sans); font-size:clamp(2.5rem,5vw,4.5rem); font-weight:800; line-height:1; letter-spacing:-.06em; font-variant-numeric:tabular-nums; }

.metric-card small { display:none; }

.leader-summary { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:18px; margin-bottom:40px; padding:24px 0; background:transparent; border:0; border-radius:0; }

.leader-summary h2 { margin: 5px 0; font-size: 1rem; }
.leader-summary p { margin: 0; color: var(--text-dim); font-size: 0.78rem; }
.leader-teams { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.leader-team {
  max-width: 100%;
  padding: 8px 12px;
  overflow-wrap: anywhere;
  color: var(--text);
  background: var(--acid-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 650;
}
.leader-team:hover { border-color: var(--acid); }
.page-header .ranking-rule { font-size: 0.78rem; line-height: 1.65; }

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  gap: 22px;
}

.panel { background:transparent; border:0; border-radius:0; }

.panel-header { display:flex; min-height:64px; padding:0 0 16px; align-items:center; justify-content:space-between; gap:16px; border:0; }

.panel-header > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.panel-header h2 { margin:0; font-size:1.15rem; font-weight:750; letter-spacing:-.025em; }

.panel-index {
  display:none;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.64rem;
}

.panel-header a,
.panel-meta {
  letter-spacing:0;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.67rem;
  letter-spacing: 0.04em;
}

.panel-header a:hover {
  color: var(--acid);
}

.leaderboard {
  min-height: 320px;
}

.leaderboard-row {
  display: grid;
  min-height: 64px;
  padding: 0 20px;
  grid-template-columns: 42px minmax(130px, 0.9fr) minmax(130px, 1.4fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.leaderboard-row:last-child {
  border-bottom: 0;
}

.leaderboard-row.is-viewer {
  background:var(--surface);
  box-shadow:none;
}

.rank-number {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.76rem;
}

.leaderboard-row:nth-child(1) .rank-number,
.leaderboard-row:nth-child(2) .rank-number,
.leaderboard-row:nth-child(3) .rank-number {
  color: var(--acid);
}

.team-identity {
  min-width: 0;
}

.team-identity strong,
.team-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.team-identity small {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 0.68rem;
}

.mini-bar,
.score-track {
  position: relative;
  width: 100%;
  height: 4px;
  overflow: hidden;
  appearance: none;
  background: #302242;
  border: 0;
  border-radius: 999px;
}

.mini-bar::-webkit-progress-bar,
.score-track::-webkit-progress-bar {
  background: #302242;
  border-radius: 999px;
}

.mini-bar::-webkit-progress-value,
.score-track::-webkit-progress-value {
  background:var(--surface);
  border-radius: 999px;
}

.mini-bar::-moz-progress-bar,
.score-track::-moz-progress-bar {
  background:var(--surface);
  border-radius: 999px;
}

.score-value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 72px;
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 750;
}

.score-value-number {
  text-align: right;
}

.compact-hill-list {
  display: grid;
  min-height: 320px;
  align-content: start;
}

.compact-hill {
  display: grid;
  min-height: 78px;
  padding: 14px 18px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.compact-hill:last-child {
  border-bottom: 0;
}

.hill-node {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.66rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.compact-hill.is-claimed .hill-node {
  color: var(--acid);
  background: var(--acid-soft);
  border-color: rgba(177, 139, 250, 0.34);
}

.compact-hill strong,
.compact-hill small {
  display: block;
}

.compact-hill strong {
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-hill small {
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 0.68rem;
}

.claim-badge {
  display: inline-flex;
  min-height: 25px;
  padding: 4px 8px;
  align-items: center;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.61rem;
  background: var(--acid-soft);
  border: 1px solid rgba(177, 139, 250, 0.24);
  border-radius: 4px;
}

.claim-badge--empty {
  color: var(--text-faint);
  background: rgba(177, 139, 250, 0.035);
  border-color: var(--line);
}

.notice-strip-panel {
  margin-top: 22px;
}

.notice-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.notice-strip-item {
  min-height: 110px;
  padding: 19px 20px;
  border-right: 1px solid var(--line-soft);
}

.notice-strip-item:last-child {
  border-right: 0;
}

.notice-strip-item span {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.64rem;
}

.notice-strip-item strong {
  display: block;
  margin: 5px 0 5px;
  font-size: 0.86rem;
}

.notice-strip-item p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 0.76rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Scoreboard freeze */
.freeze-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 0;
  padding: 13px 18px;
  color: var(--text);
  background: rgba(196, 161, 255, 0.1);
  border: 1px solid rgba(196, 161, 255, 0.4);
  border-radius: var(--radius);
}

.freeze-banner i {
  flex: none;
  width: 9px;
  height: 9px;
  background: #c4a1ff;
  border-radius: 50%;
  box-shadow:none;
}

.freeze-banner strong {
  display: block;
  font-size: 0.86rem;
}

.freeze-banner p {
  margin: 2px 0 0;
  color: var(--text-dim);
  font-size: 0.78rem;
}

.admin-inline-control {
  display: flex;
  min-height: 56px;
  margin: 18px 0 0;
  padding: 10px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.admin-inline-control strong {
  font-size: 0.84rem;
}

.admin-inline-control p {
  margin: 2px 0 0;
  color: var(--text-dim);
  font-size: 0.76rem;
}

#admin-freeze-toggle.is-active {
  color: #c4a1ff;
  border-color: rgba(196, 161, 255, 0.55);
}

/* Score chart */
.score-chart-panel {
  margin-top: 18px;
  overflow: visible;
}

.score-chart {
  position: relative;
  min-height: 160px;
  padding: 14px 18px 6px;
}

.score-chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-range-label {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
}

.chart-grid line {
  stroke: var(--line-soft);
  stroke-width: 1;
}

.chart-axis-label {
  fill: var(--text-faint);
  font-family: var(--mono);
  font-size: 9px;
}

.chart-line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-endpoint {
  stroke: var(--surface);
  stroke-width: 2;
}

.score-chart-svg.is-series-focused .chart-line:not(.is-highlighted),
.score-chart-svg.is-series-focused .chart-endpoint:not(.is-highlighted) {
  opacity: 0.16;
}

.chart-line.is-highlighted {
  stroke-width: 3;
}

.chart-crosshair {
  stroke: var(--text-faint);
  stroke-width: 1;
  pointer-events: none;
}

.chart-hit-area {
  cursor: crosshair;
  outline: none;
}

.chart-hit-area:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: -2px;
}

.chart-hover-dot {
  stroke: var(--surface);
  stroke-width: 2;
  pointer-events: none;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 150px;
  padding: 9px 11px;
  color: var(--text);
  font-size: 0.74rem;
  background: rgba(26,21,41,.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow:none;
  pointer-events: none;
}

.chart-tooltip-time {
  margin: 0 0 6px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

.chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 0;
}

.chart-tooltip-key {
  width: 10px;
  height: 2px;
  flex: none;
  border-radius: 1px;
}

.chart-tooltip-team {
  overflow: hidden;
  color: var(--text-dim);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-tooltip-value {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.chart-legend {
  display: flex;
  padding: 4px 18px 14px;
  gap: 14px 20px;
  flex-wrap: wrap;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-dim);
  font-size: 0.74rem;
}

.chart-legend-key {
  width: 12px;
  height: 2px;
  flex: none;
  border-radius: 1px;
}

.chart-legend-note {
  width: 100%;
  color: var(--text-faint);
  font-size: 0.7rem;
}

/* Scoreboard */
.scoreboard-panel {
  min-width:0; max-width:100%;
  overflow: hidden;
}

.scoreboard-head {
  display: grid;
  min-height: 46px;
  padding: 0 22px;
  grid-template-columns: minmax(210px, 0.85fr) minmax(170px, 0.8fr) minmax(240px, 1.35fr);
  align-items: center;
  gap: 24px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.1em;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}

.scoreboard-head span:last-child {
  text-align: right;
}

.scoreboard-list {
  min-height: 220px;
}

.scoreboard-row {
  display: grid;
  min-height: 94px;
  padding: 15px 22px;
  grid-template-columns: minmax(210px, 0.85fr) minmax(170px, 0.8fr) minmax(240px, 1.35fr);
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line-soft);
  transition: background 160ms ease;
}

.scoreboard-row:last-child {
  border-bottom: 0;
}

.scoreboard-row:hover {
  background: rgba(177, 139, 250, 0.025);
}

.scoreboard-row.is-viewer {
  background:var(--surface);
  box-shadow:none;
}

.score-team-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 16px;
}

.score-rank {
  min-width: 47px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 1.1rem;
}

.scoreboard-row:nth-child(-n + 3) .score-rank {
  color: var(--acid);
}

.score-rank small {
  color: var(--text-faint);
  font-size: 0.55rem;
  vertical-align: top;
}

.score-team-name {
  min-width: 0;
}

.score-team-name strong,
.score-team-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-team-name strong {
  font-size: 0.92rem;
}

.score-team-name small {
  color: var(--text-faint);
  font-size: 0.67rem;
}

.held-hills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.held-hill-chip {
  padding: 4px 7px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.61rem;
  background: var(--cyan-soft);
  border: 1px solid rgba(98, 244, 232, 0.24);
  border-radius: 4px;
}

.no-hill {
  color: var(--text-faint);
  font-size: 0.72rem;
}

.score-chart-cell {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 82px;
  align-items: center;
  gap: 16px;
}

.score-track {
  height: 7px;
}

.score-points {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 800;
}

.score-points-value {
  text-align: right;
}

.score-points small {
  color: var(--text-faint);
  font-size: 0.58rem;
  font-weight: 500;
}

.chart-note {
  margin: 14px 4px 0;
  color: var(--text-faint);
  font-size: 0.72rem;
}

.chart-note span {
  color: var(--acid);
}

/* Problems */
.problem-count,
.notice-count {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.problem-count strong,
.notice-count strong {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 1.6rem;
}

.problem-count span,
.notice-count span {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.09em;
}

.problem-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 24px; }

.problem-card {
  position: relative;
  display: flex;
  min-height: 300px;
  padding: 22px;
  overflow: hidden;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.problem-card::after { content:none; }

.problem-card.is-claimed::after {
  background: var(--acid);
  box-shadow:none;
}

.problem-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.problem-code {
  overflow-wrap: anywhere;
  min-width: 0;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.69rem;
  letter-spacing: 0.08em;
}

.problem-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.61rem;
}

.problem-status i {
  width: 6px;
  height: 6px;
  background: var(--text-faint);
  border-radius: 50%;
}

.problem-card.is-claimed .problem-status {
  color: var(--acid);
}

.problem-card.is-claimed .problem-status i {
  background: var(--acid);
  box-shadow:none;
}

.problem-card h2 {
  margin: 29px 0 9px;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.025em;
}

.problem-card > p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.84rem;
  line-height: 1.7;
}

.problem-meta {
  display: grid;
  margin: 24px 0 0;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}

.problem-meta div {
  padding: 10px 12px;
  background: var(--surface-soft);
}

.problem-meta dt {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.57rem;
  letter-spacing: 0.08em;
}

.problem-meta dd {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.problem-holder {
  display: flex;
  flex-wrap: wrap;
  min-height: 51px;
  margin-top: auto;
  padding: 11px 13px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-soft);
  border-left: 2px solid var(--line);
}

.problem-card.is-claimed .problem-holder {
  background: var(--acid-soft);
  border-left-color: var(--acid);
}

.problem-holder span,
.problem-holder small {
  display: block;
}

.hold-details { display: grid; gap: 3px; min-width: 0; }
.hold-start {
  display: block;
  color: var(--text-dim);
  font-size: 0.65rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.problem-holder .hold-details { text-align: right; }
.hill-identifier { overflow-wrap: anywhere; }
.team-hill-item .hill-identifier,
.team-hill-item .hold-duration { white-space: normal; overflow: visible; }

.problem-holder span {
  color: var(--text-faint);
  font-size: 0.65rem;
}

.problem-holder strong {
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.problem-holder small {
  color: var(--text-faint);
  font-size: 0.65rem;
  text-align: right;
}

/* Modem Crown submissions */
.submission-page-message {
  margin: 0 0 18px;
  padding: 12px 15px;
  color: var(--amber);
  font-size: 0.82rem;
  background: rgba(255, 189, 82, 0.08);
  border: 1px solid rgba(255, 189, 82, 0.3);
  border-left-width: 3px;
  border-radius: 7px;
}

.submission-page-message.is-error {
  color: #ffaaa5;
  background: rgba(255, 107, 98, 0.07);
  border-color: rgba(255, 107, 98, 0.36);
}

.submission-challenge-list {
  display: grid;
  margin-bottom: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.submission-challenge-list > .empty-state,
.submission-history > .empty-state { display:flex; flex-direction:column; gap:10px; align-items:flex-start; justify-content:center; min-height:110px; padding:26px 0; color:var(--text-dim); grid-column:1/-1; }

.submission-challenge-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 190px;
  padding: 20px;
  overflow: hidden;
  flex-direction: column;
  color: var(--text);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.submission-challenge-card::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 54px;
  height: 2px;
  content: "";
  background: var(--line);
  transition: width 160ms ease, background 160ms ease;
}

.submission-challenge-card:hover,
.submission-challenge-card.is-selected {
  background:var(--surface);
  border-color: rgba(177, 139, 250, 0.5);
  transform: translateY(-1px);
}

.submission-challenge-card.is-selected {
  box-shadow:none;
}

.submission-challenge-card.is-selected::after {
  width: 96px;
  background: var(--acid);
}

.submission-challenge-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.submission-challenge-card h2 {
  margin: 22px 0 7px;
  font-size: 1.12rem;
}

.submission-challenge-card h2 small {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
}

.submission-challenge-card > p {
  display: -webkit-box;
  margin: 0 0 18px;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.submission-challenge-meta {
  display: flex;
  margin-top: auto;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.61rem;
}

.submission-challenge-meta span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submission-state-badge,
.submission-active-indicator {
  display: inline-flex;
  min-height: 25px;
  padding: 4px 8px;
  align-items: center;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  background: rgba(113, 132, 170, 0.09);
  border: 1px solid var(--line);
  border-radius: 4px;
  white-space: nowrap;
}

.submission-state-badge[data-state="open"],
.submission-state-badge[data-state="accepted"] {
  color: #6ee7b7;
  background: rgba(110, 231, 183, 0.08);
  border-color: rgba(110, 231, 183, 0.3);
}

.submission-state-badge[data-state="paused"],
.submission-state-badge[data-state="queued"],
.submission-state-badge[data-state="retrying"],
.submission-active-indicator[data-state="queued"],
.submission-active-indicator[data-state="retrying"] {
  color: var(--amber);
  background: rgba(255, 189, 82, 0.08);
  border-color: rgba(255, 189, 82, 0.3);
}

.submission-state-badge[data-state="running"],
.submission-active-indicator[data-state="running"] {
  color: var(--cyan);
  background: var(--cyan-soft);
  border-color: rgba(98, 244, 232, 0.3);
}

.submission-state-badge[data-state="rejected"],
.submission-state-badge[data-state="error"] {
  color: #ffaaa5;
  background: rgba(255, 107, 98, 0.08);
  border-color: rgba(255, 107, 98, 0.3);
}

.submission-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
  align-items: start;
  gap: 20px;
}

.submission-upload-panel,
.submission-leaderboard-panel,
.submission-history-panel {
  overflow: hidden;
}

.submission-history-panel {
  grid-column: 1 / -1;
}

.submission-upload-body {
  padding: 21px;
}

.submission-description {
  margin: 0 0 18px;
  color: var(--text-dim);
  font-size: 0.84rem;
  line-height: 1.7;
}

.submission-kit-meta {
  display: grid;
  margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.submission-kit-meta > div {
  min-width: 0;
  padding: 11px 13px;
  background: var(--surface-soft);
}

.submission-kit-meta .submission-kit-hash {
  grid-column: 1 / -1;
}

.submission-kit-meta dt {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.57rem;
  letter-spacing: 0.08em;
}

.submission-kit-meta dd {
  margin: 4px 0 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.73rem;
}

.submission-kit-meta a {
  color: var(--cyan);
  text-decoration: underline;
  text-decoration-color: rgba(98, 244, 232, 0.36);
  text-underline-offset: 3px;
}

.submission-kit-meta code,
.submission-artifact-hash code {
  overflow-wrap: anywhere;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.66rem;
}

.submission-form {
  display: grid;
  margin-top: 19px;
  gap: 8px;
}

.submission-form > label {
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 650;
}

.submission-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(178px, auto);
  align-items: stretch;
  gap: 9px;
}

.submission-file-row input[type="file"] {
  min-width: 0;
  min-height: 49px;
  padding: 7px;
  color: var(--text-dim);
  font-size: 0.76rem;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.submission-file-row input[type="file"]::file-selector-button {
  height: 33px;
  margin-right: 9px;
  padding: 0 10px;
  color: var(--text);
  font: 700 0.72rem var(--sans);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
}

.submission-file-row .primary-button {
  width: auto;
  min-height: 49px;
  margin-top: 0;
  gap: 15px;
  font-size: 0.78rem;
}

.submission-file-row .primary-button:disabled,
.submission-file-row input[type="file"]:disabled {
  cursor: not-allowed;
}

.submission-file-help {
  margin: 0;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.62rem;
  overflow-wrap: anywhere;
}

.submission-form-message {
  margin: 5px 0 0;
  padding: 10px 12px;
  color: #9dd6ff;
  font-size: 0.78rem;
  background: var(--cyan-soft);
  border-left: 2px solid var(--cyan);
}

.submission-form-message.is-error {
  color: #ffaaa5;
  background: rgba(255, 107, 98, 0.08);
  border-left-color: var(--red);
}

.submission-admin-controls {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(246, 174, 45, 0.35);
  background: rgba(246, 174, 45, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.submission-admin-controls strong,
.submission-admin-controls p { display: block; }
.submission-admin-controls strong { font-size: 0.78rem; }
.submission-admin-controls p {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 0.7rem;
}
.submission-admin-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.submission-admin-actions .is-active { border-color: var(--amber); color: var(--amber); }

.submission-active-job {
  display: flex;
  margin-top: 17px;
  padding: 13px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background:var(--surface);
  border: 1px solid rgba(98, 244, 232, 0.25);
  border-radius: 7px;
}

.submission-active-job strong,
.submission-active-job span,
.submission-active-job small {
  display: block;
}

.submission-active-job strong { font-size: 0.82rem; }
.submission-active-job span { margin-top: 2px; color: var(--text-dim); font-size: 0.74rem; }
.submission-active-job small { margin-top: 4px; color: var(--text-faint); font-family: var(--mono); font-size: 0.61rem; }
.submission-active-job .submission-active-indicator { margin-top: 0; flex: none; }

.submission-freeze-note {
  padding: 10px 14px;
  color: #d7c5ff;
  font-size: 0.72rem;
  background: rgba(196, 161, 255, 0.08);
  border-bottom: 1px solid rgba(196, 161, 255, 0.23);
}

.submission-leaderboard-head,
.submission-leaderboard-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 68px minmax(130px, auto);
  align-items: center;
  gap: 12px;
}

.submission-leaderboard-head {
  min-height: 39px;
  padding: 0 16px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.57rem;
  letter-spacing: 0.06em;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line-soft);
}

.submission-leaderboard-head span:last-child { text-align: right; }

.submission-leaderboard {
  min-height: 250px;
}

.submission-leaderboard-row {
  min-height: 69px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.submission-leaderboard-row:last-child { border-bottom: 0; }

.submission-leaderboard-row.is-viewer {
  background:var(--surface);
  box-shadow:none;
}

.submission-leaderboard-team {
  display: grid;
  min-width: 0;
  grid-template-columns: 35px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.submission-rank {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.submission-leaderboard-team strong {
  overflow: hidden;
  font-size: 0.79rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submission-success-rate {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.68rem;
  text-align: center;
}

.submission-best-score { text-align: right; }
.submission-best-score strong,
.submission-best-score small { display: block; }
.submission-best-score strong {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.submission-best-score small { margin-top: 3px; color: var(--text-faint); font-size: 0.58rem; }

.submission-history {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.submission-history-item {
  min-width: 0;
  padding: 18px 20px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.submission-history-item:nth-child(2n) { border-right: 0; }

.submission-history-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 13px;
}

.submission-history-heading strong,
.submission-history-heading time { display: block; }
.submission-history-heading strong { font-size: 0.86rem; }
.submission-history-heading time { margin-top: 3px; color: var(--text-faint); font-family: var(--mono); font-size: 0.61rem; }

.submission-queue-copy,
.submission-reason {
  margin: 12px 0 0;
  color: var(--text-dim);
  font-size: 0.75rem;
}

.submission-artifact-hash {
  display: grid;
  margin: 13px 0 0;
  gap: 3px;
}

.submission-artifact-hash span {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.06em;
}

.submission-result-metrics {
  display: grid;
  margin: 15px 0 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}

.submission-result-metrics > div {
  min-width: 0;
  padding: 8px 9px;
  background: var(--surface-soft);
}

.submission-result-metrics dt {
  overflow: hidden;
  color: var(--text-faint);
  font-size: 0.57rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submission-result-metrics dd {
  margin: 3px 0 0;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submission-cost-breakdown {
  display: flex;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 6px 13px;
}

.submission-cost-breakdown > strong {
  width: 100%;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.07em;
}

.submission-cost-breakdown span {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 0.65rem;
}

.submission-cost-breakdown em {
  color: var(--text-faint);
  font-style: normal;
}

.submission-cost-breakdown b {
  font-family: var(--mono);
  font-size: 0.66rem;
}

/* Notices */
.notice-list {
  display: grid;
  max-width: 1020px;
  gap: 12px;
}

.notice-list:has(> .empty-state:only-child) { max-width:none; width:100%; }

.notice-card { display:grid; grid-template-columns:50px minmax(0,1fr) auto; gap:24px; padding:28px 0; background:transparent; border:0; border-bottom:1px solid var(--line-soft); border-radius:0; }

.notice-card--important { background:transparent; }

.notice-icon { display:block; font:800 1.6rem var(--sans); color:var(--acid); background:transparent; border:0; border-radius:0; }

.notice-title {
  display:block;
  font-weight:700;
  margin: 1px 0 7px;
  font-size: 1rem;
}

.notice-body .notice-excerpt {
  max-width: 720px;
  margin: 0;
  color: var(--text-dim);
  font-size: 0.84rem;
  line-height: 1.7;
}

.notice-date {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.65rem;
  white-space: nowrap;
}

/* Team directory and profiles */
.team-name-link {
  display: inline-block;
  max-width: 100%;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

.team-name-link:hover {
  color: var(--acid);
  border-bottom-color: rgba(177, 139, 250, 0.5);
}

.team-directory { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:64px; row-gap:0; }

.team-directory-card { position:relative; display:grid; grid-template-columns:auto minmax(0,1fr); gap:16px 24px; min-height:130px; padding:24px 0; background:transparent; border:0; border-bottom:1px solid var(--line-soft); border-radius:0; }

.team-directory-card::after { content:none; }

.team-directory-card:hover { background:transparent; color:var(--cyan); transform:none; }

.team-directory-card:hover::after {
  width: 82px;
  background: var(--acid);
}

.team-directory-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.team-directory-rank { font:800 1.5rem var(--sans); color:var(--acid); }

.team-directory-arrow { display:none; }

.team-directory-card:hover .team-directory-arrow {
  color: var(--acid);
  border-color: rgba(177, 139, 250, 0.46);
}

.team-directory-heading { margin:0; align-self:center; }

.team-directory-heading h2 {
  margin: 0;
  overflow: hidden;
  font-size: 1.18rem;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-directory-heading p {
  margin: 6px 0 0;
  color: var(--text-faint);
  font-size: 0.76rem;
}

.team-directory-metrics { display:flex; grid-column:2; gap:24px; margin:0; padding:0; background:transparent; border:0; border-radius:0; }

.team-directory-metrics div { display:grid; gap:4px; padding:0; background:transparent; }

.team-directory-metrics dt { font:500 .7rem var(--sans); color:var(--text-faint); }

.team-directory-metrics dd {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.back-link:hover {
  color: var(--acid);
}

.team-detail-header {
  margin-top: 0;
}

.team-rank-badge {
  display: grid;
  min-width: 94px;
  padding: 11px 15px;
  justify-items: end;
  background: var(--acid-soft);
  border: 1px solid rgba(177, 139, 250, 0.28);
  border-radius: 7px;
}

.team-rank-badge span {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.57rem;
  letter-spacing: 0.1em;
}

.team-rank-badge strong {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 1.3rem;
}

.team-detail-status {
  margin: 0 0 18px;
  padding: 12px 14px;
  color: var(--text-dim);
  background: var(--surface);
  border-left: 2px solid var(--cyan);
}

.team-detail-status.is-error {
  color: #ffaaa5;
  background: rgba(255, 107, 98, 0.07);
  border-left-color: var(--red);
}

.team-metric-grid {
  display: grid;
  margin-bottom: 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.team-metric-grid article {
  min-height: 118px;
  padding: 18px 20px;
  background: var(--surface);
}

.team-metric-grid span,
.team-metric-grid small,
.team-metric-grid strong {
  display: block;
}

.team-metric-grid span {
  color: var(--text-dim);
  font-size: 0.78rem;
}

.team-metric-grid strong {
  margin: 10px 0 7px;
  font-family: var(--mono);
  font-size: 1.6rem;
}

.team-metric-grid small {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.57rem;
  letter-spacing: 0.08em;
}

.team-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.team-member-list,
.team-current-hills {
  min-height: 220px;
}

.team-member-item,
.team-hill-item {
  display: grid;
  min-height: 72px;
  padding: 12px 18px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.team-member-item:last-child,
.team-hill-item:last-child {
  border-bottom: 0;
}

.team-member-item {
  grid-template-columns: 40px minmax(0, 1fr) auto;
}

.team-member-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--cyan-soft);
  border: 1px solid rgba(98, 244, 232, 0.26);
  border-radius: 7px;
}

.team-member-item strong,
.team-member-item small,
.team-hill-item strong,
.team-hill-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-member-item strong,
.team-hill-item strong {
  font-size: 0.82rem;
}

.team-member-item small,
.team-hill-item small {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 0.68rem;
}

.team-member-item > b {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.63rem;
}

.team-hill-item {
  grid-template-columns: 40px minmax(0, 1fr) auto;
}

.team-hill-marker {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.62rem;
  background: var(--acid-soft);
  border: 1px solid rgba(177, 139, 250, 0.26);
  border-radius: 50%;
}

.team-hill-item > b {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.capture-history-panel {
  margin-top: 20px;
  overflow: hidden;
}

.team-capture-list {
  min-height: 190px;
}

.capture-item {
  display: grid;
  min-height: 76px;
  padding: 13px 20px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.capture-item:last-child {
  border-bottom: 0;
}

.capture-line {
  color: var(--text-faint);
  font-size: 0.5rem;
  text-align: center;
}

.capture-item:first-child .capture-line {
  color: var(--acid);
  text-shadow: 0 0 10px rgba(177, 139, 250, 0.72);
}

.capture-copy strong,
.capture-copy small,
.capture-meta time,
.capture-meta b {
  display: block;
}

.capture-copy strong {
  font-size: 0.83rem;
}

.capture-copy small {
  margin-top: 2px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.62rem;
}

.capture-meta {
  text-align: right;
}

.capture-meta time {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.64rem;
}

.capture-meta b {
  margin-top: 4px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.65rem;
}

/* Admin notice console */
.admin-badge {
  display: inline-flex;
  padding: 8px 11px;
  align-items: center;
  gap: 8px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  background: var(--acid-soft);
  border: 1px solid rgba(177, 139, 250, 0.28);
  border-radius: 5px;
}

.admin-badge i {
  width: 7px;
  height: 7px;
  background: var(--acid);
  border-radius: 50%;
  box-shadow:none;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(330px, 0.78fr) minmax(440px, 1.22fr);
  align-items: start;
  gap: 22px;
}

.admin-composer,
.admin-notice-panel {
  overflow: hidden;
}

.admin-panel-header { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:18px 22px; background:transparent; border:0; }

.admin-panel-header span {
  display: block;
  margin-bottom: 3px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.61rem;
  letter-spacing: 0.12em;
}

.admin-panel-header h2 {
  margin: 0;
  font-size: 1rem;
}

.admin-panel-header > b,
.admin-panel-header > strong {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 1.45rem;
}

#notice-form {
  display: grid;
  padding: 22px;
  gap: 9px;
}

#notice-form label {
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 0.86rem;
  font-weight: 650;
}

#notice-form input[type="text"],
#notice-form select,
#notice-form textarea {
  width: 100%;
  color: var(--text);
  background: #15111f;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

#notice-form input[type="text"],
#notice-form select {
  min-height: 48px;
  padding: 0 13px;
}

#notice-form textarea {
  min-height: 150px;
  padding: 12px 13px;
  line-height: 1.65;
  resize: vertical;
}

#notice-form input:focus,
#notice-form select:focus,
#notice-form textarea:focus {
  border-color: rgba(177, 139, 250, 0.72);
  box-shadow:none;
}

#notice-form input::placeholder,
#notice-form textarea::placeholder {
  color: #7184aa;
}

.admin-field-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.75fr) minmax(170px, 1.25fr);
  gap: 12px;
}

.admin-field-row > div {
  display: grid;
  gap: 9px;
}

.field-counter {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.66rem;
  text-align: right;
}

.admin-form-message {
  margin: 6px 0 0;
  padding: 10px 12px;
  color: var(--acid);
  font-size: 0.8rem;
  background: var(--acid-soft);
  border-left: 2px solid var(--acid);
}

.admin-form-message.is-error {
  color: #ffaaa5;
  background: rgba(255, 107, 98, 0.08);
  border-left-color: var(--red);
}

.admin-form-actions {
  display: flex;
  margin-top: 8px;
  justify-content: flex-end;
  gap: 9px;
}

.admin-save-button {
  width: auto;
  min-width: 148px;
  min-height: 47px;
  margin-top: 0;
}

.secondary-button,
.notice-action-button {
  min-height: 42px;
  padding: 0 14px;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.secondary-button:hover,
.notice-action-button:hover {
  color: var(--text);
  background: var(--surface-strong);
  border-color: #3b527b;
}

.secondary-button:disabled,
.notice-action-button:disabled {
  cursor: wait;
  opacity: 0.5;
}

.admin-notice-list {
  min-height: 280px;
}

.admin-notice-item {
  display: grid;
  min-height: 116px;
  padding: 18px 20px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.admin-notice-item:last-child {
  border-bottom: 0;
}

.admin-notice-copy {
  min-width: 0;
}

.admin-notice-meta {
  display: flex;
  margin-bottom: 7px;
  align-items: center;
  gap: 8px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.61rem;
}

.admin-notice-meta b {
  padding: 3px 6px;
  color: var(--cyan);
  font-weight: 700;
  background: var(--cyan-soft);
  border-radius: 3px;
}

.admin-notice-item.is-important .admin-notice-meta b {
  color: var(--acid);
  background: var(--acid-soft);
}

.admin-notice-copy h3 {
  margin: 0 0 5px;
  overflow: hidden;
  font-size: 0.91rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-notice-copy p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.admin-notice-actions {
  display: flex;
  gap: 7px;
}

.notice-action-button {
  min-height: 36px;
  padding: 0 11px;
}

.notice-action-button--danger:hover {
  color: #ffaaa5;
  background: rgba(255, 107, 98, 0.07);
  border-color: rgba(255, 107, 98, 0.38);
}

.empty-state {
  grid-column: 1 / -1;
  min-width: 0;
  width: 100%;
  display: grid;
  min-height: 210px;
  padding: 32px;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.empty-state > span {
  margin-bottom: 11px;
  color: var(--acid);
  font-size: 1.4rem;
}

.empty-state strong {
  font-size: 0.9rem;
}

.empty-state p {
  margin: 5px 0 0;
  color: var(--text-faint);
  font-size: 0.76rem;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
  }

  .app-brand .brand-mark--small { width:34px; }

  .main-nav {
    justify-self: center;
  }

  .main-nav a {
    min-width: 60px;
    padding: 0 10px;
    white-space: nowrap;
  }

  .viewer-menu div {
    min-width: 0;
    max-width: clamp(64px, 10vw, 130px);
  }

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

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

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

  .team-directory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-layout {
    grid-template-columns: minmax(300px, 0.85fr) minmax(380px, 1.15fr);
  }
}

@media (max-width: 820px) {
  .viewer-menu div { max-width:130px; }
  .login-layout {
    grid-template-columns:55% 45%;
  }

  .login-intro { min-height:100dvh; padding:24px 14px; }
  .login-intro .login-copy { margin:100px 0 auto; padding:0; }
  .login-intro .login-brandline { gap:7px; }
  .login-intro .login-brandline strong { font-size:.75rem; }
  .login-intro .login-brandline span { font-size:.45rem; }
  .login-intro .brand-mark { width:30px; height:30px; flex-shrink:0; }
  .login-intro .event-edition { font-size:.5rem; }
  .login-intro .event-tagline { font-size:.65rem; }
  .login-intro .login-signal { font-size:.4rem; gap:5px; }
  .login-dark-stag { width:clamp(180px,44vw,350px); right:-52px; bottom:40px; }
  .login-panel .login-card { min-width:0; }
  .login-panel .login-heading h2 { font-size:clamp(1.1rem,3vw,1.6rem); }
  .login-panel .login-heading p,.login-panel .login-footnote { font-size:.65rem; }
  .login-panel .status-chip,.login-panel .login-heading>span { display:none; }
  .login-panel .input-shell input { min-width:0; padding:12px 8px; }
  .login-panel .primary-button { padding:12px; font-size:.8rem; }
  .login-panel .password-toggle { font-size:.6rem; padding:5px; }
  .login-copy { padding:36px 0 24px; }
  .event-stag { width:270px; right:-30px; bottom:-110px; opacity:.18; }
  .event-edition { margin-bottom:18px; }
  .event-tagline { margin-top:18px; font-size:.9rem; }
  .login-signal { font-size:.6rem; }

  .login-panel {
    min-height:100dvh;
    padding:24px 14px;
  }

  .topbar {
    position: relative;
    min-height: 116px;
    padding: 13px 16px 48px;
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 43px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    justify-self: stretch;
    justify-content: stretch;
    gap: 0;
    border-top: 1px solid var(--line-soft);
  }

  .main-nav a {
    min-width: 0;
    flex: 1;
    padding: 0 10px;
    font-size: 0.78rem;
    white-space: nowrap;
  }

  .main-nav a.active::after {
    right: 10px;
    left: 10px;
  }

  .connection-banner {
    top: 0;
    flex-wrap: wrap;
  }

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

  .context-rail {
    display: none;
  }

  .content {
    padding: 20px 17px 56px;
  }

  .page-header {
    min-height: 0;
    margin-bottom: 22px;
    align-items: flex-start;
  }

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

  .metric-card {
    min-height:110px;
    padding:12px 0;
  }

  .scoreboard-head {
    display: none;
  }

  .scoreboard-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .score-chart-cell {
    grid-template-columns: minmax(100px, 1fr) 80px;
  }

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

  .team-directory {
    grid-template-columns: 1fr;
  }

  .team-profile-grid {
    grid-template-columns: 1fr;
  }

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

  .submission-history-panel {
    grid-column: auto;
  }

  .submission-history {
    grid-template-columns: 1fr;
  }

  .submission-history-item {
    border-right: 0;
  }

  .team-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .app-brand .brand-mark--small { width:30px; }

  .topbar-actions {
    width: 100%;
    justify-self: stretch;
    gap: 8px;
  }

  .topbar-actions .viewer-menu {
    margin-left: auto;
  }

  .viewer-menu > span {
    width: 31px;
    height: 31px;
  }

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

  .metric-card {
    min-height: 120px;
    padding: 16px;
  }

  .metric-card strong {
    font-size: 1.55rem;
  }

  .metric-card small {
    letter-spacing: 0.04em;
  }

  .page-header {
    display: block;
  }

  .score-legend,
  .problem-count,
  .notice-count {
    margin-top: 17px;
  }

  .submission-challenge-list {
    grid-template-columns: 1fr;
  }

  .submission-file-row {
    grid-template-columns: 1fr;
  }

  .submission-file-row .primary-button {
    width: 100%;
  }

  .submission-admin-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .submission-admin-actions,
  .submission-admin-actions .secondary-button {
    width: 100%;
  }

  .submission-kit-meta,
  .submission-result-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .submission-leaderboard-head,
  .submission-leaderboard-row {
    grid-template-columns: minmax(105px, 1fr) 53px minmax(102px, auto);
    gap: 8px;
  }

  .leaderboard-row {
    padding: 0 14px;
    grid-template-columns: 28px minmax(90px, 1fr) 75px;
  }

  .leaderboard-row .mini-bar {
    display: none;
  }

  .compact-hill {
    padding: 13px 14px;
  }

  .notice-strip {
    grid-template-columns: 1fr;
  }

  .notice-strip-item {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .notice-strip-item:last-child {
    border-bottom: 0;
  }

  .notice-card {
    padding: 19px;
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 13px;
  }

  .notice-icon {
    width: 38px;
    height: 38px;
  }

  .notice-date {
    grid-column: 2;
  }

  .admin-field-row {
    grid-template-columns: 1fr;
  }

  .admin-notice-item {
    grid-template-columns: 1fr;
  }

  .admin-notice-actions {
    justify-content: flex-end;
  }

  .admin-form-actions {
    flex-direction: column-reverse;
  }

  .admin-save-button,
  .secondary-button {
    width: 100%;
  }

  .capture-item {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .capture-meta {
    grid-column: 2;
    text-align: left;
  }
}

/* Home is an event cover, not another metrics dashboard. */
.home-view { min-height:calc(100vh - 190px); }
.home-stage { position:relative; display:grid; grid-template-columns:minmax(0,.9fr) minmax(360px,1.1fr); min-height:620px; overflow:hidden; border-bottom:1px solid var(--line); background:radial-gradient(circle at 72% 44%,rgba(95,39,179,.2),transparent 38%); }
.home-copy { position:relative; z-index:2; display:flex; padding:clamp(42px,7vw,96px) 0 48px; flex-direction:column; justify-content:center; align-items:flex-start; }
.event-title { max-width:660px; margin:16px 0 34px; font-size:clamp(2.15rem,4.4vw,4.5rem); line-height:1.02; letter-spacing:-.06em; }
.event-title > span,.event-title > em { display:block; }
.event-title > em { color:#91d8d1; font-style:normal; }
.home-event-clock { display:grid; grid-template-columns:auto minmax(190px,auto); align-items:end; gap:4px 28px; padding-left:16px; border-left:2px solid #8f71bd; }
.home-event-clock > span { grid-column:1/-1; color:#d8cbe9; font-weight:700; }
.home-event-clock small { color:var(--text-faint); font-size:.72rem; letter-spacing:.06em; }
.home-event-clock strong { grid-column:2; grid-row:2; color:#f2edf8; font:700 clamp(1.65rem,3vw,2.7rem) var(--mono); letter-spacing:-.04em; }
.home-schedule { display:flex; gap:28px; margin:28px 0 0; }
.home-schedule div { min-width:170px; padding-top:9px; border-top:1px solid var(--line); }
.home-schedule dt,.home-facts dt { color:var(--text-faint); font:700 .61rem var(--mono); letter-spacing:.12em; }
.home-schedule dd { margin:6px 0 0; color:var(--text-dim); font-size:.78rem; }
.home-actions { display:flex; align-items:center; gap:22px; margin-top:34px; }
.home-actions a { color:var(--text-dim); font-size:.82rem; font-weight:700; }
.home-actions a:hover { color:var(--text); }
.home-actions .home-primary-link { display:flex; min-height:40px; padding:0 16px; align-items:center; gap:18px; color:#11101a; background:#91d8d1; border-radius:4px; }
.home-facts { display:flex; gap:30px; margin:44px 0 0; }
.home-facts div { display:grid; min-width:76px; gap:4px; }
.home-facts dd { margin:0; font:700 1.2rem var(--mono); }
.home-stag { position:relative; min-width:0; margin:0; pointer-events:none; }
.home-stag img { position:absolute; z-index:1; top:50%; right:1%; bottom:auto; width:min(620px,92%); max-height:88%; object-fit:contain; object-position:right center; transform:translateY(-50%); filter:drop-shadow(0 28px 40px rgba(28,8,64,.36)); }
.home-stag-orbit { position:absolute; top:14%; right:0; width:min(580px,92%); aspect-ratio:1; border:1px solid rgba(140,102,190,.18); border-radius:50%; transform:rotate(-12deg); }
.home-stag-orbit::after { position:absolute; inset:14%; content:""; border:1px solid rgba(107,211,215,.1); border-radius:50%; }

/* Profile combines personal identity, team status and both token scopes. */
.profile-header { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:18px; padding:0 0 20px; border-bottom:1px solid var(--line); }
.profile-header h1 { margin:3px 0 0; font-size:var(--page-title-size); line-height:1.2; letter-spacing:-.05em; }
.profile-header p { margin:5px 0 0; color:var(--text-dim); font-size:.8rem; }
.profile-avatar { display:grid; width:58px; height:58px; place-items:center; color:#9ee3dd; background:#1a2630; border:1px solid #36525d; border-radius:8px; font:700 1rem var(--mono); }
.profile-team-link { color:#91d8d1; font-size:.78rem; font-weight:700; }
.profile-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); margin:0; padding:24px 0; border-bottom:1px solid var(--line); }
.profile-stats div { padding:0 22px; border-left:1px solid var(--line); }
.profile-stats div:first-child { padding-left:0; border-left:0; }
.profile-stats dt { color:var(--text-faint); font-size:.72rem; }
.profile-stats dd { margin:7px 0 0; font:700 1.35rem var(--mono); }
.profile-layout { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(280px,.75fr); gap:0 42px; }
.profile-main-column,.profile-side-column { min-width:0; }
.profile-side-column { border-left:1px solid var(--line); padding-left:42px; }
.profile-section { padding:30px 0; border-bottom:1px solid var(--line); }
.profile-section > header { display:flex; align-items:baseline; gap:12px; margin-bottom:18px; }
.profile-section > header span { color:#8fd7d2; font:700 .61rem var(--mono); letter-spacing:.12em; }
.profile-section > header h2 { margin:0; font-size:1rem; }
.profile-section > p { color:var(--text-dim); font-size:.8rem; line-height:1.65; }
.profile-section .account-details { margin:0; }
.profile-account-actions { display:flex; margin-top:20px; }
.profile-token-section > label { display:block; margin:16px 0 6px; color:var(--text-dim); font-size:.74rem; }
.profile-token-section > input { width:100%; min-height:44px; padding:0 12px; color:var(--text); background:#171522; border:1px solid var(--line); border-radius:5px; }
.profile-token-section .operations-actions { margin-top:10px; }
.profile-token-section .primary-button { width:auto; min-height:40px; margin:0; padding:0 16px; border-radius:5px; }
.profile-token-value,.personal-token-result { display:flex; align-items:center; gap:10px; margin-top:12px; }
.profile-token-value code,.personal-token-result code { min-width:0; padding:9px 11px; overflow:auto; color:#b6e8e4; background:#141a22; border:1px solid var(--line); border-radius:4px; user-select:all; }
.profile-member-list,.profile-solved-list { display:grid; gap:0; }
.profile-member-item { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:10px; padding:11px 0; border-bottom:1px solid var(--line-soft); }
.profile-member-avatar { display:grid; width:30px; height:30px; place-items:center; color:#9edcd7; background:#1b2630; border-radius:4px; font:700 .66rem var(--mono); }
.profile-member-item strong { font-size:.82rem; }
.profile-member-item small { color:var(--text-faint); font-size:.68rem; }
.profile-solved-item { display:grid; grid-template-columns:minmax(76px,auto) minmax(0,1fr) auto; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--line-soft); }
.profile-solved-item span { color:#a88bc5; font:700 .61rem var(--mono); }
.profile-solved-item strong { min-width:0; overflow:hidden; text-overflow:ellipsis; font-size:.82rem; white-space:nowrap; }
.profile-solved-item b { color:#f1b3bb; font:700 .72rem var(--mono); }
.profile-empty-copy { color:var(--text-faint); font-size:.78rem; }

@media (max-width:980px) {
  .home-stage { grid-template-columns:minmax(0,1fr) minmax(280px,.7fr); }
  .home-stag img { right:-18%; width:115%; opacity:.76; }
  .profile-layout { grid-template-columns:1fr; }
  .profile-side-column { padding-left:0; border-left:0; }
}

@media (max-width:700px) {
  .home-stage { display:block; min-height:650px; }
  .home-copy { padding-top:48px; }
  .home-stag { position:absolute; inset:180px -90px -20px 30%; opacity:.38; }
  .home-schedule { display:grid; gap:12px; }
  .home-event-clock { grid-template-columns:1fr; }
  .home-event-clock strong { grid-column:1; grid-row:auto; }
  .home-actions { flex-wrap:wrap; }
  .profile-header { grid-template-columns:auto minmax(0,1fr); }
  .profile-team-link { grid-column:1/-1; }
  .profile-stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 0; }
  .profile-stats div:nth-child(3) { padding-left:0; border-left:0; }
}

/* Account and operations pages */
.operations-nav { display:flex; gap:22px; flex-wrap:wrap; margin-bottom:28px; padding:0 0 18px; background:transparent; border:0; border-radius:0; }
.operations-nav a { display:inline-flex; align-items:center; min-height:44px; padding:8px 0; color:var(--text-dim); background:transparent; border:0; border-radius:0; font-weight:650; }
.operations-nav a[aria-current="page"], .operations-nav a.active { color: var(--acid); border-color: var(--acid); }
.admin-operations-nav { display:flex; flex-wrap:wrap; gap:22px; padding:0 0 22px; margin-bottom:24px; border:0; background:transparent; border-radius:0; }
.operations-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.operations-card { padding: 24px; margin-bottom: 20px; min-width: 0; }
.operations-card h2 { margin: 0 0 15px; font-size: 1.1rem; }
.operations-card p { color: var(--text-dim); font-size: 0.83rem; line-height: 1.7; }
.operations-card label { display: block; margin: 17px 0 6px; font-size: 0.8rem; color: var(--text-dim); }
.operations-card input, .operations-card select, .operations-card textarea {
  width: 100%; min-width: 0; padding: 11px 12px; background: var(--surface-soft); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 0.85rem;
}
.operations-card textarea { resize: vertical; }
.operations-card small { display: block; color: var(--text-dim); margin-top: 7px; font-size: 0.72rem; line-height: 1.65; }
.operations-card form, .operations-card div { min-width: 0; }
.operations-card > button, .operations-card form > button { margin-top: 20px; }
#challenge-form > .admin-form-actions {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}
#challenge-form > .admin-form-actions > button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 96px;
  min-height: 44px;
  margin: 0;
  padding: 10px 20px;
  border-radius: 6px;
  line-height: 1.35;
  white-space: nowrap;
}
.operations-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.check-label, .operations-card .check-label { display: flex; align-items: center; gap: 9px; }
#notice-form .check-label input, .operations-card .check-label input { width: 18px; height: 18px; margin: 0; accent-color: var(--acid); }
.operations-status { padding: 13px 16px; border-left: 3px solid var(--acid); color: var(--text); background: var(--acid-soft); }
.operations-status.is-error { border-color: var(--red); background: rgba(255,107,98,0.1); }
.token-admin-toolbar { display:grid; grid-template-columns:minmax(180px,1fr) auto auto; gap:16px; align-items:end; margin:18px 0 24px; }
.token-admin-toolbar label { margin:0; }
.token-admin-toolbar .operations-actions { align-items:center; }
.admin-token-list { display:grid; gap:12px; }
.admin-token-team { padding:16px 0; border-top:1px solid var(--line-soft); }
.admin-token-team-head { display:grid; grid-template-columns:minmax(180px,1fr) minmax(260px,1.5fr) auto; gap:14px; align-items:center; }
.admin-token-team-head code { min-width:0; overflow-wrap:anywhere; color:var(--text); font-size:.76rem; user-select:all; }
.admin-token-members { display:grid; grid-template-columns:minmax(180px,1fr) minmax(260px,1.5fr); gap:6px 14px; margin-top:13px; padding-left:18px; color:var(--text-dim); font-size:.76rem; }
.admin-token-members code { color:var(--text-dim); overflow-wrap:anywhere; }
.admin-token-result { margin-top:22px; padding-top:20px; border-top:1px solid var(--line-soft); }
.admin-token-result textarea { width:100%; margin-top:10px; font:12px/1.6 var(--mono); }
@media (max-width:900px) { .token-admin-toolbar { grid-template-columns:1fr; align-items:stretch; } .admin-token-team-head { grid-template-columns:1fr; } .admin-token-team-head button { justify-self:start; } .admin-token-members { grid-template-columns:1fr; padding-left:0; } }
.operations-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.operations-row strong, .operations-row small { overflow-wrap: anywhere; }
.operations-row .secondary-button { flex-shrink: 0; width: auto; }
.account-details { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 22px; margin: 0 0 22px; }
.account-details dt { font-size: 0.76rem; color: var(--text-dim); }
.account-details dd { margin: 7px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.personal-token-result { margin-top: 18px; padding: 16px; border: 1px solid var(--line); background: rgba(3, 12, 28, .55); }
.personal-token-result code { display: block; margin: 12px 0; padding: 12px; overflow-wrap: anywhere; color: var(--accent); }
.score-value .score-delta, .score-points .score-delta {
  display: block;
  /* Fixed height + matching line-height so the empty slot and the filled
     "+15" slot are byte-identical in height. min-height alone let the text's
     inherited line-height (1.5) overflow the reservation and nudge PTS up. */
  height: 1.05em;
  line-height: 1.05em;
  color: #6ee7b7;
  font-size: 0.7rem;
  letter-spacing: 0;
  opacity: 0;
  transform: translateY(-2px);
}
.score-value .score-delta.is-negative, .score-points .score-delta.is-negative { color: var(--amber); }
.score-value .score-delta.is-visible, .score-points .score-delta.is-visible {
  animation: score-delta-flash 1.1s ease-out forwards;
}
@keyframes score-delta-flash {
  0% { opacity: 0; transform: translateY(-2px); }
  12% { opacity: 1; transform: translateY(0); }
  70% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .score-value .score-delta.is-visible, .score-points .score-delta.is-visible {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
.pinned-badge { display: inline-block; padding: 3px 6px; font-size: 0.65rem; color: var(--amber); border: 1px solid currentColor; border-radius: 4px; margin-bottom: 8px; }
@media (max-width: 820px) { .operations-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .operations-card { padding: 18px; } .account-details { grid-template-columns: minmax(0, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── 운영 상태 (OPS_READINESS.md C2/C3/H1/H2/H5) ─────────────────────────────── */
.ops-banner {
  position: sticky;
  top: 68px;
  z-index: 89;
  display: flex;
  min-height: 42px;
  padding: 8px 24px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  color: #fff;
  font-size: 0.82rem;
  background: #8f2a25;
  border-bottom: 1px solid rgba(255, 107, 98, 0.6);
}

.ops-banner[data-state="paused"],
.ops-banner[data-state="ok"] {
  color: #241800;
  background: var(--amber);
  border-bottom-color: rgba(36, 24, 0, 0.3);
}

.ops-banner a {
  color: inherit;
  font-weight: 800;
  text-underline-offset: 3px;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.ops-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 20px;
}

/* 기존 패널 규칙: 헤더처럼 본문도 좌우 20px 안쪽에 둔다. */
.ops-card > :not(.panel-header) {
  margin-right: 20px;
  margin-left: 20px;
}

.ops-card > .ops-message {
  margin-top: 4px;
}

.ops-card .admin-inline-control {
  margin-top: auto;
}

.ops-message {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.84rem;
}

.ops-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.ops-state::before {
  content: "";
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
}

.ops-state[data-state="ok"],
.ops-state[data-state="up"] {
  color: #4fd69c;
  border-color: rgba(79, 214, 156, 0.45);
}

.ops-state[data-state="paused"] {
  color: var(--amber);
  border-color: rgba(255, 189, 82, 0.5);
}

.ops-state[data-state="stale"],
.ops-state[data-state="down"],
.ops-state[data-state="invalid_king"] {
  color: var(--red);
  border-color: rgba(255, 107, 98, 0.5);
}

.ops-meta {
  display: grid;
  gap: 6px;
  margin: 0;
}

.ops-meta div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  font-size: 0.8rem;
}

.ops-meta dt {
  color: var(--text-faint);
}

.ops-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.ops-hills-panel {
  margin-top: 20px;
  padding-bottom: 20px;
}

.ops-hill-list {
  display: grid;
  gap: 8px;
  padding: 16px 20px 0;
}

.ops-hill-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(0, 2fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.ops-hill-name {
  display: grid;
}

.ops-hill-name small,
.ops-hill-detail {
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

#ops-pause-toggle.is-active,
.ops-hill-row .secondary-button.is-active,
#ops-token-toggle.is-active {
  color: var(--amber);
  border-color: rgba(255, 189, 82, 0.55);
}

.reset-schedule {
  margin: 6px 0 0;
  color: var(--cyan);
  font-size: 0.84rem;
}

.team-token-panel {
  margin: 0 0 20px;   /* 위는 팀 지표 묶음의 margin-bottom(20px)이 띄운다 */
}

.team-token-message {
  margin: 0;
  padding: 16px 20px 12px;
  color: var(--text-dim);
  font-size: 0.84rem;
}

.token-box {
  padding: 0 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.token-box code {
  padding: 8px 12px;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.04em;
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: 8px;
  user-select: all;
}

/* Challenge catalogue and matrix scoreboard are intentionally distinct from
   the legacy capture-Hill visuals.  KotH is a portal category, not a global
   object that a team can be said to be currently holding. */
.problem-filter-toolbar { display:flex; align-items:flex-end; justify-content:space-between; gap:18px 28px; margin:0 0 22px; flex-wrap:wrap; }
.problem-filter-group { display:grid; gap:7px; }
.problem-filter-label { color:var(--text-dim); font:700 .64rem var(--mono); letter-spacing:.11em; text-transform:uppercase; }
.problem-filters { display:flex; gap:8px; margin:0; flex-wrap:wrap; }
.problem-filters .secondary-button.active { border-color:var(--cyan); color:var(--cyan); background:rgba(71,211,255,.09); }
.problem-card--koth { --problem-surface:#3a2029; --problem-hover:#472631; --problem-edge:#8a4858; --problem-accent:#ffabb5; box-shadow:inset 3px 0 #e87889; cursor:pointer; }
.problem-card--jeopardy { --problem-surface:#15324b; --problem-hover:#1a3d5b; --problem-edge:#3b6c91; --problem-accent:#8bd5ff; box-shadow:inset 3px 0 #58b7ed; cursor:pointer; }
.problem-card--link:hover,.problem-card--link:focus-visible { transform:none; outline:2px solid var(--cyan); outline-offset:7px; box-shadow:none; }
.problem-card--compact { display:grid; grid-template-columns:minmax(0,1fr) auto; min-height:138px; padding:24px; gap:12px 24px; border:1px solid var(--problem-edge,var(--line-soft)); border-radius:8px; background:var(--problem-surface,var(--surface)); align-content:center; transition:background-color 150ms ease; }
.problem-card--compact:hover { background:var(--problem-hover,var(--surface-strong)); }
.problem-card--compact:focus-visible { outline:2px solid var(--problem-accent,var(--cyan)); outline-offset:3px; }
.problem-card--compact .problem-category-strip { grid-column:1; grid-row:1; color:var(--problem-accent,var(--cyan)); }
.problem-card--compact h2 { grid-column:1; grid-row:2; margin:0; font-size:clamp(1.3rem,2.1vw,1.85rem); letter-spacing:-.035em; overflow-wrap:anywhere; }
.problem-category-strip { display:block; grid-column:1/-1; margin:0; padding:0; color:var(--cyan); background:transparent; border:0; font:700 .72rem var(--sans); letter-spacing:.04em; }
.problem-card--jeopardy .problem-category-strip { color:var(--problem-accent); background:transparent; border:0; }
.problem-score { grid-column:2; grid-row:2; display:flex; align-items:baseline; justify-content:flex-end; gap:8px; padding:0; border:0; }
.problem-score small { display:none; }.problem-score strong { color:var(--text); font-family:var(--mono); }
.problem-card--jeopardy.is-solved { --problem-surface:rgba(39,52,61,.48); --problem-hover:rgba(46,61,70,.58); --problem-edge:rgba(112,132,143,.46); --problem-accent:#91a8b4; box-shadow:inset 3px 0 rgba(126,149,160,.58); }
.problem-card--jeopardy.is-solved h2,
.problem-card--jeopardy.is-solved .problem-score strong { color:#b7c1c7; }
.problem-solve-badge { grid-column:2; grid-row:1; justify-self:end; color:#aab9c0; font:800 .68rem var(--mono); letter-spacing:.08em; }
/* A repeating tile layout keeps catalogue order stable during live updates. */
.problem-grid--mosaic {
  grid-template-columns:repeat(4,minmax(0,1fr));
  grid-auto-rows:minmax(168px,auto);
  grid-auto-flow:row;
  gap:16px;
}
.problem-grid--mosaic > .empty-state { grid-column:1/-1; }
.problem-grid--mosaic > .problem-card--compact {
  grid-column:span 1;
  grid-row:span 1;
  grid-template-rows:auto minmax(min-content,1fr) auto;
  min-width:0;
  min-height:0;
  padding:20px;
  gap:12px 16px;
  align-content:stretch;
}
.problem-grid--mosaic > .problem-card--compact:nth-child(12n+1),
.problem-grid--mosaic > .problem-card--compact:nth-child(12n+11) {
  grid-column:span 2;
  grid-row:span 2;
}
.problem-grid--mosaic > .problem-card--compact:nth-child(12n+2),
.problem-grid--mosaic > .problem-card--compact:nth-child(12n+6),
.problem-grid--mosaic > .problem-card--compact:nth-child(12n+10),
.problem-grid--mosaic > .problem-card--compact:nth-child(12n+12) { grid-column:span 2; }
.problem-grid--mosaic > .problem-card--compact:nth-child(12n+5),
.problem-grid--mosaic > .problem-card--compact:nth-child(12n+7) { grid-row:span 2; }
.problem-grid--mosaic .problem-category-strip { min-width:0; align-self:start; line-height:1.4; overflow-wrap:anywhere; }
.problem-grid--mosaic .problem-solve-badge { align-self:start; white-space:nowrap; }
.problem-grid--mosaic .problem-card--compact h2 {
  grid-column:1/-1;
  grid-row:2;
  align-self:center;
  font-size:clamp(1.05rem,1.5vw,1.35rem);
  line-height:1.35;
}
.problem-grid--mosaic > .problem-card--compact:nth-child(12n+1) h2,
.problem-grid--mosaic > .problem-card--compact:nth-child(12n+11) h2 { font-size:clamp(1.35rem,2.2vw,1.75rem); }
.problem-grid--mosaic .problem-score { grid-column:1/-1; grid-row:3; justify-content:flex-start; align-self:end; min-width:0; }
.problem-grid--mosaic .problem-score strong { font-size:1.05rem; overflow-wrap:anywhere; }
@media (max-width:1180px) {
  .problem-grid--mosaic { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .problem-grid--mosaic > .problem-card--compact:nth-child(n) { grid-column:span 1; grid-row:span 1; }
  .problem-grid--mosaic > .problem-card--compact:nth-child(8n+1) { grid-column:span 2; }
  .problem-grid--mosaic > .problem-card--compact:nth-child(8n+5) { grid-column:span 2; grid-row:span 2; }
  .problem-grid--mosaic > .problem-card--compact:nth-child(8n+2),
  .problem-grid--mosaic > .problem-card--compact:nth-child(8n+7) { grid-row:span 2; }
  .problem-grid--mosaic > .problem-card--compact:nth-child(n) h2 { font-size:1.2rem; }
}
@media (max-width:640px) {
  .problem-grid--mosaic { grid-template-columns:minmax(0,1fr); grid-auto-rows:auto; gap:12px; }
  .problem-grid--mosaic > .problem-card--compact:nth-child(n) { grid-column:span 1; grid-row:span 1; min-height:164px; padding:18px; }
  .problem-grid--mosaic > .problem-card--compact:nth-child(4n+1) { min-height:212px; }
}

/* Shared muted palette for catalogue cards and their detail dialogs. */
.problem-card--poster, .problem-detail {
  --challenge-surface:linear-gradient(135deg,#2d2744,#211c34);
  --challenge-ink:#f1edf9;
  --challenge-muted:#b6aacd;
  --challenge-accent:#c4adf6;
  --challenge-footer:#211b33;
  --challenge-edge:#4c405f;
  --challenge-arrow:#3b304e;
  --challenge-halo:#6a528c;
  --poster-art-size:104px;
  --poster-title-size:clamp(1.05rem,1.5vw,1.35rem);
}
.problem-card--poster.problem-card--koth, .problem-detail--koth {
  --challenge-surface:linear-gradient(135deg,#2a3154,#202641);
  --challenge-ink:#edf0ff;
  --challenge-muted:#b2bedf;
  --challenge-accent:#a3bbfa;
  --challenge-footer:#1d233b;
  --challenge-edge:#424d72;
  --challenge-arrow:#343f63;
  --challenge-halo:#526eaf;
}
.problem-card--poster.is-solved, .problem-detail--solved {
  --challenge-surface:linear-gradient(135deg,#223b36,#1b2e2d);
  --challenge-ink:#e2f2eb;
  --challenge-muted:#a3c5b8;
  --challenge-accent:#89d3b6;
  --challenge-footer:#192d28;
  --challenge-edge:#3c5b51;
  --challenge-arrow:#2c493e;
  --challenge-halo:#488771;
}
.problem-grid--mosaic { grid-auto-rows:minmax(216px,auto); }
.problem-grid--mosaic > .problem-card--poster {
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:minmax(min-content,1fr) auto;
  padding:0;
  gap:0;
  color:var(--challenge-ink);
  background:var(--challenge-surface);
  border:1px solid var(--challenge-edge);
  border-radius:5px;
  box-shadow:0 2px 3px #00000012,0 12px 28px #0000001c;
  isolation:isolate;
  transition:transform 180ms ease,box-shadow 180ms ease;
}
.problem-grid--mosaic > .problem-card--poster:hover {
  background:var(--challenge-surface);
  transform:translateY(-3px);
  box-shadow:0 5px 10px #0000001a,0 18px 34px #00000029;
}
.problem-grid--mosaic > .problem-card--poster:focus-visible { outline:3px solid var(--challenge-accent); outline-offset:4px; }
.problem-card-main { position:relative; grid-column:1; grid-row:1; display:flex; min-width:0; min-height:152px; isolation:isolate; }
.problem-card-main::after {
  content:""; position:absolute; z-index:-1; right:-16px; bottom:-12px;
  width:calc(var(--poster-art-size) * 1.6); aspect-ratio:1;
  background:radial-gradient(circle,var(--challenge-halo),transparent 68%);
  opacity:.55; pointer-events:none;
}
.problem-card-copy { position:relative; z-index:1; width:100%; min-width:0; padding:22px calc(var(--poster-art-size) + 22px) 20px 20px; }
.problem-kind { display:block; color:var(--challenge-accent); font-size:.61rem; font-weight:800; line-height:1.4; letter-spacing:.08em; overflow-wrap:anywhere; }
.problem-grid--mosaic > .problem-card--poster:nth-child(n) h2 {
  margin:10px 0 8px;
  color:var(--challenge-ink);
  font-size:var(--poster-title-size);
  line-height:1.3;
  letter-spacing:-.04em;
}
.problem-grid--mosaic .problem-card--poster .problem-category-strip { color:var(--challenge-muted); font-size:.65rem; font-weight:600; line-height:1.4; letter-spacing:.03em; }
.problem-card-art { position:absolute; z-index:0; right:10px; bottom:10px; width:var(--poster-art-size); height:var(--poster-art-size); pointer-events:none; }
.problem-card-art svg { display:block; width:100%; height:100%; filter:saturate(.6) brightness(.85); opacity:.8; }
.problem-grid--mosaic .problem-card--poster .problem-solve-badge {
  position:absolute; z-index:2; top:17px; right:16px; padding:4px 7px;
  color:#a3dfc4; background:#233e34; border:1px solid #466858; border-radius:4px;
  font-size:.57rem; font-weight:800; line-height:1.2; letter-spacing:.04em;
}
.problem-card-footer { grid-column:1; grid-row:2; display:flex; align-items:center; justify-content:space-between; gap:16px; min-width:0; padding:12px 20px; background:var(--challenge-footer); }
.problem-grid--mosaic .problem-card--poster .problem-score { display:flex; flex-direction:column; align-items:flex-start; align-self:auto; gap:4px; min-width:0; }
.problem-grid--mosaic .problem-card--poster .problem-score small { display:block; color:var(--challenge-muted); font-size:.61rem; font-weight:500; line-height:1.2; letter-spacing:.01em; }
.problem-grid--mosaic .problem-card--poster .problem-score strong { color:var(--challenge-ink); font-size:1.05rem; font-weight:750; line-height:1.2; overflow-wrap:anywhere; }
.problem-card-arrow { display:grid; place-items:center; flex:0 0 32px; width:32px; height:32px; color:var(--challenge-accent); background:var(--challenge-arrow); border-radius:50%; font-size:1.1rem; font-weight:600; }
.problem-grid--mosaic > .problem-card--poster:nth-child(12n+1),
.problem-grid--mosaic > .problem-card--poster:nth-child(12n+11) { --poster-art-size:196px; --poster-title-size:clamp(1.35rem,2.2vw,1.75rem); }
.problem-grid--mosaic > .problem-card--poster:nth-child(12n+2),
.problem-grid--mosaic > .problem-card--poster:nth-child(12n+6),
.problem-grid--mosaic > .problem-card--poster:nth-child(12n+10),
.problem-grid--mosaic > .problem-card--poster:nth-child(12n+12) { --poster-art-size:128px; }
.problem-grid--mosaic > .problem-card--poster:nth-child(12n+5),
.problem-grid--mosaic > .problem-card--poster:nth-child(12n+7) { --poster-art-size:144px; }
@media (max-width:1180px) {
  .problem-grid--mosaic > .problem-card--poster:nth-child(n) { --poster-art-size:104px; --poster-title-size:1.2rem; }
  .problem-grid--mosaic > .problem-card--poster:nth-child(8n+1) { --poster-art-size:128px; }
  .problem-grid--mosaic > .problem-card--poster:nth-child(8n+5) { --poster-art-size:176px; --poster-title-size:1.5rem; }
  .problem-grid--mosaic > .problem-card--poster:nth-child(8n+2),
  .problem-grid--mosaic > .problem-card--poster:nth-child(8n+7) { --poster-art-size:144px; }
}
@media (max-width:640px) {
  .problem-grid--mosaic { grid-auto-rows:auto; }
  .problem-grid--mosaic > .problem-card--poster:nth-child(n) { min-height:216px; padding:0; --poster-art-size:96px; --poster-title-size:1.2rem; }
  .problem-grid--mosaic > .problem-card--poster:nth-child(4n+1) { min-height:252px; --poster-art-size:128px; --poster-title-size:1.35rem; }
}
@media (prefers-reduced-motion:reduce) {
  .problem-grid--mosaic > .problem-card--poster { transition:none; }
  .problem-grid--mosaic > .problem-card--poster:hover { transform:none; }
}

.problem-detail {
  border:1px solid var(--challenge-edge);
  background:#191523;
  border-radius:14px;
}
.problem-dialog {
  color:var(--text);
  padding:0;
  width:min(820px,calc(100vw - 40px));
  max-height:calc(100dvh - 48px);
  overflow:auto;
  margin:auto;
  box-shadow:0 28px 100px #00000066;
  scrollbar-width:thin;
  scrollbar-color:var(--challenge-edge) #191523;
}
.problem-dialog::backdrop { background:#080610bd; backdrop-filter:blur(7px); }
body.problem-modal-open { overflow:hidden; }
.problem-detail-body { min-width:0; }
.problem-detail-head {
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:18px 28px;
  align-items:end;
  padding:26px 28px;
  background:var(--challenge-surface);
  border-bottom:1px solid var(--challenge-edge);
}
.problem-detail-meta { grid-column:1/-1; display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; min-height:28px; padding-right:48px; }
.problem-detail-meta .problem-kind { font-size:.65rem; letter-spacing:.09em; }
.problem-detail-category { padding:4px 8px; border:1px solid var(--challenge-edge); border-radius:5px; color:var(--challenge-muted); font-size:.65rem; font-weight:650; overflow-wrap:anywhere; }
.problem-detail-head h2 { grid-column:1; margin:0; min-width:0; color:var(--challenge-ink); font-size:clamp(1.25rem,2.5vw,1.6rem); font-weight:750; line-height:1.35; letter-spacing:-.025em; overflow-wrap:anywhere; }
.problem-detail-score { grid-column:2; display:grid; gap:4px; text-align:right; }
.problem-detail-score small { color:var(--challenge-muted); font-size:.65rem; line-height:1.4; }
.problem-detail-score strong { color:var(--challenge-accent); font-size:1.25rem; font-weight:750; white-space:nowrap; }
.problem-detail-solved { color:#a3dfc4; font-size:.65rem; font-weight:750; letter-spacing:.05em; }
.detail-close {
  position:absolute; top:20px; right:20px;
  display:grid; place-items:center;
  width:36px; height:36px; padding:0;
  border:1px solid var(--challenge-edge); border-radius:8px;
  color:var(--challenge-muted); background:#ffffff05;
  cursor:pointer; font-size:1.35rem; line-height:1;
}
.detail-close:hover { color:var(--challenge-ink); background:#ffffff0c; }
.problem-detail-content { display:grid; gap:22px; min-width:0; padding:26px 28px 28px; }
.problem-detail-description { color:#c6bdd5; font-size:.92rem; line-height:1.85; white-space:pre-wrap; overflow-wrap:anywhere; min-width:0; }
.problem-detail-description:empty { display:none; }
.problem-portal-link {
  display:grid; grid-template-columns:minmax(0,1fr) auto; gap:5px 18px; align-items:center;
  width:100%; min-width:0; margin:0; padding:16px 18px;
  color:var(--challenge-ink); background:#ffffff04;
  border:1px solid var(--challenge-edge); border-radius:9px;
  transition:background-color 150ms ease,border-color 150ms ease;
}
.problem-portal-link:hover { background:#ffffff08; border-color:var(--challenge-accent); }
.problem-portal-kicker { grid-column:1; color:var(--challenge-accent); font-size:.7rem; font-weight:650; }
.problem-portal-url { grid-column:1; min-width:0; overflow-wrap:anywhere; font-size:.87rem; font-weight:550; }
.problem-portal-arrow { grid-column:2; grid-row:1/3; color:var(--challenge-accent); font-size:1.25rem; }
.problem-detail-resources { display:grid; gap:10px; min-width:0; }
.problem-detail-resources h3 { margin:0; color:#aba0bf; font-size:.72rem; font-weight:600; }
.detail-attachments { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); gap:10px; min-width:0; }
.detail-attachment {
  display:grid; grid-template-columns:36px minmax(0,1fr) auto; align-items:center; gap:12px;
  min-width:0; min-height:70px; padding:14px 16px;
  border:1px solid #3c334b; border-radius:9px;
  color:var(--text); background:#ffffff03;
  text-decoration:none; transition:border-color 150ms ease,background-color 150ms ease;
}
.detail-attachment:hover { color:var(--text); border-color:var(--challenge-edge); background:#ffffff07; }
.detail-attachment-icon { display:grid; place-items:center; width:36px; height:36px; border-radius:8px; background:var(--challenge-arrow); color:var(--challenge-accent); }
.detail-attachment-icon svg { width:19px; height:19px; }
.detail-attachment-copy { display:grid; gap:4px; min-width:0; }
.detail-attachment-copy strong { font-size:.83rem; font-weight:650; line-height:1.45; overflow-wrap:anywhere; }
.detail-attachment-address { color:#a89bbd; font-size:.65rem; line-height:1.5; overflow-wrap:anywhere; }
.detail-attachment-arrow { color:var(--challenge-accent); font-size:1.1rem; }
.detail-flag-form {
  display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:12px;
  margin:0; padding:22px 28px 26px;
  border-top:1px solid #ffffff0e; background:#14111f;
}
.detail-flag-field { display:grid; gap:10px; min-width:0; }
.detail-flag-caption { color:var(--challenge-muted); font-size:.67rem; font-weight:650; letter-spacing:.08em; }
.detail-flag-field input {
  width:100%; min-width:0; height:48px; padding:0 15px;
  color:var(--text); background:#100e19; border:1px solid #453951; border-radius:8px;
  font-family:var(--sans); font-size:.9rem; line-height:normal;
}
.detail-flag-field input::placeholder { color:#9586a9; }
.detail-flag-field input:focus { border-color:var(--challenge-accent); outline:2px solid var(--challenge-edge); outline-offset:2px; }
.detail-flag-submit.primary-button {
  width:auto; min-width:104px; min-height:48px; height:48px; margin:0; padding:0 20px;
  justify-content:center; border-radius:8px; border:1px solid transparent;
  background:var(--challenge-accent); color:#171323; font-size:.88rem; font-weight:750;
}
.detail-flag-submit.primary-button:hover { background:var(--challenge-accent); filter:brightness(1.08); }
.detail-flag-submit.primary-button:disabled { filter:none; opacity:.55; }
.problem-detail-description a { color:var(--challenge-accent); font-weight:600; text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:4px; overflow-wrap:anywhere; }
.problem-detail-description a::after { content:" ↗"; display:inline-block; font-size:.85em; }
.problem-detail-description a:hover { color:var(--challenge-ink); text-decoration-thickness:2px; }
.problem-dialog :is(a,button):focus-visible { outline:2px solid var(--challenge-accent); outline-offset:4px; }
.problem-dialog > .problem-detail-loading { padding:32px; margin:0; color:var(--text-dim); }
.problem-dialog > .empty-state { margin:54px 28px 28px; }
@media (max-width:560px) {
  .problem-dialog { width:calc(100vw - 24px); max-height:calc(100dvh - 24px); border-radius:12px; }
  .problem-detail-head { grid-template-columns:minmax(0,1fr); gap:14px; padding:20px; }
  .problem-detail-meta { padding-right:40px; gap:8px; }
  .detail-close { top:16px; right:14px; }
  .problem-detail-score { grid-column:1; display:flex; align-items:baseline; gap:9px; text-align:left; }
  .problem-detail-score strong { font-size:1.05rem; }
  .problem-detail-content { padding:22px 20px; gap:20px; }
  .problem-detail-description { font-size:.88rem; }
  .detail-flag-form { padding:20px; gap:10px; }
  .detail-flag-submit.primary-button { min-width:78px; padding:0 14px; }
  .detail-attachment { padding:12px; gap:10px; }
}

/* Explicit column widths and opaque sticky cells keep scrolling scores separate. */
.scoreboard-matrix-wrap {
  --matrix-rank-width:56px;
  --matrix-team-width:216px;
  --matrix-total-width:112px;
  --matrix-problem-width:152px;
  --matrix-fixed-width:calc(var(--matrix-rank-width) + var(--matrix-team-width) + var(--matrix-total-width));
  display:block; position:relative; isolation:isolate;
  width:100%; max-width:100%; min-width:0; overflow:auto;
  border:0; border-top:1px solid var(--line); border-radius:0;
  scrollbar-width:thin; scrollbar-color:#51415f var(--bg); overscroll-behavior-x:contain;
}
.scoreboard-matrix-wrap:focus:not(:focus-visible) { outline:none; }
.scoreboard-matrix-wrap:focus-visible { outline-offset:-2px; }
.scoreboard-matrix {
  width:max(100%, calc(var(--matrix-fixed-width) + var(--matrix-problem-width) * var(--matrix-problem-count)));
  table-layout:fixed; border-collapse:separate; border-spacing:0;
  font-size:.84rem; font-variant-numeric:tabular-nums;
}
.scoreboard-matrix .matrix-col-rank { width:var(--matrix-rank-width); }
.scoreboard-matrix .matrix-col-team { width:var(--matrix-team-width); }
.scoreboard-matrix .matrix-col-total { width:var(--matrix-total-width); }
.scoreboard-matrix th, .scoreboard-matrix td {
  padding:16px; border-bottom:1px solid #2b2438;
  vertical-align:middle; line-height:1.45;
}
.scoreboard-matrix thead th {
  position:sticky; top:0; z-index:3; height:88px;
  background:#20192e; color:var(--text-dim); text-align:left;
  font-size:.76rem; font-weight:600;
  border-bottom:1px solid #463653;
}
.scoreboard-matrix .matrix-category {
  display:block; margin-bottom:6px;
  font-size:.62rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase;
}
.scoreboard-matrix .matrix-problem--koth .matrix-category { color:#edacb8; }
.scoreboard-matrix .matrix-problem--jeopardy .matrix-category { color:#92c8ed; }
.scoreboard-matrix .matrix-title {
  display:block; color:var(--text); font-size:.8rem; font-weight:650;
  white-space:normal; overflow-wrap:anywhere; word-break:keep-all;
}
.scoreboard-matrix tbody tr { --matrix-row-bg:#120f1e; }
.scoreboard-matrix tbody tr:nth-child(even) { --matrix-row-bg:#171222; }
.scoreboard-matrix tbody tr:hover { --matrix-row-bg:#241c33; }
.scoreboard-matrix tbody tr.is-viewer { --matrix-row-bg:#172b32; }
.scoreboard-matrix tbody tr.is-viewer:hover { --matrix-row-bg:#1d353d; }
.scoreboard-matrix tbody th, .scoreboard-matrix tbody td {
  height:56px; background:var(--matrix-row-bg); color:var(--text);
}
.scoreboard-matrix :is(.matrix-rank,.matrix-team,.matrix-total) { position:sticky; z-index:2; }
.scoreboard-matrix thead :is(.matrix-rank,.matrix-team,.matrix-total) { z-index:4; }
.scoreboard-matrix .matrix-rank { left:0; padding-inline:8px; text-align:center; color:var(--text-faint); }
.scoreboard-matrix .matrix-team { left:var(--matrix-rank-width); text-align:left; }
.scoreboard-matrix .matrix-total {
  left:calc(var(--matrix-rank-width) + var(--matrix-team-width)); text-align:right;
  border-right:1px solid #493950; box-shadow:6px 0 10px -8px #000;
}
.scoreboard-matrix tbody .matrix-total { font-weight:750; color:#e4d6fa; white-space:nowrap; }
.scoreboard-matrix .matrix-team-link {
  display:block; font-weight:650; white-space:normal; overflow-wrap:anywhere; word-break:keep-all;
}
.scoreboard-matrix .matrix-team-link:hover { color:var(--cyan); }
.scoreboard-matrix tr.is-viewer :is(.matrix-team,.matrix-total) { color:var(--cyan); }
.scoreboard-matrix tr.is-viewer .matrix-rank { box-shadow:inset 3px 0 var(--cyan); }
.scoreboard-matrix :is(.matrix-problem,.koth-cell,.jeopardy-cell) { border-right:1px solid #272032; }
.scoreboard-matrix :is(.koth-cell,.jeopardy-cell) { text-align:center; white-space:nowrap; }
.scoreboard-matrix .koth-cell { color:#d8c6ed; }
.scoreboard-matrix .jeopardy-cell { color:#84788f; }
.scoreboard-matrix .jeopardy-cell.is-solved { color:#b1ddd2; font-weight:550; }
.scoreboard-matrix .jeopardy-cell.is-first-blood { color:#ffd369; font-weight:750; }
@media (max-width:600px) {
  .scoreboard-matrix-wrap {
    --matrix-rank-width:40px; --matrix-team-width:128px;
    --matrix-total-width:88px; --matrix-problem-width:136px;
  }
  .scoreboard-matrix th, .scoreboard-matrix td { padding:13px 12px; }
  .scoreboard-matrix .matrix-rank { padding-inline:6px; }
  .scoreboard-matrix .matrix-team { border-right:1px solid #493950; box-shadow:6px 0 10px -8px #000; }
  /* Keep space for a score column beside the pinned team on narrow screens. */
  .scoreboard-matrix tbody .matrix-total { position:static; }
  .scoreboard-matrix thead .matrix-total { left:auto; z-index:3; }
  .scoreboard-matrix .matrix-total { box-shadow:none; }
}

.event-gate {
  width: min(760px, calc(100% - 40px));
  margin: clamp(48px, 10vh, 120px) auto;
  padding: clamp(30px, 5vw, 58px);
  border: 1px solid rgba(71, 211, 255, .3);
  border-radius: 18px;
  background:var(--surface);
  box-shadow:none;
  text-align: center;
}
.event-gate > p:first-child { color:var(--cyan); font:700 .7rem var(--mono); letter-spacing:.18em; }
.event-gate h1 { margin:12px 0; font-size:clamp(1.7rem,4vw,2.7rem); }
.event-gate > strong { display:block; margin:22px 0; color:#fff; font:700 clamp(2rem,7vw,4.6rem) var(--mono); letter-spacing:.04em; }
.event-gate-message { color:var(--text-dim); }
.event-lobby-notices { display:grid; gap:8px; margin-top:30px; text-align:left; }
.event-lobby-notice { padding:12px 14px; border-left:2px solid var(--cyan); background:rgba(255,255,255,.035); }
.event-lobby-notice strong { display:block; margin-bottom:4px; }
.event-lobby-notice span { color:var(--text-dim); white-space:pre-wrap; }
.event-schedule-card { margin-bottom:20px; }
.event-schedule-heading { display:flex; align-items:start; justify-content:space-between; gap:20px; }
.event-schedule-heading h2 { margin:.35rem 0 0; }
.event-schedule-heading > strong { color:var(--cyan); font:700 .75rem var(--mono); letter-spacing:.1em; }
.event-schedule-intro { margin-bottom:18px; color:var(--text-dim); }
.event-schedule-steps { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:0 0 24px; padding:0; list-style:none; }
.event-schedule-steps li { display:flex; align-items:center; gap:10px; min-height:44px; padding:9px 12px; border:1px solid var(--line-soft); border-radius:9px; background:rgba(255,255,255,.025); color:var(--text-dim); }
.event-schedule-steps b { display:grid; place-items:center; width:24px; height:24px; flex:0 0 24px; border-radius:50%; background:rgba(71,211,255,.12); color:var(--cyan); font:700 .72rem var(--mono); }
.event-schedule-times { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.event-schedule-times label { display:grid; gap:8px; }
.event-schedule-times label > span { display:grid; gap:3px; }
.event-schedule-times label small { color:var(--text-faint); font-weight:400; }
.event-problem-fieldset { margin:18px 0; padding:14px; border:1px solid var(--line); border-radius:10px; }
.event-problem-fieldset legend { padding:0 8px; color:var(--text-dim); }
.event-problem-fieldset > p { margin:2px 2px 14px; color:var(--text-faint); font-size:.82rem; }
.event-problem-selection { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:9px; }
.event-problem-option { display:grid; grid-template-columns:20px minmax(0,1fr) auto; align-items:center; gap:12px; min-height:66px; padding:12px 14px; border:1px solid var(--line-soft); border-radius:9px; background:var(--surface-soft); cursor:pointer; transition:border-color .15s,background .15s; }
.event-problem-option:hover { border-color:rgba(71,211,255,.42); background:rgba(71,211,255,.045); }
.event-problem-option:has(input:checked) { border-color:rgba(71,211,255,.7); background:rgba(71,211,255,.075); }
.event-problem-option input[type="checkbox"] { width:18px; height:18px; min-width:18px; margin:0; padding:0; accent-color:var(--cyan); }
.event-problem-copy { display:grid; gap:5px; min-width:0; }
.event-problem-copy strong { overflow-wrap:anywhere; }
.event-problem-copy small { color:var(--text-faint); font-size:.72rem; }
.event-problem-version { color:var(--text-faint); font:600 .68rem var(--mono); white-space:nowrap; }
.event-schedule-summary { margin:-2px 0 16px; padding:12px 14px; border-left:2px solid var(--cyan); background:rgba(71,211,255,.045); color:var(--text-dim); font-size:.84rem; }
.event-schedule-footer { display:grid; gap:14px; }
.event-schedule-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.event-schedule-actions .primary-button { min-width:220px; }
.event-schedule-actions button { min-height:44px; }
.event-danger-zone { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:20px; padding:14px 16px; border:1px solid rgba(255,110,96,.28); border-left:3px solid rgba(255,110,96,.7); border-radius:8px; background:rgba(255,110,96,.045); }
.event-danger-zone[hidden] { display:none; }
.event-danger-zone > div { display:grid; gap:4px; }
.event-danger-zone strong { color:#ffd1cc; }
.event-danger-zone small { color:var(--text-faint); line-height:1.5; }
.event-danger-zone .danger-button { min-width:150px; min-height:44px; color:#ffd1cc; border:1px solid rgba(255,110,96,.48); background:rgba(255,110,96,.08); }
.event-danger-zone .danger-button:hover { border-color:rgba(255,110,96,.8); background:rgba(255,110,96,.14); }

@media (max-width: 1180px) {
  .ops-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .ops-hill-row { grid-template-columns: minmax(0, 1fr) auto; }
  .ops-hill-detail { grid-column: 1 / -1; }
  .ops-hill-row .secondary-button { grid-column: 1 / -1; }
  .ops-banner { padding: 8px 16px; }
  .event-schedule-times { grid-template-columns:1fr; }
  .event-schedule-steps { grid-template-columns:1fr; }
  .event-schedule-actions { display:grid; grid-template-columns:1fr; }
  .event-schedule-actions .primary-button { min-width:0; width:100%; }
  .event-danger-zone { grid-template-columns:1fr; }
  .event-danger-zone .danger-button { width:100%; }
}

/* HOME is a single-screen cover. The flex shell accounts for the real topbar
   height, including its two-row compact layout, without viewport guesswork. */
body.home-active { overflow:hidden; }
body.home-active #app-view { display:flex; height:100dvh; min-height:0; flex-direction:column; overflow:hidden; }
body.home-active .topbar,
body.home-active .connection-banner,
body.home-active .ops-banner { flex:0 0 auto; }
body.home-active .workspace { flex:1 1 auto; min-height:0; overflow:hidden; }
body.home-active .content { height:100%; padding:0 clamp(22px,4vw,68px); overflow:hidden; }
body.home-active .home-view,
body.home-active .home-stage { height:100%; min-height:0; overflow:hidden; }
body.home-active .home-stage { border-bottom:0; }

@media (max-width:700px) {
  body.home-active .home-copy { height:100%; padding:16px 0; justify-content:center; }
  body.home-active .home-copy h1 { margin:8px 0 18px; }
  body.home-active .home-schedule { margin-top:14px; }
  body.home-active .home-actions { margin-top:18px; }
  body.home-active .home-facts { margin-top:22px; }
}

.problem-detail-description .description-code{font-family:var(--sans);font-size:12.5px;font-weight:400;font-style:normal;line-height:1.04;letter-spacing:0;word-spacing:0;font-variant-ligatures:none;font-feature-settings:"liga" 0,"calt" 0;white-space:pre;overflow-wrap:normal;word-break:normal;tab-size:4;text-align:left;width:max-content;max-width:100%;margin:22px auto;padding:14px 0;overflow:auto;color:var(--text)}
.problem-detail-description .description-code code{font:inherit;line-height:inherit;letter-spacing:0;white-space:pre;color:inherit;background:none;padding:0;border:0}
.description-code:focus-visible{outline:1px solid var(--cyan);outline-offset:5px}

/* Catalogue-first administration; editors open only on explicit selection. */
.event-schedule-card>summary{cursor:pointer;list-style:none;margin:0}.event-schedule-card>summary::-webkit-details-marker{display:none}.event-schedule-card>summary::after{content:"＋";font-size:22px;color:var(--text-dim);margin-left:12px}.event-schedule-card[open]>summary::after{content:"−"}.event-schedule-card:not([open])>summary h2{margin-bottom:0}.event-schedule-card>summary>strong{margin-left:auto}.challenge-catalogue-heading,.challenge-editor-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.challenge-catalogue-heading>div{display:flex;gap:10px;flex-wrap:wrap}.challenge-catalogue-heading h2{margin:0}.challenge-editor{width:min(1120px,calc(100vw - 32px));max-height:calc(100dvh - 40px);padding:24px;background:var(--surface,#101827);color:var(--text);border:1px solid var(--border,#334155);border-radius:12px;overflow:auto;box-sizing:border-box}.challenge-editor::backdrop{background:rgba(4,6,15,.78)}.challenge-editor .operations-grid{margin-top:18px;align-items:start}.challenge-editor .operations-card{min-width:0}.challenge-editor .admin-form-actions{justify-content:flex-end}.challenge-editor .admin-form-actions .primary-button{width:auto;min-width:110px}.challenge-editor .operations-card input,.challenge-editor .operations-card textarea{min-width:0;max-width:100%;box-sizing:border-box}.challenge-editor #challenge-editor-message{position:sticky;top:0;z-index:2;background:var(--surface,#101827);padding:12px}.managed-attachment-url{display:block;max-width:100%;overflow-wrap:anywhere;color:var(--text-dim);font-size:12px}@media(max-width:700px){.challenge-catalogue-heading{align-items:flex-start;flex-direction:column}.challenge-editor{padding:14px}.challenge-editor .operations-grid{grid-template-columns:1fr}.event-schedule-card>summary{flex-wrap:wrap}.event-schedule-card>summary>strong{margin-left:0}}
.challenge-catalogue-heading>div{align-items:center;flex-wrap:nowrap}.challenge-catalogue-heading .primary-button,.event-schedule-actions .primary-button{width:auto;margin:0;min-height:42px;padding:0 18px;justify-content:center;border-radius:6px}.challenge-catalogue-heading button{margin:0;white-space:nowrap}.challenge-editor .admin-form-actions button{margin:0;min-height:44px;border-radius:6px}

/* Notice console: use available content width, including browser zoom. */
.admin-layout { grid-template-columns:repeat(auto-fit,minmax(min(100%,26rem),1fr)); }
.admin-layout > *, .admin-panel-header > div, #notice-form, .admin-field-row > * { min-width:0; }
.admin-layout .admin-field-row { grid-template-columns:repeat(auto-fit,minmax(min(100%,10.5rem),1fr)); }
#notice-form input, #notice-form select, #notice-form textarea { min-width:0; max-width:100%; box-sizing:border-box; }
.admin-notice-panel { container-type:inline-size; }
.admin-notice-meta { flex-wrap:wrap; overflow-wrap:anywhere; }
.admin-notice-copy { overflow-wrap:anywhere; }
.admin-notice-actions { flex-wrap:wrap; }
@container (max-width:420px) {
  .admin-notice-item { grid-template-columns:minmax(0,1fr); }
  .admin-notice-actions { justify-content:flex-end; }
}

/* Nonmodal new-notice alert: existing state polling, no extra requests. */
.notice-alert {
  position:fixed; inset:auto; right:24px; bottom:24px; z-index:1200;
  width:min(380px,calc(100vw - 32px)); max-height:calc(100dvh - 40px); overflow:auto;
  display:grid; gap:9px; margin:0; padding:20px 48px 18px 20px; box-sizing:border-box;
  color:var(--text); background:var(--surface-strong,#191628);
  border:1px solid var(--line); border-left:3px solid var(--cyan); border-radius:10px;
  box-shadow:0 12px 34px rgba(0,0,0,.3); font-family:var(--sans);
}
.notice-alert.is-important { border-left-color:var(--acid); }
.notice-alert-heading { color:var(--text-dim); font-size:.76rem; }
.notice-alert-title { font-size:.96rem; line-height:1.5; overflow-wrap:anywhere; }
.notice-alert-preview { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin:0; color:var(--text-dim); font-size:.82rem; line-height:1.6; overflow-wrap:anywhere; white-space:pre-wrap; }
.notice-alert-link { justify-self:start; padding:7px 0; color:var(--cyan); font-size:.83rem; font-weight:700; text-decoration:underline; text-underline-offset:3px; }
.notice-alert-close { position:absolute; top:5px; right:5px; width:40px; min-height:40px; padding:0; color:var(--text-dim); background:transparent; border:0; border-radius:5px; font-size:22px; cursor:pointer; }
.notice-alert-close:hover { color:var(--text); background:var(--surface-soft); }
.notice-alert :focus-visible { outline:2px solid var(--cyan); outline-offset:3px; }
@media(max-width:560px) { .notice-alert { right:16px; bottom:16px; } }
.event-problem-selection .event-problem-option{display:grid;margin:0}.event-problem-selection .event-problem-copy small{margin-top:0}

/* The login brand uses the same header grid and title typography as Home. */
.login-header {
  position:absolute; inset:0 0 auto; z-index:5;
  background:transparent; border-bottom-color:transparent; backdrop-filter:none;
  pointer-events:none;
}
.login-header .main-nav,
.login-header .topbar-actions { visibility:hidden; }
.login-copy .event-title { margin:0; }

/* The outgoing view stays above Home while its form leaves to the right. */
body.auth-transitioning { overflow:hidden !important; }
.login-layout.login-transition-overlay {
  position:fixed; left:0; width:100%; z-index:200;
  overflow:hidden; pointer-events:none;
}
.auth-title-bridge {
  position:fixed; z-index:210; margin:0; max-width:none;
  pointer-events:none; transform-origin:top left;
}
.auth-stag-bridge {
  position:fixed; z-index:205; pointer-events:none;
  transform-origin:top left;
}
.auth-stag-bridge > img {
  position:absolute; inset:0; display:block; width:100%; height:100%;
  max-width:none; max-height:none; object-fit:contain;
}
.auth-shared-hidden { visibility:hidden; }

@media (max-width:560px) {
  .login-layout { grid-template-columns:minmax(0,1fr); min-height:100dvh; }
  .login-intro { min-height:0; padding:16px; }
  .login-intro .login-copy { margin:88px 0 20px; }
  .login-intro .login-signal { font-size:.6rem; }
  .login-dark-stag { width:210px; right:-35px; bottom:-75px; opacity:.3; }
  .login-panel { min-height:0; padding:16px 16px 32px; align-items:start; }
  .login-heading { margin-top:0; }
}

/* Public scoreboard visibility is separate from its freeze state. */
#scoreboard-content { display:grid; gap:20px; }
.scoreboard-hidden-state { padding:clamp(40px,8vw,80px) 20px; text-align:center; }
.scoreboard-hidden-state h2 { margin:0; font-size:clamp(1.1rem,2.5vw,1.45rem); letter-spacing:-.02em; }
#admin-scoreboard-visibility-toggle { flex-shrink:0; }
#admin-scoreboard-visibility-toggle.is-active { color:var(--acid); border-color:var(--acid); background:var(--acid-soft); }

/* Temporary sample data is confined to the administrator's browser. */
.ui-preview-banner {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:10px clamp(22px, 4vw, 68px); border-bottom:1px solid var(--line);
  background:rgba(177,139,250,.08); font-size:.78rem;
}
.ui-preview-banner > div { display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; }
.ui-preview-banner strong { color:var(--acid); }
.ui-preview-banner span { color:var(--text-dim); }
.ui-preview-banner button, #ui-preview-toggle {
  flex-shrink:0; min-height:36px; padding:7px 12px; font-size:.78rem;
}
#ui-preview-toggle { margin-left:auto; align-self:center; }
@media (max-width:600px) {
  .ui-preview-banner { align-items:flex-start; flex-wrap:wrap; }
  #ui-preview-toggle { margin-left:0; }
}


/* Read notices without losing the current competition view. */
.notice-card, .event-lobby-notice {
  width:100%; color:var(--text); font-family:var(--sans); text-align:left; cursor:pointer;
}
.notice-card:hover, .event-lobby-notice:hover { background:rgba(177,139,250,.045); }
.notice-card:focus-visible, .event-lobby-notice:focus-visible { outline:2px solid var(--acid); outline-offset:3px; }
.notice-body { min-width:0; }
.notice-title { line-height:1.5; overflow-wrap:anywhere; }
.notice-excerpt {
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden; white-space:pre-wrap; overflow-wrap:anywhere;
}
.notice-alert-link { border:0; background:transparent; cursor:pointer; font-family:inherit; text-align:left; }
body.notice-modal-open { overflow:hidden; }
.notice-dialog {
  width:min(720px,calc(100vw - 48px)); max-width:none; max-height:calc(100dvh - 64px);
  margin:auto; padding:0; overflow:hidden; color:var(--text); background:#171222;
  border:1px solid var(--line); border-radius:16px; box-shadow:0 28px 90px #0008;
  font-family:var(--sans);
}
.notice-dialog[open] { display:grid; grid-template-rows:auto minmax(0,1fr); }
.notice-dialog::backdrop { background:#080610bd; backdrop-filter:blur(7px); }
.notice-detail-header { position:relative; padding:26px 30px 22px; border-bottom:1px solid var(--line-soft); }
.notice-detail-meta { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding-right:35px; color:var(--acid); font-size:.76rem; font-weight:650; }
.notice-detail-meta .pinned-badge { margin:0; }
.notice-detail-meta .notice-date { white-space:normal; overflow-wrap:anywhere; }
.notice-detail-header h2 { margin:16px 32px 0 0; font-size:clamp(1.15rem,2.5vw,1.45rem); line-height:1.5; letter-spacing:-.03em; overflow-wrap:anywhere; }
.notice-detail-header h2:focus { outline:none; }
.notice-detail-close { position:absolute; right:14px; top:14px; width:40px; height:40px; padding:0; border:0; border-radius:8px; background:transparent; color:var(--text-dim); font:26px var(--sans); cursor:pointer; }
.notice-detail-close:hover { color:var(--text); background:var(--surface-soft); }
.notice-detail-body { min-height:0; padding:26px 30px 32px; overflow:auto; overscroll-behavior:contain; white-space:pre-wrap; overflow-wrap:anywhere; color:var(--text-dim); font-size:.94rem; line-height:1.9; }
.notice-detail-body a { color:var(--acid); text-decoration:underline; text-underline-offset:3px; }
.notice-detail-body .description-code { max-width:100%; overflow:auto; }
.notice-dialog :is(button,a,.notice-detail-body):focus-visible { outline:2px solid var(--acid); outline-offset:-3px; }
@media(max-width:560px) {
  .notice-dialog { width:calc(100vw - 24px); max-height:calc(100dvh - 24px); border-radius:12px; }
  .notice-detail-header { padding:22px 20px 18px; }
  .notice-detail-body { padding:20px; font-size:.9rem; }
}
