/* 天德神諭測試版:品牌 tokens 抄自 apps/tender-site/style.css */
:root {
  --cream: #F4EBD8; --cream-deep: #EADFC6; --bone: #FBF6EC;
  --ink: #1A1714; --ink-soft: #3A332C; --ash: #6f675c;
  --flame: #E8632C; --flame-deep: #C9501E;
  --vermilion: #C73E2E; --vermilion-deep: #A52E22;
  --jade: #3E6B5C; --jade-deep: #2C4F43;
  --gold: #E0A33C; --gold-deep: #BD841F;
  --shadow: 3px 3px 0 var(--ink);
  --snap: cubic-bezier(0.34, 1.4, 0.5, 1);
  --card-w: min(66vw, 300px); /* 手機第一個畫面要同時放得下店名、牌、神諭一句,方便截圖 */
}
* { box-sizing: border-box; }
html { background: var(--cream); }
body {
  margin: 0; color: var(--ink-soft);
  background-color: var(--cream);
  background-image: radial-gradient(rgba(26,23,20,.035) .5px, transparent .5px);
  background-size: 4px 4px;
  font: 400 17px/1.7 "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
img { max-width: 100%; display: block; }
h2, h3 { color: var(--ink); line-height: 1.25; margin: 0 0 .4em; }
p { margin: 0 0 .8em; }
main { max-width: 480px; margin: 0 auto; padding: 0 18px; }
[hidden] { display: none !important; }

/* 頁首匾額 */
.top { text-align: center; padding: 26px 18px 8px; }
.plaque {
  display: inline-flex; flex-direction: column; align-items: center;
  background: var(--ink); color: var(--gold); border: 4px solid var(--gold);
  outline: 3px solid var(--ink); padding: 8px 26px 6px; box-shadow: 5px 5px 0 var(--vermilion);
}
.plaque b { font-size: 30px; font-weight: 900; letter-spacing: .3em; margin-right: -.3em; }
.plaque small { font: 700 11px/1.4 "Noto Sans TC", sans-serif; letter-spacing: .3em; color: var(--cream); }
.sub { margin: 14px 0 0; color: var(--vermilion); font-weight: 700; letter-spacing: .12em; }

.step { text-align: center; padding: 18px 0 8px; }
.lead { font-size: 21px; font-weight: 700; color: var(--ink); margin: 10px 0 18px; }
.hint { color: var(--ash); font-size: 14px; margin-top: 16px; }

/* 按鈕:蓋印按壓 */
.btn {
  display: inline-block; font: 700 18px/1 "Noto Serif TC", serif; text-decoration: none; cursor: pointer;
  padding: 14px 22px; border: 3px solid var(--ink); border-radius: 3px;
  background: var(--flame); color: var(--bone); box-shadow: var(--shadow);
  transition: transform .2s var(--snap), box-shadow .2s var(--snap), background .2s;
}
.btn:active { transform: translate(3px,3px); box-shadow: 0 0 0 var(--ink); }
.topics { display: flex; gap: 12px; justify-content: center; }
.topic { flex: 1; max-width: 120px; padding: 18px 0; font-size: 22px; background: var(--vermilion); }
.topic:nth-child(2) { background: var(--flame); }
.topic:nth-child(3) { background: var(--jade); }

/* 三張牌背 */
.spread { display: flex; gap: 10px; justify-content: center; padding: 6px 0 20px; }
.back {
  width: 30%; max-width: 130px; aspect-ratio: 2 / 3; padding: 0; cursor: pointer;
  border: 2px solid var(--gold); border-radius: 8px; overflow: hidden; background: var(--ink);
  box-shadow: var(--shadow); transition: transform .25s var(--snap);
}
.back img { width: 100%; height: 100%; object-fit: cover; }
.back:disabled { cursor: default; }
.shuffling .back:nth-child(1) { animation: shuffle-l .5s ease-in-out 3; }
.shuffling .back:nth-child(2) { animation: shuffle-c .5s ease-in-out 3; }
.shuffling .back:nth-child(3) { animation: shuffle-r .5s ease-in-out 3; }
@keyframes shuffle-l { 50% { transform: translateX(80%) rotate(-6deg); } }
@keyframes shuffle-c { 50% { transform: translateY(-10%) rotate(3deg); } }
@keyframes shuffle-r { 50% { transform: translateX(-80%) rotate(6deg); } }
.ready .back:hover, .ready .back:focus-visible { transform: translateY(-8px); }
.ready .back { animation: breathe 2.4s ease-in-out infinite; }
.ready .back:nth-child(2) { animation-delay: .4s; } .ready .back:nth-child(3) { animation-delay: .8s; }
@keyframes breathe { 50% { box-shadow: 3px 3px 0 var(--ink), 0 0 0 3px var(--gold); } }

/* 翻牌 */
.flip { width: var(--card-w); aspect-ratio: 2 / 3; margin: 6px auto 0; perspective: 1200px; }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform .9s cubic-bezier(.3,.7,.3,1); transform-style: preserve-3d; }
.flip.open .flip-inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: 3px solid var(--gold); outline: 3px solid var(--ink); border-radius: 10px; overflow: hidden;
  background: var(--ink); box-shadow: 6px 6px 0 var(--vermilion);
}
.face img { width: 100%; height: 100%; object-fit: cover; }
.face-front { transform: rotateY(180deg); }
.reversed #card-img { transform: rotate(180deg); }
.nameplate {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 26px 10px 12px; background: linear-gradient(transparent, rgba(26,23,20,.92) 45%);
  color: var(--cream); font-size: 24px; font-weight: 900; letter-spacing: .2em;
}
.seal {
  font-size: 13px; font-weight: 700; letter-spacing: .1em; padding: 3px 7px; border: 2px solid currentColor;
  border-radius: 3px; transform: rotate(-6deg); color: var(--gold);
}
.reversed .seal { color: #fff; background: var(--vermilion); border-color: var(--vermilion); }

/* 牌義 */
.date { margin: 18px 0 0; font: 700 15px/1.4 "Noto Sans TC", sans-serif; letter-spacing: .12em; color: var(--vermilion); }
.date b { font-size: 20px; color: var(--ink); }
.oracle { font-size: 24px; font-weight: 900; color: var(--ink); line-height: 1.45; margin: 8px 4px 14px; text-wrap: balance; }
#reading { text-align: left; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 0; margin: 0 0 18px; }
.chips li { font: 700 14px/1 "Noto Sans TC", sans-serif; padding: 7px 10px; border: 2px solid var(--ink); border-radius: 3px; background: var(--bone); }
.main { font-size: 18px; }
.mine { background: var(--bone); border: 3px solid var(--ink); border-radius: 6px; box-shadow: var(--shadow); padding: 14px 16px 6px; margin: 20px 0 12px; }
.mine h3 { font-size: 16px; color: var(--vermilion); letter-spacing: .1em; }
.mine p { font-size: 19px; font-weight: 700; color: var(--ink); }
.others { margin: 0 0 22px; border-bottom: 1px dashed var(--ash); padding-bottom: 8px; }
.others summary { cursor: pointer; color: var(--jade); font-weight: 700; padding: 6px 0; }
.others h4 { margin: 10px 0 2px; font-size: 15px; color: var(--ash); }
.others p { margin: 0 0 6px; }

/* 籤條 */
.slip {
  margin: 8px auto 26px; max-width: 320px; text-align: center; background: #F7E7B4; color: var(--ink);
  border: 2px solid var(--vermilion); outline: 2px solid #F7E7B4; outline-offset: 4px; padding: 16px 18px 8px;
  box-shadow: 0 0 0 7px var(--vermilion);
}
.slip small { display: block; font: 700 12px/1 "Noto Sans TC", sans-serif; letter-spacing: .3em; color: var(--vermilion); margin-bottom: 10px; }
.slip p { font-size: 18px; font-weight: 700; }

/* 進殿 */
.ink-band { background: var(--ink); color: var(--cream); }
.temple { margin: 0 -18px; padding: 28px 22px 30px; text-align: center; }
.temple h2 { color: var(--cream); font-size: 24px; }
.kicker { font: 700 13px/1.4 "Noto Sans TC", sans-serif; letter-spacing: .22em; color: var(--gold); margin-bottom: 6px; }
.price { color: var(--gold); font-weight: 700; }
.again { color: var(--vermilion); font-weight: 700; }

/* 頁尾 */
.foot { max-width: 480px; margin: 0 auto; padding: 22px 18px 34px; text-align: center; }
.notice { display: flex; align-items: center; gap: 12px; justify-content: center; text-align: left; font-size: 14px; }
.notice img { width: 56px; }
.disclaimer { margin-top: 14px; color: var(--ash); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
