:root {
  --red: #b3261e;
  --red-d: #8c1d17;
  --dark: #2b1b17;
  --cream: #fff6ec;
  --bg: #f7f1ec;
  --grey: #8a7f78;
  --line: #ece3dc;
  --orange: #e07a1f;
  --green: #2e7d32;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--dark);
  font-size: 15px;
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 84px;
}
.hero {
  background: radial-gradient(circle at 85% 10%, #d8473c 0, transparent 45%), linear-gradient(160deg, #b3261e, #7d1913);
  color: #fff;
  padding: 22px 20px 64px;
  position: relative;
  overflow: hidden;
}
.hero .brand { font-size: 13px; letter-spacing: 2px; opacity: 0.85; font-weight: 700; }
.hero h1 { margin: 4px 0 2px; font-size: 24px; }
.hero p { margin: 0; font-size: 13px; opacity: 0.85; }
.hero .bowl { position: absolute; right: 14px; top: 10px; font-size: 64px; opacity: 0.25; transform: rotate(-12deg); }
.wrap { padding: 0 16px; margin-top: -46px; position: relative; }
.card {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 6px 20px rgba(60, 20, 10, 0.08);
  margin-bottom: 14px;
}
.card h2 { margin: 0 0 12px; font-size: 16px; }
.muted { color: var(--grey); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats b { display: block; font-size: 26px; color: var(--red); line-height: 1.2; }
.stats span { font-size: 12px; color: var(--grey); }
.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 15px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  transition: transform 0.08s, opacity 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; }
.btn.ghost { background: #f1e8e2; color: var(--dark); }
.btn.dark { background: var(--dark); }
.btn.sm { padding: 9px 12px; font-size: 14px; border-radius: 10px; width: auto; display: inline-block; }
.party { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 6px 0 16px; }
.party button {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 0;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  color: var(--dark);
}
.party button.on { border-color: var(--red); background: #ffe9e4; color: var(--red); }
.ticket {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 6px 20px rgba(60, 20, 10, 0.1);
  overflow: hidden;
  margin-bottom: 14px;
}
.ticket .top { padding: 18px 18px 10px; text-align: center; }
.ticket .num { font-size: 76px; font-weight: 800; letter-spacing: 2px; line-height: 1; margin: 6px 0; font-variant-numeric: tabular-nums; }
.ticket .tear { border-top: 2px dashed var(--line); margin: 0 14px; position: relative; }
.ticket .tear::before, .ticket .tear::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); }
.ticket .tear::before { left: -24px; }
.ticket .tear::after { right: -24px; }
.ticket .bottom { padding: 14px 18px 18px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #ffe9e4; color: var(--red); }
.pill.orange { background: #fff0e0; color: var(--orange); }
.pill.green { background: #e6f4e7; color: var(--green); }
.pill.grey { background: #eee; color: #666; }
.progress { height: 10px; background: #f1e8e2; border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--red)); border-radius: 99px; transition: width 0.6s; }
.kv { display: flex; justify-content: space-between; padding: 7px 0; font-size: 14px; }
.kv b { color: var(--dark); }
.note { background: var(--cream); border-radius: 12px; padding: 11px 13px; font-size: 13px; color: #7a4a3a; margin-top: 10px; }
.called { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { background: #fff; } 50% { background: #ffe9e4; } }
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 5;
}
.tabbar a { flex: 1; text-align: center; text-decoration: none; color: var(--grey); font-size: 11px; font-weight: 700; }
.tabbar a span { display: block; font-size: 22px; line-height: 1.3; }
.tabbar a.on { color: var(--red); }
.links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.links a { background: #fff; border-radius: 14px; padding: 14px; text-decoration: none; color: var(--dark); font-weight: 700; box-shadow: 0 3px 10px rgba(60, 20, 10, 0.06); }
.links a small { display: block; color: var(--grey); font-weight: 400; font-size: 12px; }
#toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 20, 16, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 50;
  white-space: nowrap;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.loading { text-align: center; padding: 60px 0; color: var(--grey); }
input, textarea, select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--dark);
}
textarea { min-height: 80px; resize: vertical; }
label { font-size: 13px; color: var(--grey); display: block; margin: 10px 0 4px; }
