:root {
  color-scheme: dark;
  --bg: #081116;
  --bg-soft: #102028;
  --bg-panel: rgba(7, 20, 25, 0.72);
  --bg-panel-strong: rgba(10, 26, 33, 0.9);
  --surface: rgba(238, 223, 197, 0.08);
  --surface-strong: rgba(255, 243, 221, 0.12);
  --line: rgba(250, 227, 188, 0.16);
  --line-strong: rgba(250, 227, 188, 0.28);
  --text: #f5ecd9;
  --muted: rgba(245, 236, 217, 0.72);
  --brand: #d6a15d;
  --brand-strong: #f1c482;
  --accent: #7ec7b7;
  --accent-strong: #9ce2d2;
  --danger: #cc7152;
  --shadow: 0 32px 80px rgba(0, 0, 0, 0.34);
  --radius: 28px;
  --radius-sm: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
  --page-width: 1280px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  background:
    radial-gradient(circle at top, rgba(213, 160, 93, 0.16), transparent 24%),
    linear-gradient(180deg, #071015 0%, #0c1b22 32%, #102028 100%);
}

body {
  position: relative;
  background:
    radial-gradient(circle at 16% 18%, rgba(126, 199, 183, 0.12), transparent 22%),
    radial-gradient(circle at 84% 12%, rgba(214, 161, 93, 0.16), transparent 18%),
    linear-gradient(180deg, rgba(4, 17, 24, 0.95) 0%, rgba(11, 25, 32, 0.96) 48%, rgba(8, 17, 22, 1) 100%);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 120px),
    linear-gradient(rgba(255, 255, 255, 0.02) 0, rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 120px);
  opacity: 0.2;
}

body::after {
  background: linear-gradient(180deg, rgba(8, 17, 22, 0) 0%, rgba(8, 17, 22, 0.58) 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
}

button:not(:disabled):active {
  transform: translateY(0);
}

.page-shell {
  padding-bottom: 72px;
}

.hero-shell {
  position: relative;
  overflow: hidden;
  min-height: min(92svh, 860px);
  border-bottom: 1px solid rgba(241, 196, 130, 0.12);
}

#hero-canvas,
.hero-scrim {
  position: absolute;
  inset: 0;
}

#hero-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-scrim {
  background:
    linear-gradient(90deg, rgba(5, 14, 19, 0.78) 0%, rgba(5, 14, 19, 0.58) 38%, rgba(5, 14, 19, 0.18) 72%, rgba(5, 14, 19, 0.34) 100%),
    linear-gradient(180deg, rgba(5, 14, 19, 0.18) 0%, rgba(5, 14, 19, 0.1) 48%, rgba(5, 14, 19, 0.72) 100%);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: space-between;
  min-height: min(92svh, 860px);
  max-width: var(--page-width);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 44px);
  gap: 28px;
}

.hero-meta,
.hero-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.hero-meta {
  align-self: start;
}

