:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-elev: #ffffff;
  --surface: #f7f7f8;
  --border: #ececf1;
  --border-strong: #d9d9e3;
  --text: #0d0d0d;
  --text-muted: #6e6e80;
  --text-soft: #8e8ea0;
  --accent: #10a37f;
  --accent-hover: #0e8e6e;
  --accent-soft: #e7f7f1;
  --danger: #ef4146;
  --warning: #f59e0b;
  --gold: #d4af37;
  --silver: #b6b8bd;
  --bronze: #cd7f32;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
  --font: "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------------- Topbar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; letter-spacing: -0.01em;
}
.brand-dot {
  width: 22px; height: 22px;
  display: block;
  flex-shrink: 0;
}
.brand-text { font-size: 15px; }
.topnav {
  display: flex; align-items: center; gap: 22px;
  font-size: 14px;
}
.topnav a {
  color: var(--text-muted);
  transition: color .15s ease;
}
.topnav a:hover { color: var(--text); }
.btn-ghost {
  border: 1px solid var(--border-strong);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  transition: all .15s ease;
}
.btn-ghost:hover { background: var(--surface); }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(1200px 400px at 50% -100px, rgba(16,163,127,0.06), transparent 70%),
    linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}
/* Bamboo decoration — left + right edges of hero. SVG inline as data URI. */
.hero::before, .hero::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 80px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.18;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 320'><rect x='27' y='0' width='6' height='320' fill='%2310a37f'/><rect x='22' y='70' width='16' height='4' rx='1' fill='%230e8e6e'/><rect x='22' y='160' width='16' height='4' rx='1' fill='%230e8e6e'/><rect x='22' y='250' width='16' height='4' rx='1' fill='%230e8e6e'/><ellipse cx='48' cy='50' rx='14' ry='3.5' fill='%2310a37f' transform='rotate(-32 48 50)'/><ellipse cx='12' cy='120' rx='14' ry='3.5' fill='%2310a37f' transform='rotate(32 12 120)'/><ellipse cx='48' cy='200' rx='14' ry='3.5' fill='%2310a37f' transform='rotate(-32 48 200)'/><ellipse cx='12' cy='285' rx='12' ry='3' fill='%2310a37f' transform='rotate(32 12 285)'/></svg>");
}
.hero::before { left: 2%; }
.hero::after  { right: 2%; transform: scaleX(-1); }
@media (max-width: 720px) {
  .hero::before, .hero::after { display: none; }
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 24px 56px;
  text-align: center;
}
.hero-small .hero-inner { padding: 40px 24px 32px; }
.hero-eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.hero-title {
  margin: 0 0 14px;
  font-size: 44px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
}
.hero-sub {
  margin: 0; color: var(--text-muted); font-size: 16px;
}

/* ---------------- Layout ---------------- */
.main { min-height: calc(100vh - 60px - 56px); }
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.section-head h2 {
  margin: 0;
  font-size: 22px; font-weight: 600; letter-spacing: -0.01em;
}
.meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-muted);
}
.dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong);
}
.dot-live {
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(16,163,127,0.6);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,163,127,0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(16,163,127,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,163,127,0); }
}

