:root {
  --ink: #171717;
  --ink-soft: #3f3f3f;
  --paper: #f4eddc;
  --paper-deep: #e7dcc5;
  --white: #fffdf7;
  --red: #9d1f24;
  --red-deep: #681318;
  --gold: #bd8f32;
  --gold-light: #e9c66f;
  --green: #276749;
  --blue: #245d7a;
  --muted: #746f67;
  --line: #d5c8ae;
  --admin-bg: #f1f2f3;
  --admin-panel: #ffffff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --admin-shadow: 0 8px 26px rgba(32, 39, 44, 0.08);
  --radius: 14px;
  --radius-small: 8px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
}

a {
  color: inherit;
}

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

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(36, 93, 122, 0.4);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  line-height: 1.12;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.muted,
.optional,
.field-help,
.fine-print {
  color: var(--muted);
}

.optional {
  font-size: 0.82em;
  font-weight: 500;
}

.field-help {
  margin-top: -0.6rem;
  font-size: 0.86rem;
  line-height: 1.5;
}

.field-help code {
  color: var(--red-deep);
  background: #f4eee4;
  padding: 0.12rem 0.3rem;
  border-radius: 4px;
}

.eyebrow {
  margin-bottom: 0.6rem;
  color: var(--red);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0.68rem 1rem;
  font-weight: 780;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

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

.button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.button-primary {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.button-primary:hover:not(:disabled) {
  background: var(--red-deep);
  border-color: var(--red-deep);
}

.button-secondary {
  color: var(--ink);
  background: #fff;
  border-color: #c9ced2;
}

.button-secondary:hover:not(:disabled) {
  border-color: #949ca2;
  background: #f8f9fa;
}

.button-ghost {
  color: inherit;
  background: transparent;
  border-color: currentColor;
  opacity: 0.82;
}

.button-danger {
  color: #fff;
  background: #a82129;
  border-color: #a82129;
}

.button-small {
  min-height: 34px;
  padding: 0.46rem 0.7rem;
  font-size: 0.82rem;
}

.button-wide {
  width: 100%;
}

.alert {
  border: 1px solid;
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.alert-success {
  color: #1c583d;
  background: #eaf7f0;
  border-color: #a8d4bd;
}

.alert-error {
  color: #7a151b;
  background: #fbecee;
  border-color: #e5a9ae;
}

.alert-warning {
  color: #6b4a08;
  background: #fff7dc;
  border-color: #e1c36d;
}

.alert-info {
  color: #204f67;
  background: #eaf4f8;
  border-color: #a9cad9;
}

/* Public experience */

.public-shell {
  position: relative;
  overflow-x: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 20% 10%, rgba(157, 31, 36, 0.18), transparent 26rem),
    radial-gradient(circle at 85% 82%, rgba(189, 143, 50, 0.11), transparent 28rem),
    #111;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E");
}

.public-header,
.public-main,
.public-footer {
  position: relative;
  z-index: 1;
}

.public-header {
  display: flex;
  justify-content: center;
  padding: 1.25rem 1.25rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--paper);
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-decoration: none;
}

.brand-crown {
  color: var(--gold-light);
  font-size: 1.45rem;
  line-height: 1;
}

.brand-crown.large {
  display: block;
  margin-bottom: 0.7rem;
  font-size: 3rem;
}

.public-main {
  display: grid;
  min-height: calc(100vh - 130px);
  place-items: center;
  padding: 2.2rem 1rem 3rem;
}

.public-footer {
  padding: 0 1rem 1.4rem;
  color: rgba(244, 237, 220, 0.55);
  font-family: var(--serif);
  font-size: 0.8rem;
  font-style: italic;
  text-align: center;
}

.secret-card {
  position: relative;
  width: min(680px, 100%);
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.04)),
    var(--paper);
  border: 1px solid rgba(233, 198, 111, 0.62);
  border-radius: 2px;
  box-shadow: var(--shadow);
  padding: clamp(1.6rem, 5vw, 3.8rem);
}

.secret-card::before,
.secret-card::after {
  position: absolute;
  width: 60px;
  height: 60px;
  border-color: rgba(157, 31, 36, 0.32);
  content: '';
}