.eyebrow,
.hero-edition,
.hero-kicker,
.section-kicker,
.assignment-index {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow,
.hero-edition,
.section-kicker,
.assignment-index {
  color: rgba(245, 236, 217, 0.72);
}

.hero-edition {
  padding-left: 14px;
  border-left: 1px solid rgba(245, 236, 217, 0.18);
}

.hero-copy {
  align-self: end;
  width: min(44rem, 100%);
  display: grid;
  gap: 18px;
  animation: hero-enter 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-kicker {
  color: var(--brand-strong);
}

.hero-copy h1 {
  margin: 0;
  max-width: 8ch;
  font-family: var(--font-display);
  font-size: clamp(4.2rem, 12vw, 8.5rem);
  line-height: 0.88;
  letter-spacing: -0.04em;
}

.hero-copy p:last-child {
  margin: 0;
  max-width: 34rem;
  padding: 20px 22px;
  border: 1px solid rgba(241, 196, 130, 0.18);
  border-radius: 22px;
  background: rgba(6, 18, 22, 0.44);
  backdrop-filter: blur(14px);
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(245, 236, 217, 0.88);
}

.hero-footer {
  justify-content: flex-start;
  padding-top: 24px;
  color: rgba(245, 236, 217, 0.82);
}

.hero-footer p {
  margin: 0;
  padding: 10px 0;
  font-size: 0.95rem;
}

.hero-footer p + p::before {
  content: "/";
  margin-right: 14px;
  color: rgba(245, 236, 217, 0.34);
}

#app {
  position: relative;
  z-index: 2;
  max-width: var(--page-width);
  margin: 28px auto 0;
  padding: 0 clamp(18px, 3.6vw, 36px);
}

.experience-shell {
  display: grid;
  gap: 24px;
}

.command-deck,
.scene-intro,
.operations-sheet,
.panel,
.submission-card,
.wall-card,
.auth-form-shell,
.message-stack {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--bg-panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.command-deck,
.scene-intro,
.operations-sheet,
.panel,
.auth-form-shell {
  padding: clamp(20px, 3vw, 30px);
}

.command-deck {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.35fr) auto;
  gap: 22px;
  align-items: end;
}

.command-copy h2,
.scene-copy h2,
.auth-copy h2,
.panel h2,
.operations-sheet h3 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.command-copy h2 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.command-note,
.lead,
.hint,
.tiny,
.presence-copy {
  color: var(--muted);
  line-height: 1.6;
}

.command-note,
.lead {
  margin: 12px 0 0;
  font-size: 1rem;
}

.command-center,
.auth-copy,
.scene-copy,
.field-grid,
.wall-card-body,
.progress-card,
.operations-sheet,
.panel,
.auth-form-shell {
  display: grid;
  gap: 16px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 12px;
}

.metric-strip.compact {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.metric-block {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  min-height: 86px;
  border: 1px solid rgba(250, 227, 188, 0.12);
  border-radius: 20px;
  background: rgba(255, 248, 233, 0.04);
}

.metric-block[data-tone="accent"] {
  border-color: rgba(126, 199, 183, 0.26);
  background: rgba(126, 199, 183, 0.08);
}

.metric-block strong {
  font-size: clamp(1.2rem, 2.2vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.metric-block span {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.nav-row,
.action-row,
.meta-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mode-nav {
  align-items: center;
}

.nav-btn,
.soft-btn,
.primary-btn,
.danger-btn,
.status-pill {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(250, 227, 188, 0.16);
  background: rgba(255, 248, 233, 0.05);
  color: rgba(245, 236, 217, 0.88);
}

.nav-btn,
.soft-btn,
.primary-btn,
.danger-btn {
  cursor: pointer;
  border: 1px solid transparent;
}

.nav-btn,
.soft-btn {
  color: var(--text);
  border-color: rgba(250, 227, 188, 0.16);
  background: rgba(255, 248, 233, 0.06);
}

.nav-btn[data-active="true"] {
  border-color: rgba(214, 161, 93, 0.38);
  background: linear-gradient(135deg, rgba(214, 161, 93, 0.22), rgba(126, 199, 183, 0.12));
  box-shadow: inset 0 0 0 1px rgba(214, 161, 93, 0.2);
}

.primary-btn {
  color: #081116;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  box-shadow: 0 14px 28px rgba(214, 161, 93, 0.18);
}

.danger-btn {
  color: #fff6ef;
  background: linear-gradient(135deg, #b4543b, var(--danger));
}

.primary-btn:disabled,
.soft-btn:disabled,
.danger-btn:disabled,
.nav-btn:disabled {
  cursor: wait;
  opacity: 0.56;
}

.message-stack {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.error-banner,
.success-banner {
  margin: 0;
  padding: 14px 16px;
  border-radius: 18px;
}

.error-banner {
  background: rgba(204, 113, 82, 0.14);
  color: #ffd3c7;
}

.success-banner {
  background: rgba(126, 199, 183, 0.14);
  color: #d9fff7;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: 24px;
}

.admin-auth-shell {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.auth-copy {
  align-content: center;
  padding: clamp(12px, 3vw, 24px) 0;
}

.auth-notes {
  display: grid;
  gap: 10px;
  color: rgba(245, 236, 217, 0.8);
}

.auth-notes p {
  margin: 0;
  padding-left: 18px;
  position: relative;
}

.auth-notes p::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 8px;
  height: 1px;
  background: rgba(245, 236, 217, 0.38);
}

.admin-auth-nav {
  justify-content: flex-start;
}

.auth-form-shell .action-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auth-form-shell .action-row > * {
  width: 100%;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.84rem;
  font-weight: 800;
  color: rgba(245, 236, 217, 0.84);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input,
.field textarea,
.table-input,
#login-username,
#login-password {
  width: 100%;
  border: 1px solid rgba(250, 227, 188, 0.16);
  border-radius: 18px;
  background: rgba(255, 248, 233, 0.06);
  padding: 14px 16px;
  color: var(--text);
  outline: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.field input:focus,
.field textarea:focus,
.table-input:focus,
#login-username:focus,
#login-password:focus {
  border-color: rgba(214, 161, 93, 0.44);
  box-shadow: 0 0 0 4px rgba(214, 161, 93, 0.08);
  background: rgba(255, 248, 233, 0.1);
}

.field textarea {
  min-height: 170px;
  resize: vertical;
}

.scene-intro {
  display: grid;
  gap: 20px;
}

.progress-band {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border: 1px solid rgba(250, 227, 188, 0.12);
  border-radius: 20px;
  background: rgba(255, 248, 233, 0.04);
}

.progress-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
}

.progress-copy strong {
  font-size: 1.2rem;
}

.progress-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 248, 233, 0.12);
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent-strong));
  box-shadow: 0 0 24px rgba(214, 161, 93, 0.26);
}

.presence-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.presence-stack {
  display: flex;
  padding-left: 10px;
}

.presence-avatar {
  display: inline-flex;
  padding: 4px;
  margin-left: -10px;
  border-radius: 999px;
  background: rgba(8, 17, 22, 0.72);
  box-shadow: 0 0 0 1px rgba(250, 227, 188, 0.14);
}

.avatar {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  flex: 0 0 auto;
}

.avatar-sm {
  width: 38px;
  height: 38px;
  border-radius: 14px;
}

.avatar-xs {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  vertical-align: text-bottom;
}

.field-guide,
.progress-section,
.gallery-section {
  display: grid;
  gap: 18px;
}

.section-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  justify-content: space-between;
}

.section-heading h3,
.submission-card h3,
.wall-card h3,
.player-cell h4,
.player-cell h3 {
  margin: 6px 0 0;
}

.section-heading h3,
.submission-card h3,
.wall-card h3 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.submission-card,
.wall-card,
.progress-card {
  overflow: hidden;
}

.submission-card {
  padding: clamp(18px, 2vw, 24px);
  border-radius: 26px;
}

.assignment-sheet {
  position: relative;
  gap: 20px;
}

.assignment-sheet::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, rgba(214, 161, 93, 0), rgba(214, 161, 93, 0.66), rgba(126, 199, 183, 0));
}

