/* Self-hosted brand fonts (SIL OFL 1.1) */
@font-face { font-family: 'Bebas Neue'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/bebas-neue-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Rubik'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/rubik-latin-var.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Titan One'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/titan-one-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Seoul Stop brand: orange #FF5C36, yellow #F9DA06, ink #231F20. Bold ink borders + hard offset shadows. */
:root {
  --orange: #FF5C36; --yellow: #F9DA06; --ink: #231F20; --cream: #FFF8E1; --white: #fff;
  --ok: #1E9E5A; --muted: #6B6466;
  --shadow: 5px 5px 0 var(--ink); --shadow-lg: 8px 8px 0 var(--ink);
  --r: 14px;
  --display: "Titan One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --head: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --body: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; font-family: var(--body); color: var(--ink); background: var(--orange);
  background-image: radial-gradient(rgba(35,31,32,.12) 1.2px, transparent 1.3px); background-size: 14px 14px;
  -webkit-font-smoothing: antialiased;
}
body.staff { background-color: var(--ink); background-image: none; }
body.admin { background: var(--cream); }
.wrap { max-width: 480px; margin: 0 auto; padding: 18px 16px 40px; }
.wide { max-width: 1100px; }
[hidden] { display: none !important; }

.brandbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.wordmark { font-family: var(--display); font-size: 22px; letter-spacing: .5px; color: var(--ink); background: var(--yellow);
  border: 3px solid var(--ink); border-radius: 10px; padding: 4px 10px 2px; box-shadow: 3px 3px 0 var(--ink); text-decoration: none; }
.pill { font-family: var(--head); font-size: 18px; letter-spacing: 1px; background: var(--ink); color: var(--yellow); border-radius: 999px; padding: 4px 12px 2px; }

.hero { text-align: center; margin: 10px 0 18px; }
.hero .kicker { font-family: var(--head); font-size: 30px; letter-spacing: 3px; color: var(--yellow); text-shadow: 2px 2px 0 var(--ink); }
.hero h1 { font-family: var(--display); font-size: clamp(54px, 17vw, 84px); line-height: .9; margin: 2px 0 10px; color: var(--white);
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 5px 5px 0 var(--ink); }
.hero p { font-size: 17px; line-height: 1.4; margin: 0 auto; max-width: 360px; font-weight: 500; }

.card { background: var(--yellow); border: 3px solid var(--ink); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 18px; margin: 16px 0; }
.card.white { background: var(--white); }
.card.cream { background: var(--cream); }
.card h2 { font-family: var(--head); font-size: 34px; letter-spacing: 1px; line-height: 1; margin: 0 0 8px; }
.card p { margin: 6px 0; line-height: 1.45; }
.big-emoji { font-size: 56px; line-height: 1; text-align: center; margin: 4px 0 6px; }
.small { font-size: 13px; color: var(--muted); }
.center { text-align: center; }

.btn { display: block; width: 100%; font-family: var(--head); font-size: 28px; letter-spacing: 1.5px; line-height: 1; padding: 16px 14px 12px;
  border: 3px solid var(--ink); border-radius: 12px; background: var(--ink); color: var(--yellow); box-shadow: var(--shadow);
  cursor: pointer; text-align: center; text-decoration: none; transition: transform .06s, box-shadow .06s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn.orange { background: var(--orange); color: var(--white); }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.white { background: var(--white); color: var(--ink); }
.btn.ok { background: var(--ok); color: var(--white); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn + .btn { margin-top: 12px; }
.linkbtn { text-align: center; background: none; border: 0; font: inherit; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 10px; display: block; margin: 8px auto 0; }

label { display: block; font-weight: 700; margin: 12px 0 6px; }
input[type=text], input[type=password], input[type=tel], select {
  width: 100%; font: 600 20px var(--body); padding: 12px 14px; border: 3px solid var(--ink); border-radius: 10px; background: var(--white); color: var(--ink); }
input:focus, select:focus { outline: 3px solid var(--orange); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 600; margin: 14px 0; }
.check input { width: 26px; height: 26px; accent-color: var(--ink); }

/* Scanner */
.scanner { position: relative; border: 3px solid var(--ink); border-radius: var(--r); overflow: hidden; background: #000; aspect-ratio: 3/4; box-shadow: var(--shadow-lg); }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .frame { position: absolute; inset: 30% 8%; border: 4px solid var(--yellow); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.scanner .frame.qr { inset: 18% 14%; }
.scanner .laser { position: absolute; left: 10%; right: 10%; top: 50%; height: 3px; background: var(--orange); animation: laser 1.6s ease-in-out infinite; }
@keyframes laser { 0%,100% { transform: translateY(-38px); } 50% { transform: translateY(38px); } }
.scanner .hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: var(--white); font-weight: 600; text-shadow: 0 1px 3px #000; }

/* Ticket */
.ticket { background: var(--white); border: 3px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; margin: 16px 0; }
.ticket .top { background: var(--yellow); border-bottom: 3px dashed var(--ink); padding: 16px 16px 12px; text-align: center; }
.ticket .top .lbl { font-family: var(--head); font-size: 20px; letter-spacing: 2px; }
.ticket .prize { font-family: var(--display); font-size: 30px; line-height: 1.05; margin: 6px 0 2px; }
.ticket .emoji { font-size: 50px; }
.ticket .qr { padding: 16px; display: flex; justify-content: center; }
.ticket .qr canvas { width: 220px; height: 220px; image-rendering: pixelated; border: 3px solid var(--ink); border-radius: 8px; padding: 8px; background: #fff; }
.ticket .meta { padding: 0 16px 16px; font-size: 15px; line-height: 1.5; }
.ticket .meta b { font-weight: 700; }
.ticket .id { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--muted); text-align: center; padding-bottom: 12px; }
.ticket.used .qr, .ticket.expired .qr { opacity: .25; }
.stamp { display: inline-block; font-family: var(--head); font-size: 22px; letter-spacing: 2px; border: 3px solid var(--ink); border-radius: 8px; padding: 4px 10px 1px; transform: rotate(-4deg); background: var(--white); }
.notice { background: var(--ink); color: var(--yellow); border-radius: 10px; padding: 10px 12px; font-weight: 600; margin: 10px 0; }
.mytickets a { display: flex; align-items: center; gap: 12px; padding: 10px; border: 3px solid var(--ink); border-radius: 12px; background: var(--white); color: var(--ink); text-decoration: none; margin-top: 10px; box-shadow: 3px 3px 0 var(--ink); }
.mytickets a .e { font-size: 30px; }
.mytickets a b { display: block; }

.spinner { width: 46px; height: 46px; border: 5px solid var(--ink); border-top-color: var(--yellow); border-radius: 50%; animation: rot .8s linear infinite; margin: 14px auto; }
@keyframes rot { to { transform: rotate(360deg); } }
.code-big { font-family: var(--head); font-size: 64px; letter-spacing: 4px; text-align: center; background: var(--white); border: 3px solid var(--ink); border-radius: 12px; margin: 10px 0; padding: 8px 0 2px; user-select: all; }
.steps { padding-left: 22px; margin: 8px 0; line-height: 1.5; }
.footer { text-align: center; font-size: 12px; margin-top: 26px; color: var(--ink); opacity: .8; }

/* Staff */
.status { border: 4px solid var(--ink); border-radius: 18px; padding: 20px 16px; text-align: center; margin: 16px 0; box-shadow: 6px 6px 0 rgba(0,0,0,.4); }
.status .word { font-family: var(--head); font-size: 64px; line-height: 1; letter-spacing: 2px; }
.status .sub { font-weight: 700; font-size: 20px; margin-top: 6px; }
.status.valid { background: var(--ok); color: #fff; }
.status.redeemed, .status.expired, .status.not_yet_valid { background: #CFC9C2; color: var(--ink); }
.status.wrong_store { background: var(--yellow); color: var(--ink); }
.status.forged, .status.unreadable { background: var(--orange); color: #fff; }
.status.done { background: var(--white); color: var(--ink); }
.warn { background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; padding: 12px; font-weight: 700; margin: 10px 0; }
.staff .card h2, .staff label { color: var(--ink); }
.staff .top-note { color: var(--yellow); font-weight: 600; }

/* Admin */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 2px solid rgba(35,31,32,.15); font-variant-numeric: tabular-nums; }
th { font-family: var(--head); font-size: 17px; letter-spacing: 1px; font-weight: normal; }
td.num, th.num { text-align: right; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 14px; }
.kpi { background: var(--white); border: 3px solid var(--ink); border-radius: 12px; padding: 10px; }
.kpi .v { font-family: var(--head); font-size: 38px; line-height: 1; }
.kpi .k { font-size: 12px; font-weight: 600; color: var(--muted); }
.seg { display: inline-flex; border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; box-shadow: 3px 3px 0 var(--ink); }
.seg button { font-family: var(--head); font-size: 22px; letter-spacing: 1px; padding: 10px 16px 6px; border: 0; background: var(--white); color: var(--ink); cursor: pointer; }
.seg button + button { border-left: 3px solid var(--ink); }
.seg button.on { background: var(--ink); color: var(--yellow); }
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.tag { display: inline-block; font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 2px solid var(--ink); }
.tag.bad { background: var(--orange); color: #fff; }
.tag.good { background: var(--ok); color: #fff; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--yellow); padding: 12px 18px; border-radius: 12px; font-weight: 700; z-index: 60; }

/* ⓘ help button + receipt guide dialog */
.info { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: 6px; vertical-align: 2px;
  border-radius: 50%; border: 2px solid var(--ink); background: var(--white); color: var(--ink); font: italic 700 15px/1 Georgia, serif;
  cursor: pointer; padding: 0; box-shadow: 2px 2px 0 var(--ink); }
.info:active { transform: translate(2px, 2px); box-shadow: none; }
dialog#help { width: min(460px, calc(100vw - 24px)); max-height: calc(100svh - 24px); overflow: auto; padding: 16px; border: 3px solid var(--ink);
  border-radius: var(--r); background: var(--yellow); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog#help::backdrop { background: rgba(35, 31, 32, .6); }
dialog#help h2 { font-family: var(--head); font-size: 32px; letter-spacing: 1px; margin: 0 0 10px; }
dialog#help img { width: 100%; height: auto; display: block; border: 3px solid var(--ink); border-radius: 10px; background: #fff; }
dialog#help .steps { font-size: 15px; }

/* Gift reveal stage */
.stage { background: var(--ink); border-radius: 22px; padding: 10px; box-shadow: var(--shadow-lg); border: 3px solid var(--ink); position: relative; }
.stage canvas { width: 100%; aspect-ratio: 256 / 192; image-rendering: pixelated; display: block; border-radius: 12px; background: #C6CED4; }
.stage .skip { position: absolute; right: 18px; bottom: 18px; font: 700 13px var(--body); background: rgba(255,255,255,.92); border: 2px solid var(--ink); border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.result { text-align: center; min-height: 10px; margin: 6px 0; }
.result .got { font-family: var(--display); font-size: 36px; color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.result .name { font-family: var(--head); font-size: 30px; letter-spacing: 1px; }
.fun { margin: 8px 0 0; }
#tickets .btn.white { margin-top: -6px; margin-bottom: 18px; }
details summary { cursor: pointer; }
.fun { color: var(--ink); opacity: .8; }
.footer a, .card a:not(.btn) { color: var(--ink); font-weight: 700; }

/* Free-entry label printing (admin): only the labels print, one per page, sized by the injected @page rule. */
#labels { display: none; }
button.mini { font: inherit; font-size: 12px; font-weight: 700; padding: 4px 8px; border: 2px solid #231F20; border-radius: 8px; background: #fff; cursor: pointer; }
@media print {
  body.printing-labels > main { display: none !important; }
  body.printing-labels { background: #fff !important; }
  #labels { display: block; }
  #labels .label { box-sizing: border-box; display: flex; align-items: center; gap: 0.05in; padding: 0.04in 0.05in; page-break-after: always; break-after: page; overflow: hidden; color: #000; font-family: Arial, Helvetica, sans-serif; }
  #labels .label:last-child { page-break-after: auto; break-after: auto; } /* no blank label at the end */
  #labels .label svg { height: 0.86in; width: 0.86in; flex: none; }
  #labels .label div { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; overflow: hidden; white-space: nowrap; }
  #labels .label b { font-size: 11pt; line-height: 1; }
  #labels .label code { font-family: "Courier New", monospace; font-weight: 700; font-size: 8.5pt; }
  #labels .label span { font-size: 5.8pt; }
  #labels .label span:last-child { font-size: 5pt; }
}