.secret-card::before {
  top: 13px;
  left: 13px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.secret-card::after {
  right: 13px;
  bottom: 13px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.card-rule {
  width: 58px;
  height: 5px;
  margin-bottom: 1.5rem;
  background: var(--red);
}

.secret-card h1 {
  margin-bottom: 1rem;
  font-family: var(--serif);
  font-size: clamp(2.25rem, 8vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -0.045em;
}

.secret-card h2 {
  font-family: var(--serif);
  font-size: 1.55rem;
}

.secret-card .lead {
  max-width: 55ch;
  margin-bottom: 1.8rem;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(1.06rem, 3vw, 1.3rem);
  line-height: 1.65;
}

.secret-card a:not(.button) {
  color: var(--red-deep);
  font-weight: 700;
}

.seal {
  display: grid;
  width: 96px;
  height: 96px;
  margin: 2.2rem auto;
  place-items: center;
  color: var(--gold-light);
  background:
    radial-gradient(circle at 35% 25%, #b72d35, var(--red-deep) 68%);
  border: 7px double rgba(244, 237, 220, 0.55);
  border-radius: 50%;
  box-shadow: 0 7px 15px rgba(68, 15, 18, 0.32);
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 800;
  transform: rotate(-7deg);
}

.stacked-form {
  display: grid;
  gap: 0.75rem;
}

.stacked-form label,
.grid-form label,
.filter-form label,
.two-column-form label,
.four-column-form label {
  display: grid;
  gap: 0.38rem;
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 760;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #bcb4a4;
  border-radius: 7px;
  padding: 0.76rem 0.82rem;
  color: var(--ink);
  background: #fffef9;
  line-height: 1.35;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
}

.code-form input {
  padding: 0.9rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.18rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fine-print {
  margin: 1rem 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
}

.identity-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: -0.5rem 0 2rem;
  padding: 0.72rem 0.85rem;
  color: #fff;
  background: var(--red-deep);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.identity-strip strong {
  color: var(--gold-light);
  text-align: right;
}

.unlocked-copy {
  margin-bottom: 2rem;
  font-family: var(--serif);
  font-size: 1.16rem;
  line-height: 1.68;
}

.response-panel {
  border-top: 1px solid var(--line);
  margin-top: 2rem;
  padding-top: 1.7rem;
}

.response-panel > p {
  color: var(--ink-soft);
  line-height: 1.6;
}

.submission-confirmation {
  margin-top: 2rem;
  border: 1px solid #b7cdbd;
  padding: 1.5rem;
  background: rgba(234, 247, 240, 0.7);
  text-align: center;
}

.confirmation-mark {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 0.8rem;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  font-weight: 900;
}

.submission-confirmation h2 {
  margin-bottom: 0.6rem;
}

.submission-confirmation p:last-child {
  margin-bottom: 0;
}

/* Carine Taskmaster public flow */

.public-shell {
  color: #fff;
  background: #000;
}

.public-header {
  padding-top: clamp(1.5rem, 5vw, 3rem);
}

.brand {
  color: #fff;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.public-main {
  min-height: calc(100vh - 128px);
  padding: clamp(2rem, 6vw, 5rem) 1.25rem;
}

.public-footer {
  color: rgba(255, 255, 255, 0.42);
  font-family: var(--sans);
  font-style: normal;
  letter-spacing: 0.04em;
}

.public-shell .secret-card {
  width: min(720px, 100%);
  overflow: visible;
  border: 0;
  padding: 0;
  color: #fff;
  background: transparent;
  box-shadow: none;
}

.public-shell .secret-card::before,
.public-shell .secret-card::after,
.public-shell .card-rule {
  display: none;
}

.public-shell .eyebrow {
  margin-bottom: 0.9rem;
  color: #e3b341;
}

.public-shell .secret-card h1 {
  max-width: 12ch;
  margin-bottom: 1.25rem;
  color: #fff;
  font-family: var(--sans);
  font-size: clamp(3rem, 11vw, 6.8rem);
  font-weight: 900;
  letter-spacing: -0.07em;
  line-height: 0.92;
}

.public-shell .secret-card h2 {
  color: #fff;
  font-family: var(--sans);
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 850;
  letter-spacing: -0.025em;
}

.public-shell .secret-card .lead,
.public-shell .unlocked-copy,
.public-shell .response-panel > p {
  max-width: 54ch;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--sans);
  font-size: clamp(1rem, 2.5vw, 1.16rem);
  line-height: 1.65;
}

.public-shell .stacked-form label {
  color: rgba(255, 255, 255, 0.72);
}

.public-shell input,
.public-shell textarea,
.public-shell select {
  border: 1px solid #383838;
  border-radius: 2px;
  color: #fff;
  background: #111;
}

.public-shell input::placeholder,
.public-shell textarea::placeholder {
  color: #777;
}

.public-shell input:focus,
.public-shell textarea:focus,
.public-shell select:focus {
  border-color: #e3b341;
  outline-color: rgba(227, 179, 65, 0.38);
}

.public-shell .code-form {
  max-width: 440px;
}

.public-shell .code-form input {
  min-height: 60px;
  border-width: 0 0 2px;
  padding-inline: 0;
  background: transparent;
  font-size: 1.35rem;
}

.public-shell .button-primary {
  min-height: 52px;
  border-color: #f3c74f;
  color: #080808;
  background: #f3c74f;
}

.public-shell .button-primary:hover:not(:disabled) {
  border-color: #ffdc77;
  background: #ffdc77;
}

.public-shell .fine-print {
  color: rgba(255, 255, 255, 0.46);
}

.public-shell .alert-error {
  color: #ffd9dc;
  background: #2b0b0e;
  border-color: #7d252d;
}

.public-shell .alert-warning {
  color: #ffe8aa;
  background: #281f08;
  border-color: #69561c;
}

.identity-strip {
  border: 1px solid #353535;
  border-width: 1px 0;
  margin: 0 0 2.4rem;
  padding: 0.9rem 0;
  color: rgba(255, 255, 255, 0.55);
  background: transparent;
}

.identity-strip strong {
  color: #f3c74f;
}

.public-shell .response-panel {
  border-color: #292929;
  margin-top: 2.5rem;
  padding-top: 2rem;
}

.challenge-ideas {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.85rem;
  overflow: hidden;
  border: 1px solid #343434;
  margin: 0.55rem 0 0.45rem;
  color: rgba(255, 255, 255, 0.76);
  background: #0d0d0d;
}

.ideas-label {
  position: relative;
  z-index: 1;
  padding: 0.85rem 0 0.85rem 0.9rem;
  color: #f3c74f;
  background: #0d0d0d;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ideas-window {
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}

.ideas-track {
  display: flex;
  width: max-content;
  animation: ideas-scroll 44s linear infinite;
}

.ideas-set {
  display: flex;
}

.ideas-set > span {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding-right: 2.2rem;
  font-size: 0.83rem;
  white-space: nowrap;
}

.ideas-track i {
  color: #b8242d;
  font-size: 0.55rem;
  font-style: normal;
}

@keyframes ideas-scroll {
  to { transform: translateX(-50%); }
}

.public-shell .submission-confirmation {
  border-color: #32533e;
  color: #fff;
  background: #0b1e12;
}

.public-shell .confirmation-mark {
  color: #080808;
  background: #f3c74f;
}

/* Animated code-entry screen */

.home-page::before,
.home-page::after {
  position: fixed;
  pointer-events: none;
  content: '';
}

.home-page::before {
  inset: -20%;
  z-index: 0;
  opacity: 0.11;
  background-image:
    linear-gradient(rgba(243, 199, 79, 0.24) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243, 199, 79, 0.24) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at 50% 48%, #000 0, transparent 66%);
  transform: perspective(520px) rotateX(64deg) translateY(17%);
  transform-origin: center bottom;
  animation: home-grid-drift 18s linear infinite;
}

.home-page::after {
  top: -18rem;
  right: -14rem;
  z-index: 0;
  width: 44rem;
  height: 44rem;
  opacity: 0.6;
  background:
    radial-gradient(circle, rgba(157, 31, 36, 0.34) 0, rgba(157, 31, 36, 0.12) 28%, transparent 67%);
  filter: blur(8px);
  animation: home-aura-breathe 7s ease-in-out infinite alternate;
}

.home-page .public-header .brand {
  animation: home-fade-down 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.home-page .home-card {
  position: relative;
  isolation: isolate;
}

.home-page .home-card > :not(.home-emblem) {
  position: relative;
  z-index: 2;
}

.home-page .home-card > .eyebrow {
  animation: home-copy-rise 700ms 120ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.home-page .home-card > h1 {
  text-shadow: 0 0 32px rgba(255, 255, 255, 0.08);
  animation: home-title-reveal 900ms 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.home-page .home-card > .lead {
  animation: home-copy-rise 700ms 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.home-page .home-card > .alert {
  animation: home-copy-rise 500ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.home-page .home-card > .fine-print {
  animation: home-copy-rise 700ms 850ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.home-emblem {
  position: absolute;
  top: -6.5rem;
  right: -11rem;
  z-index: 0;
  width: 30rem;
  height: 30rem;
  opacity: 0;
  color: #f3c74f;
  animation: emblem-arrive 1.4s 350ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.home-emblem strong,
.emblem-ring,
.emblem-crosshair {
  position: absolute;
}

.home-emblem strong {
  top: 50%;
  left: 50%;
  color: transparent;
  font-family: var(--sans);
  font-size: 9.5rem;
  font-weight: 950;
  letter-spacing: -0.12em;
  line-height: 1;
  -webkit-text-stroke: 2px rgba(243, 199, 79, 0.46);
  text-indent: -0.12em;
  transform: translate(-50%, -50%);
  animation: emblem-monogram-pulse 5s ease-in-out infinite;
}

.emblem-ring {
  border-radius: 50%;
}

.emblem-ring-outer {
  inset: 0;
  border: 1px solid rgba(243, 199, 79, 0.26);
  background:
    repeating-conic-gradient(from 0deg, rgba(243, 199, 79, 0.68) 0 1deg, transparent 1deg 8deg);
  mask: radial-gradient(circle, transparent 0 96%, #000 96.2% 100%);
  animation: emblem-spin 32s linear infinite;
}

.emblem-ring-inner {
  inset: 3.2rem;
  border: 1px dashed rgba(184, 36, 45, 0.72);
  box-shadow:
    inset 0 0 40px rgba(184, 36, 45, 0.08),
    0 0 40px rgba(184, 36, 45, 0.08);
  animation: emblem-spin-reverse 24s linear infinite;
}

.emblem-crosshair {
  top: 50%;
  left: 50%;
  background: linear-gradient(90deg, transparent, rgba(243, 199, 79, 0.38), transparent);
  transform: translate(-50%, -50%);
  animation: emblem-crosshair-pulse 3.5s ease-in-out infinite;
}

.emblem-crosshair-horizontal {
  width: 34rem;
  height: 1px;
}

.emblem-crosshair-vertical {
  width: 1px;
  height: 34rem;
  background: linear-gradient(transparent, rgba(243, 199, 79, 0.38), transparent);
}

.home-page .code-form {
  position: relative;
  width: min(440px, 100%);
  overflow: hidden;
  border: 1px solid rgba(243, 199, 79, 0.25);
  padding: 1.15rem;
  background:
    linear-gradient(135deg, rgba(243, 199, 79, 0.055), transparent 45%),
    rgba(7, 7, 7, 0.78);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 13px 100%, 0 calc(100% - 13px));
  backdrop-filter: blur(12px);
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
  animation: home-form-arrive 800ms 620ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.home-page .code-form::before {
  position: absolute;
  top: 0;
  left: -45%;
  width: 40%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #f3c74f, transparent);
  content: '';
  animation: code-scan 3.8s 1.2s ease-in-out infinite;
}

.home-page .code-form:focus-within {
  border-color: rgba(243, 199, 79, 0.62);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.52),
    0 0 0 1px rgba(243, 199, 79, 0.09),
    0 0 36px rgba(243, 199, 79, 0.08);
  transform: translateY(-2px);
}

.home-page .code-form input {
  border-color: rgba(255, 255, 255, 0.22);
  transition: border-color 220ms ease, text-shadow 220ms ease;
}

.home-page .code-form input:focus {
  border-color: #f3c74f;
  text-shadow: 0 0 18px rgba(243, 199, 79, 0.35);
}

.home-page .code-form .button-primary {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.home-page .code-form .button-primary::after {
  position: absolute;
  inset: -60% auto -60% -35%;
  z-index: -1;
  width: 24%;
  background: rgba(255, 255, 255, 0.55);
  content: '';
  filter: blur(7px);
  transform: rotate(18deg);
  animation: button-glint 4.2s 1.5s ease-in-out infinite;
}

.home-page .code-form .button-primary:hover:not(:disabled) {
  box-shadow: 0 0 28px rgba(243, 199, 79, 0.26);
  transform: translateY(-2px);
}

@keyframes home-grid-drift {
  to { background-position: 54px 54px, 54px 54px; }
}

@keyframes home-aura-breathe {
  from { opacity: 0.36; transform: translate3d(-3%, 2%, 0) scale(0.93); }
  to { opacity: 0.68; transform: translate3d(3%, -2%, 0) scale(1.08); }
}

@keyframes home-fade-down {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes home-copy-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes home-title-reveal {
  from { opacity: 0; filter: blur(9px); letter-spacing: -0.12em; transform: translateY(34px) scale(0.96); }
  to { opacity: 1; filter: blur(0); letter-spacing: -0.07em; transform: translateY(0) scale(1); }
}

@keyframes home-form-arrive {
  from { opacity: 0; transform: translateY(28px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes emblem-arrive {
  from { opacity: 0; transform: rotate(-14deg) scale(0.82); }
  to { opacity: 0.46; transform: rotate(0) scale(1); }
}

@keyframes emblem-spin {
  to { transform: rotate(360deg); }
}

@keyframes emblem-spin-reverse {
  to { transform: rotate(-360deg); }
}

@keyframes emblem-monogram-pulse {
  0%, 100% { opacity: 0.52; transform: translate(-50%, -50%) scale(0.98); }
  50% { opacity: 0.86; transform: translate(-50%, -50%) scale(1.02); }
}

@keyframes emblem-crosshair-pulse {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.72; }
}

@keyframes code-scan {
  0%, 28% { left: -45%; opacity: 0; }
  42% { opacity: 1; }
  62%, 100% { left: 110%; opacity: 0; }
}

@keyframes button-glint {
  0%, 58% { left: -35%; opacity: 0; }
  67% { opacity: 0.7; }
  80%, 100% { left: 125%; opacity: 0; }
}

.code-edit-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  gap: 0.5rem;
}

.code-edit-row input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 760;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.label-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.label-with-action label {
  color: var(--ink-soft);
  font-size: 0.86rem;
  font-weight: 760;
}

@media (prefers-reduced-motion: reduce) {
  .ideas-track,
  .home-page::before,
  .home-page::after,
  .home-page .public-header .brand,
  .home-page .home-card > :not(.home-emblem),
  .home-emblem,
  .home-emblem strong,
  .emblem-ring,
  .emblem-crosshair,
  .home-page .code-form,
  .home-page .code-form::before,
  .home-page .code-form .button-primary::after {
    animation: none;
  }

  .home-emblem {
    opacity: 0.32;
  }
}

@media (max-width: 540px) {
  .public-header {
    justify-content: flex-start;
  }

  .public-main {
    place-items: start stretch;
    padding-top: 3.5rem;
  }

  .home-emblem {
    top: -1.5rem;
    right: -10rem;
    width: 23rem;
    height: 23rem;
  }

  .home-emblem strong {
    font-size: 7rem;
  }

  .emblem-ring-inner {
    inset: 2.5rem;
  }

  .emblem-crosshair-horizontal {
    width: 27rem;
  }

  .emblem-crosshair-vertical {
    height: 27rem;
  }

  .home-page .code-form {
    padding: 1rem;
  }

  .challenge-ideas {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .ideas-label {
    padding-bottom: 0.35rem;
  }

  .ideas-window {
    padding: 0.55rem 0 0.8rem;
  }
}

/* Login */

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 1rem;
  color: var(--paper);
  background:
    radial-gradient(circle at top, rgba(157, 31, 36, 0.25), transparent 35rem),
    #111;
}

.login-card {
  width: min(430px, 100%);
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: clamp(1.6rem, 5vw, 2.8rem);
}

.login-card h1 {
  font-family: var(--serif);
  font-size: 2.5rem;
}

.back-link {
  display: inline-block;
  margin-top: 1.25rem;
  color: var(--red-deep);
  font-size: 0.85rem;
}

/* Admin */

.admin-shell {
  min-height: 100vh;
  color: #202529;
  background: var(--admin-bg);
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(100px, 1fr);
  align-items: center;
  gap: 1rem;
  min-height: 66px;
  border-bottom: 1px solid #d9dde0;
  padding: 0 1.4rem;
  color: #fff;
  background: #181b1e;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.16);
}

.admin-brand {
  font-family: var(--serif);
  font-weight: 750;
  text-decoration: none;
}

.admin-brand span {
  margin-right: 0.35rem;
  color: var(--gold-light);
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.admin-nav a {
  border-radius: 6px;
  padding: 0.55rem 0.68rem;
  color: #c8ced2;
  font-size: 0.84rem;
  font-weight: 720;
  text-decoration: none;
}

.admin-nav a:hover,
.admin-nav a.active {
  color: #fff;
  background: #32373b;
}

.logout-form {
  justify-self: end;
}

.logout-form .button {
  color: #d9dddf;
}

.admin-main {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 2rem 1.35rem 4rem;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-heading h1 {
  margin-bottom: 0.35rem;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.035em;
}

.page-heading p {
  max-width: 70ch;
  margin-bottom: 0;
  color: var(--muted);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-size: 0.83rem;
}

.breadcrumbs a {
  color: var(--red-deep);
  font-weight: 700;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.metric-card {
  display: flex;
  min-height: 120px;
  flex-direction: column;
  justify-content: space-between;
  border-top: 4px solid var(--red);
  background: var(--admin-panel);
  box-shadow: var(--admin-shadow);
  padding: 1rem;
}

.metric-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
  line-height: 1.35;
  text-transform: uppercase;
}

.metric-card strong {
  font-family: var(--serif);
  font-size: 2.5rem;
  line-height: 1;
}

.admin-panel {
  margin-bottom: 1.25rem;
  border: 1px solid #e0e3e5;
  border-radius: var(--radius-small);
  background: var(--admin-panel);
  box-shadow: var(--admin-shadow);
  padding: 1.25rem;
}

.admin-panel h2 {
  font-family: var(--serif);
  font-size: 1.55rem;
}

.admin-panel h3 {
  margin-top: 1.4rem;
  font-size: 1rem;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-heading h2 {
  margin-bottom: 0.25rem;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid #eceeef;
  padding: 0.85rem 0;
}

.link-row:first-of-type {
  border-top: 0;
}

.link-row code,
.full-code {
  display: block;
  margin-top: 0.35rem;
  color: #4b555c;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th,
td {
  border-bottom: 1px solid #e5e8ea;
  padding: 0.78rem 0.68rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: #5a6369;
  background: #f8f9fa;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody tr:hover {
  background: #fcfcfc;
}

td a:not(.button) {
  color: var(--red-deep);
  font-weight: 750;
}

.actions-cell,
.card-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.copy-inline {
  border: 0;
  padding: 0.2rem 0.35rem;
  color: var(--blue);
  background: transparent;
  font-size: 0.75rem;
  font-weight: 750;
  cursor: pointer;
}

.code-word {
  display: inline-block;
  border: 1px solid #d5dadd;
  border-radius: 4px;
  padding: 0.25rem 0.4rem;
  color: #28343b;
  background: #f7f8f8;
  font-weight: 700;
}

.inactive-row,
.inactive-card {
  opacity: 0.62;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border-radius: 999px;
  padding: 0.26rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 820;
  line-height: 1;
  white-space: nowrap;
}

.status-opened {
  color: #4a5358;
  background: #eceff1;
}

.status-pending {
  color: #704b04;
  background: #fff0c4;
}

.status-approved {
  color: #1e5a3e;
  background: #dff3e8;
}

.status-rejected {
  color: #7a1a20;
  background: #f8e3e5;
}

.status-completed {
  color: #fff;
  background: var(--green);
}

.form-panel {
  padding: clamp(1rem, 3vw, 1.6rem);
}

.wide-form {
  max-width: 880px;
}

.grid-form,
.filter-form,
.two-column-form,
.four-column-form {
  display: grid;
  gap: 0.85rem;
}

.grid-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.game-grid-form {
  grid-template-columns: 1.2fr 1fr 1.2fr auto;
}

.span-2 {
  grid-column: span 2;
}

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

.four-column-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two-column-form.compact {
  align-items: start;
}

.align-end {
  align-self: end;
}

.checkbox-label {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.55rem !important;
  min-height: 40px;
  color: var(--ink) !important;
  cursor: pointer;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.checkbox-stack {
  display: grid;
  gap: 0.2rem;
  padding-top: 0.2rem;
}

.form-actions {
  border-top: 1px solid #e4e7e9;
  margin-top: 0.7rem;
  padding-top: 1rem;
}

.filter-panel {
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.filter-form {
  grid-template-columns: 1fr 1.3fr 1fr auto auto;
  align-items: end;
}

.clue-admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.clue-admin-card {
  border: 1px solid #e0e3e5;
  border-top: 5px solid var(--red);
  border-radius: var(--radius-small);
  background: #fff;
  box-shadow: var(--admin-shadow);
  padding: 1.25rem;
}

.clue-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.clue-card-top h2 {
  margin-bottom: 0.7rem;
  font-family: var(--serif);
  font-size: 1.6rem;
}

.clue-admin-card > p {
  min-height: 2.8rem;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.clue-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  border-top: 1px solid #eceeef;
  border-bottom: 1px solid #eceeef;
  margin: 1rem 0;
  padding: 0.75rem 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.clue-stats strong {
  color: var(--ink);
}

.full-code {
  min-height: 2.4rem;
  border-radius: 5px;
  padding: 0.6rem;
  background: #f5f6f7;
}

.card-actions {
  margin-top: 0.9rem;
}

.empty-state {
  border: 1px dashed #c8ced2;
  border-radius: var(--radius-small);
  padding: 2rem;
  color: var(--muted);
  background: #fafbfb;
  text-align: center;
}

.empty-state h3 {
  margin-bottom: 0.45rem;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.45rem;
}

.empty-state p {
  margin-bottom: 1rem;
}

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

.detail-grid.single-detail {
  grid-template-columns: 1fr;
}

.detail-list {
  margin: 0;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1rem;
  border-bottom: 1px solid #eceeef;
  padding: 0.65rem 0;
}

.detail-list dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.detail-list dd {
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.proposal-box {
  min-height: 90px;
  border-left: 4px solid var(--red);
  padding: 1rem;
  background: #f7f3ec;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.6;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid #e3b7bb;
  margin-top: 2rem;
  padding-top: 1.2rem;
}

.danger-zone p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 1100px) {
  .admin-header {
    grid-template-columns: 1fr auto;
  }

  .admin-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    overflow-x: auto;
    padding-bottom: 0.65rem;
  }

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

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

  .span-2 {
    grid-column: auto;
  }

  .filter-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .public-header {
    justify-content: flex-start;
  }

  .public-main {
    place-items: start stretch;
    padding-top: 3.5rem;
  }

  .secret-card {
    padding: 1.5rem;
  }

  .secret-card::before,
  .secret-card::after {
    display: none;
  }

  .identity-strip,
  .page-heading,
  .panel-heading,
  .link-row,
  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .identity-strip strong {
    text-align: left;
  }

  .admin-header {
    position: static;
    grid-template-columns: 1fr auto;
    padding: 0.8rem 1rem;
  }

  .admin-brand {
    font-size: 0.9rem;
  }

  .admin-nav {
    width: calc(100vw - 2rem);
  }

  .admin-main {
    padding: 1.4rem 0.8rem 3rem;
  }

  .metrics-grid,
  .clue-admin-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

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

  .metric-card {
    min-height: 105px;
  }

  .grid-form,
  .game-grid-form,
  .filter-form,
  .two-column-form,
  .four-column-form {
    grid-template-columns: 1fr;
  }

  .detail-list > div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .actions-cell {
    min-width: 220px;
  }
}

@media (max-width: 430px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .brand {
    font-size: 0.82rem;
  }

  .secret-card h1 {
    font-size: 2.35rem;
  }
}
