:root {
  --orange: #ff6a3d;
  --chili: #d62828;
  --ink: #1a120e;
  --cream: #fff6ef;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: linear-gradient(165deg, #ff8a4c 0%, #ff6a3d 45%, #c81d25 100%);
  color: var(--cream);
  overflow: hidden;
  touch-action: none;
}
html.allow-scroll,
body.allow-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  height: auto;
  min-height: 100%;
  -webkit-overflow-scrolling: touch;
}

#app, .screen {
  height: 100%;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
}
body.allow-scroll #app {
  height: auto;
  min-height: 100%;
}
body.allow-scroll .screen:not(.hidden) {
  height: auto;
  min-height: 100%;
}

.hidden { display: none !important; }

.brand-hero {
  padding: 18vh 28px 24px;
  text-align: center;
}
.eyebrow {
  letter-spacing: 0.2em;
  opacity: 0.85;
  font-size: 12px;
}
.brand-hero.compact {
  padding: 4vh 28px 8px;
}
.brand-hero.compact h1 {
  font-size: 32px;
  margin: 4px 0;
}
.brand-hero.compact .sub {
  display: none;
}
.sub { font-size: 18px; opacity: 0.95; }

.start-panel, .taste-stage {
  padding: 0 24px 40px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
select {
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
}
.hint { font-size: 13px; opacity: 0.85; line-height: 1.45; }
.loc-status {
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0,0,0,0.18);
}
.loc-status.ok { background: rgba(20, 80, 40, 0.35); }
.loc-status.err { background: rgba(80, 10, 10, 0.4); }
.weather-status {
  font-size: 13px;
  margin: 0 0 12px;
  opacity: 0.9;
}
#btn-retry-loc { margin-bottom: 14px; }
#btn-start:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.install-btn {
  margin-top: 12px;
}
.install-hint {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.88;
}
.install-hint strong {
  font-weight: 800;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 16px 20px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  color: var(--cream);
}
.btn.primary {
  background: var(--ink);
  color: #fff;
}
.btn.ghost {
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(6px);
}
.btn.go { flex: 1.4; }
.btn.ghost { flex: 0.8; }

.taste-prompt { text-align: center; font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.taste-sub {
  text-align: center;
  margin: 0 0 14px;
  font-size: 13px;
  opacity: 0.85;
}
.taste-cats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.taste-cat {
  border: 1.5px solid rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.18);
  color: #fff;
  border-radius: 16px;
  min-height: 56px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.taste-cat.on {
  background: #fff;
  color: var(--chili, #e85d04);
  border-color: #fff;
}
.taste-tone-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 8px 0 14px;
}
.taste-tone {
  border: none;
  border-radius: 18px;
  min-height: 120px;
  background: rgba(0,0,0,0.22);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}
.taste-tone:active { transform: scale(0.98); }
#btn-taste-next, #btn-taste-skip-tone {
  width: 100%;
  max-width: 320px;
  margin: 8px auto 0;
  display: block;
}
.taste-progress { text-align: center; opacity: 0.85; }

.top {
  padding: 16px 16px 8px;
  text-align: center;
}
.copy { margin: 0 0 10px; font-size: 16px; font-weight: 600; }
.toggle {
  display: inline-flex;
  background: rgba(0,0,0,0.2);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}
