:root {
  --bg: #f4f1ea;
  --paper: #fbf8f2;
  --ink: #1a1815;
  --muted: #72685a;
  --line: #d5cbbe;
  --accent: #315f72;
  --accent-soft: #dce8ed;
  --warn: #8d4f30;
  --warn-soft: #f6e5dc;
  --danger: #8e2f2f;
  --danger-soft: #f7dfdf;
  --success: #355b3a;
  --success-soft: #deebdf;
  --shadow: 0 18px 40px rgba(41, 34, 27, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(49, 95, 114, 0.14), transparent 30%),
    linear-gradient(180deg, #efe8dc 0%, var(--bg) 35%, #f7f4ee 100%);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

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

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.page-login .app-shell {
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar,
.workspace-hero,
.spec-strip,
.panel-header,
.inline-actions,
.topbar-tools,
.brand-block {
  display: flex;
  align-items: center;
}

.topbar,
.workspace-hero,
.hero-grid,
.two-column,
.upload-layout,
.judge-layout {
  gap: 24px;
}

.topbar {
  justify-content: space-between;
  margin: 0 auto 24px;
  max-width: 1220px;
}

.brand-block {
  gap: 12px;
}

.brand-link {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wireframe-tag,
.status-pill,
.lang-chip,
.panel-kicker,
.eyebrow {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.status-pill,
.lang-chip {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 248, 242, 0.7);
}

.topbar-tools,
.language-switcher,
.inline-actions,
.action-stack {
  display: flex;
  gap: 12px;
}

.lang-chip.is-active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.page-judge-client,
.page-judging-window,
.page-judging-slideshow,
.page-judging-results {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: #000;
  color: #f5f1e8;
}

.judge-client-shell,
.judging-window-shell,
.judging-slideshow-shell,
.judging-results-shell {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.judge-client-main,
.judging-window-main,
.judging-slideshow-main,
.judging-results-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  text-align: center;
}

.judge-client-kicker {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(245, 241, 232, 0.72);
  font-size: 0.74rem;
}

.judge-client-main h1,
.judging-window-main h1,
.judging-slideshow-main h1,
.judging-results-main h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  line-height: 1;
}

.judge-client-main p,
.judging-window-status {
  margin: 14px 0 0;
  color: rgba(245, 241, 232, 0.82);
}

.judging-window-stage {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.judging-window-countdown {
  margin: 0;
  font-size: clamp(4rem, 14vw, 8rem);
  line-height: 1;
}

.judging-window-message {
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 5.2rem);
  line-height: 1;
  color: rgba(245, 241, 232, 0.9);
}

.judging-window-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.judge-keypad {
  width: min(100%, 420px);
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.judge-key {
  min-height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(245, 241, 232, 0.92);
  font-size: 1.2rem;
  font-weight: 700;
}

.judge-key.is-selected {
  border-color: #4ea86d;
  background: #70c48d;
  color: #11311d;
  opacity: 1;
}

.judge-key:disabled {
  opacity: 0.42;
}

.judge-key.is-selected:disabled {
  opacity: 1;
}

.judge-status-row {
  width: min(100%, 420px);
  min-height: 52px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(245, 241, 232, 0.82);
}

.judge-client-footer,
.judging-window-footer {
  flex: 0 0 auto;
  min-height: 84px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 8, 8, 0.96);
}

.judge-client-footer {
  justify-content: space-between;
}

.judging-window-badges {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.judge-client-badge,
.judge-name-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.judge-client-badge-connected {
  color: #70c48d;
}

.judge-client-badge-disconnected {
  color: #e08e8e;
}

.judge-client-exit {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(245, 241, 232, 0.92);
}

.judge-name-badge-empty {
  opacity: 0.72;
}

.judging-slideshow-main {
  position: relative;
  padding: 0;
  overflow: hidden;
}

.judging-results-main {
  position: relative;
  padding: 0;
  overflow: hidden;
}

.judging-results-title {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  z-index: 1;
}

.judging-results-title .secondary-button {
  justify-self: center;
}

.judging-slideshow-title {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  z-index: 1;
}

.judging-slideshow-title .secondary-button {
  justify-self: center;
}

.judging-slideshow-subtitle {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 0;
  color: rgba(245, 241, 232, 0.82);
}

.judging-slideshow-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  place-items: center;
  padding: 0;
}

.judging-results-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.judging-slideshow-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.judging-results-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.judging-slideshow-stage img.is-visible {
  opacity: 1;
}

.judging-results-stage img.is-visible {
  opacity: 1;
}

.judging-slideshow-stage p {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  line-height: 1;
}

.judging-results-stage p {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  line-height: 1;
}

.judging-results-countdown {
  font-size: clamp(4rem, 14vw, 8rem);
}

.judging-results-footer {
  flex: 0 0 auto;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 8, 8, 0.96);
}

.judging-results-meta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.judging-results-meta .score-badge,
.judging-results-meta .judge-name-badge {
  min-width: auto;
  min-height: 0;
  padding: 10px 14px;
  font-size: 1rem;
  line-height: 1;
}

.judging-slideshow-shell.is-intro .judging-slideshow-title {
  display: grid;
}

.judging-slideshow-shell.is-countdown .judging-slideshow-stage img,
.judging-slideshow-shell.is-countdown #judging-slideshow-end,
.judging-slideshow-shell.is-intro .judging-slideshow-stage img,
.judging-slideshow-shell.is-intro .judging-slideshow-countdown,
.judging-slideshow-shell.is-intro .judging-slideshow-stage p,
.judging-slideshow-shell.is-photo .judging-slideshow-countdown,
.judging-slideshow-shell.is-photo .judging-slideshow-title,
.judging-slideshow-shell.is-photo .judging-slideshow-stage p,
.judging-slideshow-shell.is-end .judging-slideshow-title,
.judging-slideshow-shell.is-end .judging-slideshow-stage img {
  display: none !important;
}

.judging-slideshow-shell.is-countdown .judging-slideshow-title {
  display: none !important;
}

.judging-results-shell.is-countdown .judging-results-stage img,
.judging-results-shell.is-countdown #judging-results-end,
.judging-results-shell.is-intro .judging-results-stage img,
.judging-results-shell.is-intro .judging-results-countdown,
.judging-results-shell.is-intro #judging-results-end,
.judging-results-shell.is-photo .judging-results-countdown,
.judging-results-shell.is-photo #judging-results-end,
.judging-results-shell.is-end .judging-results-countdown,
.judging-results-shell.is-end .judging-results-stage img {
  display: none !important;
}

.judging-results-shell.is-intro .judging-results-title {
  display: grid;
}

.judging-results-shell.is-countdown .judging-results-title,
.judging-results-shell.is-photo .judging-results-title,
.judging-results-shell.is-end .judging-results-title {
  display: none !important;
}

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

.topbar-exit {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(251, 248, 242, 0.82);
  box-shadow: var(--shadow);
}

.page-frame {
  max-width: 1220px;
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.page-login .page-frame {
  max-width: none;
  min-height: calc(100vh - 96px);
  place-items: center;
}

.page-index .page-frame {
  min-height: calc(100vh - 96px);
  place-items: center;
}

.topbar-login {
  margin-bottom: 0;
}

.login-screen {
  width: 100%;
  display: grid;
  place-items: center;
}

.login-card {
  width: min(100%, 420px);
  padding: 36px 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(251, 248, 242, 0.9);
  box-shadow: var(--shadow);
  display: grid;
  gap: 24px;
}

.login-brand,
.login-subtitle {
  margin: 0;
  text-align: center;
}

.login-brand {
  font-size: clamp(2.2rem, 8vw, 3rem);
  line-height: 1;
  text-transform: lowercase;
}

.login-subtitle {
  color: var(--muted);
  font-size: 0.98rem;
}

.index-actions {
  width: 100%;
  display: grid;
  place-items: center;
}

.admin-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.admin-sidebar {
  display: grid;
  gap: 8px;
  position: sticky;
  top: 24px;
}

.admin-nav-link {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(251, 248, 242, 0.9);
}

.admin-nav-link.is-active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.admin-content {
  display: grid;
  gap: 24px;
}

.admin-muted {
  margin: 0;
  color: var(--muted);
}

.admin-filter-form input {
  min-width: 240px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fffdfa;
}

.admin-month-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}

.admin-judging-stats {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}

.admin-stat-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(251, 248, 242, 0.72);
}

.admin-stat-card-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.admin-stat-label {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.admin-stat-card strong {
  font-size: 1rem;
}

.admin-stat-card-gold {
  background: #e2bf55;
  border-color: #d0ae45;
  color: #332500;
}

.admin-stat-card-silver {
  background: #c5cad3;
  border-color: #b4bac4;
  color: #1e2430;
}

.admin-stat-card-bronze {
  background: #c58a63;
  border-color: #b97a52;
  color: #2e1709;
}

.admin-stat-card-gold .admin-stat-label,
.admin-stat-card-silver .admin-stat-label,
.admin-stat-card-bronze .admin-stat-label {
  color: inherit;
  opacity: 0.82;
}

.admin-judging-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 16px;
}

.admin-judging-actions form {
  margin: 0;
}

.admin-judging-actions .primary-button,
.admin-judging-actions .secondary-button,
.admin-judging-actions .ghost-danger {
  gap: 8px;
}

.admin-judging-progress {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-divider {
  width: 100%;
  height: 1px;
  border: 0;
  background: var(--line);
  margin: 0 0 16px;
}

.admin-judging-music {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.admin-music-library,
.admin-music-upload {
  gap: 14px;
}

.admin-music-library h3,
.admin-music-upload h3 {
  margin: 0;
  font-size: 1rem;
}

.admin-music-list {
  max-height: 280px;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.admin-music-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdfa;
  cursor: pointer;
  font-size: 0.92rem;
  white-space: nowrap;
}

.admin-music-item input {
  margin: 0;
}

.admin-music-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-music-upload-form {
  display: grid;
  gap: 14px;
}

.admin-music-upload-form .secondary-button {
  gap: 8px;
}

.admin-music-upload-form input[type="file"] {
  width: 100%;
}

.admin-progress-box {
  display: grid;
  gap: 4px;
  min-width: 92px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(251, 248, 242, 0.72);
}

.admin-progress-box span {
  color: var(--muted);
  font-size: 0.76rem;
}

.admin-progress-box strong {
  font-size: 1.05rem;
}

.admin-control-start {
  border-color: #2f8d58;
  background: #e7f5ec;
  color: #1f5d3b;
}

.admin-control-pause {
  border-color: #2d6fb7;
  background: #e7f0fb;
  color: #18497d;
}

.admin-control-stop {
  border-color: #e2bcbc;
  background: transparent;
  color: var(--danger);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

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

.admin-actions-cell {
  white-space: nowrap;
  text-align: right;
}

.admin-table th {
  border-top: 0;
}

.admin-table th a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sort-arrow {
  min-width: 10px;
  color: var(--muted);
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-role-picks {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-role-row {
  display: grid;
  gap: 8px;
}

.admin-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdfa;
  color: var(--ink);
  cursor: pointer;
}

.admin-icon-danger {
  color: var(--danger);
  border-color: #e2bcbc;
}

.admin-icon-success {
  color: #1f5d3b;
  border-color: #9dc9ab;
  background: #e7f5ec;
}

.admin-inline-form {
  display: inline;
}

.admin-add-button {
  gap: 8px;
}

.admin-email-link {
  text-decoration: underline;
}

.admin-inline-editor summary,
.admin-score-editor summary {
  cursor: pointer;
  list-style: none;
}

.admin-inline-editor summary::-webkit-details-marker,
.admin-score-editor summary::-webkit-details-marker {
  display: none;
}

.admin-user-form {
  max-width: 560px;
}

.admin-modal {
  width: min(100%, 560px);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0;
  box-shadow: var(--shadow);
}

.admin-modal::backdrop {
  background: rgba(26, 24, 21, 0.35);
}

.admin-modal .admin-user-form,
.admin-modal .admin-score-form {
  max-width: none;
  padding: 24px;
  width: 100%;
}

.admin-modal-header h2 {
  margin: 0;
}

.admin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.admin-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.admin-photo-button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 76px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}

.score-badge-gold { background: #e2bf55; color: #332500; }
.score-badge-silver { background: #c5cad3; color: #1e2430; }
.score-badge-bronze { background: #c58a63; color: #2e1709; }
.score-badge-gray { background: #d7eaf8; color: #1f4f73; }
.score-badge-light { background: #ececec; color: #5a5a5a; }

.admin-photo-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.admin-score-form {
  width: 240px;
  padding-top: 12px;
}

.admin-modal .admin-score-form {
  padding-top: 24px;
}

.admin-score-editor {
  display: inline-block;
}

.admin-actions-cell .admin-score-editor,
.admin-actions-cell .admin-inline-form,
.admin-actions-cell .admin-icon-button {
  vertical-align: middle;
}

.admin-actions-cell {
  white-space: nowrap;
}

.admin-row-judged td {
  background: #edf8ef;
}

.admin-lightbox {
  max-width: min(96vw, 1080px);
  max-height: 92vh;
  padding: 16px;
  border: 0;
  background: rgba(18, 18, 18, 0.96);
}

.admin-lightbox::backdrop {
  background: rgba(18, 18, 18, 0.72);
}

.admin-lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 48px);
  object-fit: contain;
}

.admin-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  cursor: pointer;
}

.index-button-grid {
  width: min(100%, 760px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}

.index-toolbar {
  width: min(100%, 760px);
  display: flex;
  justify-content: flex-end;
  margin: 0 0 16px;
}

.index-button {
  min-height: 180px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(251, 248, 242, 0.9);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  gap: 16px;
  color: var(--ink);
  cursor: pointer;
}

.index-button i {
  font-size: 2rem;
}

.index-button span {
  font-size: 1.05rem;
  font-weight: 600;
}

.toast {
  position: fixed;
  right: 24px;
  top: 24px;
  width: min(360px, calc(100vw - 32px));
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 10;
  animation: fadeout 5s forwards;
}

.toast-neutral {
  background: var(--paper);
}

.toast-danger {
  background: var(--danger-soft);
  border-color: #e8baba;
}

.toast-warning {
  background: var(--warn-soft);
  border-color: #e8c7b6;
}

.toast-success {
  background: var(--success-soft);
  border-color: #c1d8c3;
}

@keyframes fadeout {
  0%, 82% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-8px); pointer-events: none; }
}

.hero-grid,
.two-column,
.upload-layout,
.judge-layout {
  display: grid;
}

.hero-grid {
  grid-template-columns: 1.2fr 0.8fr;
  min-height: 52vh;
  align-items: stretch;
}

.workspace-hero {
  justify-content: space-between;
  padding: 12px 0 8px;
}

.hero-copy,
.panel,
.identity-card,
.dropzone,
.action-panel {
  background: rgba(251, 248, 242, 0.82);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 42px;
  display: grid;
  align-content: space-between;
  background:
    linear-gradient(145deg, rgba(49, 95, 114, 0.12), rgba(251, 248, 242, 0.92) 45%),
    rgba(251, 248, 242, 0.82);
}

.hero-copy h1,
.workspace-hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 0.96;
  max-width: 12ch;
}

.lede {
  max-width: 58ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.eyebrow,
.panel-kicker,
.spec-label {
  color: var(--muted);
}

.spec-strip {
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 20px;
}

.spec-strip > div {
  display: grid;
  gap: 4px;
}

.panel,
.identity-card,
.dropzone {
  padding: 24px;
}

.panel {
  display: grid;
  gap: 20px;
}

.muted-panel {
  background: rgba(245, 239, 229, 0.85);
}

.panel-header {
  justify-content: space-between;
  gap: 12px;
}

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

.stack-form,
.member-list,
.feature-list,
.stack-grid,
.side-stack,
.score-list,
.action-stack {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: grid;
  gap: 8px;
}

.stack-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: #fffdfa;
}

.stack-form input:focus {
  outline: 2px solid rgba(49, 95, 114, 0.24);
  outline-offset: 2px;
  border-color: var(--accent);
}

.admin-settings-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
}

.admin-settings-actions {
  grid-column: 1 / -1;
  justify-self: end;
}

.primary-button,
.secondary-button,
.ghost-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.primary-button {
  background: var(--ink);
  color: white;
  cursor: pointer;
}

.secondary-button {
  border-color: var(--line);
  background: transparent;
  cursor: pointer;
}

.button-full {
  width: 100%;
}

.ghost-danger {
  border-color: #e2bcbc;
  background: white;
  color: var(--danger);
}

.helper-text,
.member-row span,
.member-row small,
.feature-list,
.photo-meta small,
.identity-card small {
  color: var(--muted);
}

.member-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.member-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.member-row > div {
  display: grid;
  gap: 4px;
}

.static-row {
  cursor: default;
}

.workspace-hero,
.identity-card {
  align-items: flex-start;
}

.identity-card {
  min-width: 270px;
  display: grid;
  gap: 8px;
}

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

.action-panel {
  padding: 28px;
  display: grid;
  gap: 14px;
  min-height: 220px;
}

.action-panel h2 {
  margin: 0;
  font-size: 1.7rem;
}

.action-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.action-panel.is-disabled {
  opacity: 0.52;
}

.two-column,
.upload-layout,
.judge-layout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
}

.upload-stage,
.stack-grid {
  display: grid;
  gap: 24px;
}

.upload-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
}

.dropzone-form {
  display: grid;
}

.file-input {
  display: none;
}

.dropzone {
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 2px;
  border-style: dashed;
  background:
    linear-gradient(180deg, rgba(220, 232, 237, 0.9), rgba(251, 248, 242, 0.95));
}

.dropzone.is-dragover {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(200, 223, 231, 1), rgba(251, 248, 242, 0.98));
}

