@font-face { font-family: "Sarabun"; src: url("fonts/Sarabun-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Sarabun"; src: url("fonts/Sarabun-Medium.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Sarabun"; src: url("fonts/Sarabun-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Sarabun"; src: url("fonts/Sarabun-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Kanit"; src: url("fonts/Kanit-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Kanit"; src: url("fonts/Kanit-Medium.ttf") format("truetype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Kanit"; src: url("fonts/Kanit-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Kanit"; src: url("fonts/Kanit-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Charm"; src: url("fonts/Charm-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Charm"; src: url("fonts/Charm-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --bg-0: #2a0808;
  --bg-1: #5c1212;
  --gold: #e4c36a;
  --gold-2: #c9a227;
  --gold-line: #d4a937;
  --gold-deep: #8a6414;
  --cream: #f6ecd7;
  --cream-2: #efe1c0;
  --red: #9e1b1b;
  --red-deep: #7a1414;
  --ink: #3a1a10;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Sarabun", "Noto Sans Thai", sans-serif;
  color: var(--cream);
  background:
    radial-gradient(ellipse 90% 55% at 50% 28%, rgba(228, 195, 106, 0.22), transparent 68%),
    radial-gradient(ellipse 80% 40% at 50% 100%, rgba(20, 0, 0, 0.55), transparent 70%),
    linear-gradient(180deg, #4a1010 0%, #6b1616 28%, #3a0c0c 100%);
  overflow-wrap: anywhere;
  line-break: auto;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.07;
  z-index: 0;
  background-image:
    repeating-linear-gradient(45deg, #e4c36a 0 2px, transparent 2px 14px),
    repeating-linear-gradient(-45deg, #e4c36a 0 2px, transparent 2px 14px);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 75%);
}
body.full { height: 100%; height: 100dvh; overflow: hidden; }
body:not(.full) { overflow: auto; }
.vfull {
  position: relative; z-index: 1;
  max-width: 430px; margin: 0 auto;
  height: 100%; height: 100dvh;
  display: flex; flex-direction: column;
  padding: calc(12px + var(--safe-top)) 20px calc(14px + var(--safe-bottom));
}
.view { position: relative; z-index: 1; }
.view[hidden] { display: none !important; }

/* ===== Home / box / stick ===== */
.home-header { text-align: center; flex: 0 0 auto; }
.mock-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: linear-gradient(180deg, #f3e2a8, #d4b24a);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 14px;
}
h1.brand {
  font-family: "Charm", "Kanit", serif;
  font-weight: 700;
  font-size: 40px;
  line-height: 1.25;
  padding-top: 4px;
  color: #ffe39a;
  text-shadow: 0 2px 0 #5a0a0a, 0 8px 24px rgba(0,0,0,0.35);
}
.flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 2px;
  color: var(--gold-2);
  opacity: 0.9;
}
.flourish span { font-size: 13px; letter-spacing: 0.4em; }
.flourish i {
  display: block;
  width: 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.subtitle {
  font-size: 14px;
  font-weight: 500;
  color: var(--cream-2);
  opacity: 0.92;
}

.stage {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.cylinder-wrap {
  width: min(268px, 72vw);
  position: relative;
  overflow: visible;
}
.cylinder-wrap svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 16px 16px rgba(0,0,0,0.42));
}
.stage { overflow: visible; }
#drawnStick { display: none; }
#drawnStick.is-visible { display: block; }
#drawnStick { cursor: pointer; }

.hint {
  margin-top: 10px;
  min-height: 22px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  text-shadow: 0 1px 8px rgba(0,0,0,0.5);
  max-width: 280px;
}

.controls {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
}
.btn-draw {
  width: 100%;
  max-width: 280px;
  height: 56px;
  border: 0;
  border-radius: 999px;
  font-family: "Kanit", "Sarabun", sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.06em;
  color: #4a0c0c;
  background: linear-gradient(180deg, #f4e09a 0%, #e4c36a 42%, #c9a227 100%);
  box-shadow:
    0 3px 0 #7a5a10,
    0 10px 22px rgba(0,0,0,0.35),
    0 0 24px rgba(228, 195, 106, 0.28);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn-draw:active { transform: translateY(2px); box-shadow: 0 1px 0 #7a5a10, 0 4px 12px rgba(0,0,0,0.3); }
.btn-draw:disabled { opacity: 0.65; cursor: default; }
.link-all {
  border: 0;
  background: none;
  color: var(--gold);
  font-family: "Sarabun", sans-serif;
  font-weight: 600;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 6px 8px;
  -webkit-tap-highlight-color: transparent;
}
.note {
  font-size: 11.5px;
  color: rgba(246, 236, 215, 0.62);
  text-align: center;
  line-height: 1.45;
  max-width: 300px;
}

/* ===== Shared top bar for fortune / all ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + var(--safe-top)) 12px 8px;
  background: linear-gradient(180deg, #5c1212 0%, #4a1010 100%);
  border-bottom: 1px solid rgba(212, 169, 55, 0.45);
  max-width: 430px;
  margin: 0 auto;
}
.topbar .btn-back,
.topbar .btn-text {
  border: 1px solid rgba(228, 195, 106, 0.55);
  background: transparent;
  color: var(--gold);
  font-family: "Sarabun", sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.topbar h2 {
  flex: 1;
  text-align: center;
  font-family: "Kanit", sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: #ffe39a;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-pill {
  text-align: center;
  padding: 8px 0 0;
}
.topbar .spacer { width: 72px; flex: none; }
.topbar .mock-pill { margin: 0 0 0 0; }

/* ===== Fortune sheet — book style, white + red-gold frame ===== */
.fortune-wrap {
  padding: 10px 10px calc(20px + var(--safe-bottom));
  max-width: 430px;
  margin: 0 auto;
}
.sheet {
  position: relative;
  background: #ffffff;
  color: var(--ink);
  border-radius: 8px;
}
.sheet .frame {
  background: #9e1b1b;
  border-radius: 6px;
  padding: 7px;
  box-shadow: inset 0 0 0 2px #9e1b1b, inset 0 0 0 3.5px #d4a937;
}
.sheet .inner {
  background: #ffffff;
  border: 1.5px solid #d4a937;
  outline: 1px solid #d4a937;
  outline-offset: -4px;
  padding: 16px 14px 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.corner {
  position: absolute;
  width: 36px;
  height: 36px;
  z-index: 3;
  pointer-events: none;
}
.corner.tl { top: 8px; left: 8px; }
.corner.tr { top: 8px; right: 8px; transform: scaleX(-1); }
.corner.bl { bottom: 8px; left: 8px; transform: scaleY(-1); }
.corner.br { bottom: 8px; right: 8px; transform: scale(-1,-1); }

.ftop { display: flex; align-items: center; gap: 8px; }
.seal {
  width: 64px; height: 64px; flex: none;
  border-radius: 50%;
  background: #9e1b1b;
  color: #f6e2a8;
  border: 2.5px double #d4a937;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.seal .s1 { font-family: "Kanit", sans-serif; font-size: 10px; line-height: 1; }
.seal .s2 { font-family: "Kanit", sans-serif; font-weight: 600; font-size: 22px; line-height: 1.05; color: #ffe9a8; }
.seal .s3 { font-size: 8px; line-height: 1.15; opacity: .9; text-align: center; padding: 0 2px; }
.title { flex: 1; text-align: center; min-width: 0; }
.title .th { font-family: "Kanit", sans-serif; font-weight: 500; font-size: 18px; color: #7a1414; line-height: 1.2; }
.title .mean { font-family: "Sarabun", sans-serif; font-weight: 600; font-size: 12.5px; color: #8a5a12; line-height: 1.3; margin-top: 1px; }
.hexbox { flex: none; width: 78px; text-align: center; }
.hx { display: block; margin: 0 auto; width: 62px; height: auto; }
.hx .ln { fill: #9e1b1b; }
.tri { display: flex; flex-direction: column; font-size: 9.5px; color: #6a3a1a; margin-top: 3px; line-height: 1.35; }

.vrow {
  display: flex; align-items: stretch; gap: 8px; margin-top: 10px;
}
.verdict {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 10px 7px;
  border-radius: 6px;
  border: 2px solid #d4a937;
  background: #fff;
}
.verdict .vb {
  font-family: "Kanit", sans-serif; font-weight: 600; font-size: 16px; line-height: 1.25;
  display: flex; align-items: center; gap: 6px;
}
.verdict .vb::before { content: ""; width: 11px; height: 11px; border-radius: 50%; flex: none; }
.verdict .vw { font-size: 13.5px; line-height: 1.4; color: #3a1a10; }
.v-yes .verdict { border-color: #2e7d32; } .v-yes .vb { color: #2e7d32; } .v-yes .vb::before { background: #2e7d32; }
.v-cond .verdict { border-color: #d9661c; } .v-cond .vb { color: #c45a14; } .v-cond .vb::before { background: #d9661c; }
.v-wait .verdict { border-color: #e2b437; } .v-wait .vb { color: #9a7410; } .v-wait .vb::before { background: #e2b437; }
.v-maybe .verdict { border-color: #c49a2a; border-style: dashed; } .v-maybe .vb { color: #8a6a1a; } .v-maybe .vb::before { background: #fff; border: 1.5px solid #c49a2a; }
.v-no .verdict { border-color: #4a2a18; } .v-no .vb { color: #4a2a18; } .v-no .vb::before { background: #4a2a18; }
.vrow .luck { display: flex; flex-direction: column; justify-content: center; }

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 0;
  border-top: 1px solid #d4a937;
  border-bottom: 1px solid #d4a937;
}
.meta .img { flex: 1; font-size: 13px; font-weight: 600; color: #5a2a10; min-width: 0; line-height: 1.35; }
.meta .k {
  display: inline-block;
  font-family: "Kanit", sans-serif;
  font-weight: 400;
  font-size: 11px;
  color: #fff;
  background: #9e1b1b;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 4px;
}
.meta .calc { display: none; }
.luck {
  text-align: center;
  padding: 3px 8px 4px;
  border: 1.5px solid #d4a937;
  border-radius: 6px;
  min-width: 78px;
  background: #ffffff;
  flex: none;
}
.luck .lt { font-size: 9px; color: #8a6a3a; line-height: 1.1; }
.luck .lv { font-family: "Kanit", sans-serif; font-weight: 500; font-size: 13px; line-height: 1.2; }
.luck.good .lv { color: #9e1b1b; }
.luck.bad .lv { color: #5a3320; }
.dots { display: flex; justify-content: center; gap: 3px; margin-top: 2px; }
.dots .d { width: 7px; height: 7px; border-radius: 50%; border: 1px solid #b8862b; box-sizing: border-box; }
.dots .d.on { background: #d4a937; }

.cloud { display: block; width: 140px; height: 16px; margin: 8px auto 6px; }

.main, .sec, .adv { overflow-wrap: break-word; }
.main {
  background: #ffffff;
  border: 1px solid #d4a937;
  border-radius: 6px;
  padding: 8px 12px 10px;
}
.main h3, .adv h3 {
  font-family: "Kanit", sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: #9e1b1b;
  line-height: 1.3;
}
.main h3::before, .adv h3::before { content: "◆ "; color: #d4a937; }
.main p { font-size: 14.5px; line-height: 1.55; text-indent: 1.5em; margin-top: 2px; color: #3a1a10; }

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(5, auto);
  grid-auto-flow: column;
  column-gap: 12px;
  row-gap: 8px;
  margin-top: 12px;
}
.sec h4 {
  font-family: "Kanit", sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: #7a1414;
  border-bottom: 1px dotted #c79a3a;
  line-height: 1.35;
  margin-bottom: 2px;
}
.sec p { font-size: 13px; line-height: 1.48; color: #3a1a10; }

.adv {
  margin-top: 12px;
  background: #9e1b1b;
  color: #fff4d6;
  border-radius: 6px;
  padding: 8px 12px 10px;
  border: 1.5px solid #d4a937;
}
.adv h3 { color: #ffe39a; }
.adv p { font-size: 14px; line-height: 1.5; margin-top: 2px; text-indent: 0; }

.sheet-foot {
  text-align: center;
  font-size: 10px;
  color: #8a6a3a;
  margin-top: 12px;
}

.fortune-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.btn-again {
  width: 100%;
  max-width: 280px;
  height: 50px;
  border: 0;
  border-radius: 999px;
  font-family: "Kanit", "Sarabun", sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #4a0c0c;
  background: linear-gradient(180deg, #f4e09a 0%, #e4c36a 42%, #c9a227 100%);
  box-shadow: 0 3px 0 #7a5a10, 0 8px 18px rgba(0,0,0,0.25);
  cursor: pointer;
}

/* ===== All list ===== */
.all-wrap {
  padding: 10px 12px calc(24px + var(--safe-bottom));
  max-width: 430px;
  margin: 0 auto;
}
.all-intro {
  text-align: center;
  font-size: 13px;
  color: var(--cream-2);
  margin: 4px 0 12px;
  line-height: 1.45;
}
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 8px 10px;
  align-items: start;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(212, 169, 55, 0.55);
  background: linear-gradient(180deg, rgba(255,253,247,0.97), rgba(251,243,223,0.96));
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 10px 9px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-family: "Sarabun", sans-serif;
}
.item:active { transform: scale(0.99); }
.item .num {
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  font-size: 22px;
  color: #9e1b1b;
  line-height: 1.1;
  text-align: center;
  padding-top: 2px;
}
.item .names { min-width: 0; }
.item .nm {
  font-size: 15px;
  line-height: 1.3;
  color: #3a1a10;
}
.item .nm .pin { font-family: "Kanit", sans-serif; font-weight: 500; color: #7a1414; }
.item .m { font-size: 12.5px; color: #6a3a1a; line-height: 1.35; margin-top: 1px; }
.item .badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: none;
}
.tag {
  font-family: "Kanit", sans-serif;
  font-weight: 500;
  font-size: 11px;
  line-height: 1.2;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.tag.v-yes { background: #2e7d32; color: #fff; }
.tag.v-cond { background: #d9661c; color: #fff; }
.tag.v-wait { background: #e2b437; color: #4a2a08; }
.tag.v-maybe { background: #fff; color: #8a6a1a; border: 1px dashed #c49a2a; }
.tag.v-no { background: #4a2a18; color: #fff4d6; }
.tag.luck { background: transparent; color: #8a5a12; border: 1px solid #d4a937; padding: 1px 6px; }


.main h3 .imgt { font-family: "Sarabun", sans-serif; font-weight: 600; color: #8a5a12; font-size: 13px; }
.title .th { font-size: 22px; }
.tri b { color: #9e1b1b; }
.hx .mk, .hx2 .mk { fill: none; stroke: #d9661c; stroke-width: 2; }
.hx .lnh, .mini6 .lnh { fill: #d9661c; }
.item .nm .nmn { font-size: 13.5px; color: #6a3a1a; }

/* ===== Menu (home) ===== */
.modes {
  flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; gap: 16px;
  padding: 8px 0; min-height: 0;
}
.mode-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 18px 16px; border-radius: 16px; cursor: pointer;
  border: 1.5px solid rgba(228, 195, 106, 0.75);
  background: linear-gradient(180deg, rgba(158, 27, 27, 0.92), rgba(110, 16, 16, 0.92));
  box-shadow: 0 10px 24px rgba(0,0,0,0.35), inset 0 0 0 3px rgba(212,169,55,0.18);
  color: var(--cream); -webkit-tap-highlight-color: transparent;
  font-family: "Sarabun", sans-serif;
}
.mode-card:active { transform: translateY(2px); }
.mode-ic {
  flex: none; width: 62px; height: 62px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #f4e09a 0%, #e4c36a 42%, #c9a227 100%); color: #6e0e0e;
  box-shadow: 0 2px 0 #7a5a10;
}
.mode-ic svg { width: 38px; height: 38px; }
.mode-tx { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mode-tx b { font-family: "Kanit", sans-serif; font-weight: 600; font-size: 23px; color: #ffe39a; line-height: 1.2; }
.mode-tx small { font-size: 14px; line-height: 1.45; color: var(--cream-2); }

/* ===== Stick stage top ===== */
.stage-top { display: flex; align-items: center; gap: 8px; flex: none; padding-top: 10px; }
.stage-top .stage-title { flex: 1; text-align: center; font-family: "Charm", "Kanit", serif; font-weight: 700; font-size: 30px; color: #ffe39a; text-shadow: 0 2px 0 #5a0a0a; line-height: 1.3; }
.stage-top .spacer { width: 72px; flex: none; }
.btn-back.ghost {
  border: 1px solid rgba(228, 195, 106, 0.55); background: transparent; color: var(--gold);
  font-family: "Sarabun", sans-serif; font-weight: 600; font-size: 14px; padding: 6px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; width: 72px;
}
.stage-sub { text-align: center; flex: none; margin-top: 2px; }

/* ===== Coin view ===== */
.coin-wrap { max-width: 430px; margin: 0 auto; padding: 12px 16px calc(24px + var(--safe-bottom)); display: flex; flex-direction: column; align-items: center; }
.coin-intro { text-align: center; font-size: 14px; line-height: 1.55; color: var(--cream-2); }
.coins { display: flex; gap: 14px; justify-content: center; margin: 16px 0 8px; perspective: 600px; }
.coin {
  width: 76px; height: 76px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: "Kanit", sans-serif; position: relative;
  box-shadow: 0 6px 14px rgba(0,0,0,0.4), inset 0 0 0 4px rgba(255,255,255,0.18);
}
.coin::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid currentColor; opacity: .35; top: 50%; left: 50%; transform: translate(-50%, -50%); display: none; }
.coin.head { background: radial-gradient(circle at 35% 30%, #fff3c0, #e4c36a 45%, #a07a20); color: #6e0e0e; border: 2px solid #f4e09a; }
.coin.tail { background: radial-gradient(circle at 35% 30%, #c98a6a, #8b3a22 50%, #4a1a0c); color: #ffe9c0; border: 2px solid #c79a3a; }
.coin.blank { background: rgba(255,255,255,0.06); border: 2px dashed rgba(228,195,106,0.6); color: rgba(246,236,215,0.6); font-size: 26px; }
.coin .cf { font-weight: 600; font-size: 19px; line-height: 1.1; }
.coin .cv { font-size: 13px; line-height: 1.1; opacity: .85; }
.coin.spin { background: radial-gradient(circle at 35% 30%, #fff3c0, #e4c36a 45%, #a07a20); border: 2px solid #f4e09a; animation: coinflip .25s linear infinite; }
.coin.spin span { visibility: hidden; }
.coin.spin.s1 { animation-duration: .21s; } .coin.spin.s2 { animation-duration: .29s; }
@keyframes coinflip { from { transform: rotateY(0) translateY(0); } 50% { transform: rotateY(180deg) translateY(-14px); } to { transform: rotateY(360deg) translateY(0); } }
.toss-info { min-height: 48px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.ti-step { font-family: "Kanit", sans-serif; font-size: 14px; color: var(--gold); }
.ti-res { font-size: 15px; color: var(--cream); }
.ti-res b { font-family: "Kanit", sans-serif; font-size: 18px; color: #ffe39a; }
.ti-res .chg { font-style: normal; color: #ffb27a; font-weight: 700; }
.build { width: 100%; background: #fff; border-radius: 10px; border: 2px solid #d4a937; padding: 10px 12px; margin-top: 8px; box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
.build-hex { display: flex; flex-direction: column; gap: 6px; }
.brow { display: grid; grid-template-columns: 50px 1fr 18px 106px; align-items: center; gap: 8px; color: #b8a080; font-size: 13px; }
.brow .bpos { font-family: "Kanit", sans-serif; color: #8a6a3a; }
.brow .bl { height: 14px; display: block; border-radius: 2px; }
.brow .bl.empty { border: 1.5px dashed #e2cfa0; }
.brow .bl.yang { background: #9e1b1b; }
.brow .bl.yin { display: flex; justify-content: space-between; }
.brow .bl.yin i { width: 42%; background: #9e1b1b; border-radius: 2px; }
.brow .bmk { color: #d9661c; font-weight: 700; font-size: 16px; text-align: center; }
.brow .bsum { color: #5a2a10; font-size: 12.5px; white-space: nowrap; }
.brow.changing .bl.yang, .brow.changing .bl.yin i { background: #d9661c; }
.brow.newest { background: #fff6dc; border-radius: 6px; outline: 4px solid #fff6dc; }
.coin-actions { width: 100%; display: flex; justify-content: center; margin-top: 16px; }
.coin-actions .btn-draw[hidden] { display: none; }
.legend { margin-top: 16px; border-collapse: collapse; font-size: 12.5px; color: var(--cream-2); width: 100%; }
.legend td { padding: 4px 6px; border-bottom: 1px solid rgba(212,169,55,0.25); }
.legend .cs { font-family: "Kanit", sans-serif; font-size: 16px; color: #ffe39a; text-align: center; width: 34px; }

/* ===== Reading ===== */
.rsum { background: #fff; color: var(--ink); border-radius: 10px; border: 2px solid #d4a937; padding: 12px; box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
.rs-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.rs-hex { text-align: center; min-width: 110px; }
.rs-lbl { font-family: "Kanit", sans-serif; font-size: 12px; color: #fff; background: #9e1b1b; display: inline-block; padding: 1px 10px; border-radius: 999px; margin-bottom: 6px; }
.hx.rs { width: 80px; height: auto; display: block; margin: 0 auto; }
.rs-num { font-family: "Kanit", sans-serif; font-weight: 600; font-size: 18px; color: #9e1b1b; margin-top: 6px; line-height: 1.2; }
.rs-name { font-family: "Kanit", sans-serif; font-size: 15px; color: #7a1414; line-height: 1.2; }
.rs-m { font-size: 12.5px; color: #8a5a12; line-height: 1.3; }
.rs-arrow { font-size: 28px; color: #d4a937; font-weight: 700; }
.rs-tosses, .rs-chg { text-align: center; font-size: 13.5px; margin-top: 8px; color: #5a2a10; }
.rs-tosses b { font-family: "Kanit", sans-serif; color: #9e1b1b; }
.rs-chg { font-family: "Kanit", sans-serif; color: #c45a14; margin-top: 2px; }
.rs-rule { margin-top: 10px; background: #fbf3df; border: 1px solid #d4a937; border-radius: 6px; padding: 8px 10px; font-size: 13.5px; line-height: 1.5; }
.rs-rule b { font-family: "Kanit", sans-serif; font-weight: 500; color: #9e1b1b; }
.rs-one { margin-top: 8px; font-size: 12.5px; color: #6a3a1a; text-align: center; line-height: 1.45; }
.rsec { display: flex; align-items: baseline; gap: 8px; margin: 20px 4px 8px; font-family: "Kanit", sans-serif; font-weight: 600; font-size: 20px; color: #ffe39a; }
.rsec span { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(180deg, #f4e09a, #c9a227); color: #6e0e0e; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; flex: none; align-self: center; }
.rsec small { font-family: "Sarabun", sans-serif; font-weight: 500; font-size: 14px; color: var(--cream-2); }
.rsub { font-family: "Kanit", sans-serif; font-weight: 500; font-size: 15px; color: #ffe39a; margin: 14px 4px 8px; line-height: 1.4; }
.nochange { background: #fff; color: #5a2a10; border-radius: 8px; border: 1.5px dashed #d4a937; padding: 12px; font-size: 14px; text-align: center; }
.reading .sheet { margin-top: 4px; }

/* ===== Line cards ===== */
.lines-panel { margin-top: 12px; background: #fff; color: var(--ink); border-radius: 8px; border: 1.5px solid #d4a937; }
.lines-panel.open { margin-top: 0; }
.lines-panel summary { cursor: pointer; padding: 10px 12px; font-family: "Kanit", sans-serif; font-weight: 500; font-size: 15px; color: #9e1b1b; }
.lines-panel summary small { font-family: "Sarabun", sans-serif; color: #8a6a3a; font-size: 12px; }
.lp-body { padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.lines-panel.open .lp-body { padding-top: 10px; }
.judg { background: #fbf3df; border-radius: 6px; padding: 8px 10px; border-left: 4px solid #d4a937; }
.judg h3 { font-family: "Kanit", sans-serif; font-weight: 500; font-size: 13.5px; color: #9e1b1b; }
.judg p { font-size: 14px; line-height: 1.55; color: #3a1a10; }
.lc { display: grid; grid-template-columns: 64px 1fr; gap: 10px; border: 1px solid #e7d3a0; border-radius: 6px; padding: 8px; }
.lc.is-main { border: 2px solid #d9661c; background: #fff8f2; }
.lc.yong { border-style: dashed; }
.lside { text-align: center; }
.mini6 { width: 40px; height: auto; display: block; margin: 0 auto 4px; }
.mini6 .ln { fill: #d8c49a; }
.lz { font-family: "Kanit", sans-serif; font-weight: 600; font-size: 13.5px; color: #9e1b1b; line-height: 1.2; }
.lp { font-size: 11.5px; color: #8a6a3a; line-height: 1.2; }
.lsum { margin-top: 3px; font-family: "Kanit", sans-serif; font-size: 12px; color: #c45a14; }
.lth { font-size: 14px; line-height: 1.55; color: #3a1a10; }
.ltag { display: inline-block; font-family: "Kanit", sans-serif; font-size: 11px; color: #fff; background: #d9661c; border-radius: 4px; padding: 0 6px; margin-right: 6px; vertical-align: 1px; }
.lh { margin-top: 4px; font-size: 13px; line-height: 1.45; color: #6a3a1a; }
.lh span { font-family: "Kanit", sans-serif; font-size: 11px; color: #9e1b1b; border: 1px solid #d4a937; border-radius: 4px; padding: 0 5px; margin-right: 6px; }
.lh em { font-style: normal; }



/* ===== Saved readings ===== */
.modes { gap: 14px; }
.mode-card.small { padding: 12px 16px; background: rgba(60, 10, 10, 0.55); }
.mode-card.small .mode-ic { width: 46px; height: 46px; }
.mode-card.small .mode-ic svg { width: 28px; height: 28px; }
.mode-card.small .mode-tx b { font-size: 19px; }
.savebar { display: flex; align-items: center; gap: 10px; background: #fff8e6; color: var(--ink); border: 1.5px solid #d4a937; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.savebar.done { background: #eef7ee; border-color: #2e7d32; }
.sb-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 13px; line-height: 1.4; color: #6a3a1a; }
.sb-tx b { font-family: "Kanit", sans-serif; font-weight: 500; font-size: 14.5px; color: #9e1b1b; }
.savebar.done .sb-tx b { color: #2e7d32; }
.sb-btn { flex: none; border: 0; border-radius: 999px; padding: 9px 16px; font-family: "Kanit", sans-serif; font-weight: 600; font-size: 15px; cursor: pointer; color: #4a0c0c; background: linear-gradient(180deg, #f4e09a 0%, #e4c36a 42%, #c9a227 100%); box-shadow: 0 2px 0 #7a5a10; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.sb-btn.ghost { background: #fff; color: #9e1b1b; border: 1.5px solid #d4a937; box-shadow: none; font-weight: 500; font-size: 14px; padding: 7px 12px; }
.sb-btn.danger { background: #fff; color: #b3261e; border: 1.5px solid #b3261e; box-shadow: none; font-weight: 500; font-size: 14px; padding: 7px 14px; }
.reading #readingSave .savebar, #fortuneSave .savebar { margin-top: 2px; }
.srow { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; border: 1px solid rgba(212,169,55,0.55); background: linear-gradient(180deg, rgba(255,253,247,0.97), rgba(251,243,223,0.96)); color: var(--ink); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-family: "Sarabun", sans-serif; -webkit-tap-highlight-color: transparent; }
.srow:active { transform: scale(0.99); }
.sr-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sr-date { font-size: 12.5px; color: #8a6a3a; }
.sr-mode { font-family: "Kanit", sans-serif; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; color: #fff; background: #9e1b1b; white-space: nowrap; }
.sr-mode.m-coin { background: #8a6414; }
.sr-q { font-size: 15.5px; font-weight: 600; color: #3a1a10; line-height: 1.4; }
.sr-q.empty, .qc-q.empty { color: #a08a6a; font-weight: 400; font-style: italic; }
.sr-hex { font-family: "Kanit", sans-serif; font-size: 13.5px; color: #9e1b1b; }
.saved-empty { display: flex; flex-direction: column; gap: 6px; text-align: center; background: rgba(255,255,255,0.06); border: 1.5px dashed rgba(228,195,106,0.6); border-radius: 12px; padding: 26px 18px; color: var(--cream-2); font-size: 14px; line-height: 1.5; }
.saved-empty b { font-family: "Kanit", sans-serif; font-size: 18px; color: #ffe39a; font-weight: 500; }
.saved-note { margin-top: 16px; text-align: center; font-size: 12px; color: rgba(246,236,215,0.7); line-height: 1.5; }
.qcard { background: #fff; color: var(--ink); border-radius: 10px; border: 2px solid #d4a937; padding: 12px; margin-bottom: 12px; box-shadow: 0 8px 20px rgba(0,0,0,0.3); }
.qc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qc-lbl { margin-top: 8px; font-family: "Kanit", sans-serif; font-size: 12px; color: #8a6a3a; }
.qc-q { font-size: 17px; font-weight: 600; line-height: 1.45; color: #3a1a10; }
.qc-hex { margin-top: 4px; font-family: "Kanit", sans-serif; font-size: 14px; color: #9e1b1b; }
.qc-act { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(20, 4, 4, 0.62); display: flex; align-items: flex-end; justify-content: center; padding: 16px 12px calc(16px + var(--safe-bottom)); }
.modal[hidden] { display: none; }
html.modal-open, html.modal-open body { overflow: hidden; }
.modal-box { width: 100%; max-width: 420px; background: #fff; color: var(--ink); border-radius: 16px; border: 2px solid #d4a937; padding: 16px; box-shadow: 0 16px 40px rgba(0,0,0,0.45); margin-bottom: 20vh; }
.m-title { font-family: "Kanit", sans-serif; font-weight: 600; font-size: 19px; color: #9e1b1b; }
.m-sub { font-size: 13.5px; color: #6a3a1a; margin-top: 2px; line-height: 1.5; }
.m-warn { font-size: 13px; color: #b3261e; margin-top: 6px; }
.m-lbl { display: block; margin-top: 12px; font-family: "Kanit", sans-serif; font-size: 14px; color: #5a2a10; }
.m-ta { width: 100%; margin-top: 4px; font-family: "Sarabun", sans-serif; font-size: 16px; line-height: 1.5; padding: 10px; border: 1.5px solid #d4a937; border-radius: 8px; resize: vertical; color: #3a1a10; background: #fffdf7; }
.m-ta:focus { outline: 2px solid #e4c36a; }
.m-err { color: #b3261e; font-size: 13px; margin-top: 6px; }
.m-act { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
.m-btn { border: 0; border-radius: 999px; padding: 10px 20px; font-family: "Kanit", sans-serif; font-weight: 600; font-size: 16px; cursor: pointer; color: #4a0c0c; background: linear-gradient(180deg, #f4e09a 0%, #e4c36a 42%, #c9a227 100%); box-shadow: 0 2px 0 #7a5a10; }
.m-btn.ghost { background: #fff; color: #6a3a1a; border: 1.5px solid #d4a937; box-shadow: none; font-weight: 500; }
.m-btn.danger { background: #b3261e; color: #fff; box-shadow: 0 2px 0 #6e1410; }



/* ===== Manual entry ===== */
.mode-card.mid { padding: 14px 16px; }
.mode-card.mid .mode-ic { width: 54px; height: 54px; }
.mode-card.mid .mode-ic svg { width: 32px; height: 32px; }
.mode-card.mid .mode-tx b { font-size: 21px; }
.sr-mode.m-manual { background: #4a6a2a; }
.mpick { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 14px; }
.mpick select { flex: 1; min-width: 0; height: 46px; border-radius: 10px; border: 2px solid #d4a937; background: #fffdf7; color: #3a1a10; font-family: "Kanit", sans-serif; font-size: 16px; padding: 0 10px; }
.mstep { flex: none; width: 46px; height: 46px; border-radius: 10px; border: 1.5px solid rgba(228,195,106,0.75); background: rgba(158,27,27,0.8); color: #ffe39a; font-size: 26px; line-height: 1; cursor: pointer; }
.build.manual { margin-top: 12px; }
.mrow { display: grid; grid-template-columns: 46px 1fr 74px 40px; align-items: center; gap: 8px; color: #5a2a10; font-size: 13px; }
.mrow .bpos { font-family: "Kanit", sans-serif; color: #8a6a3a; }
.mline { display: block; width: 100%; padding: 9px 4px; border: 1px dashed transparent; border-radius: 6px; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mline:active { background: #fff6dc; border-color: #e2cfa0; }
.mline .bl { height: 16px; display: flex; border-radius: 2px; }
.mline .bl.yang { background: #9e1b1b; }
.mline .bl.yin { justify-content: space-between; }
.mline .bl.yin i { width: 42%; background: #9e1b1b; border-radius: 2px; }
.mrow.changing .bl.yang, .mrow.changing .bl.yin i { background: #d9661c; }
.mchk { display: flex; align-items: center; gap: 4px; font-family: "Kanit", sans-serif; font-size: 13.5px; color: #5a2a10; cursor: pointer; white-space: nowrap; }
.mchk input { width: 20px; height: 20px; accent-color: #d9661c; }
.mval { font-family: "Kanit", sans-serif; color: #c45a14; font-size: 13px; text-align: right; white-space: nowrap; }
.minfo { width: 100%; margin-top: 10px; text-align: center; color: var(--cream); font-size: 14px; line-height: 1.5; display: flex; flex-direction: column; }
.minfo b { font-family: "Kanit", sans-serif; font-size: 18px; color: #ffe39a; font-weight: 600; }
.minfo .mi-tri { font-size: 12.5px; color: var(--cream-2); }
.minfo .mi-chg { font-family: "Kanit", sans-serif; color: #ffb27a; }
.minfo .mi-chg.none { color: var(--cream-2); font-family: "Sarabun", sans-serif; font-size: 13px; }



/* ===== v7: simpler flow ===== */
.btn-mute {
  position: fixed; z-index: 40; top: calc(10px + var(--safe-top)); right: 10px;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(228,195,106,0.6); background: rgba(60,10,10,0.65); color: #ffe39a;
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.btn-mute svg { width: 22px; height: 22px; }
.btn-mute.is-muted { color: rgba(246,236,215,0.6); }
.topbar { padding-right: 58px; }
.topbar .spacer { width: 0; }
.topbar.clear { background: none; border: 0; padding: 0 50px 0 0; margin: 0; width: 100%; position: static; }

.home-header { padding-top: 26px; }
.bigmodes { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; gap: 18px; min-height: 0; }
.bigbtn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%;
  padding: 22px 16px 20px; border-radius: 22px; cursor: pointer; text-align: center;
  border: 2px solid rgba(228,195,106,0.85);
  background: linear-gradient(180deg, rgba(170,32,32,0.95), rgba(110,16,16,0.95));
  box-shadow: 0 12px 26px rgba(0,0,0,0.38), inset 0 0 0 4px rgba(212,169,55,0.16);
  color: var(--cream); font-family: "Sarabun", sans-serif; -webkit-tap-highlight-color: transparent;
}
.bigbtn:active { transform: translateY(2px); }
.bb-ic { width: 66px; height: 66px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #f4e09a 0%, #e4c36a 42%, #c9a227 100%); color: #6e0e0e; box-shadow: 0 2px 0 #7a5a10; margin-bottom: 4px; }
.bb-ic svg { width: 40px; height: 40px; }
.bigbtn b { font-family: "Kanit", sans-serif; font-weight: 600; font-size: 30px; line-height: 1.2; color: #ffe39a; }
.bigbtn small { font-size: 15px; color: var(--cream-2); }
.minibar { display: flex; gap: 8px; margin-top: 14px; flex: none; }
.minibar button {
  flex: 1; min-width: 0; height: 46px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(228,195,106,0.55); background: rgba(40,6,6,0.5); color: var(--gold);
  font-family: "Kanit", sans-serif; font-size: 14.5px; display: flex; align-items: center; justify-content: center; gap: 4px;
  -webkit-tap-highlight-color: transparent;
}
.minibar em { font-style: normal; font-size: 11.5px; background: #e4c36a; color: #4a0c0c; border-radius: 999px; padding: 0 6px; min-width: 18px; }
.minibar em:empty { display: none; }
.v-home .note { margin: 10px auto 0; flex: none; }

.cat-wrap { max-width: 430px; margin: 0 auto; padding: 14px 14px calc(24px + var(--safe-bottom)); }
.cat-intro { text-align: center; color: var(--cream-2); font-size: 15px; margin-bottom: 14px; line-height: 1.5; }
.catgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.catbtn {
  min-height: 74px; padding: 10px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid #d4a937; background: linear-gradient(180deg, #fffdf7, #fbf0d6); color: #7a1414;
  font-family: "Kanit", sans-serif; font-weight: 500; font-size: 17px; line-height: 1.3;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25); -webkit-tap-highlight-color: transparent;
}
.catbtn:active { transform: scale(0.98); background: #fff1c8; }
.catchip { align-self: center; margin: 6px auto 0; display: table; background: rgba(255,248,230,0.95); color: #7a1414; border: 1px solid #d4a937; border-radius: 999px; padding: 4px 14px; font-family: "Kanit", sans-serif; font-size: 14px; }
.catchip .cc-k { color: #8a6a3a; font-size: 12px; }

/* stick stage */
.v-stick .stage { flex: 1 1 auto; }
.cylinder-wrap { cursor: pointer; -webkit-tap-highlight-color: transparent; outline: none; touch-action: manipulation; }
.cylinder-wrap svg { transform-origin: 50% 92%; }
.cylinder-wrap.jig svg { animation: jig .32s ease-in-out; }
@keyframes jig { 0% { transform: rotate(0); } 20% { transform: rotate(-5deg) translateX(-3px); } 45% { transform: rotate(4deg) translateX(3px); } 70% { transform: rotate(-2.5deg); } 100% { transform: rotate(0); } }
.meter { display: flex; gap: 6px; justify-content: center; min-height: 10px; margin-top: 4px; }
.meter i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--gold); }
.meter i.on { background: var(--gold); }
.controls { gap: 8px; }
.btn-soft { border: 1px solid rgba(228,195,106,0.6); background: rgba(40,6,6,0.45); color: var(--gold); border-radius: 999px; padding: 9px 22px; font-family: "Kanit", sans-serif; font-size: 15px; cursor: pointer; }
.btn-motion { border: 0; border-radius: 999px; padding: 10px 22px; font-family: "Kanit", sans-serif; font-weight: 600; font-size: 16px; color: #fff; background: #2e7d32; box-shadow: 0 2px 0 #1b4d1e; cursor: pointer; }
.btn-motion[hidden], .btn-draw[hidden], .btn-soft[hidden] { display: none; }

/* coin stage */
.v-coin .coin-wrap { padding-top: 8px; }
.v-coin .build { margin-top: 10px; padding: 8px 10px; }
.v-coin .build-hex { gap: 3px; }
.v-coin .brow .bl { height: 12px; }
.coin-stage { width: 100%; margin-top: 8px; min-height: 170px; border-radius: 16px; border: 1.5px dashed rgba(228,195,106,0.5); background: radial-gradient(ellipse at 50% 80%, rgba(228,195,106,0.16), transparent 70%); display: flex; flex-direction: column; justify-content: flex-end; align-items: center; padding: 10px 8px 12px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; position: relative; z-index: 5; }
.coin-stage .coins { margin: 0 0 8px; perspective: 700px; }
.coins.jig { animation: jig .3s ease-in-out; }
.coin.flying { background: radial-gradient(circle at 35% 30%, #fff3c0, #e4c36a 45%, #a07a20); border: 2px solid #f4e09a; will-change: transform; }
.coin.flying span { visibility: hidden; }
.coin.landed { animation: landpop .25s ease-out; }
@keyframes landpop { 0% { transform: scale(1.12); } 100% { transform: scale(1); } }
.stage-hint { font-size: 13px; color: var(--cream-2); text-align: center; line-height: 1.4; }
.legend-box { width: 100%; margin-top: 12px; color: var(--cream-2); }
.legend-box summary { cursor: pointer; text-align: center; color: var(--gold); font-family: "Kanit", sans-serif; font-size: 14px; }
.legend-note { font-size: 12px; text-align: center; margin-top: 6px; }

/* result */
.qbox { background: #fff; color: var(--ink); border-radius: 12px; border: 2px solid #d4a937; padding: 10px 12px; margin-bottom: 12px; }
.qb-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.qb-lbl { display: block; margin-top: 6px; font-family: "Kanit", sans-serif; font-size: 14px; color: #7a1414; }
#qInput { width: 100%; margin-top: 3px; font-family: "Sarabun", sans-serif; font-size: 16px; line-height: 1.45; padding: 8px 10px; border: 1.5px solid #e2cfa0; border-radius: 8px; resize: vertical; color: #3a1a10; background: #fffdf7; }
#qInput:focus { outline: 2px solid #e4c36a; }
.qb-status { font-size: 12px; color: #2e7d32; margin-top: 3px; }
.rcard { background: #fff; color: var(--ink); border-radius: 12px; border: 2px solid #d4a937; padding: 12px; margin-bottom: 12px; box-shadow: 0 8px 20px rgba(0,0,0,0.28); }
.rcard.second { border-color: #c9a227; background: #fffaf0; }
.rc-lbl { font-family: "Kanit", sans-serif; font-size: 13px; color: #fff; background: #9e1b1b; display: inline-block; padding: 1px 12px; border-radius: 999px; margin-bottom: 8px; }
.rc-head { display: flex; align-items: center; gap: 10px; }
.seal.sm { width: 56px; height: 56px; }
.seal.sm .s2 { font-size: 20px; }
.rc-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rc-name b { font-family: "Kanit", sans-serif; font-weight: 600; font-size: 24px; color: #7a1414; line-height: 1.2; }
.rc-name span { font-size: 13px; color: #8a5a12; line-height: 1.35; }
.hx.rc { width: 56px; height: auto; flex: none; }
.judg-lead { margin-top: 10px; background: #fbf3df; border-left: 4px solid #9e1b1b; border-radius: 6px; padding: 8px 10px; }
.judg-lead h4, .catf h4 { font-family: "Kanit", sans-serif; font-weight: 500; font-size: 13.5px; color: #9e1b1b; }
.judg-lead p { font-size: 14.5px; line-height: 1.55; color: #3a1a10; }
.catf { margin-top: 10px; border: 1.5px solid #d4a937; border-radius: 8px; padding: 8px 10px; }
.catf h4 { font-size: 15.5px; }
.catf p { font-size: 16.5px; line-height: 1.6; color: #3a1a10; }
.rcard.lines .sl-rule { font-size: 13px; color: #6a3a1a; margin-bottom: 6px; line-height: 1.45; }
.sline { border-top: 1px dotted #d4a937; padding: 6px 0; }
.sline.is-main .sl-t { font-weight: 600; }
.sl-k { font-family: "Kanit", sans-serif; font-size: 13px; color: #c45a14; }
.sl-t { font-size: 14.5px; line-height: 1.55; color: #3a1a10; }
.btn-more { display: block; width: 100%; margin: 4px 0 12px; padding: 12px; border-radius: 12px; border: 1.5px solid rgba(228,195,106,0.8); background: rgba(40,6,6,0.5); color: #ffe39a; font-family: "Kanit", sans-serif; font-size: 16px; cursor: pointer; }
.more[hidden] { display: none; }
.oldnote { color: var(--cream-2); font-size: 13px; text-align: center; margin: 0 0 10px; }
.act-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.link-all.danger { color: #ffb0a0; }
.sr-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.sr-cat { font-family: "Kanit", sans-serif; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; color: #7a1414; background: #fff1c8; border: 1px solid #d4a937; white-space: nowrap; }

@media (min-width: 700px) {
  .vfull, .cat-wrap, .coin-wrap, .fortune-wrap, .all-wrap, .topbar { max-width: 520px; }
  .cylinder-wrap { width: min(320px, 60vw); }
}
html.shot * { animation: none !important; transition: none !important; }

/* ===== เซียมซี อี้จิง (แอปใหม่) ===== */
.energy { width: 220px; max-width: 70vw; height: 10px; margin: 8px auto 0; border-radius: 999px; border: 1.5px solid rgba(228,195,106,0.75); background: rgba(40,6,6,0.5); overflow: hidden; }
.energy i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #c9a227, #ffe39a); transition: width .12s linear; }
.energy[hidden], .meter[hidden] { display: none; }
.meter { margin-top: 6px; }
.meter i { width: 8px; height: 8px; }
.srow-w { position: relative; }
.srow-w .srow { padding-right: 62px; }
.sr-del { position: absolute; right: 8px; bottom: 8px; border: 1px solid #c98a7a; background: #fff6f2; color: #9e1b1b; border-radius: 999px; padding: 3px 12px; font-family: "Kanit", sans-serif; font-size: 13px; cursor: pointer; }
.srow-w + .srow-w { margin-top: 0; }

.v-result .fortune-wrap { padding-bottom: calc(28px + var(--safe-bottom)); }
.rz-card { background: var(--cream); color: var(--ink); border-radius: 18px; padding: 20px 18px; margin-top: 6px; border: 2px solid var(--gold-line); box-shadow: 0 8px 24px rgba(0,0,0,.35); overflow-wrap: anywhere; }
.rz-no { text-align: center; font-family: "Kanit", sans-serif; color: var(--red); font-size: 15px; }
.rz-name { text-align: center; font-family: "Kanit", sans-serif; font-weight: 600; font-size: 30px; line-height: 1.25; color: var(--red-deep); margin: 2px 0; }
.rz-img { text-align: center; color: #7a5a3a; font-size: 15px; }
.rz-hx { display: block; width: 92px; height: auto; margin: 12px auto; fill: var(--red-deep); }
.rz-badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0 12px; }
.rz-b { font-family: "Kanit", sans-serif; font-size: 15px; padding: 4px 12px; border-radius: 99px; }
.rz-lv { background: var(--red); color: #fff6dc; }
.rz-lv.bad { background: #4a3a34; }
.rz-vd { background: #fff; border: 1.5px solid #c9a227; color: var(--ink); }
.rz-quote { font-family: "Kanit", sans-serif; font-size: 19px; line-height: 1.55; text-align: center; color: var(--red-deep); padding: 12px 6px; border-top: 1px dashed #c9a227; border-bottom: 1px dashed #c9a227; margin: 0; }
.rz-cat { margin-top: 16px; }
.rz-cat h3 { font-family: "Kanit", sans-serif; font-weight: 600; font-size: 17px; color: var(--red); margin: 0 0 6px; }
.rz-cat p { font-size: 17px; line-height: 1.7; margin: 0; color: var(--ink); }
.rz-ovbtn { display: block; margin: 12px auto 0; border: 1px solid #c9a227; background: #fffaf0; color: var(--red-deep); border-radius: 999px; padding: 6px 16px; font-family: "Kanit", sans-serif; font-size: 14.5px; cursor: pointer; }
.rz-ov { margin-top: 10px; background: #fffaf0; border: 1px solid #e2cfa0; border-radius: 12px; padding: 10px 12px; }
.rz-ov[hidden], .rz-more[hidden] { display: none; }
.rz-ov p { margin: 0; font-size: 16px; line-height: 1.7; color: var(--ink); }
.rz-adv { color: var(--ink); margin-top: 14px; background: #fbe9b8; border: 1px solid #e0c070; border-radius: 12px; padding: 10px 12px; }
.rz-adv b { font-family: "Kanit", sans-serif; font-weight: 600; color: var(--red-deep); font-size: 16px; }
.rz-adv p { margin: 2px 0 0; font-size: 16px; line-height: 1.6; color: var(--ink); }
.rz-more { margin-top: 16px; border-top: 1px dashed #c9a227; padding-top: 4px; }
.rz-oc { margin-top: 12px; }
.rz-oc h4 { font-family: "Kanit", sans-serif; font-weight: 600; font-size: 16px; color: var(--red); margin: 0 0 4px; }
.rz-oc p { margin: 0; font-size: 16px; line-height: 1.65; color: var(--ink); }
.rz-q { margin-top: 14px; }
.rz-q label { display: block; font-family: "Kanit", sans-serif; font-size: 14px; color: var(--gold); }
.rz-q label span { color: var(--cream-2); font-size: 13px; }
.rz-q #qInput { margin-top: 6px; background: rgba(255,255,255,.08); border: 1px solid var(--gold-deep); color: #f6ecd7; }
.rz-q #qInput::placeholder { color: rgba(233,217,180,0.7); }
.rz-qs { font-size: 12.5px; color: #b9e3a8; margin-top: 4px; }
.rz-btns { display: flex; gap: 10px; margin-top: 14px; }
.rz-btn { flex: 1; min-width: 0; text-align: center; font-family: "Kanit", sans-serif; font-size: 16px; padding: 12px 8px; border-radius: 14px; cursor: pointer; }
.rz-btn.pri { border: 0; background: linear-gradient(180deg, var(--gold), #c9a227); color: var(--ink); font-weight: 600; }
.rz-btn.sec { border: 1.5px solid var(--gold); background: transparent; color: var(--gold); }
.rz-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 14px; }
.rz-note { font-size: 13px; color: #e4c36a; opacity: .8; text-align: center; margin-top: 10px; }
@media (max-width: 360px) { .rz-name { font-size: 26px; } .rz-quote { font-size: 17.5px; } .rz-card { padding: 16px 13px; } }
