/* oh!shoot Lucky Shot — brand design system v1.0
   Uncommon Red #B02821 · Black #232323 · White · Navy #1A1F54 (restrained)
   Font: Pretendard only. No gradients, no letter-spacing tricks, no shadows on type. */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

:root {
  --red: #B02821;
  --black: #232323;
  --white: #ffffff;
  --navy: #1A1F54;
  --steel: #8E9196;
  --line: #e5e2dd;
  --font: 'Pretendard', -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#app {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 32px;
}

.screen { display: flex; flex-direction: column; flex: 1; animation: fadeIn .4s ease; }
.hidden { display: none !important; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* ── brand bits ─────────────────────────────────────── */
.brand-logo { height: 30px; width: auto; align-self: flex-start; }
.store-name {
  color: var(--steel);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 10px;
}

.marquee {
  font-weight: 800;
  font-size: clamp(34px, 9vw, 44px);
  line-height: 1.1;
  text-transform: uppercase;
  margin: 28px 0 12px;
  color: var(--black);
}
.marquee em { font-style: normal; color: var(--red); }

.sub { color: var(--black); opacity: .72; font-size: 15px; line-height: 1.55; }

.btn {
  font-family: var(--font);
  font-weight: 800;
  font-size: 18px;
  text-transform: uppercase;
  color: var(--white);
  background: var(--red);
  border: none;
  border-radius: 14px;
  padding: 18px 24px;
  width: 100%;
  cursor: pointer;
  transition: transform .1s ease, opacity .15s ease;
}
.btn:active { transform: scale(.97); }
.btn.secondary {
  background: var(--white);
  border: 2px solid var(--black);
  color: var(--black);
  font-weight: 700;
  font-size: 15px;
  text-transform: none;
}

.spacer { flex: 1; }

.store-list { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.store-list .btn { text-align: center; }

/* ── coupon / result — Red background + White contents (1st priority combo) */
.bridge {
  font-weight: 800;
  font-size: clamp(19px, 5.4vw, 23px);
  line-height: 1.25;
  text-transform: uppercase;
  color: var(--black);
  margin: 20px 0 14px;
}
.coupon-card {
  text-align: center;
  background: var(--red);
  color: var(--white);
  border-radius: 16px;
  padding: 24px 24px 22px;
}
.coupon-card .card-logo { height: 20px; margin-top: 18px; opacity: .9; }
/* under 5 minutes: the card itself pulses red */
.coupon-card.critical { outline: 3px solid var(--red); outline-offset: 3px; animation: cardPulse 1s infinite; }
@keyframes cardPulse { 50% { outline-color: rgba(176, 40, 33, .12); } }
.tier-label {
  font-weight: 800;
  font-size: clamp(34px, 10vw, 46px);
  color: var(--white);
  text-transform: uppercase;
  line-height: 1.05;
}
.tier-detail { color: var(--white); opacity: .85; font-size: 14px; margin-top: 8px; }

.code-box {
  margin: 22px auto 6px;
  font-weight: 800;
  font-size: clamp(38px, 11vw, 50px);
  letter-spacing: 6px; /* functional: hand-typed at the kiosk */
  color: var(--black);
  background: var(--white);
  border-radius: 10px;
  padding: 14px 10px 14px 16px;
  user-select: all;
}
.code-hint { font-size: 12px; font-weight: 600; color: var(--white); opacity: .8; text-transform: uppercase; }

/* countdown = hero of the card: big, ticking from the first frame */
.countdown {
  margin: 0 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .25);
  color: var(--white);
}
.countdown b {
  display: block;
  font-weight: 800;
  font-size: 44px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.count-sub { display: block; font-size: 13px; opacity: .85; margin-top: 4px; }
.countdown.urgent b { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* the ONE primary action */
.cta-kiosk { margin-top: 14px; font-size: 16px; }
.cta-kiosk:disabled { opacity: .4; cursor: default; }

/* 3-step strip: walk over → type → shoot */
.steps { display: flex; gap: 8px; margin-top: 12px; }
.step {
  flex: 1;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--black);
  overflow-wrap: anywhere;
}
.step b { display: block; color: var(--red); font-size: 14px; font-weight: 800; margin-bottom: 2px; }

/* KIOSK MODE: fullscreen code — hold the phone up and type it in */
.kiosk-mode {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}
.kiosk-mode[hidden] { display: none; }
.km-tier { font-weight: 800; font-size: 20px; text-transform: uppercase; color: var(--red); }
.km-code {
  font-weight: 800;
  font-size: 72px;
  line-height: 1.1;
  letter-spacing: 8px; /* functional: hand-typed at the kiosk */
  color: var(--black);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.km-hint { font-size: 15px; color: var(--black); opacity: .7; }
.km-count { font-size: 16px; color: var(--black); }
.km-count b { font-weight: 800; font-variant-numeric: tabular-nums; }
.km-back { width: auto; padding: 12px 22px; margin-top: 10px; }
.repeat-note { margin: 14px 0 0; font-size: 13px; font-weight: 700; color: var(--white); }
.expired-note { margin: 14px 0 0; font-size: 13px; font-weight: 700; color: var(--white); text-decoration: underline; }
.is-expired .code-box { opacity: .4; text-decoration: line-through; }

/* ── bonus layer ────────────────────────────────────── */
.bonus {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.bonus h3 { font-size: 13px; font-weight: 800; text-transform: uppercase; color: var(--red); margin-bottom: 12px; }
.bonus-row { display: flex; gap: 10px; }
.bonus-row .btn { font-size: 14px; padding: 13px; }
.muted { color: var(--steel); font-size: 12px; }

/* ── game stage ─────────────────────────────────────── */
#stage { flex: 1; display: flex; flex-direction: column; min-height: 60dvh; }
#stage canvas {
  width: 100%;
  border-radius: 12px;
  display: block;
  touch-action: none;
  border: 1px solid var(--line);
}
.stage-canvas-wrap { position: relative; }
.sfx-toggle {
  position: absolute;
  bottom: 10px;
  left: 10px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .85);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sfx-toggle:active { transform: scale(.94); }
.stage-title {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 18px;
  margin-bottom: 10px;
  text-align: center;
  color: var(--black);
}
.stage-hint { text-align: center; font-size: 13px; color: var(--steel); margin-top: 10px; }

/* scratch */
.scratch-wrap { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; }
.scratch-under {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  background: var(--red); border-radius: 12px;
}
.scratch-wrap canvas { position: relative; z-index: 2; }

/* ── kiosk & admin ──────────────────────────────────── */
.kiosk-input {
  width: 100%; font-family: var(--font); font-weight: 800; font-size: 36px; letter-spacing: 8px;
  text-align: center; text-transform: uppercase; color: var(--black);
  background: var(--white); border: 2px solid var(--black); border-radius: 12px;
  padding: 16px 6px 16px 14px; outline: none; margin: 18px 0;
}
.kiosk-input:focus { border-color: var(--red); }
.verdict { text-align: center; padding: 22px; border-radius: 12px; margin-top: 18px; font-size: 17px; }
.verdict.ok { background: var(--red); color: var(--white); }
.verdict.ok .tier-detail, .verdict.ok p { color: var(--white); }
.verdict.bad { background: var(--white); border: 2px solid var(--red); color: var(--black); }
.verdict .tier-label { font-size: 30px; }

table.stats { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
table.stats th, table.stats td { padding: 8px 6px; text-align: right; border-bottom: 1px solid var(--line); }
table.stats th:first-child, table.stats td:first-child { text-align: left; }
table.stats th { color: var(--steel); text-transform: uppercase; font-size: 11px; font-weight: 700; }
.admin-section { margin: 26px 0; }
.admin-section h2 { font-weight: 800; font-size: 17px; text-transform: uppercase; margin-bottom: 10px; }
.admin-row { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; align-items: center; }
.admin-row input, .admin-row select {
  font-family: var(--font); font-size: 14px; color: var(--black);
  background: var(--white); border: 1px solid var(--black); border-radius: 8px; padding: 9px 10px;
}
.admin-row .btn { width: auto; font-size: 13px; padding: 10px 16px; }
