/* PAYDAY — Morrow's HR: a near-photoreal white office, a glossy printer, warm paper, red seals. Calm, expensive, polite. */
:root {
  --night: #0e1116; --ink: #16181d; --paper: #f6f2e8; --dim: #8b93a3; --gold: #c9a227; --gold-hi: #e3c264; --red: #c8262b;
  --ok: #1f9d63; --line: rgba(255,255,255,.12);
  --sys: -apple-system, "Helvetica Neue", "Hiragino Sans", "Noto Sans JP", "Noto Sans Thai", "Apple SD Gothic Neo", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--night); color: #eef0f4; font: 500 15px/1.45 var(--sys); overflow-x: hidden; }
html:lang(ko) { word-break: keep-all; overflow-wrap: anywhere; }
html:lang(ja) { line-break: strict; }
button { font: inherit; color: inherit; touch-action: manipulation; }
.mute { position: fixed; z-index: 40; top: calc(10px + var(--safe-t)); right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(14,17,22,.7); color: #eef0f4; display: grid; place-items: center; padding: 0; }
.mute svg { width: 20px; height: 20px; }
.office { position: fixed; inset: 0; z-index: 0; }
.office img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; filter: brightness(.55) saturate(.9); }
.office::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,17,22,.15) 0%, rgba(14,17,22,.75) 55%, rgba(14,17,22,.96) 100%); }
.screen { position: relative; z-index: 2; min-height: 100vh; min-height: 100dvh; max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; padding: calc(18px + var(--safe-t)) 16px calc(22px + var(--safe-b)); }
.kicker { margin: 0; padding-right: 44px; font: 800 10.5px var(--mono); letter-spacing: .16em; color: #c9ced6; text-transform: uppercase; }
.fine { margin: 0; font-size: 12px; color: var(--dim); }
.go { min-height: 56px; border: 0; border-radius: 14px; background: linear-gradient(180deg, #f3f0e6, #d9d2bf); color: var(--ink); font: 800 18px var(--sys); cursor: pointer; box-shadow: 0 10px 26px rgba(0,0,0,.35), inset 0 -2px 0 rgba(0,0,0,.08); }
.go:disabled { opacity: .45; cursor: default; }
.go:active:not(:disabled) { transform: scale(.98); }
.ghost { display: grid; place-items: center; min-height: 48px; border-radius: 14px; border: 1.5px solid rgba(255,255,255,.25); background: rgba(14,17,22,.4); color: #eef0f4; font-weight: 700; text-decoration: none; text-align: center; padding: 0 12px; cursor: pointer; }

/* 1 · hook */
.hook { justify-content: flex-end; }
.hook h1 { margin: 0; font: 900 clamp(48px, 15vw, 72px)/.95 var(--sys); letter-spacing: -.02em; color: #fff; }
:lang(ja) .hook h1, :lang(ko) .hook h1, :lang(th) .hook h1 { letter-spacing: 0; font-size: clamp(40px, 12vw, 60px); }
.line { margin: 0; font: 800 clamp(20px, 6vw, 26px)/1.25 var(--sys); text-wrap: balance; }
.hook-printer { position: relative; width: 78%; margin: 4px auto -6px; }
.hook-printer img { width: 100%; display: block; filter: drop-shadow(0 18px 30px rgba(0,0,0,.6)); }
.hook-printer .peek { position: absolute; left: 14%; right: 14%; top: 60%; height: 22%; background: linear-gradient(180deg, #fbf8f0, #ece5d3); border-radius: 2px 2px 6px 6px; box-shadow: 0 6px 14px rgba(0,0,0,.35); animation: peek 2.4s ease-in-out infinite; z-index: -1; }
@keyframes peek { 50% { transform: translateY(10%); } }
.how { margin: 0; color: #c9ced6; }
.friend, .pending { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(201,162,39,.15); border: 1px solid rgba(201,162,39,.55); font-weight: 700; }
.pending { background: rgba(200,38,43,.16); border-color: rgba(200,38,43,.6); }

/* 2 · form */
.form { background: rgba(14,17,22,.82); max-width: none; }
.form > * { width: 100%; max-width: 448px; margin-left: auto; margin-right: auto; }
.form h3 { margin: 8px 0 0; font: 800 15px/1.3 var(--sys); }
.sliders { display: grid; gap: 14px; }
.sl { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.sl label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 700; }
.sl label b { font: 900 24px var(--sys); color: #fff; font-variant-numeric: tabular-nums; }
.sl input[type=range] { width: 100%; accent-color: var(--gold); height: 28px; }
.sl p { margin: 0; min-height: 2.6em; font: italic 600 12.5px/1.3 var(--sys); color: #d8c48a; }
.hint { text-align: center; }
.more { border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.more summary { cursor: pointer; padding: 12px 14px; font-weight: 700; color: #c9ced6; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: '+'; display: inline-block; width: 1.3em; font-weight: 900; color: var(--gold-hi); }
.more[open] summary::before { content: '\2212'; }
.more .sliders { padding: 0 10px 12px; }
.depts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dept, .chip { display: grid; justify-items: center; align-content: start; gap: 3px; padding: 8px 4px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(255,255,255,.04); cursor: pointer; text-align: center; }
.dept img { width: 56px; height: 56px; object-fit: contain; }
.dept b { font: 800 10.5px/1.15 var(--sys); }
.dept small { font: 600 9.5px/1.1 var(--sys); color: var(--dim); }
.dept.on, .chip.on { border-color: var(--gold-hi); background: rgba(201,162,39,.18); box-shadow: 0 0 0 2px rgba(227,194,100,.25); }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chip img { width: 46px; height: 46px; object-fit: contain; }
.chip b { font: 800 10.5px/1.15 var(--sys); }

/* 3 · printing */
.printing { justify-content: center; align-items: center; overflow: hidden; }
.status { margin: 0; font: 800 12px var(--mono); letter-spacing: .14em; color: #c9ced6; text-transform: uppercase; animation: blinkS 1s steps(2) infinite; }
@keyframes blinkS { 50% { opacity: .35; } }
.machine { position: relative; width: min(92vw, 420px); }
.machine .printer { position: relative; z-index: 2; width: 100%; display: block; filter: drop-shadow(0 24px 40px rgba(0,0,0,.65)); }
/* the paper comes out of the slot: the tray is clipped at the slot's top edge (slot measured from art: y 56.6% of the printer) */
.tray { position: absolute; z-index: 3; left: 12%; width: 76%; top: 59%; height: 0; overflow: visible; }
.tray canvas { position: absolute; left: 0; top: 0; width: 100%; height: auto; transform: translateY(-100%); clip-path: inset(100% 0 0 0); box-shadow: 0 14px 30px rgba(0,0,0,.45); }
.tray.out canvas { animation: printOut 2.6s steps(26, end) forwards; }
@keyframes printOut { to { transform: translateY(0); clip-path: inset(0 0 0 0); } }
.seals { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 1024 / 1536; pointer-events: none; }
.seal { position: absolute; width: 19%; aspect-ratio: 1; animation: slam .3s cubic-bezier(.5,0,.7,.4) both; }
@keyframes slam { from { transform: scale(2.6) rotate(-22deg); opacity: 0; } 70% { transform: scale(.95) rotate(var(--r)); opacity: 1; } to { transform: scale(1) rotate(var(--r)); opacity: 1; } }

/* 4 · letter */
.letter { background: rgba(14,17,22,.9); max-width: none; }
.letter > * { width: 100%; max-width: 448px; margin-left: auto; margin-right: auto; }
.lt-art canvas { width: 100%; height: auto; display: block; border-radius: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.5); }
.letter h2 { margin: 6px 0 0; font: 900 clamp(28px, 9vw, 40px)/1.05 var(--sys); color: var(--red); text-wrap: balance; transform: rotate(-2deg); animation: slamT .35s cubic-bezier(.5,0,.7,.4) both .3s; }
.letter.good h2 { color: var(--gold-hi); }
@keyframes slamT { from { transform: scale(2) rotate(-8deg); opacity: 0; } }
.lt-body { margin: 0; font: 700 17px/1.4 var(--sys); }
.lt-vs { margin: 0; font: 700 13px var(--mono); color: var(--dim); }
.exit { display: grid; gap: 8px; padding: 12px; border-radius: 14px; border: 1.5px dashed rgba(200,38,43,.65); background: rgba(200,38,43,.08); }
.exit .kicker { padding-right: 0; color: #ffb3b3; }
.exits { display: grid; gap: 8px; }
.exits button { min-height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(255,255,255,.05); font-weight: 800; text-align: left; padding: 0 14px; cursor: pointer; }
.exits button.on { border-color: var(--red); background: rgba(200,38,43,.28); }
.reason { margin: 0; font: italic 800 18px/1.3 var(--sys); color: #ffb3b3; }

/* 5 · result */
.result { background: rgba(14,17,22,.9); max-width: none; }
.result > * { width: 100%; max-width: 448px; margin-left: auto; margin-right: auto; }
.slip-img { width: 100%; height: auto; display: block; border-radius: 4px; box-shadow: 0 20px 44px rgba(0,0,0,.55); }
.badge-row { display: grid; grid-template-columns: 34% 1fr; gap: 14px; align-items: center; }
.badge-row canvas { width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 22px rgba(0,0,0,.5)); }
.yokai-line { margin: 0; font: 800 17px/1.35 var(--sys); }
.cmp { margin: 0; font-weight: 700; color: var(--gold-hi); }
.cal { width: 100%; min-height: 44px; margin-top: 10px; font-size: 14px; line-height: 1.2; padding: 8px 10px; }
.cal:disabled { cursor: default; border-color: rgba(227,194,100,.6); color: var(--gold-hi); }
.cal-fine { margin-top: 6px; font-size: 11px; }
.actions { display: grid; gap: 8px; }
.door { display: block; padding: 14px; border-radius: 14px; background: #2a1c14; color: #f6e8d6; text-decoration: none; font-weight: 800; text-align: center; }
@media (prefers-reduced-motion: reduce) { .hook-printer .peek, .status, .letter h2, .seal { animation: none; } .tray.out canvas { animation-duration: .01s; } }
