/* Eggcorn Secret Santa. Staff pages are "Wrapped": orange ground, black type.
   Admin is the same brand on cream so a 45 row table stays readable. */
:root {
  --orange: #FB5E00; --black: #010002; --cream: #FFF2E2; --peach: #FCD09C; --berry: #B50036;
  --bg: #FB5E00; --fg: #010002; --muted: #2E1200; --accent: #010002; --surface: #FFF2E2;
  --line: rgba(1, 0, 2, .3); --radius: 18px;
  --display: "DM Serif Display", "Plus Jakarta Sans", Georgia, serif;
  --body: "General Sans", "Plus Jakarta Sans", Arial, Helvetica, sans-serif;
}
.admin-page {
  --bg: #FFF2E2; --muted: #5A463A; --accent: #B50036; --surface: #FFFFFF; --line: rgba(1, 0, 2, .16); --radius: 10px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-weight: 300; font-size: 16px; line-height: 1.55; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-right, 0px)) 64px max(16px, env(safe-area-inset-left, 0px)); }
h1, h2 { font-family: var(--display); font-weight: 400; line-height: 1; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(40px, 7vw, 68px); overflow-wrap: anywhere; }
h1.long { font-size: clamp(32px, 5vw, 54px); }
h2 { font-size: 28px; }
h3 { font-weight: 600; font-size: 18px; line-height: 1.2; margin: 0; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.top img { height: 26px; width: auto; display: block; }

.btn { background: var(--black); color: #FFFFFF; border: 0; border-radius: var(--radius); padding: 14px 24px; font-weight: 600; font-size: 16px; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--fg); padding: 9px 14px; font-size: 14px; font-weight: 500; }
.field { background: var(--surface); color: var(--black); border: 1px solid var(--fg); border-radius: var(--radius); padding: 13px 16px; min-width: 0; width: 100%; }
.err { font-weight: 600; text-decoration: underline; }
.admin-page .err { color: var(--berry); text-decoration: none; }

/* staff */
.staff { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px 56px; align-items: start; padding-top: 32px; }
.staff > * { min-width: 0; }
.lede { font-size: 18px; max-width: 34em; margin-top: 18px; }
.codeform { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.codeform .field { flex: 1 1 180px; width: auto; font-weight: 600; font-size: 20px; letter-spacing: .14em; text-transform: uppercase; }
.codeform .field::placeholder { letter-spacing: .04em; text-transform: none; font-weight: 300; font-size: 16px; color: #5A463A; }
.factform { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; max-width: 30em; }
.factform label { font-weight: 500; font-size: 14px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); }
.facts b { font-weight: 600; display: block; }
.note { margin-top: 22px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); max-width: 32em; }
.note b { font-weight: 600; }
.stagecol { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.guess { width: min(480px, 100%); display: flex; flex-direction: column; gap: 14px; }
.gopt { text-align: left; background: var(--surface); color: var(--black); border: 1px solid var(--fg); border-radius: var(--radius); padding: 18px 20px; font-size: 18px; font-weight: 500; cursor: pointer; line-height: 1.3; }
.gopt:hover { background: var(--black); color: #FFFFFF; }
.gift { position: relative; width: min(340px, 100%); aspect-ratio: 1 / 1; border-radius: 18px; overflow: hidden; background: #FFF2E2; color: #010002; display: flex; flex-direction: column; justify-content: center; padding: 26px; border: 2px solid #010002; }
.gift .who { font-family: var(--display); font-size: clamp(26px, 7vw, 34px); line-height: 1; margin-top: 8px; color: #B50036; overflow-wrap: anywhere; min-height: 1em; }
.gift .lab { font-weight: 500; font-size: 14px; }
.gift canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; transition: opacity .6s; }
.gift.open canvas { opacity: 0; pointer-events: none; }
.preview { border: 1px dashed var(--line); border-radius: var(--radius); padding: 24px; max-width: 26em; }

/* admin */
.login { max-width: 24em; padding-top: 48px; display: flex; flex-direction: column; gap: 14px; }
.admin { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 36px 48px; padding-top: 28px; align-items: start; }
.admin > * { min-width: 0; }
.col { display: flex; flex-direction: column; gap: 36px; }
.block { display: flex; flex-direction: column; gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 300px; overflow: auto; padding: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.chip button { border: 0; background: transparent; cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 50%; margin-right: -8px; }
.rowf { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rowf .field { flex: 1 1 150px; width: auto; padding: 10px 12px; }
.pairs { list-style: none; margin: 0; padding: 0; }
.pairs li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bar { height: 10px; border: 1px solid var(--fg); border-radius: 999px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.drawbox { border: 1px solid var(--fg); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.tablebox { overflow: auto; max-height: 560px; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; position: sticky; top: 0; background: var(--bg); }
td.code { font-weight: 600; letter-spacing: .1em; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 500; border: 1px solid var(--line); }
.pill.done { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--black); color: #FFFFFF; padding: 10px 18px; border-radius: 999px; font-weight: 500; font-size: 14px; z-index: 20; }

@media (max-width: 820px) {
  .admin { grid-template-columns: minmax(0, 1fr); }
  /* On a phone the game sits right under the headline, details go last. */
  .staff { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .staff > div:first-child { display: contents; }
  .staff .stagecol { order: 1; margin-top: 26px; }
  .staff .facts, .staff .outrow { order: 2; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01s !important; }
}
