/* 브랜드 컬러: 노랑 · 화이트 · 검정 (의뢰인 요청 — 깔끔하고 시크하게)
   기본 대상: 매장 태블릿 가로 화면. 세로·휴대폰에서도 깨지지 않게 한 줄로 쌓는다. */
:root {
  --yellow: #FFE500;      /* 브랜드 노랑 */
  --yellow-soft: #FFF6A8; /* 내 순위 강조 같은 옅은 노랑 */
  --black: #111111;
  --white: #FFFFFF;
  --ink-2: rgba(17, 17, 17, 0.62);
  --ink-3: rgba(17, 17, 17, 0.42);
  --line: rgba(17, 17, 17, 0.12);
  --alert: #D92D20;       /* 입력 오류 문구에만 사용 */
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--yellow);
  color: var(--black);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
img { -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; }

#app { min-height: 100dvh; }
.screen, .sheet { display: none; }
#app[data-screen="intro"] .intro { display: flex; }
#app:not([data-screen="intro"]) .game { display: flex; }
#app[data-screen="success"] .success,
#app[data-screen="done"] .done { display: flex; }

/* ── 공통 버튼 ───────────────────────────── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 58px; padding: 0 20px;
  border: 0; border-radius: 14px;
  font-size: 18px; font-weight: 700;
  transition: transform .08s ease, opacity .2s ease;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-main { background: var(--black); color: var(--yellow); }
.btn-main:disabled { opacity: 1; background: rgba(17, 17, 17, .14); color: rgba(17, 17, 17, .5); }
.btn-text {
  display: block; margin: 10px auto 0; padding: 10px 14px;
  background: none; border: 0; color: var(--ink-2); font-size: 15px; text-decoration: underline; text-underline-offset: 3px;
}
.btn-chip {
  border: 1.5px solid var(--black); background: var(--white); color: var(--black);
  border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; flex: none;
  background: rgba(17, 17, 17, 0.08) center / 22px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4z'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13'/%3E%3C/svg%3E");
}
.icon-btn.is-muted {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111111' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4z'/%3E%3Cpath d='m22 9-6 6M16 9l6 6'/%3E%3C/svg%3E");
}
.hud .icon-btn {
  background-color: rgba(255, 255, 255, 0.12);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4z'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13'/%3E%3C/svg%3E");
}
.hud .icon-btn.is-muted {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4z'/%3E%3Cpath d='m22 9-6 6M16 9l6 6'/%3E%3C/svg%3E");
}

/* ── 대기 화면 (세로·휴대폰: 한 줄로 쌓기) ─── */
.intro {
  flex-direction: column; align-items: stretch; gap: 0;
  max-width: 480px; margin: 0 auto; min-height: 100dvh;
  padding: calc(14px + var(--safe-t)) 20px calc(28px + var(--safe-b));
}
.intro-main { display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.brand { font-size: 15px; font-weight: 800; letter-spacing: 0; }

.hero { text-align: center; padding: 2px 0 16px; }
.hero-tart { display: block; width: 120px; height: 120px; margin: 4px auto 6px; object-fit: contain; animation: tart-float 4.5s ease-in-out infinite; }
@keyframes tart-float { 50% { transform: translateY(-5px) rotate(-1.5deg); } }
.title {
  font-weight: 800; white-space: pre-line;
  font-size: clamp(34px, 9.4vw, 44px); line-height: 1.2; letter-spacing: -0.045em;
  margin: 4px 0 12px; word-break: keep-all;
}
.desc { margin: 0 auto; max-width: 21em; font-size: 16px; font-weight: 500; color: var(--ink-2); word-break: keep-all; }

.rules {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin: 6px 0 18px; padding: 14px 0;
  border-top: 2px solid var(--black); border-bottom: 2px solid var(--black);
  text-align: center;
}
.rules div + div { border-left: 1px solid rgba(17, 17, 17, .2); }
.rules dt { font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--ink-2); }
.rules dd { margin: 2px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.samples { margin: 0 0 16px; text-align: center; }
.samples img { display: block; width: 200px; max-width: 70%; height: auto; margin: 0 auto; }
.samples figcaption { margin-top: 6px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); word-break: keep-all; }
.btn-start { min-height: 64px; font-size: 20px; }
.btn-start:not(:disabled) { animation: start-pulse 2.4s ease-in-out infinite; } /* 대기 화면에서 손님 눈길 끌기 */
@keyframes start-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(17, 17, 17, .35); } 50% { box-shadow: 0 0 0 10px rgba(17, 17, 17, 0); } }
.prize { margin: 14px 4px 22px; text-align: center; font-size: 14.5px; font-weight: 700; word-break: keep-all; }