.footer {
  border-top: 1px solid var(--border);
  padding: 22px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.footer-sign {
  color: var(--text-muted);
  letter-spacing: 0.04em;
  border-left: 1px solid var(--border);
  padding-left: 14px;
}

.loading { color: var(--text-muted); padding: 40px 0; text-align: center; }

/* ---------------- Buttons ---------------- */
.btn-primary {
  background: var(--text);
  color: #fff;
  border: 1px solid var(--text);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  transition: transform .05s ease, background .15s ease, opacity .15s ease;
}
.btn-primary:hover { background: #1a1a1a; }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: background .15s ease;
}
.btn-secondary:hover { background: var(--surface); }
.btn-danger {
  background: #fff; color: var(--danger);
  border: 1px solid #f5c1c3;
  padding: 6px 12px; border-radius: var(--radius-sm); font-size: 12px;
}
.btn-danger:hover { background: #fff5f5; }

/* ---------------- Flashes ---------------- */
.flashes {
  max-width: 480px; margin: 24px auto 0; padding: 0 24px;
}
.flash {
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 14px; border: 1px solid var(--border);
}
.flash-error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.flash-success { background: var(--accent-soft); border-color: #bfe5d6; color: #0b6b53; }

/* ---------------- Login ---------------- */
.auth-wrap {
  min-height: calc(100vh - 60px - 56px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
}
.auth-card {
  width: 100%; max-width: 380px;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 36px 32px;
  box-shadow: var(--shadow-md);
}
.auth-title {
  margin: 0 0 6px; font-size: 24px; font-weight: 600; letter-spacing: -0.01em;
}
.auth-sub { margin: 0 0 22px; color: var(--text-muted); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); }
.auth-form input {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}
.auth-form .btn-primary { margin-top: 6px; }

/* ---------------- Leaderboard ---------------- */
.leaderboard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.lb-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
}
.lb-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.lb-banner {
  margin: -20px -22px 4px;
  height: 120px;
  overflow: hidden;
  background: linear-gradient(180deg, #f5f5f7, #ebebee);
}
.lb-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-rank-stripe {
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--border-strong);
}
.lb-card[data-rank="1"] .lb-rank-stripe { background: var(--gold); }
.lb-card[data-rank="2"] .lb-rank-stripe { background: var(--silver); }
.lb-card[data-rank="3"] .lb-rank-stripe { background: var(--bronze); }

.lb-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
}
.lb-rank {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--text-soft); text-transform: uppercase;
}
.lb-card[data-rank="1"] .lb-rank { color: var(--gold); }
.lb-card[data-rank="2"] .lb-rank { color: var(--silver); }
.lb-card[data-rank="3"] .lb-rank { color: var(--bronze); }
.lb-name { margin: 4px 0 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.lb-desc { color: var(--text-muted); font-size: 13px; margin: 0; }

.lb-score-row {
  display: flex; align-items: baseline; gap: 6px;
}
.lb-score {
  font-size: 32px; font-weight: 700; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.lb-score-suffix { color: var(--text-soft); font-size: 13px; }
.lb-judges { font-size: 12px; color: var(--text-muted); }

.lb-emojis {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-top: 8px; border-top: 1px dashed var(--border);
}
.lb-emoji-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface);
  border-radius: 999px; padding: 3px 9px; font-size: 13px;
}
.lb-emoji-pill .count { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ---------------- Judge ---------------- */
.judge-grid {
  display: grid; gap: 20px;
}
.judge-team-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px;
  overflow: hidden;
}
.judge-team-banner {
  margin: -22px -24px 16px;
  height: 140px;
  overflow: hidden;
  background: linear-gradient(180deg, #f5f5f7, #ebebee);
}
.judge-team-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.judge-team-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px; margin-bottom: 16px;
}
.judge-team-name { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.judge-team-desc { color: var(--text-muted); font-size: 16px; margin: 6px 0 0; }
.judge-team-total {
  font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.judge-team-total .suffix { font-size: 15px; color: var(--text-soft); font-weight: 500; margin-left: 2px; }

.criterion-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center; gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.criterion-row:last-child { border-bottom: none; }
.criterion-meta .name { font-weight: 600; font-size: 20px; }
.criterion-meta .desc {
  color: var(--text); font-size: 16px; margin-top: 6px;
  line-height: 1.55; white-space: pre-wrap;
}
.criterion-meta .max { color: var(--text-soft); font-size: 15px; margin-top: 6px; }

.level-group { display: flex; gap: 8px; }
.level-btn {
  width: 54px; height: 54px;
  border: 1px solid var(--border-strong);
  background: #fff;
  border-radius: var(--radius-sm);
  font-size: 20px; font-weight: 600; color: var(--text-muted);
  transition: all .12s ease;
}
.level-btn:hover { border-color: var(--text); color: var(--text); }
.level-btn.active {
  background: var(--text); color: #fff; border-color: var(--text);
}
.criterion-points {
  font-variant-numeric: tabular-nums;
  font-weight: 600; font-size: 18px;
  min-width: 88px; text-align: right;
}
#judge-name { font-size: 16px; font-weight: 600; color: var(--text); }
#save-state { font-size: 14px; }

/* ---------------- Admin ---------------- */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.tab {
  background: transparent; border: none;
  padding: 12px 16px;
  font-size: 14px; color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s ease, border-color .15s ease;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--text); font-weight: 500; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.card h3 {
  margin: 0 0 16px; font-size: 15px; font-weight: 600; letter-spacing: -0.005em;
}
.hint { color: var(--text-muted); font-size: 12px; margin: 10px 0 12px; }

.form-grid { display: grid; gap: 14px; max-width: 560px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); }
.form-grid input, .form-row input, .form-row select {
  padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-grid input:focus, .form-row input:focus {
  outline: none; border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}

.form-row {
  display: grid; grid-template-columns: 1.4fr 2fr 1fr 1fr auto;
  gap: 10px; align-items: center;
}
.form-row.judges-form { grid-template-columns: 1fr 1fr 1fr auto; }

.rows { display: flex; flex-direction: column; gap: 8px; }
.row-item {
  display: grid;
  grid-template-columns: 1.2fr 2fr 100px 80px auto;
  gap: 12px; align-items: center;
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.row-item input {
  padding: 8px 10px; border: 1px solid transparent;
  background: transparent; border-radius: 6px;
  font-size: 13px; font-family: inherit; width: 100%;
}
.row-item input:focus { background: #fff; border-color: var(--border-strong); outline: none; }
.row-item .actions { display: flex; gap: 6px; justify-content: flex-end; }

.row-item.judge { grid-template-columns: 1fr 1fr 1fr 100px auto; }
.row-item.team {
  grid-template-columns: 140px 1.2fr 110px 2fr 80px auto;
  align-items: flex-start;
}
.row-item.criterion {
  grid-template-columns: 1.2fr 110px 2fr 100px 80px auto;
  align-items: start;
}
.row-item select {
  padding: 8px 10px; border: 1px solid var(--border);
  background: #fff; border-radius: 6px;
  font-size: 13px; font-family: inherit; width: 100%;
}
.row-item select:focus { border-color: var(--border-strong); outline: none; }
.row-item textarea {
  padding: 8px 10px; border: 1px solid transparent;
  background: transparent; border-radius: 6px;
  font-size: 13px; font-family: inherit; width: 100%;
  resize: vertical; min-height: 38px; line-height: 1.45;
}
.row-item textarea:focus { background: #fff; border-color: var(--border-strong); outline: none; }

.form-row.team-form { grid-template-columns: 1.4fr 110px 2fr 1fr auto; }
.form-row.criteria-form { grid-template-columns: 1.4fr 110px 2fr 1fr 1fr auto; }

/* ----- category (division) badges & grouping ----- */
.cat-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.7; white-space: nowrap;
}
.cat-wakate { background: var(--accent-soft); color: var(--accent); }
.cat-chuken { background: #eef2ff; color: #4f46e5; }
.judge-team-head .cat-badge, .aud-card-head .cat-badge { margin-bottom: 6px; }

.cat-group { display: flex; flex-direction: column; gap: 8px; }
.cat-group + .cat-group { margin-top: 20px; }
.cat-group-head { margin-bottom: 0; }
.cat-empty {
  color: var(--text-muted); font-size: 13px;
  padding: 12px 14px; background: var(--bg-soft);
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
}
.lb-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ----- score visibility ----- */
.reveal-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.reveal-text { display: flex; flex-direction: column; gap: 4px; }
.reveal-label { font-size: 15px; font-weight: 600; }
.reveal-hint { font-size: 12px; color: var(--text-muted); max-width: 520px; }
.reveal-control { display: flex; align-items: center; gap: 12px; }
.reveal-state {
  font-size: 12px; font-weight: 600; padding: 3px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
}
.reveal-state.is-public { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.reveal-state.is-private { background: #fff7ed; color: var(--warning); border-color: transparent; }

.lb-score-hidden {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  padding: 10px 0;
}
.lb-card.scores-hidden .lb-rank-stripe { background: var(--border); }

.banner-cell { display: flex; flex-direction: column; gap: 8px; }
.banner-thumb {
  width: 140px; height: 80px;
  border-radius: var(--radius-sm);
  background: #f0f0f3;
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.banner-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-empty { color: var(--text-soft); font-size: 11px; }
.banner-actions { display: flex; flex-direction: column; gap: 4px; }
.banner-actions .btn-secondary, .banner-actions .btn-danger {
  font-size: 11px; padding: 4px 8px; text-align: center;
}
.file-btn {
  display: inline-block; cursor: pointer;
}

/* ---------------- Audience ---------------- */
.audience-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 720px; margin: 0 auto;
}
.aud-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  overflow: hidden;
}
.aud-banner {
  margin: -20px -22px 14px;
  height: 110px;
  overflow: hidden;
  background: linear-gradient(180deg, #f5f5f7, #ebebee);
}
.aud-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aud-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px;
}
.aud-team-name { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.aud-team-desc { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
/* selection bar */
.aud-selbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 4px 0 18px; min-height: 44px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-muted); font-size: 14px;
}
.aud-selbar.has-pick { background: var(--accent-soft); color: var(--accent); }
.aud-selbar.locked { background: #fff7ed; color: var(--warning); font-weight: 500; }
.aud-selbar .sel-label { font-weight: 600; }
.aud-selbar .sel-emoji { font-size: 26px; line-height: 1; }
.aud-selbar .sel-hint { font-size: 13px; }
.aud-withdraw { margin-left: auto; }

/* picker grid */
.aud-picker { display: flex; flex-direction: column; gap: 16px; }
.aud-emoji-group-label {
  font-size: 12px; font-weight: 600; color: var(--text-soft);
  margin-bottom: 8px; letter-spacing: .02em;
}
.aud-emoji-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr));
  gap: 8px;
}
.aud-emoji-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1; padding: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 26px;
  transition: transform .1s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.aud-emoji-btn:hover:not(:disabled) { border-color: var(--text); background: var(--surface); }
.aud-emoji-btn:active:not(:disabled) { transform: scale(0.92); }
.aud-emoji-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.aud-emoji-btn.selected {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent) inset;
}
.aud-emoji-btn .cnt {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
  background: var(--text); color: #fff;
  border-radius: 999px; font-size: 11px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.aud-emoji-btn.selected .cnt { background: var(--accent); }

/* ---------------- Error ---------------- */
.error-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 60px 30px;
  text-align: center; max-width: 480px; margin: 60px auto;
}
.error-code { font-size: 56px; font-weight: 700; letter-spacing: -0.03em; }
.error-msg { color: var(--text-muted); margin: 8px 0 24px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 720px) {
  .hero-title { font-size: 32px; }
  .topnav { gap: 14px; font-size: 13px; }
  .container { padding: 28px 16px 60px; }
  .criterion-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .criterion-points { text-align: left; }
  .form-row { grid-template-columns: 1fr; }
  .row-item { grid-template-columns: 1fr; }
  .row-item .actions { justify-content: flex-start; }
  .topbar-inner { padding: 12px 16px; }
}

/* ============ Event progression (admin-driven flow) ============ */

/* Shared live pulse dot */
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,163,127,0.45); }
  70%  { box-shadow: 0 0 0 8px rgba(16,163,127,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,163,127,0); }
}

