/* ============================================================
   艾維斯吃啥所 ELVIS EAT LAB — V01
   沿用艾維斯旅行所（ELVIS TRAVEL LAB）視覺語言：
   白底、簡潔導覽列、圓角卡片、橘色主色 CTA、hexagon LOGO
   遊戲層則加入活潑動畫、食物 emoji、轉盤/骰子/抽籤互動
   ============================================================ */

:root {
  --brand-purple: #4b2fd6;
  --brand-blue: #2f6bd6;
  --accent: #ec6a52;
  --accent-dark: #d9573f;
  --ink: #1f2430;
  --ink-soft: #5b6270;
  --line: #e8e6e1;
  --bg: #ffffff;
  --bg-soft: #faf9f7;
  --success: #2f9e5c;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 2px 10px rgba(31, 36, 48, 0.06);
  --shadow-pop: 0 12px 32px rgba(31, 36, 48, 0.14);
  --font-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------------- Header ---------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img.logo {
  width: 40px;
  height: 40px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text .zh {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.brand-text .en {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--ink);
}

/* ---------------- Layout wrapper ---------------- */

main {
  flex: 1;
  width: 100%;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------------- Hero ---------------- */

.hero {
  padding: 72px 32px 40px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(28px, 4.4vw, 46px);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 14px;
}

.hero h1 .highlight {
  color: var(--accent);
}

.hero p.subtitle {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0 0 34px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 8px 20px rgba(217, 87, 63, 0.28);
}

.btn-primary:hover { box-shadow: 0 10px 26px rgba(217, 87, 63, 0.36); }

.btn-secondary {
  background: var(--bg-soft);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: none;
  color: var(--ink-soft);
  padding: 10px 16px;
}

.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ---------------- Quick-pick chips (南投3天2夜 style) ---------------- */

.quick-label {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 36px 0 12px;
  text-align: left;
}

.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}

.chip:hover { border-color: var(--accent); background: #fff6f4; }

/* ---------------- Freetext card (不想填表？直接告訴我...) ---------------- */

.freetext-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  background: #fff;
  box-shadow: var(--shadow-card);
  text-align: left;
}

.freetext-card label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.freetext-card textarea {
  width: 100%;
  min-height: 90px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 16px;
}

.freetext-card textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.freetext-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.link-arrow {
  font-size: 13px;
  color: var(--brand-blue);
  font-weight: 600;
}

/* ---------------- Sections ---------------- */

section.block {
  padding: 40px 32px;
}

section.block h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
}

section.block .block-sub {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 24px;
}

/* ---------------- Category quick filter ---------------- */

.category-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 20px;
  scrollbar-width: thin;
}

.category-pill {
  flex: 0 0 auto;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.category-pill.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* ---------------- Filter bar ---------------- */

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-select {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  color: var(--ink);
}

/* ---------------- Restaurant cards ---------------- */

.restaurant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.restaurant-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .15s ease, transform .15s ease;
}

.restaurant-card:hover {
  box-shadow: var(--shadow-pop);
  transform: translateY(-2px);
}

.restaurant-card .rc-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.restaurant-card .rc-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.restaurant-card .rc-emoji {
  font-size: 22px;
}

.restaurant-card .rc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge.open { background: #e7f7ee; color: var(--success); }
.badge.closed { background: #fbeaea; color: #c0392b; }
.badge.rating { background: #fff4e0; color: #b5750a; }

.rc-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.rc-actions .btn {
  padding: 10px 14px;
  font-size: 13px;
  flex: 1;
}

/* ---------------- Empty / loading / error states ---------------- */

.state-block {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

.state-block .state-emoji {
  font-size: 44px;
  margin-bottom: 14px;
}

.state-block h3 {
  font-size: 17px;
  color: var(--ink);
  margin: 0 0 8px;
}

.state-block p {
  font-size: 14px;
  margin: 0 0 20px;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 14px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Sticky candidate bar (今天想吃) ---------------- */

.candidate-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(31,36,48,0.08);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 200;
  transform: translateY(110%);
  transition: transform .25s ease;
}

.candidate-bar.visible { transform: translateY(0); }

.candidate-bar .cb-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
}

.candidate-bar .cb-count {
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
}

.candidate-bar .cb-actions {
  display: flex;
  gap: 10px;
}

.candidate-bar .cb-actions .btn {
  padding: 11px 18px;
  font-size: 13px;
}

/* ---------------- Candidate list page ---------------- */

.candidate-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}

.candidate-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.candidate-row .cr-index {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.candidate-row .cr-main {
  flex: 1;
  min-width: 0;
}

.candidate-row .cr-name {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 3px;
}

.candidate-row .cr-meta {
  font-size: 12px;
  color: var(--ink-soft);
}

.candidate-row .cr-remove {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 18px;
  padding: 4px 8px;
}

.candidate-row .cr-remove:hover { color: #c0392b; }

/* ---------------- Game mode select ---------------- */

.game-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 30px;
}

.game-mode-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  text-align: center;
  background: #fff;
  box-shadow: var(--shadow-card);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.game-mode-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-pop);
  border-color: var(--accent);
}

.game-mode-card .gm-emoji {
  font-size: 46px;
  margin-bottom: 14px;
  display: block;
}

.game-mode-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.game-mode-card p {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 18px;
  min-height: 34px;
}

/* ---------------- Wheel ---------------- */

.wheel-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 40px;
}