/* ── 대기 화면 (가로 태블릿: 왼쪽 안내·시작 / 오른쪽 실시간 랭킹) ─── */
@media (orientation: landscape) and (min-width: 700px) {
  #app[data-screen="intro"] .intro { display: grid; }
  .intro {
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr); gap: clamp(20px, 3.2vw, 44px);
    align-items: center; max-width: 1400px; height: 100dvh; min-height: 0;
    padding: calc(16px + var(--safe-t)) calc(clamp(20px, 3.4vw, 48px) + var(--safe-r)) calc(16px + var(--safe-b)) calc(clamp(20px, 3.4vw, 48px) + var(--safe-l));
  }
  .intro-main { min-height: 0; justify-content: center; }
  .topbar { position: fixed; top: calc(10px + var(--safe-t)); left: calc(clamp(20px, 3.4vw, 48px) + var(--safe-l)); right: calc(clamp(20px, 3.4vw, 48px) + var(--safe-r)); z-index: 2; pointer-events: none; }
  .topbar > * { pointer-events: auto; }
  .hero { display: flex; align-items: center; gap: clamp(14px, 2vw, 26px); text-align: left; padding: 0 0 clamp(10px, 2vh, 20px); }
  .hero-tart { width: clamp(96px, 13vw, 150px); height: auto; aspect-ratio: 1; margin: 0; flex: none; }
  .title { font-size: clamp(36px, 4.6vw, 58px); margin: 0 0 8px; }
  .desc { margin: 0; max-width: none; font-size: clamp(15px, 1.5vw, 18px); }
  .rules { margin: 0 0 clamp(10px, 2vh, 18px); padding: clamp(10px, 1.8vh, 16px) 0; }
  .rules dd { font-size: clamp(20px, 2.2vw, 26px); }
  .samples { display: flex; align-items: center; gap: 14px; text-align: left; margin: 0 0 clamp(10px, 2vh, 18px); }
  .samples img { width: clamp(150px, 16vw, 210px); max-width: none; margin: 0; flex: none; }
  .samples figcaption { margin: 0; }
  .btn-start { min-height: clamp(60px, 9vh, 76px); font-size: clamp(20px, 2.2vw, 24px); }
  .prize { margin: clamp(10px, 1.6vh, 16px) 0 0; text-align: left; }
  .intro-rank { align-self: center; max-height: calc(100dvh - 32px - var(--safe-t) - var(--safe-b)); overflow: auto; }
  .intro-rank .rank-head h2 { font-size: 20px; }
  .intro-rank .rank-list li { padding: clamp(6px, 1.1vh, 10px) 6px; font-size: 16px; }
}