/* ---- Admin 進行 console ---- */
.prog-now-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.prog-now { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.prog-now-label { font-size: 12px; color: var(--text-muted); }
.prog-now-name { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.prog-now-badge {
  font-size: 12px; font-weight: 600; padding: 4px 12px;
  border-radius: 999px; background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--border);
}
.prog-now-badge.is-open { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.prog-now-badge.is-paused { background: #fff7ed; color: var(--warning); border-color: transparent; }
.prog-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.prog-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center; gap: 12px;
}
.prog-order {
  width: 28px; height: 28px; display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 8px; background: var(--surface);
  font-size: 12px; color: var(--text-muted);
}
.prog-name { font-weight: 600; }
.prog-badge {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface); color: var(--text-muted);
}
.prog-row.status-live .prog-badge { background: var(--accent-soft); color: var(--accent); }
.prog-row.status-done .prog-badge { background: #f1f1f4; color: var(--text-soft); }
.prog-row.status-done .prog-name { color: var(--text-muted); }
.prog-row.is-active {
  background: var(--accent-soft);
  border-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(16,163,127,0.25);
}

/* ---- Live tags (judge / audience / overview) ---- */
.judge-live-tag, .aud-live-tag, .lb-live-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--accent);
  margin-bottom: 8px;
}
.judge-team-card.is-live, .aud-card.is-live {
  box-shadow: inset 0 0 0 2px rgba(16,163,127,0.35), var(--shadow-md);
}
.lb-card.is-live {
  box-shadow: inset 0 0 0 2px rgba(16,163,127,0.45), var(--shadow-md);
}

/* ---- Lock notes ---- */
.judge-lock-note, .aud-lock-note {
  background: #fff7ed; color: var(--warning);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 15px; font-weight: 500; margin: 8px 0 4px;
}
.judge-lock-note { font-size: 17px; }

/* ---- Judge comment area ---- */
.judge-comment {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px dashed var(--border);
}
.judge-comment-label {
  display: block; font-size: 13px; font-weight: 600;
  margin-bottom: 8px; color: var(--text);
}
.judge-comment-input {
  width: 100%; min-height: 72px; padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 13px; font-family: inherit;
  line-height: 1.6; resize: vertical;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.judge-comment-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(16,163,127,0.15);
  outline: none;
}
.judge-comment-input:disabled {
  background: var(--surface); color: var(--text-muted);
  cursor: not-allowed;
}

/* ---- Waiting (no team on stage) ---- */
.judge-wait, .aud-wait {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 64px 24px; text-align: center;
  color: var(--text-muted);
}
.judge-wait p, .aud-wait p { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.judge-wait span, .aud-wait span { font-size: 13px; }
.judge-wait-dot, .aud-wait-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); animation: live-pulse 1.8s infinite;
}