.wheel-wrap {
  position: relative;
  width: min(340px, 84vw);
  height: min(340px, 84vw);
  margin-bottom: 30px;
}

.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 24px solid var(--accent);
  z-index: 10;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.25));
}

.wheel-svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 10px 34px rgba(31,36,48,0.22);
  transition: transform 4.5s cubic-bezier(0.17, 0.89, 0.32, 1.15);
}

.wheel-hub {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  z-index: 5;
}

/* ---------------- Dice ---------------- */

.dice-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 0 40px;
}

.dice-cube {
  font-size: 96px;
  margin-bottom: 30px;
  line-height: 1;
}

.dice-cube.rolling {
  animation: dice-roll 0.9s ease-in-out;
}

@keyframes dice-roll {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(120deg) scale(1.1); }
  50% { transform: rotate(240deg) scale(0.95); }
  75% { transform: rotate(330deg) scale(1.08); }
  100% { transform: rotate(360deg) scale(1); }
}

/* ---------------- Draw / lottery ---------------- */

.draw-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 0 40px;
}

.draw-cards {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 30px;
}

.draw-card {
  width: 74px; height: 104px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-blue));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  font-weight: 800;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform .18s ease;
}

.draw-card:hover { transform: translateY(-6px) rotate(-2deg); }

.draw-card.picked {
  animation: draw-flip 0.6s ease forwards;
}

@keyframes draw-flip {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

/* ---------------- Result page ---------------- */

.result-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px 60px;
  text-align: center;
}

.result-card {
  width: 100%;
  max-width: 420px;
  border-radius: 28px;
  padding: 40px 30px;
  background: linear-gradient(160deg, #fff 0%, #fff6f2 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  position: relative;
  overflow: hidden;
}

.result-card .rs-tag {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.result-card .rs-emoji {
  font-size: 56px;
  margin-bottom: 10px;
}

.result-card .rs-name {
  font-size: 26px;
  font-weight: 800;
  margin: 6px 0 14px;
  word-break: break-word;
}

.result-card .rs-meta {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 26px;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.result-actions .btn { font-size: 13px; padding: 13px; }

.reroll-zone {
  margin-top: 24px;
  font-size: 13px;
  color: var(--ink-soft);
}

.reroll-count {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 10px;
}

/* confetti */
.confetti-piece {
  position: absolute;
  width: 8px; height: 14px;
  top: -20px;
  opacity: 0.9;
  animation: confetti-fall 2.6s ease-in forwards;
}

@keyframes confetti-fall {
  to { transform: translateY(420px) rotate(540deg); opacity: 0; }
}

/* ---------------- Detail modal / page ---------------- */

.detail-hero {
  height: 200px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 64px;
  margin-bottom: 24px;
  color: #fff;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h4 {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.review-item {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 13px;
}

.review-item .r-head {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 4px;
}

/* ---------------- Footer ---------------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px 32px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--bg-soft);
}

.site-footer .status-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  margin-right: 4px;
}

/* ---------------- Utility ---------------- */

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-24 { margin-top: 24px; }
.mb-100 { margin-bottom: 100px; }

/* ---------------- Responsive ---------------- */

@media (max-width: 720px) {
  .site-header { padding: 14px 18px; }
  .main-nav { display: none; }
  .main-nav.open {
    display: flex;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    flex-direction: column;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    gap: 14px;
  }
  .nav-toggle { display: block; }
  .hero { padding: 44px 18px 30px; }
  .container, section.block { padding-left: 18px; padding-right: 18px; }
  .freetext-footer { flex-direction: column; align-items: flex-start; }
  .candidate-bar { padding: 12px 16px; flex-wrap: wrap; }
  .result-actions { grid-template-columns: 1fr; }
  .dice-cube { font-size: 76px; }
}