/* ── 카드 (랭킹) ─────────────────────────── */
.rank-panel { background: var(--white); border-radius: 18px; padding: 16px 16px 10px; }
.rank-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rank-head h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.live { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; letter-spacing: .04em; color: var(--black); }
.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--black); animation: live 1.6s ease-in-out infinite; }
@keyframes live { 50% { opacity: .2; } }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li {
  display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px;
  padding: 9px 4px; border-top: 1px solid var(--line); font-size: 15px;
}
.rank-list li:first-child { border-top: 0; }
.rank-list .rk {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.rank-list li:nth-child(1) .rk { background: var(--yellow); color: var(--black); box-shadow: inset 0 0 0 1.5px var(--black); }
.rank-list li:nth-child(2) .rk,
.rank-list li:nth-child(3) .rk { background: var(--black); color: var(--white); }
.rank-list .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .tail { margin-left: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rank-list .tm { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.rank-list li.me { background: var(--yellow-soft); border-radius: 10px; border-top-color: transparent; }
.rank-list li.me + li { border-top-color: transparent; }
.rank-list li.gap { display: block; padding: 2px 0; text-align: center; color: var(--ink-3); border-top: 0; }
.rank-list li.gap + li { border-top: 0; }
.rank-list .empty { display: block; padding: 18px 4px 14px; text-align: center; color: var(--ink-2); font-size: 14px; border: 0; }
.rank-list .tag { margin-left: 6px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--black); font-size: 11px; font-weight: 800; vertical-align: 1px; }
.rank-more { margin: 6px auto 0; font-size: 14px; }

/* ── 게임 화면 (검정 바탕에 그림이 돋보이게) ── */
.game {
  position: relative;
  flex-direction: column; height: 100dvh; max-height: 100dvh; overflow: hidden;
  padding: var(--safe-t) var(--safe-r) 0 var(--safe-l);
  background: var(--black); color: var(--white);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.hud { display: flex; align-items: center; gap: 12px; padding: 10px 14px; flex: none; }
.dial {
  --p: 1;
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: 6px 14px 6px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.1);
}
.dial::before { /* 남은 시간만큼 남는 노란 링 */
  content: ''; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--yellow) calc(var(--p) * 1turn), rgba(255, 255, 255, .16) 0);
  -webkit-mask: radial-gradient(circle, transparent 52%, #000 54%);
          mask: radial-gradient(circle, transparent 52%, #000 54%);
}
.dial-num { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; min-width: 3.4em; }
.dial.hurry { background: var(--yellow); color: var(--black); animation: hurry 1s ease-in-out infinite; }
.dial.hurry::before { background: conic-gradient(var(--black) calc(var(--p) * 1turn), rgba(17, 17, 17, .15) 0); }
@keyframes hurry { 50% { transform: scale(1.04); } }
.dial.hit { animation: hit .45s ease; }
@keyframes hit { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.hud-mid { flex: 1; min-width: 0; display: none; justify-content: center; }
.found { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.found-count { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .8); }
.found-count b { font-size: 21px; color: var(--yellow); }
.found-icons { display: flex; gap: 4px; }
.found-icons i {
  width: 10px; height: 10px; border-radius: 50%; display: block;
  border: 1.5px solid rgba(255, 255, 255, .45);
  transition: background .2s, border-color .2s, transform .25s;
}
.found-icons i.on { background: var(--yellow); border-color: var(--yellow); transform: scale(1.15); }

/* 확대 끔(매장 태블릿): 브라우저 핀치·두 번 탭 확대 막기 */
html.nozoom, html.nozoom body { touch-action: pan-x pan-y; }
.stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none; background: var(--black); }
.board { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.board img {
  display: block; width: 100%; height: 100%;
  pointer-events: none; -webkit-user-drag: none; user-select: none;
  transition: filter .5s ease;
}
.board.veil img { filter: blur(16px) saturate(.6); }
.board.gray img { filter: grayscale(1) brightness(.9); }
.overlay { position: absolute; inset: 0; pointer-events: none; }

.mark { position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; }
.mark-found { /* 흰 링 + 검정 테두리: 노란 그림 위에서도 잘 보임 */
  border-radius: 50%; border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--black), inset 0 0 0 2px var(--black);
  animation: ring-in .38s cubic-bezier(.2, 1.4, .4, 1) both;
}
.mark-found::after {
  content: ''; position: absolute; inset: -40%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .95) 0 16%, rgba(255, 229, 0, .6) 32%, rgba(255, 229, 0, 0) 62%);
  animation: sparkle .5s ease-out both;
}
@keyframes ring-in { from { transform: translate(-50%, -50%) scale(1.9); opacity: 0; } }
@keyframes sparkle { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }
.mark-wrong { animation: wrong-pop .9s ease both; }
.mark-wrong::before, .mark-wrong::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 100%; height: 18%;
  background: var(--black); border-radius: 99px; box-shadow: 0 0 0 2px var(--white);
  transform: translate(-50%, -50%) rotate(45deg);
}
.mark-wrong::after { transform: translate(-50%, -50%) rotate(-45deg); }
@keyframes wrong-pop { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.float-text {
  position: absolute; transform: translate(-50%, -120%); white-space: nowrap; pointer-events: none;
  padding: 2px 9px; border-radius: 999px; background: var(--black); color: var(--yellow);
  font-weight: 800; font-size: 16px;
  animation: float-up .9s ease-out forwards;
}
@keyframes float-up { to { transform: translate(-50%, -260%); opacity: 0; } }

.countdown { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.countdown:empty { display: none; }
.countdown span {
  display: grid; place-items: center; width: 150px; height: 150px; border-radius: 50%;
  background: var(--yellow); color: var(--black); box-shadow: 0 0 0 4px var(--black);
  font-size: 88px; font-weight: 900; line-height: 1; letter-spacing: -0.04em;
  animation: count-pop .7s ease-out both;
}
.countdown .go { font-size: 40px; }
@keyframes count-pop { from { transform: scale(1.6); opacity: 0; } 30% { transform: scale(1); opacity: 1; } to { opacity: .92; } }

.stamp {
  position: absolute; left: 50%; top: 40%; pointer-events: none;
  padding: 10px 26px; border-radius: 14px;
  background: var(--black); color: var(--yellow); box-shadow: 0 0 0 3px var(--yellow);
  font-size: 38px; font-weight: 900; letter-spacing: -0.02em;
  transform: translate(-50%, -50%) rotate(-6deg); opacity: 0; white-space: nowrap;
}
.stamp.win { top: 46%; background: var(--yellow); color: var(--black); box-shadow: 0 0 0 4px var(--black); font-size: 54px; padding: 12px 34px; }
.stamp.on { animation: slam .45s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes slam { from { transform: translate(-50%, -50%) rotate(-6deg) scale(2.4); opacity: 0; } to { transform: translate(-50%, -50%) rotate(-6deg) scale(1); opacity: 1; } }
.game.shake .stage { animation: hit .5s ease; }

/* 실패: 효과 + 탈락 안내 → 잠시 후 자동으로 처음 화면 (의뢰인 요청: 다시 하기 팝업 없음) */
.fail-msg {
  position: absolute; left: 50%; top: 54%; transform: translateX(-50%);
  width: min(86%, 380px); padding: 16px 18px 18px; border-radius: 18px;
  background: var(--white); color: var(--black); text-align: center; overflow: hidden;
  box-shadow: 0 0 0 3px var(--black), 0 14px 34px -12px rgba(0, 0, 0, .6);
  pointer-events: none;
  animation: fail-in .4s .3s ease-out both;
}
.fail-title { display: block; font-size: 18px; font-weight: 800; line-height: 1.38; letter-spacing: -0.03em; word-break: keep-all; }
.fail-sub { display: block; margin-top: 6px; font-size: 14px; color: var(--ink-2); word-break: keep-all; }
.fail-sub b { color: var(--black); font-weight: 800; }
.fail-bar { position: absolute; left: 0; bottom: 0; height: 4px; width: 100%; background: var(--yellow); transform-origin: left; animation: fail-bar linear forwards; }
@keyframes fail-in { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes fail-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

.game-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 48px; padding: 6px 14px calc(6px + var(--safe-b));
}
.hint { font-size: 13.5px; color: rgba(255, 255, 255, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rotate-hint { display: none; font-size: 13px; color: var(--yellow); white-space: nowrap; }
.game .btn-chip { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .6); }
.game:not(.zoomed) .btn-zoom-reset { display: none; }
.game.zoomed .hint, .game.nozoom .hint { display: none; }

/* 가로(태블릿): 안내·되돌리기는 위쪽 막대 가운데로 — 그림을 최대한 크게 */
@media (orientation: landscape) {
  .hud-mid { display: flex; }
  .game-foot { display: none; }
}
/* 세로로 든 휴대폰·태블릿: 가로로 돌리라는 안내 */
@media (orientation: portrait) and (max-width: 1100px) {
  .game:not(.zoomed) .rotate-hint { display: inline; }
  .game:not(.zoomed) .game-foot .hint { display: none; }
}

/* ── 결과 시트 ───────────────────────────── */
.sheet {
  position: fixed; inset: 0; z-index: 10;
  align-items: flex-end; justify-content: center;
  background: rgba(0, 0, 0, .55);
}
.sheet-card {
  width: 100%; max-width: 480px; max-height: 94dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--white); color: var(--black); border-radius: 24px 24px 0 0;
  padding: 26px 22px calc(22px + var(--safe-b));
  text-align: center;
  animation: sheet-up .42s cubic-bezier(.2, .9, .3, 1) both;
}
@keyframes sheet-up { from { transform: translateY(100%); } }
.result-badge {
  display: inline-block; margin: 0 0 8px; padding: 4px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 800;
}
.result-badge.win { background: var(--yellow); color: var(--black); }
.result-title { font-weight: 800; font-size: 24px; line-height: 1.32; margin: 0 0 6px; letter-spacing: -0.035em; word-break: keep-all; }
.record { margin: 4px 0 0; font-size: 60px; font-weight: 900; letter-spacing: -0.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.record small { font-size: 22px; font-weight: 700; margin-left: 4px; letter-spacing: 0; }
.record.small { font-size: 44px; }
.record-note { margin: 4px 0 14px; color: var(--ink-2); font-size: 15px; min-height: 1.5em; }

.winner-note { /* 랭킹 1위 혜택 — 의뢰인 문구 그대로, 짧고 눈에 띄게 */
  display: flex; align-items: flex-start; gap: 10px; text-align: left;
  margin: 0 0 14px; padding: 13px 14px; border-radius: 14px;
  background: var(--yellow); color: var(--black);
  font-size: 15.5px; font-weight: 700; line-height: 1.5; word-break: keep-all;
}
.winner-note b {
  flex: none; margin-top: 1px; padding: 3px 9px; border-radius: 999px;
  background: var(--black); color: var(--yellow); font-size: 12.5px; font-weight: 800; white-space: nowrap;
}
.entry { text-align: left; border-top: 1px solid var(--line); padding-top: 18px; }
.entry-lead { margin: 0 0 14px; font-size: 14.5px; color: var(--ink-2); word-break: keep-all; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.field input {
  width: 100%; height: 54px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid rgba(17, 17, 17, .22); background: var(--white); font-size: 18px;
}
.field input:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 4px rgba(255, 229, 0, .7); }
.consent { margin: 4px 0 12px; font-size: 14px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--black); flex: none; }
.consent details { margin: 6px 0 0 34px; color: var(--ink-2); }
.consent summary { cursor: pointer; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.consent ul { margin: 8px 0 0; padding-left: 16px; font-size: 13px; line-height: 1.6; }
.form-error { min-height: 1.4em; margin: 0 0 10px; color: var(--alert); font-size: 14px; font-weight: 600; }

.done .rank-panel { text-align: left; border: 1px solid var(--line); margin-top: 16px; }
.done .result-col .btn { margin-top: 4px; }
.auto-return { position: relative; margin: 12px 0 0; padding-bottom: 8px; font-size: 14px; color: var(--ink-2); overflow: hidden; }
.auto-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--yellow); transform-origin: left; border-radius: 2px; }

#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 30; display: none; }

@media (min-width: 720px) {
  .sheet { align-items: center; }
  .sheet-card { border-radius: 24px; max-width: 460px; }
}
/* 가로 태블릿: 결과·입력 화면을 두 칸으로 (왼쪽 결과·1위 안내, 오른쪽 입력 또는 랭킹) */
@media (orientation: landscape) and (min-width: 700px) {
  .sheet { align-items: center; padding: calc(12px + var(--safe-t)) 16px calc(12px + var(--safe-b)); }
  .sheet-card.wide {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start;
    max-width: 900px; max-height: calc(100dvh - 24px - var(--safe-t) - var(--safe-b));
    border-radius: 24px; padding: 28px 30px;
  }
  .sheet-card.wide .result-col { text-align: left; }
  .sheet-card.wide .entry { border-top: 0; padding-top: 0; }
  .done .rank-panel { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.start-error { text-align: center; margin: 0 0 8px; min-height: 0; }
.start-error:empty { display: none; }

/* ── 전체 랭킹 시트 ─────────────────────────── */
.rankall { display: none; z-index: 20; }
.rankall:not([hidden]) { display: flex; }
.rankall .sheet-card { text-align: left; }
.rankall .rank-list { margin-bottom: 16px; }

/* ── 새 1위 알림 ─────────────────────────── */
.toast {
  position: fixed; left: 50%; top: calc(14px + var(--safe-t)); z-index: 40;
  transform: translate(-50%, -160%); max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 999px; background: var(--black); color: var(--yellow);
  font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .45);
  transition: transform .45s cubic-bezier(.2, 1.2, .4, 1), opacity .3s ease;
  pointer-events: none; opacity: 0;
}
.toast.on { transform: translate(-50%, 0); opacity: 1; }

/* ── 테스트 사이트 전용 ─────────────────────── */
.test-badge { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--black); color: var(--yellow); font-size: 11.5px; font-weight: 800; vertical-align: 1px; }
.btn-test { margin-top: 10px; min-height: 48px; font-size: 15px; background: var(--white); color: var(--black); border: 2px dashed var(--black); }
