:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #667085;
  --paper: #fbfaf7;
  --surface: #fff;
  --line: #e6e1d8;
  --teal: #117f7a;
  --teal-dark: #0a5655;
  --danger: #b42318;
  --shadow: 0 18px 55px rgba(24,33,47,.1);
}
* { box-sizing: border-box; }
body {
  margin: 0; min-width: 320px; color: var(--ink);
  background:
    linear-gradient(180deg, rgba(251,250,247,.94), rgba(251,250,247,.99)),
    radial-gradient(circle at 10% 0%, rgba(17,127,122,.12), transparent 28rem),
    radial-gradient(circle at 88% 10%, rgba(239,111,81,.12), transparent 26rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.shell { width: calc(100% - 48px); max-width: 1180px; margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid rgba(230,225,216,.78); background: rgba(251,250,247,.9); backdrop-filter: blur(18px); }
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 950; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 8px; background: rgba(255,255,255,.85); border: 1px solid rgba(24,33,47,.08); box-shadow: 0 10px 24px rgba(24,33,47,.14); }
.brand-mark img { width: 36px; height: 36px; object-fit: contain; }
.nav-links { display: flex; align-items: center; gap: 20px; color: var(--muted); font-weight: 850; }
main { padding: 52px 0 70px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.6rem, 5vw, 4.8rem); line-height: .96; }
p { color: #4e5b6d; line-height: 1.65; }
.hero { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 24px; align-items: end; margin-bottom: 24px; }
.hero p { max-width: 660px; margin-top: 16px; }
.panel { border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.84); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 1.25rem; }
.panel-body { padding: 20px; }
.grid { display: grid; grid-template-columns: minmax(320px,.85fr) minmax(0,1.15fr); gap: 18px; align-items: start; }
.auth-stack { display: grid; gap: 14px; max-width: 480px; margin: 0 auto; }
.register-panel { display: none; }
.register-panel.visible { display: block; }
.auth-switch { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; text-align: center; }
.link-button { min-height: 0; border: 0; padding: 0; background: transparent; color: var(--teal-dark); font-weight: 950; }
label { display: block; margin-bottom: 14px; color: var(--ink); font-weight: 900; }
input {
  width: 100%; min-height: 44px; margin-top: 7px; border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; background: #fff; color: var(--ink);
}
.button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 8px; padding: 0 15px; background: #fff; color: var(--ink);
  cursor: pointer; font-weight: 900;
}
.button.primary, button.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
button:disabled { cursor: not-allowed; opacity: .58; }
.notice { border-radius: 8px; padding: 12px 14px; margin-bottom: 18px; background: #eef9f7; color: var(--teal-dark); border: 1px solid #b7dfdb; font-weight: 850; }
.notice.error { background: #fff5f3; color: var(--danger); border-color: #f4c6bd; }
.muted { color: var(--muted); font-size: .92rem; }
.upload-drop { border: 1px dashed rgba(17,127,122,.38); border-radius: 8px; padding: 16px; background: rgba(238,249,247,.48); }
.preview-card {
  display: none; grid-template-columns: 160px minmax(0,1fr); gap: 16px; align-items: center;
  margin-top: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fff;
}
.preview-card.visible { display: grid; }
.sprite-stage { display: grid; place-items: center; min-height: 150px; border-radius: 8px; background: linear-gradient(135deg, rgba(17,127,122,.1), transparent 46%), #f5f2ec; }
.sprite-viewport { display: grid; place-items: center; width: min(72%, 130px); aspect-ratio: 12 / 13; }
.sprite-frame { width: 100%; height: 100%; background-repeat: no-repeat; background-size: 800% var(--sprite-sheet-height, 900%); background-position: 0% var(--sprite-row-y, 62.5%); filter: drop-shadow(0 16px 14px rgba(24,33,47,.14)); animation: sprite-row-six 1200ms steps(1) infinite; }
@keyframes sprite-row-six {
  0% { background-position: 0% var(--sprite-row-y, 62.5%); }
  12.5% { background-position: 14.2857% var(--sprite-row-y, 62.5%); }
  25% { background-position: 28.5714% var(--sprite-row-y, 62.5%); }
  37.5% { background-position: 42.8571% var(--sprite-row-y, 62.5%); }
  50% { background-position: 57.1429% var(--sprite-row-y, 62.5%); }
  62.5% { background-position: 71.4286% var(--sprite-row-y, 62.5%); }
  75% { background-position: 85.7143% var(--sprite-row-y, 62.5%); }
  87.5%, 100% { background-position: 100% var(--sprite-row-y, 62.5%); }
}
.confirm-row { display: none; align-items: start; gap: 10px; margin: 14px 0; color: #344054; font-weight: 850; }
.confirm-row.visible { display: flex; }
.confirm-row input { width: auto; min-height: auto; margin: 4px 0 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: #475467; font-size: .84rem; }
.thumb { width: 58px; height: 58px; object-fit: contain; border-radius: 8px; background: #f4f1ea; border: 1px solid var(--line); }
.status { display: inline-flex; border-radius: 999px; padding: 4px 9px; font-size: .78rem; font-weight: 950; background: #eef9f7; color: var(--teal); }
.status.pending { background: #fff8e6; color: #7a5200; }
.status.rejected, .status.hidden { background: #f2f4f7; color: #475467; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.upload-status { min-height: 22px; margin-top: 10px; color: var(--teal-dark); font-weight: 850; }
.upload-status.error { color: var(--danger); }
code { font-family: "SFMono-Regular", Consolas, monospace; color: #25313f; word-break: break-all; }
@media (max-width: 900px) {
  .grid, .hero { grid-template-columns: 1fr; }
  .preview-card { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid var(--line); padding: 12px 0; }
  td { border: 0; padding: 6px 0; }
}
@media (max-width: 680px) {
  .shell { width: calc(100% - 28px); }
  main { padding-top: 34px; }
}
