/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --red:      #C1272D;
  --red-dark: #a31f24;
  --yellow:   #F4B400;
  --green:    #2E5339;
  --cream:    #FFF8EC;
  --ink:      #241914;
  --ink-mid:  #5a3e37;
  --ink-light:#8a6a5e;
  --border:   #241914;
  --dashed:   #c9b8af;
}

html { font-size: 16px; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Be Vietnam Pro', sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 16px 40px;
}

#app {
  width: 100%;
  max-width: 460px;
}

/* ── Loading ─────────────────────────────────────────────────── */
.loading-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.loading-dots {
  display: flex;
  gap: 8px;
}

.loading-dots span {
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50%;
  animation: bounce 0.8s infinite alternate;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  from { transform: translateY(0); opacity: 0.4; }
  to   { transform: translateY(-10px); opacity: 1; }
}

/* ── Intro Screen ────────────────────────────────────────────── */
.intro-wrap {
  margin-top: 24px;
}

.intro-card {
  background: #fff;
  border: 2.5px solid var(--border);
  position: relative;
}

.intro-header {
  background: var(--ink);
  padding: 14px 20px;
  text-align: center;
}

.brand-label {
  font-family: 'Be Vietnam Pro', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.35em;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
}

.intro-body {
  padding: 28px 24px 24px;
}

.intro-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.15;
  text-align: center;
  margin-bottom: 10px;
}

.intro-title span {
  color: var(--red);
}

.intro-meta {
  text-align: center;
  font-size: 13px;
  color: var(--ink-light);
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

.intro-desc {
  font-size: 14px;
  color: var(--ink-mid);
  line-height: 1.65;
  text-align: center;
  margin-bottom: 24px;
}

.tear-line {
  margin: 0 -24px 24px;
  border: none;
  border-top: 2px dashed var(--dashed);
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
  display: block;
  width: 100%;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 15px 20px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.02em;
}

.btn-primary:hover  { background: var(--red-dark); }
.btn-primary:active { transform: scale(0.98); }

.btn-share {
  display: block;
  width: 100%;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 14px 20px;
  font-family: 'Baloo 2', sans-serif;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-bottom: 10px;
}

.btn-share:hover   { background: var(--red-dark); }
.btn-share:active  { transform: scale(0.98); }
.btn-share:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-secondary {
  display: block;
  width: 100%;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  padding: 12px 20px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.btn-secondary:hover { background: var(--ink); color: #fff; }

/* ── Progress Bar ────────────────────────────────────────────── */
.progress-wrap {
  margin: 20px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-dots {
  display: flex;
  gap: 5px;
  flex: 1;
}

.p-dot {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: var(--dashed);
  transition: background 0.25s;
}

.p-dot.done    { background: var(--red); }
.p-dot.current { background: var(--yellow); }

.progress-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-light);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

/* ── Question Card ───────────────────────────────────────────── */
.question-card {
  background: #fff;
  border: 2px solid var(--border);
  padding: 24px 20px 20px;
}

.question-num {
  font-size: 10px;
  font-family: 'Be Vietnam Pro', monospace;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.question-text {
  font-family: 'Baloo 2', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 22px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.opt-btn {
  width: 100%;
  background: var(--cream);
  border: 1.5px solid #c9b8af;
  border-radius: 3px;
  padding: 13px 16px;
  text-align: left;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.45;
}

.opt-btn:hover {
  background: #fff8dc;
  border-color: var(--yellow);
}

.opt-btn.selected {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ── Result Receipt ──────────────────────────────────────────── */
.result-wrap {
  margin-top: 20px;
}

.receipt {
  background: #fff;
  border: 2.5px solid var(--border);
  overflow: hidden;
}

.receipt-head {
  background: var(--ink);
  color: #fff;
  text-align: center;
  padding: 16px 20px 14px;
}

.receipt-brand {
  font-size: 9px;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  font-family: 'Be Vietnam Pro', monospace;
  color: rgba(255,255,255,0.45);
  margin-bottom: 4px;
}

.receipt-title {
  font-family: 'Baloo 2', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.receipt-body {
  padding: 20px 20px 0;
}

.receipt-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: 'Be Vietnam Pro', monospace;
  color: var(--ink-light);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.receipt-hr {
  border: none;
  border-top: 1.5px dashed var(--dashed);
  margin: 14px 0;
}

.dish-hero {
  text-align: center;
  padding: 6px 0 12px;
}

.dish-emoji {
  font-size: 54px;
  line-height: 1;
  display: block;
  margin-bottom: 8px;
}

.dish-name {
  font-family: 'Baloo 2', sans-serif;
  font-size: 38px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}

.dish-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0 10px;
  justify-content: center;
}

.tag {
  background: var(--yellow);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 99px;
  font-family: 'Be Vietnam Pro', sans-serif;
  letter-spacing: 0.02em;
}

.dish-blurb {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-mid);
  margin: 14px 0 8px;
}

/* Torn-edge separator before footer */
.receipt-tear {
  margin: 14px -20px 0;
  height: 22px;
  position: relative;
  background: var(--cream);
}

.receipt-tear::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    #fff 0 10px,
    transparent 10px 18px
  );
  border-top: 1.5px dashed var(--dashed);
  top: 50%;
}

.receipt-foot {
  padding: 18px 20px 22px;
}

.share-name-input {
  width: 100%;
  border: 1.5px solid #c9b8af;
  border-radius: 3px;
  background: var(--cream);
  padding: 11px 14px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 10px;
  outline: none;
  transition: border-color 0.15s;
}

.share-name-input:focus { border-color: var(--red); }
.share-name-input::placeholder { color: var(--ink-light); }

.share-link-box {
  display: none;
  background: var(--cream);
  border: 1px solid var(--dashed);
  border-radius: 3px;
  padding: 9px 13px;
  font-size: 12px;
  font-family: 'Be Vietnam Pro', monospace;
  color: var(--ink-mid);
  word-break: break-all;
  margin-bottom: 10px;
  cursor: pointer;
  user-select: all;
}

.share-link-box.visible { display: block; }

.copy-hint {
  font-size: 11px;
  color: var(--ink-light);
  text-align: center;
  margin-bottom: 10px;
  display: none;
}

.copy-hint.visible { display: block; }

/* ── Receipt footer barcode decoration ─────────────────────── */
.receipt-barcode {
  text-align: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e8ddd6;
}

.barcode-lines {
  display: inline-flex;
  gap: 2px;
  height: 28px;
  align-items: flex-end;
  margin-bottom: 5px;
}

.barcode-lines span {
  display: block;
  background: var(--ink);
  width: 2px;
}

.barcode-text {
  font-family: 'Be Vietnam Pro', monospace;
  font-size: 9px;
  letter-spacing: 0.25em;
  color: var(--ink-light);
  text-transform: uppercase;
}

/* ── Transition animations ───────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.intro-wrap,
.quiz-wrap,
.result-wrap {
  animation: fadeUp 0.3s ease both;
}

/* ── Desktop tweak ───────────────────────────────────────────── */
@media (min-width: 600px) {
  body { padding: 32px 24px 60px; }
  #app { max-width: 500px; }
  .intro-title { font-size: 34px; }
  .question-text { font-size: 22px; }
  .dish-name { font-size: 44px; }
  .dish-emoji { font-size: 64px; }
}