.tog {
  border: none;
  background: transparent;
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}
.tog.on { background: #fff; color: var(--chili); }
.intent-reason {
  margin: 0 0 8px;
  font-size: 12px;
  opacity: 0.9;
}
.meta-row {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  opacity: 0.9;
}
.btn-duo {
  margin-top: 10px;
  border: none;
  background: rgba(0,0,0,0.22);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.card-stage {
  height: calc(100% - 190px);
  padding: 8px 12px;
  position: relative;
}
.card {
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  transition: transform 0.15s ease, opacity 0.15s ease;
  touch-action: none;
}
.card.gold {
  outline: 3px solid #ffd166;
  outline-offset: -3px;
}
.card-media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #1e2a36;
}
.card-media.is-map {
  background-size: cover;
  background-color: #d7e3ef;
}
.card-media.is-map-css {
  background-image:
    linear-gradient(rgba(30, 55, 80, 0.15), rgba(20, 35, 50, 0.45)),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(255, 255, 255, 0.22) 28px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 27px,
      rgba(255, 255, 255, 0.22) 28px
    ),
    linear-gradient(160deg, #8eb6d8 0%, #c5d9ea 45%, #9bb8ce 100%);
}
.map-badge {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  background: rgba(26, 18, 14, 0.82);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.map-badge::before {
  content: "📍 ";
}
.card-media .map-pin {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -100%);
  font-size: 42px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
  z-index: 1;
  line-height: 1;
}
.card-scrim {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 20px 24px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
}
.place { margin: 0; font-size: 22px; font-weight: 800; }
.menu { margin: 4px 0; opacity: 0.95; }
.eta, .tag { margin: 2px 0; font-size: 14px; }
.gold-badge {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffd166;
  color: #3b2a00;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
}
.detail {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(18, 10, 6, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.detail.hidden { display: none !important; }
.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.detail-head strong {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
}
.detail-close {
  border: none;
  background: rgba(255,255,255,0.16);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  flex-shrink: 0;
}
.detail-grid {
  display: grid;
  gap: 8px;
}
.detail-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
}
.detail-row .k {
  opacity: 0.7;
  font-weight: 700;
}
.detail-row .v {
  font-weight: 600;
}
.sens-box {
  margin-top: 4px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
}
.sens-box .sens-title {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}
.sens-gauge {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  overflow: hidden;
}
.sens-gauge > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd166, #ff6a3d 55%, #d62828);
}
.sens-tip {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.9;
}
.story-reward {
  margin: 0 auto 14px;
  max-width: 340px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0,0,0,0.18);
  text-align: left;
}
.story-reward-badge {
  display: inline-block;
  margin: 0 0 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  color: #191919;
  font-size: 11px;
  font-weight: 800;
}
.story-reward-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.95;
}
.done-actions-row {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 8px;
  margin-top: 10px;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
}
.done-actions-row .btn {
  margin-top: 0;
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 800;
}
.btn.share.outline {
  background: #fff;
  color: #191919;
  border: 1.5px solid rgba(255,255,255,0.85);
  box-shadow: none;
}
.btn.kakao-link {
  background: #fee500;
  color: #191919;
  border: none;
  margin-top: 10px;
}
.done-actions-row .btn.kakao-link {
  margin-top: 0;
}
.kakao-ico {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-block;
  background: #191919;
  border-radius: 45% 45% 45% 8%;
  position: relative;
}
.kakao-ico::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 5px;
  width: 10px;
  height: 7px;
  border-radius: 40%;
  background: #fee500;
}
#btn-locate {
  margin-bottom: 10px;
}
.empty {
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  font-size: 18px;
}

#screen-feed {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
#screen-feed .top {
  flex-shrink: 0;
  padding-bottom: 4px;
}
#screen-feed .card-stage {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  padding: 4px 18px 6px;
}
#screen-feed .bottom {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  flex-shrink: 0;
  padding: 6px 20px 4px;
}
#screen-feed .swipe-hint {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  flex-shrink: 0;
  padding: 0 12px 10px;
}