.dropzone.is-disabled {
  opacity: 0.58;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(232, 228, 221, 0.9), rgba(245, 241, 235, 0.95));
}

.upload-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  line-height: 1.2;
}

.dropzone-copy {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.2;
}

.upload-list {
  display: grid;
  gap: 14px;
}

.upload-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.upload-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.upload-thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

.upload-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.upload-meta strong,
.upload-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-meta span {
  color: var(--muted);
}

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

.empty-state {
  padding: 28px;
  border-radius: 22px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.5);
  min-height: 220px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.empty-state p,
.empty-state strong {
  margin: 0;
}

.feature-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.6;
}

@media (max-width: 980px) {
  .admin-shell,
  .hero-grid,
  .action-grid,
  .two-column,
  .upload-layout,
  .judge-layout,
  .photo-grid,
  .admin-settings-form {
    grid-template-columns: 1fr;
  }

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

  .admin-sidebar {
    position: static;
  }

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

  .identity-card {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 16px;
  }

  .page-login .page-frame {
    min-height: calc(100vh - 82px);
  }

  .page-index .page-frame {
    min-height: calc(100vh - 82px);
  }

  .hero-copy,
  .panel,
  .dropzone,
  .identity-card,
  .action-panel,
  .login-card,
  .index-button {
    border-radius: 22px;
    padding: 20px;
  }

  .hero-copy h1,
  .workspace-hero h1 {
    max-width: none;
    font-size: 2.4rem;
  }

  .topbar-tools,
  .language-switcher,
  .inline-actions,
  .action-stack {
    flex-wrap: wrap;
  }

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

  .admin-filter-form input {
    min-width: 0;
    width: 100%;
  }

  .admin-table-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-item form {
    grid-column: 1 / -1;
  }

  .upload-thumb {
    width: 72px;
    height: 72px;
  }
}