.assignment-sheet[data-locked="true"] {
  border-color: rgba(126, 199, 183, 0.26);
  background:
    linear-gradient(180deg, rgba(126, 199, 183, 0.08), rgba(255, 255, 255, 0)),
    var(--bg-panel-strong);
}

.assignment-header {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  align-items: start;
}

.assignment-meta {
  justify-content: flex-end;
}

.media-well,
.editor-well,
.progress-card {
  padding: 16px;
  border: 1px solid rgba(250, 227, 188, 0.12);
  border-radius: 22px;
  background: rgba(255, 248, 233, 0.04);
}

.upload-well {
  display: grid;
  gap: 12px;
}

.inspiration-panel {
  display: grid;
  gap: 10px;
}

.inspiration-chip-row {
  gap: 8px;
}

.inspiration-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(126, 199, 183, 0.24);
  background: rgba(126, 199, 183, 0.12);
  color: rgba(245, 236, 217, 0.9);
  font-size: 0.9rem;
  line-height: 1.2;
}

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

.file-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
  text-decoration: none;
}

.file-trigger[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.photo-stage {
  width: 100%;
  border: 1px solid rgba(250, 227, 188, 0.12);
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(126, 199, 183, 0.14), rgba(214, 161, 93, 0.16)),
    rgba(255, 248, 233, 0.04);
}

