:root {
  --ink: #201a1a;
  --muted: #665b57;
  --paper: #fffaf0;
  --white: #ffffff;
  --line: #eadfcf;
  --red: #ef3340;
  --red-dark: #b91827;
  --yellow: #ffd23f;
  --green: #13a85a;
  --blue: #2f6fdf;
  --orange: #ff8a2a;
  --shadow: 0 18px 42px rgba(32, 26, 26, 0.13);
  --radius: 8px;
  --max: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(239, 51, 64, 0.08) 0 1px, transparent 1px 34px),
    linear-gradient(0deg, rgba(255, 210, 63, 0.14) 0 1px, transparent 1px 34px),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

img {
  display: block;
  max-width: 100%;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

label {
  font-weight: 750;
}

code {
  display: inline-block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
  font-size: 12px;
}

.site-header,
.site-nav,
.brand-lockup,
.hero-actions,
.button-row,
.leader-row,
.dashboard-meta,
.admin-heading,
.table-heading,
.mini-row {
  display: flex;
  align-items: center;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  justify-content: space-between;
  gap: 14px;
  padding: 12px max(16px, calc((100vw - var(--max)) / 2));
  background: rgba(255, 250, 240, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand-lockup {
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  flex: 0 0 auto;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--red);
  font-weight: 950;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup small {
  color: var(--muted);
  font-size: 12px;
}

.site-nav {
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-weight: 750;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
  padding: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(280px, 0.98fr);
  gap: 32px;
  align-items: center;
  max-width: var(--max);
  min-height: calc(100vh - 96px);
  margin: 0 auto;
  padding: 52px 18px 72px;
}

.hero h1,
.section-heading h1,
.section-heading h2,
.panel h1,
.panel h2,
.admin-heading h1 {
  margin: 10px 0;
  line-height: 1.02;
}

.hero h1 {
  max-width: 720px;
  font-size: 56px;
  font-weight: 950;
}

.hero p,
.section-heading p,
.panel p {
  color: var(--muted);
  margin: 0 0 20px;
}

.hero-copy {
  min-width: 0;
}

.hero-art {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  min-height: 420px;
  padding: 24px;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, var(--yellow) 0 50%, #ffffff 50% 100%);
  box-shadow: 10px 10px 0 var(--blue);
}

.hero-art::before,
.hero-art::after {
  content: "";
  position: absolute;
  border: 3px solid var(--ink);
  background: var(--red);
  transform: rotate(-10deg);
}

.hero-art::before {
  width: 86px;
  height: 24px;
  left: 24px;
  top: 22px;
}

.hero-art::after {
  width: 46px;
  height: 46px;
  right: 28px;
  bottom: 28px;
  background: var(--green);
  transform: rotate(14deg);
}

.hero-art img {
  width: 100%;
  min-width: 0;
  border-radius: var(--radius);
  background: var(--white);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 rgba(32, 26, 26, 0.24);
}

.hero-art img:nth-child(2) {
  transform: translateY(54px) rotate(5deg);
}

.hero-art img:nth-child(3) {
  grid-column: 1 / -1;
  width: 58%;
  justify-self: center;
  transform: rotate(-4deg);
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 44px 18px;
}

.section.narrow {
  max-width: 720px;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 22px;
}

.section-heading h1,
.section-heading h2 {
  font-size: 38px;
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 850;
  font-size: 12px;
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--ink);
}

.badge-yellow {
  background: var(--yellow);
}

.badge-green {
  background: #b8f3cd;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--red);
  color: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  font-weight: 900;
  padding: 10px 16px;
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.button:hover,
.button:focus-visible {
  transform: translate(-1px, -1px);
  box-shadow: 6px 6px 0 var(--ink);
}

.button:disabled {
  cursor: progress;
  opacity: 0.65;
}

.button-large {
  min-height: 52px;
  padding-inline: 22px;
}

.button-secondary {
  background: var(--yellow);
  color: var(--ink);
}

.button-ghost {
  background: var(--white);
  color: var(--ink);
}

.button-danger {
  background: var(--red-dark);
}

.button-small {
  min-height: 36px;
  padding: 6px 10px;
  box-shadow: 2px 2px 0 var(--ink);
}

.full-width {
  width: 100%;
}

.hero-actions,
.button-row {
  gap: 12px;
  flex-wrap: wrap;
}

.steps-grid,
.score-grid,
.content-grid,
.settings-grid {
  display: grid;
  gap: 16px;
}

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

.step-card,
.panel,
.score-card,
.leaderboard-strip,
.admin-panel,
.admin-stat {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.step-card {
  padding: 18px;
}

.step-card strong {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--yellow);
  border: 2px solid var(--ink);
}

.step-card h3 {
  margin: 16px 0 6px;
}

.step-card p,
.muted,
.small-note {
  color: var(--muted);
}

.split-section,
.content-grid,
.settings-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

.split-section {
  display: grid;
  gap: 22px;
  align-items: start;
}

.leaderboard-strip,
.panel,
.admin-panel {
  padding: 20px;
}

.leader-row,
.mini-row {
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.leader-row:first-of-type,
.mini-row:first-of-type {
  border-top: 0;
}

.auth-section {
  padding-top: 76px;
}

.auth-form,
.stack-form,
.upload-form {
  display: grid;
  gap: 12px;
}

.phone-field {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}

.phone-field span {
  display: grid;
  min-height: 44px;
  place-items: center;
  border-right: 1px solid var(--line);
  background: #fff0b8;
  font-weight: 850;
}

.phone-field input {
  border: 0;
  border-radius: 0;
}

.hidden {
  display: none !important;
}

.recaptcha-box {
  min-height: 78px;
  margin-top: 14px;
}

.recaptcha-box.recaptcha-invisible {
  min-height: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
}

.form-message {
  min-height: 24px;
  color: var(--muted);
  font-weight: 750;
}

.form-message[data-type="error"],
.error-text {
  color: var(--red-dark);
}

.form-message[data-type="success"] {
  color: #08783f;
}

.character-form {
  padding-bottom: 76px;
}

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

.character-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 210px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.character-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.character-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  filter: grayscale(1);
  border-radius: var(--radius);
  background: #f6f6f6;
}

.character-card strong,
.character-card small {
  overflow-wrap: anywhere;
}

.character-card small {
  color: var(--muted);
}

.character-card:hover {
  transform: translateY(-2px);
}

.character-card.is-selected {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(19, 168, 90, 0.18);
}

.character-card.is-selected img {
  filter: grayscale(0);
}

.selected-badge {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  display: none;
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
  font-size: 11px;
  font-weight: 900;
  padding: 4px 8px;
}

.character-card.is-selected .selected-badge {
  display: inline-flex;
}

.sticky-action {
  position: sticky;
  bottom: 14px;
  z-index: 12;
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.file-drop {
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 2px dashed var(--blue);
  border-radius: var(--radius);
  background: #edf4ff;
  cursor: pointer;
  padding: 18px;
  text-align: center;
}

.file-drop span {
  font-size: 22px;
  font-weight: 950;
}

.file-drop input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.preview-box img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--white);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 650;
}

.checkbox-row input {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  margin-top: 2px;
}

.celebration-panel {
  text-align: center;
}

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

.score-card {
  padding: 18px;
}

.score-card span {
  color: var(--muted);
  font-weight: 850;
}

.score-card strong {
  display: block;
  margin-top: 8px;
  font-size: 42px;
  line-height: 1;
}

.score-card.approved {
  background: #e9fff1;
}

.score-card.pending {
  background: #fff4c8;
}

.score-card.rejected {
  background: #ffe6e8;
}

.dashboard-meta {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

.submission-list {
  display: grid;
  gap: 12px;
}

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

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

.submission-item img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: var(--radius);
  background: #f6f6f6;
}

.submission-item h3,
.submission-item p {
  margin: 0;
}

.submission-status {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.status-pending {
  background: #fff1a6;
}

.status-approved {
  background: #b8f3cd;
}

.status-rejected {
  background: #ffd4da;
}

.terms-float {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 30;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 850;
  padding: 8px 12px;
}

.toast {
  position: fixed;
  z-index: 60;
  top: 72px;
  right: 16px;
  max-width: min(420px, calc(100vw - 32px));
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-weight: 800;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast-success {
  background: #d9ffe7;
}

.toast-error {
  background: #ffdce1;
}

.toast-hide {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.legal-copy h2 {
  margin-top: 22px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
  background: #f7f8fb;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid #dfe4ef;
  background: var(--white);
}

.admin-nav {
  display: grid;
  gap: 6px;
}

.admin-nav a {
  border-radius: var(--radius);
  padding: 10px 12px;
  font-weight: 800;
}

.admin-nav a:hover {
  background: #eef3ff;
}

.admin-main {
  min-width: 0;
  padding: 26px;
}

.admin-main-centered {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
}

.admin-login {
  width: min(460px, calc(100vw - 32px));
}

.auth-card {
  width: 100%;
}

.admin-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-heading h1,
.admin-heading p {
  margin: 0;
}

.admin-heading p {
  color: var(--muted);
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-stat {
  padding: 16px;
  box-shadow: none;
}

.admin-stat span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.admin-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.admin-panel {
  margin-bottom: 18px;
  box-shadow: none;
}

.table-heading {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.table-heading h2 {
  margin: 0;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 840px;
}

th,
td {
  border-bottom: 1px solid #e3e8f1;
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #4f5c70;
  font-size: 12px;
  text-transform: uppercase;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(140px, 0.8fr) minmax(160px, 1fr) minmax(160px, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.thumb {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.review-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(340px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.review-photo {
  width: 100%;
  max-height: 680px;
  object-fit: contain;
  border-radius: var(--radius);
  background: #f1f3f8;
}

.detail-list {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 12px;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 850;
}

.detail-list dd {
  min-width: 0;
  margin: 0;
}

.review-form {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.warning-text {
  color: #9a5d00;
  font-weight: 900;
}

.notice {
  border-radius: var(--radius);
  margin-bottom: 14px;
  padding: 12px 14px;
  font-weight: 850;
}

.notice.warning {
  background: #fff0b8;
  border: 1px solid #e0b100;
}

.settings-actions {
  grid-column: 1 / -1;
}

@media (max-width: 920px) {
  .hero,
  .split-section,
  .content-grid,
  .settings-grid,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 34px;
  }

  .hero h1 {
    font-size: 44px;
  }

  .steps-grid,
  .score-grid,
  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .admin-sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid #dfe4ef;
  }

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

  .filter-bar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
  }

  .site-nav {
    gap: 8px;
    font-size: 14px;
  }

  .hero h1,
  .section-heading h1,
  .section-heading h2 {
    font-size: 34px;
  }

  .hero-art {
    min-height: 300px;
  }

  .steps-grid,
  .score-grid,
  .admin-stat-grid,
  .filter-bar {
    grid-template-columns: 1fr;
  }

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

  .character-card {
    min-height: 156px;
    padding: 7px;
  }

  .character-card strong {
    font-size: 13px;
  }

  .character-card small {
    font-size: 11px;
  }

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

  .submission-status {
    grid-column: 1 / -1;
    justify-items: start;
  }

  .admin-main {
    padding: 16px;
  }

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

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

  .terms-float {
    left: 14px;
    right: auto;
  }
}
