/* =====================================================================
   duduangfree.buzz — tarot.css : ไพ่ทาโรต์ลายมังกร-โคมแดงทอง (CSS ล้วน ไม่มีไฟล์รูป)
   ===================================================================== */
:root {
  --tr-dragon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none'%3E%3Ccircle cx='50' cy='50' r='47' stroke='%23f7c548' stroke-opacity='.5' stroke-width='.8'/%3E%3Ccircle cx='50' cy='50' r='44' stroke='%23f7c548' stroke-opacity='.3' stroke-width='.4' stroke-dasharray='1 2'/%3E%3Cpath d='M62.7 18.5 A34 34 0 1 1 37.3 18.5' stroke='%23f7c548' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M62.7 18.5 A34 34 0 1 1 37.3 18.5' stroke='%236e1424' stroke-width='5' stroke-dasharray='.7 2.1' stroke-linecap='round' stroke-opacity='.5'/%3E%3Cpath d='M37.3 18.5 L33 12' stroke='%23f7c548' stroke-width='1.6' stroke-linecap='round'/%3E%3Cpath d='M58 13 Q66 6 76 11 L70 15 L78 20 L68 20 Q66 26 58 23 Q54 19 58 13Z' fill='%23f7c548'/%3E%3Cpath d='M62 12 L58 4 M67 11 L67 3' stroke='%23f7c548' stroke-width='1.3' stroke-linecap='round'/%3E%3Cpath d='M72 20 Q80 24 84 32 M70 22 Q76 30 74 38' stroke='%23f7c548' stroke-width='1' stroke-linecap='round'/%3E%3Ccircle cx='66' cy='15.5' r='1.6' fill='%23ff2a44'/%3E%3Cellipse cx='50' cy='53' rx='12' ry='14' fill='%23c4142e' stroke='%23f7c548' stroke-width='1.2'/%3E%3Cpath d='M50 39 Q43 53 50 67 M50 39 Q57 53 50 67' stroke='%23f7c548' stroke-width='.8'/%3E%3Crect x='42.5' y='35.5' width='15' height='3.6' rx='1' fill='%23f7c548'/%3E%3Crect x='42.5' y='66.5' width='15' height='3.6' rx='1' fill='%23f7c548'/%3E%3Cpath d='M50 70 V80 M47 80 H53 M48 80 V84 M50 80 V85 M52 80 V84' stroke='%23f7c548' stroke-width='1' stroke-linecap='round'/%3E%3Ccircle cx='50' cy='53' r='4' fill='%23f7c548'/%3E%3Crect x='48.2' y='51.2' width='3.6' height='3.6' fill='%23c4142e'/%3E%3C/svg%3E");
  --tr-scales: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10' fill='none' stroke='%23f7c548' stroke-opacity='.22' stroke-width='.7'%3E%3Cpath d='M0 10 A8 8 0 0 1 16 10 M-8 5 A8 8 0 0 1 8 5 M8 5 A8 8 0 0 1 24 5'/%3E%3C/svg%3E");
  --tr-spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1 L13.4 10.6 L23 12 L13.4 13.4 L12 23 L10.6 13.4 L1 12 L10.6 10.6Z' fill='%23f7c548'/%3E%3C/svg%3E");
  --tr-cw: 150px;           /* ความกว้างไพ่ผลลัพธ์ */
  --tr-foil: linear-gradient(120deg, #ffe39a 0%, #f7c548 30%, #b8862b 52%, #ffe39a 70%, #f7c548 100%);
}
@media (max-width: 640px) { :root { --tr-cw: 96px; } }

/* ---------- Stepper ---------- */
.tr-steps { list-style: none; margin: 0 auto 28px; padding: 0; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.tr-steps li {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px;
  font-family: var(--font-head); font-size: .9rem; color: var(--text-3);
  border: 1px solid var(--border); background: var(--surface); transition: color .3s, border-color .3s, background .3s;
}
.tr-steps li b {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 500; font-size: .85rem;
  background: var(--surface-2); color: var(--text-2);
}
.tr-steps li.active { color: var(--gold-2); border-color: var(--border-2); background: rgba(247,197,72,.08); }
.tr-steps li.active b { background: linear-gradient(135deg, var(--gold-2), var(--gold-3)); color: #2a1d05; }
.tr-steps li.done { color: var(--text-2); }
.tr-steps li.done b { background: rgba(168,85,247,.45); color: var(--text); }
@media (max-width: 480px) {
  .tr-steps { gap: 4px; }
  .tr-steps li { padding: 4px 10px 4px 4px; font-size: .78rem; gap: 6px; }
  .tr-steps li b { width: 22px; height: 22px; font-size: .75rem; }
}
.tr-panel { animation: fadeUp .45s ease both; }

/* =====================================================================
   CARD BACK
   ===================================================================== */
.tback {
  display: block; position: relative; border-radius: 9px;
  background:
    var(--tr-spark) 50% 5% / 9% auto no-repeat,
    var(--tr-spark) 50% 95% / 9% auto no-repeat,
    var(--tr-dragon) 50% 50% / 88% auto no-repeat,
    radial-gradient(circle at 50% 50%, rgba(247,197,72,.18) 0, transparent 40%),
    var(--tr-scales) 0 0 / 16px 10px,
    radial-gradient(120% 80% at 50% 50%, #4c1d95 0%, #3a1470 55%, #14082a 100%);
  border: 1px solid var(--gold);
  box-shadow:
    inset 0 0 0 3px #14082a,
    inset 0 0 0 4px rgba(247,197,72,.8),
    inset 0 0 22px rgba(168,85,247,.5),
    0 8px 22px -8px rgba(0,0,0,.8);
}

/* =====================================================================
   CARD FACE
   ===================================================================== */
.tface {
  position: relative; display: block; aspect-ratio: 3 / 5; border-radius: 9px; overflow: hidden;
  container-type: inline-size;
  background:
    radial-gradient(90% 55% at 50% 42%, rgba(168,85,247,.28), transparent 70%),
    radial-gradient(60% 30% at 50% 100%, rgba(247,197,72,.10), transparent 70%),
    linear-gradient(165deg, #3a0c18 0%, #220810 55%, #0d0618 100%);
  border: 1px solid var(--gold);
  box-shadow:
    inset 0 0 0 3px #14082a,
    inset 0 0 0 4px rgba(247,197,72,.55),
    inset 0 0 28px rgba(247,197,72,.12),
    0 10px 28px -10px rgba(0,0,0,.85);
  color: var(--gold);
}
.tface::after { /* foil sheen */
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(255,240,200,.09) 44%, transparent 58%);
}
.tface-in { position: absolute; inset: 0; }
.tc-num {
  position: absolute; top: 5cqw; left: 8cqw; font-family: var(--font-head); font-weight: 500;
  font-size: max(8px, 10cqw); line-height: 1;
  background: var(--tr-foil); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tc-num-br { top: auto; left: auto; bottom: 5cqw; right: 8cqw; transform: rotate(180deg); opacity: .55; font-size: max(7px, 7cqw); }
.tc-art { position: absolute; left: 12%; right: 12%; top: 12%; bottom: 29%; display: grid; place-items: center; }
.tc-art svg { display: block; filter: drop-shadow(0 0 1.6cqw rgba(247,197,72,.45)); }

/* major */
.tc-major { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }
.tc-halo {
  position: absolute; width: 70cqw; height: 70cqw; border-radius: 50%;
  border: 1px solid rgba(247,197,72,.55);
  box-shadow: 0 0 0 3cqw rgba(247,197,72,.06), inset 0 0 8cqw rgba(247,197,72,.25), 0 0 10cqw rgba(168,85,247,.4);
  background: radial-gradient(circle, rgba(247,197,72,.16), transparent 70%);
}
.tc-halo::before {
  content: ''; position: absolute; inset: -6cqw; border-radius: 50%; border: 1px dashed rgba(247,197,72,.3);
}
.tc-symbol { position: relative; font-size: 34cqw; line-height: 1; filter: drop-shadow(0 0 3cqw rgba(247,197,72,.55)); }

/* ace */
.tc-ace svg { width: 56cqw; height: 56cqw; }
.tc-ace { position: relative; display: grid; place-items: center; }
.tc-ace::before {
  content: ''; position: absolute; width: 66cqw; height: 66cqw; border-radius: 50%;
  background: radial-gradient(circle, rgba(247,197,72,.22), transparent 68%);
}

/* pips 2–10 */
.tc-pips { position: relative; width: 100%; height: 100%; --ps: 18cqw; }
.tc-pips-lg { --ps: 25cqw; }
.tc-pips-md { --ps: 21cqw; }
.tc-pips i { position: absolute; width: var(--ps); height: var(--ps); transform: translate(-50%, -50%); }
.tc-pips svg { width: 100%; height: 100%; }

/* court */
.tc-court { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1cqw; position: relative; }
.tc-crown { width: 30cqw; height: 30cqw; }
.tc-court > .tr-si { width: 42cqw; height: 42cqw; }
.tc-title {
  margin-top: 1cqw; min-width: 14cqw; padding: .5cqw 3cqw; border-radius: 99px; text-align: center;
  font-family: var(--font-head); font-size: max(8px, 9cqw); line-height: 1.3; font-weight: 500; color: #2a1d05;
  background: var(--tr-foil); box-shadow: 0 0 3cqw rgba(247,197,72,.4);
}

/* names */
.tc-names {
  position: absolute; left: 7%; right: 7%; bottom: 7%; text-align: center;
  padding-top: 2.5cqw; border-top: 1px solid rgba(247,197,72,.35);
}
.tc-th {
  display: block; font-family: var(--font-head); font-weight: 500; font-size: max(9px, 10.5cqw); line-height: 1.25;
  background: var(--tr-foil); -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tc-en {
  display: block; font-size: max(7px, 6.6cqw); line-height: 1.3; letter-spacing: .03em; color: var(--silver-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* =====================================================================
   STEP 1 — spreads & options
   ===================================================================== */
.tr-spreads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
@media (max-width: 760px) { .tr-spreads { grid-template-columns: 1fr; gap: 12px; } }
.tr-spread {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; cursor: pointer;
  padding: 22px 16px 18px; border-radius: var(--radius); color: var(--text);
  background: linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s, box-shadow .2s, background .2s;
  font: inherit;
}
.tr-spread:hover { transform: translateY(-3px); border-color: var(--border-2); }
.tr-spread:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
.tr-spread.active {
  border-color: var(--gold); background: linear-gradient(160deg, rgba(247,197,72,.12), rgba(168,85,247,.08));
  box-shadow: 0 0 0 1px var(--gold), var(--shadow-gold), var(--shadow);
}
.tr-spread-vis { display: flex; justify-content: center; gap: 5px; height: 60px; align-items: flex-end; margin-bottom: 6px; }
.tr-spread-vis .tback { width: 34px; height: 57px; border-radius: 5px; transition: transform .3s; }
.tr-spread-vis .tback:nth-child(odd) { transform: translateY(-3px); }
.tr-spread.active .tr-spread-vis .tback { box-shadow: inset 0 0 0 2px #14082a, inset 0 0 0 3px rgba(247,197,72,.75), 0 0 16px rgba(247,197,72,.35); }
.tr-spread-name { font-family: var(--font-head); font-size: 1.25rem; font-weight: 500; }
.tr-spread.active .tr-spread-name { color: var(--gold-2); }
.tr-spread-sub { font-family: var(--font-head); color: var(--gold); font-size: .95rem; }
.tr-spread-pos { font-size: .88rem; color: var(--text-3); line-height: 1.5; }
@media (max-width: 760px) {
  .tr-spread { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; text-align: left; align-items: center; column-gap: 14px; row-gap: 2px; padding: 14px 16px; }
  .tr-spread-vis { grid-row: 1 / 4; margin: 0; height: 48px; width: 92px; gap: 3px; }
  .tr-spread-vis .tback { width: 22px; height: 37px; border-radius: 4px; }
  .tr-spread-name { font-size: 1.1rem; }
}

.tr-options { display: flex; flex-direction: column; gap: 14px; }
.tr-opt-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tr-opt-label { font-family: var(--font-head); font-size: .9rem; color: var(--text-2); }
.tr-focus { flex-wrap: wrap; max-width: 100%; }
@media (max-width: 480px) {
  .tr-opt-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .tr-focus { display: grid; grid-template-columns: repeat(4, 1fr); border-radius: 16px; }
  .tr-focus button { padding: 8px 4px; font-size: .88rem; }
}
.tr-q-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: -8px; }
.tr-go { justify-content: center; margin-top: 4px; }

/* =====================================================================
   STEP 2 — shuffle & fan
   ===================================================================== */
.tr-stage { --fw: 84px; position: relative; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
@media (max-width: 560px) { .tr-stage { --fw: 58px; } }
.tr-deck { perspective: 700px; position: relative; width: calc(var(--fw) * 1.25); height: calc(var(--fw) * 2.08); margin: 20px auto; }
.tr-deck .tback { position: absolute; inset: 0; transform: translate(calc(var(--o) * -1), calc(var(--o) * -1)); }
.tr-deck.shuffling .tback { animation: trRiffle .62s cubic-bezier(.45,.05,.35,1) calc(var(--i) * 45ms) 2 both; }
@keyframes trRiffle {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  30% { transform: translate(calc(var(--s) * 78%), -8%) rotate(calc(var(--s) * 16deg)) rotateY(calc(var(--s) * 38deg)); }
  62% { transform: translate(calc(var(--s) * -14%), 2%) rotate(calc(var(--s) * -5deg)); }
}
.tr-deck.shuffling { filter: drop-shadow(0 0 22px rgba(168,85,247,.55)) drop-shadow(0 0 10px rgba(247,197,72,.35)); }

.tr-fan { width: 100%; }
.tr-fan-row { position: relative; width: 100%; }
.tr-fan-row + .tr-fan-row { margin-top: -10px; }
.tr-fan-card {
  position: absolute; left: 50%; width: var(--fw); height: calc(var(--fw) * 5 / 3); margin-left: calc(var(--fw) / -2);
  padding: 0; border: 0; background: none; cursor: pointer; border-radius: 9px;
  transform-origin: 50% var(--R, 300px);
  transform: rotate(calc(var(--a, 0) * 1deg));
  transition: transform .42s cubic-bezier(.2,.8,.2,1), opacity .4s ease, filter .3s ease;
  -webkit-tap-highlight-color: transparent;
}
.tr-fan-card .tback { width: 100%; height: 100%; border-radius: inherit; transition: box-shadow .3s; }
.tr-fan.dealing .tr-fan-card { transform: rotate(0deg) translateY(40px) scale(.9); opacity: 0; transition: none; }
.tr-fan.dealing-go .tr-fan-card { transition-delay: calc(var(--i) * 28ms); }
@media (hover: hover) {
  .tr-fan.ready:not(.complete) .tr-fan-card:not(.picked):hover { transform: rotate(calc(var(--a, 0) * 1deg)) translateY(-12px); }
  .tr-fan.ready:not(.complete) .tr-fan-card:not(.picked):hover .tback { box-shadow: inset 0 0 0 3px #14082a, inset 0 0 0 4px rgba(247,197,72,.9), 0 0 16px rgba(247,197,72,.35); }
}
.tr-fan-card:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.tr-fan-card.picked { transform: rotate(calc(var(--a, 0) * 1deg)) translateY(-30px); z-index: 40; }
.tr-fan-card.picked .tback {
  box-shadow: inset 0 0 0 3px #14082a, inset 0 0 0 4px var(--gold-2), 0 0 0 2px var(--gold-2), 0 0 26px 6px rgba(247,197,72,.55);
  animation: trGlow 1.5s ease-in-out infinite alternate;
}
@keyframes trGlow { to { box-shadow: inset 0 0 0 3px #14082a, inset 0 0 0 4px var(--gold-2), 0 0 0 2px var(--gold-2), 0 0 38px 10px rgba(247,197,72,.7); } }
.tr-pick-no {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%); min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px;
  display: none; place-items: center; font-family: var(--font-head); font-size: .78rem; font-weight: 600; color: #2a1d05;
  background: linear-gradient(135deg, var(--gold-2), var(--gold-3)); box-shadow: 0 0 10px rgba(247,197,72,.6);
}
.tr-fan-card.picked .tr-pick-no { display: grid; }
.tr-fan.complete .tr-fan-card:not(.picked) { opacity: .3; filter: grayscale(.5); cursor: default; }

.tr-pickbar { display: flex; align-items: center; justify-content: center; gap: 10px 14px; flex-wrap: wrap; margin-top: 16px; min-height: 32px; text-align: center; }
.tr-counter { font-size: .95rem; padding: 6px 14px; }
.tr-hint { color: var(--text-2); font-family: var(--font-head); font-size: .95rem; }

/* =====================================================================
   STEP 3 — flip & result
   ===================================================================== */
.tr-rhead { text-align: center; }
.tr-rhead h2 { margin: 8px 0 12px; }
.tr-rhead h2 .gradient-text { display: inline-block; font-size: .8em; }
.tr-rmeta { justify-content: center; }
.tr-rq {
  margin: 16px auto 0; max-width: 620px; font-family: var(--font-head); font-size: 1.1rem; color: var(--text);
  overflow-wrap: anywhere;
}

.tr-spread-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 26px 22px; margin: 34px 0 30px; }
@media (max-width: 640px) { .tr-spread-row { gap: 18px 12px; } }
.tr-slot { display: flex; flex-direction: column; align-items: center; gap: 10px; width: var(--tr-cw); }
.tr-slot-label {
  font-family: var(--font-head); font-size: .9rem; color: var(--gold-2); text-align: center; line-height: 1.25; min-height: 2.5em;
  display: flex; align-items: flex-end;
}
@media (max-width: 640px) { .tr-slot-label { font-size: .78rem; } }

.tcard { width: var(--tr-cw); aspect-ratio: 3 / 5; perspective: 1100px; --rx: 0deg; --ry: 0deg; transition: transform .18s ease-out; }
.tcard.flipped { transform: rotateX(var(--rx)) rotateY(var(--ry)); }
.tcard-inner {
  position: relative; width: 100%; height: 100%; transform-style: preserve-3d;
  transform: rotateY(0deg) rotateZ(0deg);
  transition: transform .95s cubic-bezier(.3,.75,.25,1);
}
.tcard.flipped .tcard-inner { transform: rotateY(180deg) rotateZ(0deg); }
.tcard.flipped.rev .tcard-inner { transform: rotateY(180deg) rotateZ(180deg); }
.tside { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.tside.tback, .tside.tface { width: 100%; height: 100%; aspect-ratio: auto; }
.tside.tface { transform: rotateY(180deg); transition: box-shadow .6s ease .5s; }
.tcard.flipped .tside.tface {
  box-shadow: inset 0 0 0 3px #14082a, inset 0 0 0 4px rgba(247,197,72,.55), inset 0 0 28px rgba(247,197,72,.12),
    0 0 34px -4px rgba(247,197,72,.45), 0 14px 30px -12px rgba(0,0,0,.9);
}

.tr-details, .tr-summary { transition: opacity .6s ease, transform .6s ease; }
.tr-details.pending, .tr-summary.pending { opacity: 0; transform: translateY(14px); }
.tr-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 18px; margin-bottom: 18px; }
.tr-details .card + .card { margin-top: 0; }
.tr-detail { display: flex; flex-direction: column; }
.tr-detail-head .eyebrow { font-size: .78rem; }
.tr-pos-hint { margin: 2px 0 8px; font-size: .85rem; color: var(--text-3); }
.tr-detail h3 { display: block; margin: 0 0 10px; font-size: 1.25rem; color: var(--gold-2); }
.tr-detail h3 small { display: block; font-size: .8rem; color: var(--silver-2); font-family: var(--font-body); letter-spacing: .03em; }
.tr-kw { margin: 12px 0 4px; }
.tr-kw .chip { font-size: .8rem; padding: 3px 10px; }
.tr-mhead { margin: 14px 0 4px; font-size: .95rem; color: var(--red-2); font-weight: 400; }
.tr-meaning { color: var(--text); line-height: 1.8; }
.tr-general { font-size: .92rem; color: var(--text-2); }
.tr-general b { color: var(--text-3); font-weight: 500; font-family: var(--font-head); }
.tr-detail .callout { margin-top: auto; margin-bottom: 0; font-size: .95rem; }

.tr-summary h3 { justify-content: center; margin-bottom: 16px; }
.tr-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; text-align: center; }
@media (max-width: 420px) { .tr-tiles { gap: 8px; } .tr-tiles .info-tile { padding: 10px 6px; } }
.tr-bars { margin: 8px 0 4px; }
.tr-bars .bar-row { grid-template-columns: minmax(120px, 190px) 1fr 30px; }
.tr-bars .bar-row small { color: var(--text-3); font-size: .78rem; }
@media (max-width: 480px) { .tr-bars .bar-row { grid-template-columns: 96px 1fr 22px; font-size: .88rem; gap: 8px; } .tr-bars .bar-row small { display: none; } }
.tr-si-inline { width: 1.1em; height: 1.1em; vertical-align: -.18em; }
.tr-answer {
  text-align: center; padding: 18px 16px; margin: 0 auto 18px; max-width: 520px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: radial-gradient(circle at 50% 0, rgba(247,197,72,.16), transparent 70%);
}
.tr-answer .lbl { display: block; font-family: var(--font-head); font-size: .85rem; letter-spacing: .15em; color: var(--text-3); }
.tr-answer b {
  display: block; font-family: var(--font-head); font-size: 2.6rem; font-weight: 500; line-height: 1.2;
  background: var(--tr-foil); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tr-answer.tr-ans-no b { background: linear-gradient(120deg, #e6d8ff, var(--red-2)); -webkit-background-clip: text; background-clip: text; }
.tr-answer.tr-ans-maybe b { background: linear-gradient(120deg, #eef0f6, var(--silver)); -webkit-background-clip: text; background-clip: text; }
.tr-answer p { margin: 4px 0 0; color: var(--text-2); }

/* =====================================================================
   LIBRARY (78 cards)
   ===================================================================== */
.tr-lib-tools { display: flex; gap: 12px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 10px; }
.tr-filters .chip { cursor: pointer; font-size: .9rem; padding: 6px 14px; transition: color .2s, border-color .2s, background .2s; }
.tr-filters .chip:hover { color: var(--text); border-color: var(--border-2); }
.tr-filters .chip.active { color: #2a1d05; border-color: transparent; background: linear-gradient(135deg, var(--gold-2), var(--gold-3)); }
.tr-search { max-width: 300px; }
@media (max-width: 720px) { .tr-search { max-width: none; } }
.tr-lib-count { margin: 0 0 14px; }
.tr-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 14px; }
@media (max-width: 480px) { .tr-lib-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; } }
.tr-lib-card {
  display: block; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 9px; font: inherit;
  transition: transform .22s ease, filter .22s ease;
}
.tr-lib-card:hover { transform: translateY(-4px); filter: drop-shadow(0 8px 18px rgba(247,197,72,.25)); }
.tr-lib-card:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 3px; }
.tr-lib-card .tface { width: 100%; }
.tr-empty { grid-column: 1 / -1; text-align: center; padding: 30px 0; }

/* Modal */
.tr-modal {
  width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 26px; margin: auto;
  color: var(--text); background: linear-gradient(170deg, #1d0f36, #0d0618); border: 1px solid var(--border-2);
  border-radius: var(--radius); box-shadow: 0 30px 80px -20px rgba(0,0,0,.9), var(--shadow-gold); overflow-y: auto;
}
.tr-modal::backdrop { background: rgba(7,3,15, .78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.tr-modal[open] { animation: fadeUp .3s ease both; }
.tr-modal-close {
  position: sticky; top: 0; float: right; margin: -10px -10px 0 0; z-index: 2; width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text-2); font-size: 1rem;
}
.tr-modal-close:hover { color: var(--gold-2); border-color: var(--border-2); }
.tr-m-top { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: center; margin-bottom: 14px; }
.tr-m-advice { margin: 0 0 18px; }
.tr-m-face { width: 150px; }
.tr-m-info h3 { margin: 6px 0 0; font-size: 1.6rem; color: var(--gold-2); display: block; }
.tr-m-en { margin: 0 0 10px; }
.tr-m-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tr-m-side { padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); }
.tr-m-side h4 { margin: 0 0 10px; font-size: 1.05rem; }
.tr-m-up h4 { color: var(--gold-2); }
.tr-m-rev h4 { color: var(--red-2); }
.tr-m-side .chips { margin-bottom: 10px; }
.tr-m-side .chip { font-size: .8rem; padding: 3px 10px; }
.tr-m-side p { font-size: .95rem; }
.tr-m-side .kv { font-size: .9rem; }
@media (max-width: 640px) {
  .tr-modal { padding: 18px 16px; }
  .tr-m-top { grid-template-columns: 96px 1fr; gap: 14px; }
  .tr-m-face { width: 96px; }
  .tr-m-info h3 { font-size: 1.3rem; }
  .tr-m-sides { grid-template-columns: 1fr; }
  .tr-m-side .kv { grid-template-columns: 1fr; gap: 2px; }
  .tr-m-side .kv dd { margin-bottom: 8px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .tr-deck.shuffling .tback, .tr-fan-card.picked .tback { animation: none; }
  .tcard-inner, .tr-fan-card, .tr-details, .tr-summary { transition: none; }
}


/* =====================================================================
   รีสกิน duduangfree.buzz : hero / โหมด / ถามด่วน Yes-No
   ===================================================================== */
.tr-hero { position: relative; }
.tr-lanterns { display: flex; justify-content: center; gap: clamp(18px, 8vw, 90px); margin-bottom: -6px; pointer-events: none; }
.tr-lanterns .lantern:nth-child(2) { margin-top: 10px; }

.tr-modes { display: flex; width: fit-content; max-width: 100%; margin: 0 auto 26px; flex-wrap: wrap; justify-content: center; border-radius: 22px; }
.tr-modes button { font-size: .98rem; }
.tr-modepane { animation: fadeUp .4s ease both; }

.tq-box { max-width: 820px; margin: 0 auto 20px; }
.tq-box .section-title { margin-bottom: 14px; }
.tq-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 18px; }
.tq-chip {
  display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer; font: inherit; font-family: var(--font-head); font-size: .98rem;
  padding: 11px 14px; border-radius: 12px; color: var(--text);
  background: linear-gradient(160deg, rgba(168,85,247,.1), rgba(0,0,0,.25)); border: 1px solid var(--border);
  transition: transform .18s, border-color .18s, box-shadow .18s, background .18s; -webkit-tap-highlight-color: transparent;
}
.tq-chip:hover { transform: translateY(-2px); border-color: var(--red); box-shadow: 0 0 18px -6px var(--red); }
.tq-chip:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.tq-chip.active { border-color: var(--gold); background: linear-gradient(160deg, rgba(247,197,72,.16), rgba(168,85,247,.12)); box-shadow: 0 0 20px -6px var(--gold); }
.tq-ico { font-size: 1.3rem; flex: none; }
.tq-field { margin-bottom: 8px; }

.tq-stage { --fw: 84px; --tr-cw: 150px; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; }
.tq-deck { margin: 14px auto; }
.tq-flip { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 12px; -webkit-tap-highlight-color: transparent; animation: tqBob 2.6s ease-in-out infinite; }
.tq-flip:has(.flipped) { animation: none; cursor: default; }
.tq-flip:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 6px; }
.tq-flip .tcard { --tr-cw: 160px; margin: 0 auto; }
.tq-flip .tcard:not(.flipped) .tback { box-shadow: inset 0 0 0 3px #14082a, inset 0 0 0 4px var(--gold-2), 0 0 28px 2px rgba(168,85,247,.55); }
@keyframes tqBob { 50% { transform: translateY(-8px); } }
.tq-hint { margin: 4px 0 0; min-height: 1.4em; text-align: center; }
.tq-go-row { justify-content: center; margin-top: 10px; }

.tq-result { max-width: 820px; margin: 0 auto; text-align: center; }
.tq-q { margin: 6px auto 10px; font-family: var(--font-head); font-size: 1.1rem; color: var(--text-2); overflow-wrap: anywhere; }
.tq-sign-wrap { display: flex; justify-content: center; margin: 4px 0 6px; }
.tq-sign {
  display: inline-block; padding: 8px 34px 12px; border-radius: 16px; font-family: var(--font-head); font-weight: 600; font-size: clamp(2.6rem, 11vw, 4.2rem); line-height: 1.25;
  border: 3px solid currentColor; background: rgba(0,0,0,.35);
  animation: tqSlam .6s cubic-bezier(.2,1.6,.4,1) both;
}
@keyframes tqSlam { from { opacity: 0; transform: scale(2.2) rotate(-6deg); } 60% { transform: scale(.94) rotate(1deg); } }
.tq-r-yes .tq-sign { color: #fff4d0; border-color: var(--gold); text-shadow: 0 0 8px var(--gold), 0 0 24px var(--gold); box-shadow: 0 0 26px -2px var(--gold), inset 0 0 20px -6px var(--gold); }
.tq-r-no .tq-sign { color: #efe6ff; border-color: var(--red); text-shadow: 0 0 8px var(--red), 0 0 24px var(--red); box-shadow: 0 0 26px -2px var(--red), inset 0 0 20px -6px var(--red); }
.tq-r-maybe .tq-sign { color: #ffe8cf; border-color: var(--ember); text-shadow: 0 0 8px var(--ember), 0 0 22px var(--ember); box-shadow: 0 0 26px -2px var(--ember), inset 0 0 20px -6px var(--ember); }
.tq-quip { margin: 0 0 14px; font-family: var(--font-head); font-size: 1.15rem; color: var(--gold-2); }
.tq-meter { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; max-width: 440px; margin: 0 auto 16px; font-family: var(--font-head); font-size: .85rem; color: var(--text-3); }
.tq-track { position: relative; height: 10px; border-radius: 99px; background: linear-gradient(90deg, var(--red), #3a1470 45%, #3a1470 55%, var(--gold)); box-shadow: inset 0 0 6px rgba(0,0,0,.6); }
.tq-needle { --v: 50; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #fff; border: 3px solid var(--gold);
  box-shadow: 0 0 12px var(--gold); transition: left 1.1s cubic-bezier(.2,.9,.25,1.1); }
.tq-needle.go { left: calc(var(--v) * 1%); }
.tq-cardline { margin: 4px 0 8px; font-size: 1.05rem; color: var(--text); }
.tq-cardline b { color: var(--gold-2); font-family: var(--font-head); font-weight: 500; }
.tq-cardline small { color: var(--silver-2); }
.tq-kw { justify-content: center; margin-bottom: 10px; }
.tq-kw .chip { font-size: .8rem; padding: 3px 10px; }
.tq-text { margin: 0 auto 14px; max-width: 560px; color: var(--text-2); line-height: 1.75; min-height: 3.4em; }
.tq-result .callout { text-align: left; margin-bottom: 14px; }
.tq-result .actions { justify-content: center; }
@media (max-width: 560px) {
  .tq-presets { grid-template-columns: 1fr; gap: 8px; }
  .tq-stage { --tr-cw: 126px; }
  .tq-flip .tcard { --tr-cw: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  .tq-flip, .tq-sign { animation: none; }
  .tq-needle { transition: none; }
  .tcard { transition: none; }
}
@media (max-width: 480px) {
  .tr-modes { display: grid; grid-template-columns: 1fr 1fr; width: 100%; border-radius: 16px; }
  .tr-modes button { font-size: .85rem; padding: 10px 6px; }
}