.photo-stage[data-empty="true"] {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 22px;
}

.photo-stage[data-empty="false"] {
  padding: 12px;
}

.photo-placeholder {
  margin: 0;
  max-width: 28ch;
  text-align: center;
  line-height: 1.6;
  color: rgba(245, 236, 217, 0.74);
}

.image-preview,
.wall-photo {
  display: block;
  width: 100%;
  max-width: 100%;
  border-radius: 16px;
}

.wall-photo {
  height: 100%;
  min-height: 320px;
  object-fit: cover;
}

.photo-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.progress-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.progress-card[data-online="true"] {
  border-color: rgba(126, 199, 183, 0.26);
  background: rgba(126, 199, 183, 0.08);
}

.player-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.player-cell p,
.player-cell h4,
.player-cell h3,
.submission-card p,
.wall-card p {
  margin: 0;
}

.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.wall-card {
  display: grid;
  align-content: start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
    rgba(8, 20, 25, 0.82);
  transition:
    transform 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease;
}

.wall-card:hover {
  transform: translateY(-4px);
  border-color: rgba(214, 161, 93, 0.28);
}

.wall-photo-stage {
  border-bottom: 1px solid rgba(250, 227, 188, 0.1);
}

.wall-card-body {
  padding: 18px;
}

.quote {
  padding-left: 14px;
  border-left: 2px solid rgba(214, 161, 93, 0.54);
  color: rgba(245, 236, 217, 0.9);
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(250, 227, 188, 0.1);
  border-radius: 22px;
  background: rgba(255, 248, 233, 0.03);
}

.password-reset-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

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

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(250, 227, 188, 0.08);
  text-align: left;
  white-space: nowrap;
}

thead th {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(245, 236, 217, 0.66);
}

td:last-child,
th:last-child {
  white-space: normal;
}

.hint,
.tiny {
  margin: 0;
}

.tiny {
  font-size: 0.84rem;
}

.empty-state {
  place-items: start;
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .command-deck,
  .auth-shell,
  .admin-auth-shell,
  .field-grid.dual,
  .assignment-grid {
    grid-template-columns: 1fr;
  }

  .command-deck {
    position: relative;
    top: 0;
  }

  #app {
    margin-top: 20px;
  }
}

@media (max-width: 720px) {
  .hero-shell,
  .hero-grid {
    min-height: 84svh;
  }

  .hero-grid {
    padding: 20px 16px 28px;
  }

  .hero-copy {
    gap: 14px;
    width: 100%;
  }

  .hero-copy h1 {
    font-size: clamp(3.7rem, 20vw, 5.2rem);
  }

  .hero-meta,
  .hero-footer {
    display: grid;
    justify-items: start;
    gap: 8px;
  }

  .hero-edition {
    padding-left: 0;
    border-left: 0;
  }

  .hero-footer p {
    padding: 0;
  }

  .hero-footer p + p::before {
    content: none;
    margin-right: 0;
  }

  .hero-copy p:last-child {
    padding: 16px;
  }

  #app {
    padding: 0 12px;
    margin-top: 14px;
  }

  .command-deck,
  .scene-intro,
  .operations-sheet,
  .panel,
  .submission-card,
  .wall-card,
  .auth-form-shell,
  .message-stack {
    border-radius: 22px;
  }

  .metric-strip,
  .progress-wall,
  .wall-grid {
    grid-template-columns: 1fr;
  }

  .action-row > * {
    flex: 1 1 100%;
  }

  .auth-form-shell .action-row {
    grid-template-columns: 1fr;
  }

  .photo-choice-row {
    grid-template-columns: 1fr;
  }

  .password-reset-row {
    flex-direction: column;
    align-items: stretch;
  }

  th,
  td {
    white-space: normal;
  }
}
