/* ---------- TRAC Tarot and Palmistry (inside the site shell; uses the shop tokens and buttons) ---------- */
@import url("trac-shop.css");

.tt-hero { background: radial-gradient(circle at 85% 20%, rgba(201,162,39,.4), transparent 42%), linear-gradient(135deg, #14254D 0%, #2B2F6B 55%, #4B2A6B 100%); }
.tt-step { color: var(--sp-navy); font-size: 1.05rem; margin: 1.4rem 0 .6rem; }
.tt-form { margin-top: .4rem; }
.tt-spreads { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; }
.tt-spread { position: relative; display: flex; flex-direction: column; gap: .25rem; padding: .8rem .9rem; border: 1.5px solid var(--sp-line); border-radius: 14px;
  background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.tt-spread input { position: absolute; opacity: 0; pointer-events: none; }
.tt-spread b { color: var(--sp-navy); }
.tt-spread b small { color: var(--sp-muted); font-weight: 500; margin-left: .3rem; }
.tt-spread span { color: var(--sp-muted); font-size: .86rem; line-height: 1.35; }
.tt-spread em { align-self: flex-start; margin-top: .2rem; font-style: normal; font-size: .7rem; font-weight: 700; color: var(--sp-org); background: var(--sp-peach); padding: .1rem .45rem; border-radius: 999px; }
.tt-spread.is-on { border-color: var(--sp-org); box-shadow: 0 0 0 3px rgba(232,101,10,.12); }
.tt-spread.is-locked { background: #FAFAFA; }
.tt-q input { width: 100%; box-sizing: border-box; padding: .75rem .9rem; border: 1.5px solid #D7DCE6; border-radius: 12px; font: inherit; color: var(--sp-ink); }
.tt-q input:focus { outline: none; border-color: var(--sp-org); }
.tt-hint { color: var(--sp-muted); font-size: .85rem; margin: .4rem 0 0; }
.tt-more { margin: 1rem 0 0; color: var(--sp-ink); }
.tt-more summary { cursor: pointer; color: var(--sp-navy); font-weight: 600; }
.tt-check { display: flex; gap: .5rem; align-items: center; margin: .6rem 0 0; }
.tt-go { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 1.2rem 0 .4rem; }
.tt-status { color: var(--sp-muted); font-size: .92rem; }

/* the table */
.tt-board { --cw: min(124px, calc((100vw - 56px) / (var(--cols, 3) + .7))); --ch: calc(var(--cw) * 1.7); --gap: 14px;
  position: relative; margin: 1rem auto 0; width: calc(var(--cols, 1) * (var(--cw) + var(--gap)));
  height: calc(var(--rows, 1) * (var(--ch) + 48px)); max-width: 100%; }
.tt-board:empty { height: 0; }
.tt-card { position: absolute; left: calc(var(--x) * (var(--cw) + var(--gap))); top: calc(var(--y) * (var(--ch) + 48px)); width: var(--cw);
  padding: 0; border: 0; background: none; cursor: pointer; perspective: 900px; opacity: 0; transform: translateY(-30px);
  animation: tt-deal .45s ease-out forwards; animation-delay: var(--d); font: inherit; text-align: center; }
.tt-card.is-turned { z-index: 2; }
.tt-card.is-turned .tt-in { transform: rotate(90deg) scale(.92); }
.tt-card.is-turned.is-open .tt-in { transform: rotate(90deg) scale(.92) rotateY(180deg); }
.tt-card.is-turned .tt-cap, .tt-card.is-turned.is-open .tt-cap span { visibility: hidden; }
.tt-in { position: relative; display: block; width: var(--cw); height: var(--ch); transform-style: preserve-3d; transition: transform .7s cubic-bezier(.3,.7,.3,1); }
.tt-card.is-open .tt-in { transform: rotateY(180deg); }
.tt-back, .tt-front { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 10px;
  box-shadow: 0 6px 16px rgba(20,37,77,.22); }
.tt-front { transform: rotateY(180deg); }
.tt-front.is-rev .tt-svg { transform: rotate(180deg); }
.tt-svg { display: block; width: 100%; height: 100%; }
.tt-cap { display: flex; flex-direction: column; margin-top: 6px; font-size: .74rem; line-height: 1.2; color: var(--sp-muted); }
.tt-cap b { color: var(--sp-navy); font-size: .78rem; }
.tt-cap span { visibility: hidden; }
.tt-card.is-open .tt-cap span { visibility: visible; }
.tt-card:hover .tt-back { box-shadow: 0 0 0 3px rgba(201,162,39,.6), 0 8px 18px rgba(20,37,77,.25); }
@keyframes tt-deal { to { opacity: 1; transform: none; } }

.tt-board.is-shuffling { --cols: 3; --rows: 1; height: 210px; }
.tt-shuf { position: absolute; left: 50%; top: 10px; width: 110px; height: 187px; margin-left: -55px; animation: tt-shuf .65s ease-in-out infinite alternate;
  animation-delay: calc(var(--k) * -90ms); }
@keyframes tt-shuf { from { transform: translateX(calc(-60px + var(--k) * 4px)) rotate(-6deg); } to { transform: translateX(calc(60px - var(--k) * 4px)) rotate(6deg); } }

/* one card close up */
.tt-pop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(15,23,42,.55); padding: 16px; }
.tt-pop[hidden] { display: none; }
.tt-pop > * { background: #fff; }
.tt-pop { grid-template-columns: 1fr; }
.tt-pop-card { width: 150px; margin: 0 auto; }
.tt-pop-card.is-rev .tt-svg { transform: rotate(180deg); }
.tt-pop > div:last-child { max-width: 460px; padding: 1rem 1.2rem; border-radius: 16px; color: var(--sp-ink); }
.tt-pop > .tt-pop-card { background: none; }
.tt-pop h3 { margin: 0 0 .3rem; color: var(--sp-navy); }
.tt-pop small { color: var(--sp-org); font-size: .8rem; }

/* the reading */
.tt-reading { margin-top: 1.5rem; padding: 1.2rem 1.4rem; border: 1px solid var(--sp-line); border-radius: 18px; background: #fff; }
.tt-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.tt-head h2 { margin: 0; flex: 1 1 260px; }
.tt-badge { font-size: .74rem; font-weight: 700; color: #fff; background: var(--sp-navy); padding: .2rem .6rem; border-radius: 999px; }
.tt-tools { display: flex; gap: .4rem; }
.tt-tools .sp-btn { padding: .4rem .8rem; font-size: .85rem; }
.tt-text { color: var(--sp-ink); line-height: 1.6; }
.tt-text h2 { font-size: 1.1rem; margin: 1.3rem 0 .4rem; }
.tt-text ul { padding-left: 1.2rem; }
.tt-text li { margin: .35rem 0; }
.tt-kw { color: var(--sp-org-d); font-weight: 600; font-size: .86rem; margin: .1rem 0 .5rem; }
.tt-meta { color: var(--sp-muted); font-size: .8rem; }
.tt-plans { margin-top: 1.4rem; padding: .9rem 1.1rem; border-radius: 14px; background: var(--sp-peach); color: var(--sp-ink); font-size: .9rem; line-height: 1.55; }
.tt-plans a { color: var(--sp-org-d); font-weight: 700; }
.tt-foot { color: var(--sp-muted); font-size: .8rem; margin-top: 1rem; }

/* the card library */
.tt-jump { display: flex; flex-wrap: wrap; gap: .4rem; margin: .4rem 0 1rem; }
.tt-jump a { padding: .35rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--sp-line); text-decoration: none; color: var(--sp-navy); font-weight: 600; font-size: .88rem; }
.tt-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .9rem; }
.tt-libcard { display: grid; grid-template-columns: 96px 1fr; gap: .9rem; padding: .9rem; background: #fff; border: 1px solid var(--sp-line); border-radius: 16px; }
.tt-libcard h3 { margin: 0; color: var(--sp-navy); font-size: 1rem; }
.tt-libcard p { margin: .3rem 0; font-size: .88rem; line-height: 1.45; }
.tt-libcard details summary { cursor: pointer; color: var(--sp-org-d); font-size: .85rem; font-weight: 600; }
.tt-libimg { width: 96px; height: 163px; }

@media print {
  .tt-form, .tt-hero, .tt-plans, .side-nav, .tt-tools, .tt-pop { display: none !important; }
  .tt-card { opacity: 1; transform: none; animation: none; }
}
@media (max-width: 560px) {
  .tt-reading { padding: 1rem; }
  .tt-libcard { grid-template-columns: 72px 1fr; }
  .tt-libimg { width: 72px; height: 122px; }
}

/* ---------- Palmistry ---------- */
.pm-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.2rem; margin-top: 1rem; align-items: start; }
.pm-stagebox { position: sticky; top: 1rem; background: #fff; border: 1px solid var(--sp-line); border-radius: 18px; padding: .6rem; }
.pm-svg { display: block; width: 100%; max-height: 78vh; touch-action: none; user-select: none; background: #FFFBF6; border-radius: 12px; }
.pm-svg .pm-handle { cursor: grab; }
.pm-svg .pm-line { cursor: pointer; }
.pm-panel .tt-step:first-child { margin-top: 0; }
.pm-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .5rem 0; }
.pm-row select, .pm-opts select { font: inherit; padding: .35rem .5rem; border: 1px solid #D7DCE6; border-radius: 8px; color: var(--sp-ink); background: #fff; }
.pm-file { cursor: pointer; }
.pm-lines { display: grid; gap: .35rem; }
.pm-line { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .35rem .55rem; border: 1px solid var(--sp-line); border-radius: 10px; background: #fff; }
.pm-line.is-off { opacity: .6; }
.pm-lname { display: flex; align-items: center; gap: .4rem; flex: 1 1 160px; font-weight: 600; color: var(--sp-navy); }
.pm-lname i, .pm-legend i { display: inline-block; width: 18px; height: 4px; border-radius: 2px; }
.pm-line select { font: inherit; font-size: .85rem; padding: .2rem .4rem; border: 1px solid #D7DCE6; border-radius: 6px; }
.pm-line details summary { cursor: pointer; font-size: .82rem; color: var(--sp-org-d); }
.pm-tools { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .4rem 0; }
.pm-tl { font-size: .82rem; color: var(--sp-muted); width: 100%; }
.pm-tools button { font: inherit; font-size: .84rem; padding: .32rem .7rem; border-radius: 999px; border: 1px solid #D7DCE6; background: #fff; color: var(--sp-ink); cursor: pointer; }
.pm-tools button.is-on { background: var(--sp-org); border-color: var(--sp-org); color: #fff; }
.pm-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .5rem .8rem; margin: .5rem 0; font-size: .88rem; }
.pm-opts label { display: flex; flex-direction: column; gap: .25rem; color: var(--sp-ink); }
.pm-opts label.tt-check { flex-direction: row; }
.pm-wait { color: var(--sp-muted); }
.pm-res { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 1.2rem; margin-top: .6rem; }
.pm-chart { display: block; width: 100%; max-height: 80vh; }
.pm-legend { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .8rem; color: var(--sp-muted); margin: .5rem 0; }
.pm-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.pm-table { width: 100%; border-collapse: collapse; font-size: .86rem; margin-top: .4rem; }
.pm-table th { text-align: left; color: var(--sp-navy); border-bottom: 1px solid var(--sp-line); padding: .3rem; }
.pm-table td { padding: .28rem .3rem; border-bottom: 1px solid #F3EEE8; white-space: nowrap; }
.pm-bar { display: inline-block; width: 70px; height: 8px; border-radius: 4px; background: #F3EEE8; margin-right: .4rem; vertical-align: middle; overflow: hidden; }
.pm-bar b { display: block; height: 100%; }
@media (max-width: 860px) {
  .pm-grid, .pm-res { grid-template-columns: 1fr; }
  .pm-stagebox { position: static; }
}
@media print { .pm-panel, .pm-stagebox { display: none !important; } }


/* ---------- Palmistry: the three ways to show the palm, and the camera (22 Oct) ---------- */
.pm-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; background: #F4EFE9; padding: .3rem; border-radius: 14px; margin: .4rem 0 .6rem; }
.pm-tabs button { display: flex; flex-direction: column; align-items: center; gap: .25rem; border: 0; background: transparent; border-radius: 10px; padding: .55rem .4rem;
  font: inherit; font-size: .86rem; font-weight: 600; color: #374151; cursor: pointer; text-align: center; }
.pm-tabs button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pm-tabs button.is-on { background: #fff; color: #C2410C; box-shadow: 0 2px 8px rgba(20,37,77,.10); }
.pm-pane { background: #fff; border: 1px solid var(--sp-line, #ECE6DF); border-radius: 12px; padding: .7rem .85rem; }
.pm-pane[hidden] { display: none; }
.pm-pane p { margin: 0 0 .6rem; color: #374151; font-size: .92rem; }
.pm-cam { position: fixed; inset: 0; z-index: 1000; background: #000; display: flex; flex-direction: column; }
.pm-cam[hidden] { display: none; }
.pm-cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pm-cam video.is-mirror { transform: scaleX(-1); }
.pm-cam-frame { position: absolute; inset: 0 0 110px 0; display: grid; place-items: center; pointer-events: none; }
.pm-guide { height: min(100%, calc((100vw - 24px) * 4 / 3)); aspect-ratio: 3 / 4; max-width: calc(100vw - 24px); }
.pm-guide .pm-grid-lines line { stroke: rgba(255,255,255,.28); stroke-width: 1.5; }
.pm-guide .pm-outline { fill: rgba(255,255,255,.06); stroke: #FBBF24; stroke-width: 4; stroke-dasharray: 14 9; stroke-linejoin: round; }
.pm-cam-msg { position: absolute; left: 50%; top: max(12px, env(safe-area-inset-top)); transform: translateX(-50%); width: min(92vw, 560px); margin: 0;
  background: rgba(0,0,0,.6); color: #fff; padding: .55rem .9rem; border-radius: 12px; text-align: center; font-size: .92rem; }
.pm-cam-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 110px; padding-bottom: env(safe-area-inset-bottom); display: flex; align-items: center; justify-content: space-around; background: rgba(0,0,0,.55); }
.pm-cam-btn { border: 1px solid rgba(255,255,255,.5); background: transparent; color: #fff; border-radius: 999px; padding: .55rem 1rem; font: inherit; font-size: .9rem; cursor: pointer; }
.pm-shoot { width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; background: transparent; display: grid; place-items: center; cursor: pointer; }
.pm-shoot span { width: 58px; height: 58px; border-radius: 50%; background: #fff; }
.pm-shoot:active span { background: #FBBF24; }
body.pm-cam-open { overflow: hidden; }

/* ---------- Palmistry: fitting the lines to the hand (22 Oct) ---------- */
.pm-fitbar { display: flex; align-items: center; gap: .8rem; background: #FFF7E6; border: 1px solid #F6C987; border-radius: 12px; padding: .6rem .8rem; margin: 0 0 .6rem; }
.pm-fitbar[hidden] { display: none; }
.pm-fitbar p { margin: 0; flex: 1; color: #1F2937; font-size: .92rem; }
.pm-fitbtn { margin-top: .4rem; }
.pm-fitbtn[hidden] { display: none; }
@media (max-width: 640px) { .pm-fitbar { flex-direction: column; align-items: stretch; } }
.pm-shoot:disabled { opacity: .5; }
@media (max-width: 420px) { .pm-cam-btn { padding: .45rem .6rem; font-size: .78rem; } }

/* Birth chart from the palm (owner, 7 Nov 2026): white card on grey, magenta heading, solid buttons. */
.pc { margin: 1.6rem 0; padding: 1.4rem; background: #fff; border: 1px solid #E3E3E8; border-radius: 14px; }
.pc .pc-title { margin: 0 0 .4rem; color: #A3195B !important; font-size: 1.35rem; }
.pc-lead { margin: 0 0 1rem; color: #4A4250; }
.pc-tabs { margin-bottom: 1rem; }
.pc-table { display: grid; gap: 0; border: 1px solid #E3E3E8; border-radius: 10px; overflow: hidden; margin: .6rem 0 1rem; }
.pc-r { display: grid; grid-template-columns: minmax(0, 1fr) 90px 90px; gap: .6rem; align-items: center; padding: .55rem .8rem; border-top: 1px solid #EEEEF1; }
.pc-r:first-child { border-top: 0; }
.pc-h { background: #F4F4F6; font-weight: 600; font-size: .85rem; color: #4A4250; }
.pc-r small { display: block; color: #6B6470; font-size: .8rem; margin-top: .15rem; }
.pc-r input, .pc input[type=number], .pc input[type=text] { box-sizing: border-box; width: 100%; font: inherit; padding: .4rem .5rem; border: 1px solid #D7DCE6; border-radius: 8px; background: #fff; }
.pc-more { margin: 0 0 1rem; }
.pc-more summary { cursor: pointer; color: #A3195B; font-weight: 600; }
.pc-place { position: relative; }
.pc-sugg { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; background: #fff; border: 1px solid #D7DCE6; border-radius: 8px; box-shadow: 0 6px 18px rgba(31,26,36,.12); display: flex; flex-direction: column; }
.pc-sugg button { text-align: left; padding: .45rem .6rem; border: 0; background: none; font: inherit; cursor: pointer; }
.pc-sugg button:hover { background: #FBF3F7; }
.pc-planets { align-items: start; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; margin: .6rem 0 1rem; }
.pc-planet { border: 1px solid #E3E3E8; border-radius: 10px; padding: .7rem .8rem; background: #fff; }
.pc-planet label { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.pc-planet select { font: inherit; padding: .35rem .5rem; border: 1px solid #D7DCE6; border-radius: 8px; background: #fff; }
.pc-planet details { margin-top: .5rem; }
.pc-planet summary { cursor: pointer; color: #A3195B; font-size: .9rem; font-weight: 600; }
.pc-sign { font-size: .88rem; margin: .5rem 0; }
.pc-how { border-top: 1px solid #EEEEF1; padding: .45rem 0; font-size: .85rem; }
.pc-how .sp-btn { min-height: 30px; padding: 0 .7rem; font-size: .8rem; }
.pc-how ul { margin: .35rem 0 0 1.1rem; padding: 0; color: #4A4250; }
.pc-fish { margin: .2rem 0 1rem; }
.pc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; margin: 1rem 0; }
.pc-house { border: 1px solid #E3E3E8; border-radius: 8px; padding: .4rem .5rem; background: #F4F4F6; min-height: 54px; }
.pc-house span { display: block; font-size: .72rem; color: #8A6A10; font-weight: 600; }
.pc-house b { font-size: .85rem; color: #1F1A24; font-weight: 600; }
@media (max-width: 560px) { .pc { padding: .8rem; } .pc .tt-reading { padding: .4rem 0 0; border: 0; } .pc-r small { font-size: .75rem; } .pc-r { grid-template-columns: minmax(0, 1fr) 64px 64px; padding: .5rem; } .pc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