.bottom {
  position: absolute;
  left: 0; right: 0; bottom: 28px;
  display: flex;
  gap: 10px;
  padding: 0 16px;
}
.bottom.actions {
  justify-content: center;
  align-items: center;
  gap: 22px;
}
.btn-action {
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}
.btn-action.nope {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.btn-action.go-star {
  min-width: 132px;
  height: 72px;
  border-radius: 999px;
  background: var(--ink);
  flex-direction: column;
  gap: 2px;
  padding: 10px 26px;
}
.btn-action.go-star .star {
  font-size: 26px;
  color: #ffd166;
  line-height: 1;
}
.btn-action.go-star .go-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.swipe-hint {
  position: absolute;
  left: 0; right: 0; bottom: 8px;
  text-align: center;
  font-size: 11px;
  opacity: 0.75;
  margin: 0;
}

.done-box {
  padding: 8vh 24px calc(28px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}
.done-box h2 { font-size: 34px; margin: 0 0 6px; }
#screen-done {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}
#screen-done .done-box .btn,
#screen-done .done-box a.btn {
  margin-top: 10px;
}
.receipt-card {
  display: block;
  margin: 16px auto 20px;
  padding: 18px 18px 14px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 18px;
  max-width: 340px;
  text-align: center;
  color: #fff;
  box-shadow: 0 12px 32px rgba(0,0,0,0.22);
}
/* Asset ID gradients (용량 최적화: 이미지 대신 CSS) — 페르소나 20선 */
.receipt-card.theme-bg_destiny { background: linear-gradient(165deg, #FF6B6B 0%, #FF8E8B 100%); color: #1a120e; }
.receipt-card.theme-bg_ironwall { background: linear-gradient(165deg, #4A4A4A 0%, #2C3E50 100%); }
.receipt-card.theme-bg_sprint { background: linear-gradient(165deg, #00E676 0%, #1DE9B6 100%); color: #0b2e1c; }
.receipt-card.theme-bg_overthink { background: linear-gradient(165deg, #5C6BC0 0%, #283593 100%); }
.receipt-card.theme-bg_meat { background: linear-gradient(165deg, #F44336 0%, #BF360C 100%); }
.receipt-card.theme-bg_herb { background: linear-gradient(165deg, #66BB6A 0%, #1B5E20 100%); }
.receipt-card.theme-bg_chameleon { background: linear-gradient(165deg, #AB47BC 0%, #6A1B9A 100%); }
.receipt-card.theme-bg_survival { background: linear-gradient(165deg, #34495E 0%, #5D6D7E 100%); }
.receipt-card.theme-bg_midnight { background: linear-gradient(165deg, #1A1A2E 0%, #E94560 100%); }
.receipt-card.theme-bg_nomad { background: linear-gradient(165deg, #D4A373 0%, #FAEDCD 100%); color: #3b2a1a; }
.receipt-card.theme-bg_heat { background: linear-gradient(165deg, #FF7043 0%, #E65100 100%); color: #2a1000; }
.receipt-card.theme-bg_morning { background: linear-gradient(165deg, #FFCC80 0%, #FF8A65 100%); color: #3b2410; }
.receipt-card.theme-bg_hermit { background: linear-gradient(165deg, #90A4AE 0%, #455A64 100%); }
.receipt-card.theme-bg_spicy { background: linear-gradient(165deg, #D32F2F 0%, #FF0000 100%); }
.receipt-card.theme-bg_temp { background: linear-gradient(165deg, #FF5A00 0%, #FF9B00 100%); color: #2a1200; }
.receipt-card.theme-bg_flex { background: linear-gradient(165deg, #FFD700 0%, #F1C40F 100%); color: #2a2200; }
.receipt-card.theme-bg_value { background: linear-gradient(165deg, #26A69A 0%, #004D40 100%); }
.receipt-card.theme-bg_carb { background: linear-gradient(165deg, #FFB74D 0%, #EF6C00 100%); color: #2a1600; }
.receipt-card.theme-bg_hangover { background: linear-gradient(165deg, #4DB6AC 0%, #00695C 100%); }
.receipt-card.theme-bg_basic { background: linear-gradient(165deg, #FF5A00 0%, #E62E00 100%); }
.receipt-sticker {
  font-size: 56px;
  line-height: 1;
  margin: 8px 0 10px;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.25));
  animation: sticker-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes sticker-pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.receipt-label {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.14em;
  opacity: 0.85;
  font-weight: 700;
}
.receipt-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}
.receipt-sub {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.92;
  text-align: left;
}
.receipt-divider {
  height: 1px;
  margin: 14px 0;
  background: rgba(255,255,255,0.28);
}
.receipt-card.theme-bg_destiny .receipt-divider,
.receipt-card.theme-bg_sprint .receipt-divider,
.receipt-card.theme-bg_nomad .receipt-divider,
.receipt-card.theme-bg_temp .receipt-divider,
.receipt-card.theme-bg_flex .receipt-divider,
.receipt-card.theme-bg_heat .receipt-divider,
.receipt-card.theme-bg_morning .receipt-divider,
.receipt-card.theme-bg_carb .receipt-divider {
  background: rgba(0,0,0,0.18);
}
.receipt-row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: 6px 0;
  font-size: 13px;
  text-align: left;
}
.receipt-row span { opacity: 0.75; flex-shrink: 0; font-weight: 600; }
.receipt-row strong {
  text-align: right;
  font-weight: 800;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}
.receipt-row.reason strong { font-weight: 600; opacity: 0.95; }
.receipt-wm {
  margin: 14px 0 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  opacity: 0.75;
  font-weight: 700;
}
.done-box .btn { margin-top: 10px; }
.auth-status {
  margin: 8px 0 0;
  font-size: 12px;
  opacity: 0.9;
}
.kakao-link-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 8, 4, 0.78);
}
.kakao-link-overlay.hidden { display: none; }
.kakao-link-card {
  width: min(360px, 100%);
  border-radius: 20px;
  padding: 22px 20px 18px;
  background: #fff7f2;
  color: #1a120e;
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
}
.kakao-link-eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 800;
  opacity: 0.7;
}
.kakao-steps {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.kakao-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  opacity: 0.4;
}
.kakao-steps li span {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #ddd;
  color: #333;
  font-size: 12px;
}
.kakao-steps li.on { opacity: 1; }
.kakao-steps li.on span { background: #fee500; }
.kakao-steps li.done { opacity: 0.85; }
.kakao-steps li.done span { background: #1a120e; color: #fff; }
.kakao-link-msg {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 600;
}
#btn-kakao-overlay-ok {
  width: 100%;
}
.share-status {
  margin: 10px 0 0;
  font-size: 13px;
  opacity: 0.9;
}
.handoff-note {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.9;
}

/* Match 폭죽 */
.match-flash {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(20, 8, 4, 0.72);
  pointer-events: none;
  animation: match-in 0.25s ease-out;
}
.match-title {
  font-size: 48px;
  font-weight: 900;
  margin: 0;
  color: #ffd166;
  text-shadow: 0 4px 24px rgba(0,0,0,0.45);
  animation: match-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.match-sub {
  margin: 8px 0 0;
  font-size: 16px;
  opacity: 0.95;
}
.confetti-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  animation: confetti-fly 0.9s ease-out forwards;
}
@keyframes match-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes match-pop {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes confetti-fly {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), -180px) rotate(var(--rot));
    opacity: 0;
  }
}
