:root {
  --bg: #080808;
  --bg-soft: #111;
  --card-border: #c79c3b;
  --text-main: #f7f0d5;
  --text-muted: #c6b892;
  --accent: #e0b94a;
  --danger: #ff6060;
  --shadow-soft: 0 10px 25px rgba(0,0,0,0.5);
  --font-main: "Prompt", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}


body {
  
  margin: 0;
  font-family: var(--font-main);
  background: radial-gradient(circle at top, #2a2215 0%, #050505 55%, #000 100%);
  color: var(--text-main);
}

/* THEME SWITCH (ถ้าอยากทำธีมอื่นเพิ่มค่อยต่อยอดได้) */
body.theme-vintage {
  --bg: #f4f0e5;
  --bg-soft: #e1d8c8;
  --card-border: #8a5a2c;
  --text-main: #2b1c0f;
  --text-muted: #7a5b3c;
  --accent: #c4853a;
  background: radial-gradient(circle at top, #f8f2e4 0%, #e3d8c7 80%);
  color: var(--text-main);
}
h1, h2.section-title, .result-title, .pickTitle {
  font-family: "Cormorant Garamond", serif;
  letter-spacing: 0.04em;
}

/* LAYOUT */

#app {
  max-width: 100%;
  /* background: url("images/celtic_cross_bg.jpg") center/cover no-repeat; */
  margin: 0 auto;
  padding-bottom: 40px;
}
.navbar {
    background: #e8d9c5;
    border-bottom: 1px solid rgba(150, 110, 60, 0.7);
}


.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(0,0,0,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: sticky;
  top: 0;
  z-index: 50;
}

body.theme-vintage .topbar {
    background: linear-gradient(
        180deg,
        #171312 0%,
        #191411 60%,
        rgba(23, 19, 18, 0.85) 100%
    );
    border-bottom: 1px solid rgba(255, 205, 140, 0.4);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.logo-text-wrap {
  display: flex;
  flex-direction: column;
}

.logo-main {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f7f0d5;
}

.logo-dot {
  color: var(--accent);
}

.logo-tagline {
  font-size: 11px;
  color: var(--text-muted);
}


.controls {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 14px;
}

.controls select {
  padding: 4px 8px;
}

button {
  font-family: inherit;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: transparent;
  padding: 6px 14px;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.15s ease-out;
}

button:hover {
  background: var(--accent);
  color: #000;
}

.btn-primary {
  font-size: 18px;
  padding: 10px 26px;
  margin-top: 20px;
}

.screen {
  padding: 24px 20px;
}

.center {
  text-align: center;
}

.hidden {
  display: none !important;
}

.toggle span {
  margin-left: 4px;
}

/* SHUFFLE ANIMATION */

/* กองไพ่ตอนสับแบบหมุนวน */
.shuffle-deck {
  width: 180px;
  height: 250px;
  margin: 40px auto 10px;
  position: relative;
}

/* ไพ่แต่ละใบในกอง */
.shuffle-deck img {
  position: absolute;
  width: 160px;
  height: 230px;
  left: 10px;
  top: 10px;
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.55);
  transition: top 0.18s ease-out,
              left 0.18s ease-out,
              transform 0.18s ease-out;
}


@keyframes shuffle {
  0%   { transform: translateX(0) rotate(0deg); }
  25%  { transform: translateX(-8px) rotate(-4deg); }
  50%  { transform: translateX(8px) rotate(4deg); }
  75%  { transform: translateX(-4px) rotate(-2deg); }
  100% { transform: translateX(0) rotate(0deg); }
}

/* วงไพ่ */

#circleArea {
  width: 100%;
  height: 600px;
  margin: 0 auto;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  
}

.circle-card {
  width: 90px;
  height: 150px;
  background: url("images/backcard.png") center/cover no-repeat;
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
}

.circle-card:hover {
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: 0 0 15px rgba(255,215,0,0.5);
}

.picked-counter {
  text-align: center;
  margin-top: 14px;
  color: var(--text-muted);
}
.pickTitle{
	position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 56;
  text-align: center;
}
/*ให้ข้อความลอยอยู่กลางวง*/
.circle-wrapper {
  position: absolute;
  width: 100%;
 /* margin: 0 auto 40px;*/
  /*align-items: center;*/

  /* เพิ่มสองบรรทัดนี้เข้าไป */
  display: flex;
  z-index: 55;
  justify-content: center;   /* จัดของข้างในให้อยู่กลางแนวนอน */
  background: url("images/celtic_cross_bg.jpg") center/cover no-repeat; 
 
}

/* วงไพ่เดิม ไม่ต้องแก้อะไรมาก ถ้ามีแล้วใช้ของเดิมได้เลย */
.circle-area {
  /*position: absolute;*/
  flex: 1 1 100%;
  position: relative;
  top: 200px;
  left: 45%;
  right:50%;
  transform: translate(-50%, -50%); 
  z-index: 51;
  text-align: center;
  width: 750px;              /* หรือขนาดที่คุณใช้จริง */
  height: 650px;             /* ถ้าใช้ padding-top:100% อยู่แล้ว จะใช้แทนก็ได้ */
 

}

/* ข้อความตรงกลางวง */
.circle-counter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  text-align: center;

  font-size: 1rem;
  color: #ffeb9a;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);

  padding: 8px 14px;
  border-radius: 999px;
  background: radial-gradient(circle at top, rgba(0,0,0,0.85), rgba(0,0,0,0.4));
  border: 1px solid rgba(255, 215, 0, 0.6);
  pointer-events: none; /* กันไม่ให้คลิกโดนข้อความแทนไพ่ */
}

/* BOARD */

#boardWrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  align-items: flex-start;
}

.board {
  position: relative;
  min-width: 350px;
  min-height: 320px;
 
}

/* Celtic Cross Layout 10 ใบ */

.board-10 {
  width: 800px;
  height: 600px;
  margin-top: 35px;
  border-radius: 18px;
  border: 1px solid rgba(199,156,59,0.4);
  background: radial-gradient(circle at center, rgba(255,255,255,0.03), transparent);
  position: relative; 
  background: url("images/celtic_cross_bg.jpg") center/cover no-repeat;
 
}

/* Card slot + flip */

.card-slot {
  width: 110px;
  height: 180px;
  position: absolute;
  perspective: 900px;
}

.card-inner {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.4s ease-out;
  box-shadow: var(--shadow-soft);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  backface-visibility: hidden;
  background-size: cover;
  background-position: center;
}

/* หลังไพ่ */
.card-back {
  background-image: url("images/backcard.png");
}

/* หน้าไพ่ */
.card-front {
  transform: rotateY(180deg);
}

/* กลับหัว */
.card-front.reversed {
  transform: rotateY(180deg) rotateZ(180deg);
}

/* สถานะคว่ำหรือหงาย */
.card-inner.flipped {
  transform: rotateY(180deg);
}

/* ตำแหน่ง Celtic Cross ตามรูป */
#pos1  { left: 200px; top: 150px; }
#pos2  { left: 230px; top: 150px; transform: rotate(90deg);  }      /* ทับ p1 แบบไขว้ */
#pos3  { left: 200px; top: 350px; }
#pos4  { left: 200px; top: -50px; }
#pos5  { left: 60px;  top: 150px; }
#pos6  { left: 380px; top: 150px; }
#pos7  { left: 520px; top: 350px; }
#pos8  { left: 520px; top: 240px; }
#pos9  { left: 520px; top: 130px; }
#pos10 { left: 520px; top: 20px; }

/* Simple spread (1/3/5 ใบ) */

#simpleBoard {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.simple-slot {
  width: 110px;
  height: 180px;
  perspective: 900px;
}

/* Reading */

#readingWrapper {
  flex: 1 1 600px;
  max-width: 800px;
  border: 1px solid rgba(199,156,59,0.4);
  margin: 16px;
  padding: 12px;
}

#readingDetails h3 {
  margin-bottom: 4px;
  color: var(--accent);
}

#readingDetails small {
  color: var(--text-muted);
}

#readingDetails p {
  margin-top: 4px;
  margin-bottom: 12px;
}

#readingSummary {
  border-top: 1px solid rgba(199,156,59,0.5);
  margin-top: 16px;
  padding-top: 12px;
  font-size: 15px;
  color: var(--text-main);
}

.actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* History */

#historySection {
  padding: 10px 20px 30px;
}

#historyList {
  font-size: 14px;
  color: var(--text-muted);
}
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-item {
  border-top: 1px dashed rgba(255,255,255,0.1);
  padding: 6px 0;
}
/*เอฟเฟกต์เลื่อนเข้า–ออก*/
.history-section {
  max-width: 1100px;
  margin: 40px auto 80px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.history-body {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s ease;
}

.history-body.open {
  max-height: 500px; /* หรือจะให้ใหญ่หน่อยก็ 999px ไปเลย */
  opacity: 1;
}

.history-footer {
  margin-top: 8px;
  text-align: right;
}

/* Responsive */

@media (max-width: 900px) {
  #circleArea {
    width: 360px;
    height: 360px;
  }
  .board-10 {
    width: 100%;
    height: 420px;
  }
  #pos1  { left: 36%; top: 150px; }
  #pos2  { left: 43%; top: 150px; transform: rotate(90deg); }
  #pos3  { left: 36%; top: 320px; }
  #pos4  { left: 36%; top: -10px; }
  #pos5  { left: 16%; top: 150px; }
  #pos6  { left: 65%; top: 150px; }
  #pos7  { left: 75%; top: 350px; }
  #pos8  { left: 75%; top: 240px; }
  #pos9  { left: 75%; top: 130px; }
  #pos10 { left: 75%; top: 20px; }

  #boardWrapper {
    flex-direction: column;
    align-items: center;
  }
  #readingWrapper {
    max-width: 100%;
  }
}
/* Deck Preview */
#deckPreview {
    position: relative;
    width: 180px;
    height: 260px;
    margin: 0 auto 30px auto;
    animation: shuffleDeck 1.2s infinite ease-in-out;
    transform-origin: center;
}

/* ไพ่แต่ละใบในสำรับ */
.card-stack {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('images/backcard.png') no-repeat center/cover;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,.4);
    transform: translate(calc(var(--i) * 1.5px), calc(var(--i) * -1.5px));
    pointer-events: none; /* ไม่ให้เลือก */
}

/* Animation โยกซ้าย–ขวา ให้เหมือนกำลังสับไพ่ */
@keyframes shuffleDeck {
    0%   { transform: translateX(0) rotate(0deg); }
    25%  { transform: translateX(-8px) rotate(-2deg); }
    50%  { transform: translateX(0px) rotate(0deg); }
    75%  { transform: translateX(8px) rotate(2deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

/* Hover ให้กองไพ่ดูมีชีวิต */
#deckPreview:hover {
    animation-play-state: paused;
    transform: scale(1.02);
}
/* ==========================
   STEP 2: SHUFFLE ANIMATION
   ========================== */

#deckShuffle {
    position: relative;
    width: 190px;
    height: 280px;
    margin: 30px auto;
    animation: shuffleMotion 1.3s infinite ease-in-out;
    transform-origin: center;
}

/* ไพ่แต่ละใบในกอง */
.shuffle-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('images/backcard.png') no-repeat center/cover;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);

    /* ซ้อนเหลื่อมตาม index */
    transform: translate(calc(var(--i) * 1.5px), calc(var(--i) * -1.5px));
    transition: all .3s ease;
}

/* Animation โยกซ้าย–ขวา */
@keyframes shuffleMotion {
    0%   { transform: translateX(0) rotate(0deg); }
    25%  { transform: translateX(-12px) rotate(-2deg); }
    50%  { transform: translateX(0px) rotate(0deg); }
    75%  { transform: translateX(12px) rotate(2deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

/* ==========================
   Spread Like Shuffling
   ========================== */
/* Hover = ไพ่แตกออกเล็กน้อย */
#deckShuffle:hover .shuffle-card {
    transform:
        translate(calc(var(--i) * 4px), calc(var(--i) * -4px))
        rotate(calc(var(--i) * 1deg));
    transition: transform .25s ease;
}

/* Hover หยุด animation เพื่อให้แตกออกนิ่ง ๆ */
#deckShuffle:hover {
    animation-play-state: paused;
}
/* ======================================
   Riffle Shuffle Animation – Step 2
   ====================================== */

#riffleArea {
    position: relative;
    width: 350px;
    height: 300px;
    margin: 30px auto;
}

/* ซ้าย */
#leftPile, #rightPile {
    position: absolute;
    top: 20px;
    width: 140px;
    height: 220px;
}

#leftPile {
    left: 0;
    animation: liftLeft 1.4s infinite ease-in-out;
}

#rightPile {
    right: 0;
    animation: liftRight 1.4s infinite ease-in-out;
}

.riffle-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('images/backcard.png') no-repeat center/cover;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    transform: translate(calc(var(--i) * 2px), calc(var(--i) * -2px));
    animation: dropCard 1.4s infinite ease-in-out;
    animation-delay: calc(var(--i) * 0.05s);
}

/* ยกขึ้นเหมือนคนถือไพ่ก่อนสับ */
@keyframes liftLeft {
    0%   { transform: translateY(0) rotate(-3deg); }
    30%  { transform: translateY(-20px) rotate(-6deg); }
    50%  { transform: translateY(0) rotate(-3deg); }
    100% { transform: translateY(0) rotate(-3deg); }
}

@keyframes liftRight {
    0%   { transform: translateY(0) rotate(3deg); }
    30%  { transform: translateY(-20px) rotate(6deg); }
    50%  { transform: translateY(0) rotate(3deg); }
    100% { transform: translateY(0) rotate(3deg); }
}

/* ไพ่ตกลงสลับกันแบบ Riffle */
@keyframes dropCard {
    0%   { transform: translate(calc(var(--i)*2px), calc(var(--i)*-2px)); opacity:1; }
    40%  { transform: translate(calc(var(--i)*2px), calc(var(--i)*-2px)) translateY(-10px); }
    60%  { opacity:0; }
    70%  { transform: translateY(120px) scale(0.9); opacity:0; }
    90%  { transform: translateY(0) scale(1); opacity:1; }
    100% { opacity:1; }
}

/* Hover = หยุดการสับเพื่อดูสำรับ */
#riffleArea:hover * {
    animation-play-state: paused;
}
/* ======================================
      3D Riffle Shuffle — ULTRA
   ====================================== */

#riffleArea3D {
    position: relative;
    width: 360px;
    height: 300px;
    margin: 40px auto;
    perspective: 1200px;           /* เพิ่มมิติ */
}

/* กองซ้าย/ขวา */
#leftPile3D, #rightPile3D {
    position: absolute;
    top: 30px;
    width: 150px;
    height: 230px;
}

#leftPile3D { left: 0; }
#rightPile3D { right: 0; }

/* ใบไพ่ */
.riffle3d-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url("images/backcard.png") no-repeat center/cover;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,.5);

    transform-style: preserve-3d;

    /* ชั้นของไพ่ */
    transform: translateY(calc(var(--i) * -3px)) translateX(calc(var(--i) * 2px));
    
    /* animation หลัก */
    animation: riffle3d 2.2s infinite ease-in-out;
    animation-delay: calc(var(--i) * 0.15s);
}

/* =============================
     ANIMATION: Riffle 3D
   ============================= */

/*
 ขั้นตอน:
 0–25%   → แยกกอง + ดีดขึ้น + หมุน 3D เล็กน้อย
 25–55%  → ไพ่กระโดดลงตรงกลาง สลับซ้าย–ขวา
 55–100% → รวมกองกลับเป็นสำรับเดียว
*/

@keyframes riffle3d {
    0% {
        transform:
          translateY(calc(var(--i) * -3px))
          translateX(calc(var(--i) * 2px))
          rotateX(0deg) rotateY(0deg);
        opacity: 1;
    }

    /* ดีดขึ้น */
    20% {
        transform:
          translateY(-40px)
          translateX(calc(var(--pile) * 35px))
          rotateX(10deg) rotateY(0deg);
        opacity: 1;
    }

    /* สลับไพ่ตกลงกลาง */
    45% {
        transform:
          translateY(80px)
          translateX(calc(var(--pile) * -10px))
          rotateX(-15deg);
        opacity: .5;
    }

    /* รวมเป็นสำรับเดียว */
    80% {
        transform:
          translateY(0px)
          translateX(0px)
          rotateX(0deg);
        opacity: 1;
    }

    100% {
        transform:
          translateY(calc(var(--i) * -3px))
          translateX(calc(var(--i) * 2px));
        opacity: 1;
    }
}

/* กำหนดว่ากองซ้ายเป็น -1 ขวาเป็น +1 */
#leftPile3D .riffle3d-card { --pile: -1; }
#rightPile3D .riffle3d-card { --pile: 1; }

/* Hover = หยุดเพื่อดูใกล้ ๆ */
#riffleArea3D:hover .riffle3d-card {
    animation-play-state: paused;
    cursor: pointer;
}
#riffleArea3D {
    animation: floatDeck 3.5s ease-in-out infinite;
}

@keyframes floatDeck {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-12px); }
    100% { transform: translateY(0px); }
}
#riffleArea3D::before {
    content: "";
    position: absolute;
    width: 120%;
    height: 120%;
    top: -10%;
    left: -60%;
    background: linear-gradient(
       75deg,
       rgba(255,255,255,0) 0%,
       rgba(255,255,255,0.25) 50%,
       rgba(255,255,255,0) 100%
    );
    transform: skewX(-20deg);
    animation: lightSweep 4s infinite;
    pointer-events: none;
}

@keyframes lightSweep {
    0%   { transform: translateX(0) skewX(-20deg); }
    100% { transform: translateX(200%) skewX(-20deg); }
}
.riffle3d-card {
    box-shadow:
        0 4px 10px rgba(0,0,0,.5),
        0 0 12px rgba(255,215,0,0.15);
    transition: box-shadow .3s ease;
}

#riffleArea3D:hover .riffle3d-card {
    box-shadow:
        0 4px 12px rgba(0,0,0,.6),
        0 0 20px rgba(255,215,0,0.35);
}
#particleLayer {
    position: absolute;
    width: 360px;
    height: 300px;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    overflow: visible;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255,215,0,0.8);
    border-radius: 50%;
    animation: spark 1.5s linear forwards;
    filter: blur(1px);
}

@keyframes spark {
    0%   { opacity:1; transform: translateY(0) scale(1); }
    100% { opacity:0; transform: translateY(40px) scale(0.5); }
}
/* ======================================
   STEP 2 – Riffle Shuffle 3D (Soft)
   ====================================== */

#riffleArea3D {
    position: relative;
    width: 360px;
    height: 300px;
    margin: 40px auto;
    perspective: 1200px;
    animation: floatDeck 4s ease-in-out infinite;
}

@keyframes floatDeck {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-12px); }
    100% { transform: translateY(0px); }
}

/* piles */
#leftPile3D, #rightPile3D {
    position: absolute;
    top: 30px;
    width: 150px;
    height: 230px;
}

#leftPile3D { left: 0; }
#rightPile3D { right: 0; }

.riffle3d-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('images/backcard.png') no-repeat center/cover;
    border-radius: 12px;
    box-shadow:
        0 4px 10px rgba(0,0,0,.5),
        0 0 12px rgba(255,215,0,0.15);

    transform-style: preserve-3d;
    transform: translateY(calc(var(--i) * -3px)) translateX(calc(var(--i) * 2px));

    animation: riffle3dsoft 2.8s infinite ease-in-out;
    animation-delay: calc(var(--i) * 0.2s);
}

/* soft riffle – cinematic */
@keyframes riffle3dsoft {
    0% {
        transform: translateY(calc(var(--i)*-3px)) translateX(calc(var(--i)*2px));
        opacity: 1;
    }

    /* lift gently */
    25% {
        transform: translateY(-25px) rotateX(6deg) rotateY(calc(var(--pile) * 2deg));
        opacity: 1;
    }

    /* drop softly */
    55% {
        transform: translateY(30px) rotateX(-8deg);
        opacity: .4;
    }

    /* merge */
    85% {
        transform: translateY(0) translateX(0) rotateX(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(calc(var(--i)*-3px)) translateX(calc(var(--i)*2px));
        opacity: 1;
    }
}

#leftPile3D .riffle3d-card { --pile: -1; }
#rightPile3D .riffle3d-card { --pile: 1; }

/* pause on hover */
#riffleArea3D:hover .riffle3d-card {
    animation-play-state: paused;
    cursor: pointer;
}

/* Light sweep cinematic */
#riffleArea3D::before {
    content: "";
    position: absolute;
    width: 150%;
    height: 150%;
    top: -20%;
    left: -70%;
    background: linear-gradient(75deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.18) 50%,
        rgba(255,255,255,0) 100%
    );
    transform: skewX(-20deg);
    animation: lightSweep 5s infinite;
    pointer-events: none;
}

@keyframes lightSweep {
    0%   { transform: translateX(0) skewX(-20deg); }
    100% { transform: translateX(220%) skewX(-20deg); }
}

/* aura */
.riffle3d-card:hover {
    box-shadow:
        0 4px 12px rgba(0,0,0,.6),
        0 0 20px rgba(255,215,0,0.35);
}
.circle-card {
    opacity: 0;
    transform: scale(0.3) translateY(20px);
    animation: dealCard 0.8s forwards ease-out;
    animation-delay: calc(var(--i) * 0.12s);
}

@keyframes dealCard {
    0%   { opacity: 0; transform: scale(0.3) translateY(20px); }
    50%  { opacity: 1; transform: scale(1.05) translateY(-8px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
/* =======================
   MODE SWITCH (Free / Pro)
   ======================= */

.mode-switch {
  /* width: 100%; */
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid rgba(199,156,59,0.5);
  padding: 3px;
  margin: 10px 0 14px;
  background: rgba(0,0,0,0.4);
}

body.theme-vintage .mode-switch {
  background: rgba(255,255,255,0.8);
  border-color: rgba(138,90,44,0.5);
}

.mode-btn {
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  transition: all 0.18s ease-out;
}

.mode-btn.active {
  background: var(--accent);
  color: #000;
}

.mode-btn:not(.active):hover {
  background: rgba(255,255,255,0.08);
}

.pro-badge {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  background: linear-gradient(120deg, #ffdd7a, #ffb347);
  color: #3b220a;
}

/* PRO Panel */

.pro-card {
  margin-top: 8px;
  padding: 14px 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(199,156,59,0.4);
  background: radial-gradient(circle at top, rgba(255,255,255,0.08), transparent 60%);
  font-size: 14px;
}

body.theme-vintage .pro-card {
  background: radial-gradient(circle at top, rgba(255,255,255,0.9), #f1e3d0 70%);
}

.pro-card h3 {
  margin-top: 0;
  margin-bottom: 4px;
  font-size: 16px;
  color: var(--accent);
}

.pro-intro {
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--text-main);
}

.pro-benefits {
  margin: 0 0 10px 18px;
  padding: 0;
  color: var(--text-muted);
}

.pro-benefits li {
  margin-bottom: 3px;
}

.pro-cta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}

#aiAnalyzeBtn {
  align-self: flex-start;
  border-radius: 999px;
  border-width: 0;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  background: linear-gradient(120deg, #f2d38a, #f2b94a);
  color: #2b1c0f;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

#aiAnalyzeBtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

.ai-status {
  font-size: 12px;
  color: var(--text-muted);
}

.ai-result {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
}

/* responsive tweak */
@media (max-width: 900px) {
  .mode-switch {
    width: 100%;
    justify-content: space-between;
  }
}
/* Highlight active mode (FREE default) */
.mode-btn.active {
  background: linear-gradient(120deg, #ffe28a, #ffd052);
  color: #2a1b0a;
  box-shadow:
    0 0 6px rgba(255, 208, 82, 0.6),
    inset 0 0 8px rgba(255, 255, 255, 0.3);
  font-weight: 600;
  transform: translateY(-1px);
}

/* ขณะ hover โหมดอื่น */
.mode-btn:not(.active):hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* ป้องกันปุ่ม active กระตุก */
.mode-btn {
  transition: all 0.18s ease-out;
}
/* =======================
   INLINE PAYWALL (Mode D)
   ======================= */

.paywall {
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(199,156,59,0.45);
  background: rgba(0,0,0,0.45);
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  animation: fadeIn 0.25s ease-out;
}

body.theme-vintage .paywall {
  background: rgba(255,255,255,0.85);
}

.paywall h4 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 15px;
}

.paywall p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.4;
}

.price-box {
  background: rgba(255,215,100,0.18);
  padding: 6px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  color: #ffd977;
  font-size: 14px;
}

body.theme-vintage .price-box {
  background: rgba(255,215,100,0.25);
  color: #4a310e;
}

.pay-btn {
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(120deg, #ffe28a, #ffcb47);
  color: #2a1b0a;
  cursor: pointer;
  width: 100%;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.pay-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(0,0,0,0.35);
}

.pay-note {
  margin-top: 6px;
  font-size: 11px;
  text-align: center;
  color: var(--text-muted);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.qr-box {
  width: 180px;
  margin: 10px auto;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.2);
}

body.theme-vintage .qr-box {
  background: rgba(255,255,255,0.7);
}

.qr-img {
  width: 100%;
  border-radius: 8px;
}
/* กล่องคำพยากรณ์หลัก */
.ai-reading-box {
  max-width: 100%;
  margin: 2rem auto;
  padding: 1.75rem 2rem;
  border-radius: 18px;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 55%),
              radial-gradient(circle at bottom right, rgba(255, 215, 0, 0.08), transparent 55%),
              #111111;
  border: 1px solid rgba(255, 215, 0, 0.25);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.65),
    0 0 25px rgba(255, 215, 0, 0.15);
  color: #f5f5f5;
  position: relative;
  overflow: hidden;
  font-size: 0.98rem;
  line-height: 1.75;
  /* สำคัญมาก: ให้เคารพ line break จาก AI */
  white-space: pre-line;
}

/* เส้นกรอบด้านในเบา ๆ */
.ai-reading-box::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  pointer-events: none;
}

/* ฮาโลทองด้านหลัง ให้ดูมีออร่า */
.ai-reading-box::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.22), transparent 60%);
  filter: blur(3px);
  pointer-events: none;
}

/* หัวข้อใหญ่ที่เราให้ AI ใส่เอง เช่น "คำพยากรณ์ไพ่ Celtic Cross" */
.ai-reading-box-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffe28a;
  margin-bottom: 0.75rem;
}

/* ถ้าคุณปิงอยากครอบข้อความทักทายแยกออกมาได้ */
.ai-reading-box-intro {
  font-style: italic;
  color: #e0d7c5;
  margin-bottom: 1.1rem;
}

/* เลขหัวข้อ ① ② ③ ให้เด่นขึ้นเล็กน้อย */
.ai-reading-box strong {
  color: #ffe28a;
  font-weight: 600;
}

/* ให้ลิงก์ (ถ้ามี) ดูกลืนกับธีม */
.ai-reading-box {
  max-width: 760px;
  margin: 2rem auto;
  padding: 1.75rem 2rem 1.5rem;
  border-radius: 18px;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 55%),
              radial-gradient(circle at bottom right, rgba(255, 215, 0, 0.08), transparent 55%),
              #111111;
  border: 1px solid rgba(255, 215, 0, 0.25);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.65),
    0 0 25px rgba(255, 215, 0, 0.15);
  color: #f5f5f5;
  position: relative;
  overflow: hidden;
  font-size: 0.98rem;
  line-height: 1.75;
}

/* header ด้านบน */
.ai-reading-header {
  margin-bottom: 1rem;
}

.ai-reading-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffe28a;
}

.ai-reading-subtitle {
  font-size: 0.85rem;
  color: #e0d7c5;
  opacity: 0.9;
  margin-top: 0.1rem;
  font-style: italic;
}

/* เนื้อหา AI */
.ai-reading-content {
  white-space: pre-line;   /* เคารพการขึ้นบรรทัดของ AI */
  margin-bottom: 1.1rem;
}

/* footer ปิดท้ายดวง */
.ai-reading-footer {
  font-size: 0.85rem;
  color: #d2c4a3;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.6rem;
  margin-top: 0.4rem;
  font-style: italic;
}

/* เน้นตัวเลขหัวข้อ ① ② ③ */
.ai-reading-content strong {
  color: #ffe28a;
  font-weight: 600;
}

@media (max-width: 640px) {
  .ai-reading-box {
    margin: 1.25rem 1rem;
    padding: 1.3rem 1.4rem 1.1rem;
    font-size: 0.94rem;
  }
}
/* จัดแผงเมนู */
.ai-pro-panel {
  margin: 25px auto 20px;
  position: absolute   
 top: 50%;  
 left: 50%;
  /* text-align: center; */
}

.ai-pro-panel .mode-btn {
  margin: 0 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: #1b1b1b;
  color: #eee;
  cursor: pointer;
}

.mode-btn.pro {
  background: #2b1f05;
  border-color: gold;
  color: gold;
}

.mode-btn.extra {
  background: #222;
  font-size: 0.85rem;
}

.ai-status-text {
  display: block;
  margin-top: 10px;
  color: #ffd36b;
  font-size: 0.9rem;
}

/* ผลดูดวงฟรี */
.free-reading-box {
  max-width: 760px;
  margin: 20px auto;
  padding: 18px;
  background: rgba(0,0,0,0.3);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
}

.free-reading-cards {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.free-mini-card {
  width: 70px;
  border-radius: 6px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

.free-reading-text {
  white-space: pre-line;
  color: #e7e7e7;
  line-height: 1.7;
}

/* AI Reading Box */
.ai-reading-box {
  max-width: 760px;
  margin: 20px auto;
  padding: 1.6rem;
  border-radius: 18px;
  background: radial-gradient(circle at top left, rgba(255,255,255,0.05), transparent 55%),
              radial-gradient(circle at bottom right, rgba(255,215,0,0.08), transparent 55%),
              #111;
  border: 1px solid rgba(255,215,0,0.25);
  box-shadow: 0 18px 40px rgba(0,0,0,0.65);
  color: #f5f5f5;
}

.ai-reading-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffe28a;
}

.ai-reading-subtitle {
  font-size: 0.85rem;
  color: #dcd0b4;
  font-style: italic;
  opacity: 0.9;
  margin-top: 2px;
}

.ai-reading-content {
  white-space: pre-line;
  margin-top: 10px;
  line-height: 1.75;
}

.ai-reading-footer {
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
  color: #d2c4a3;
  font-style: italic;
}
/* กล่องรวม thumbnail ไพ่ 10 ใบ */
.reading-cards-preview {
  max-width: 760px;
  margin: 24px auto 32px;
  padding: 16px 24px;
  display: grid;
  grid-template-columns: repeat(2, auto); /* ซ้าย 5 ใบ / ขวา 5 ใบ */
  column-gap: 40px;
  row-gap: 8px;
  justify-content: center;
  align-items: flex-start;

  background: radial-gradient(circle at top, rgba(255, 215, 0, 0.08), rgba(0, 0, 0, 0.9));
  border-radius: 18px;
  border: 1px solid rgba(255, 215, 0, 0.35);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.85);
}

/* เวลายังไม่มีไพ่ให้พรีวิว */
.reading-cards-preview.hidden {
  display: none;
}

/* คอลัมน์ซ้าย/ขวา (5 ใบต่อฝั่ง) */
.reading-cards-preview-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

/* รูปไพ่ย่อ */
.reading-card-thumb {
  width: 82px;
  height: 135px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.8);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.8);
  background: radial-gradient(circle at top, #2b2115, #050303);
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out, filter 0.18s ease-out;
}

/* ไพ่กลับหัว */
.reading-card-thumb.reversed {
  transform: rotate(180deg);
}

/* เอฟเฟกต์ตอน hover */
.reading-card-thumb:hover {
  transform: translateY(-4px) scale(1.04) rotate(var(--rev-rotate, 0deg));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.9);
  filter: brightness(1.05);
}

/* มือถือ / จอเล็ก: ให้จัดเป็น 2 แถวแทนจะได้ไม่แน่นเกินไป */
@media (max-width: 768px) {
  .reading-cards-preview {
    max-width: 100%;
    margin: 16px auto 24px;
    padding: 12px 16px;
    column-gap: 24px;
  }

  .reading-card-thumb {
    width: 70px;
    height: 115px;
  }
}
/* ===== Layout ไพ่ย่อประกบซ้าย–ขวา ===== */

.reading-layout {
	width: 100%;
  max-width: 1100px;
  margin: 16px auto 40px;
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 90px; /* ซ้าย / กลาง / ขวา */
  gap: 24px;
  align-items: flex-start;
}
#readingCenterPanel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* คอลัมน์ซ้าย–ขวา */
.reading-thumb-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* ไพ่ย่อแต่ละใบ */
.reading-card-thumb {
  width: 72px;
  height: 120px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 215, 0, 0.8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
  background-color: #120d07;
}

.reading-card-thumb.reversed {
  transform: rotate(180deg);
}

/* มือถือ / จอแคบ: stack เป็นแนวตั้ง */
@media (max-width: 900px) {
  .reading-layout {
    grid-template-columns: 1fr;
  }

  .reading-thumb-col {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
}
#readingCenterPanel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#proReadingPanel {
    padding: 18px;
    border-radius: 14px;
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(199,156,59,0.45);
    box-shadow: 0 4px 18px rgba(0,0,0,0.5);
    animation: fadeIn 0.25s ease-out;
}

#proReadingPanel h3 {
    margin-top: 0;
    color: var(--accent);
}

#proReadingPanel p,
#proReadingPanel li {
    color: var(--text-muted);
    line-height: 1.55;
}

#aiResult {
    margin-top: 12px;
    padding: 16px;
    background: rgba(0,0,0,0.35);
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 100, 0.25);
    min-height: 80px;
}
/*ปรับขยายหน้าจอ*/
/* =====================================
   FIX: ให้ Layout Desktop ขยายกว้างขึ้น
   ===================================== */

/* ปลดล็อคความกว้างของหน้าจอหลัก */
.screen {
  max-width: 1400px !important;   /* เดิม 900–1100 → เพิ่ม */
  width: 100%;
  padding-left: 20px;
  padding-right: 20px;
}

/* ขยาย ส่วนแสดงผลอ่านไพ่ */
#step4.screen {
  max-width: 1400px !important;
}

/* reading layout ซ้าย–กลาง–ขวา ให้กว้างขึ้น */
.reading-layout {
  max-width: 1400px !important;
  grid-template-columns: 120px minmax(0, 1fr) 120px; /* เดิม 96,96 → เพิ่ม */
}

/* ไพ่ซ้าย–ขวา ให้ใหญ่ขึ้นตามสัดส่วน */
.reading-card-thumb {
  width: 90px;
  height: 142px;
}

/* Celtic board ไม่ถูกบีบ */
#boardWrapper {
  max-width: 100%;
  margin: 0 auto;
  transform: scale(1);
}

/* ปรับเฉพาะ Desktop ขึ้นไป */
@media (min-width: 1280px) {

  .screen,
  #step4.screen,
  .reading-layout {
    max-width: 1600px !important; /* ปลดล็อคอีกระดับ */
  }

  .reading-layout {
    grid-template-columns: 150px minmax(0, 1fr) 150px; 
  }

  .reading-card-thumb {
    width: 100px;
    height: 158px;
  }
}
/* =====================================
   Desktop Wide Layout – ThaiTarot.ink
   ขยายเฉพาะจอคอมที่กว้างหน่อย
   ===================================== */

/* จอปกติขึ้นไป (ประมาณโน้ตบุ๊ก) ให้กว้างขึ้นนิดนึงก่อน */
@media (min-width: 1024px) {

  .screen {
    max-width: 1400px !important;
    width: 100%;
    padding-left: 24px;
    padding-right: 24px;
  }

  #step4.screen {
    max-width: 1400px !important;
  }

  .reading-layout {
    max-width: 1400px !important;
    column-gap: 28px;
    grid-template-columns: 130px minmax(0, 1fr) 130px; /* ซ้าย/กลาง/ขวา กว้างขึ้น */
  }

  .reading-card-thumb {
    width: 92px;
    height: 146px;
  }

  #boardWrapper {
    max-width: 100%;
    margin: 0 auto;
    transform: scale(1.05);      /* ขยายบอร์ดขึ้นนิดเดียวให้เต็มตา */
    transform-origin: top center;
  }
}

/* จอใหญ่จริง ๆ (เช่น 24–27 นิ้วขึ้นไป) ให้เต็มกว้างแบบ Cinematic */
@media (min-width: 1440px) {

  .screen,
  #step4.screen,
  .reading-layout {
    max-width: 1600px !important;
  }

  .reading-layout {
    grid-template-columns: 150px minmax(0, 1fr) 150px;
    column-gap: 36px;
  }

  .reading-card-thumb {
    width: 100px;
    height: 158px;
  }

  #boardWrapper {
    transform: scale(1.1);       /* จอใหญ่ ขยายอีกนิด */
  }
}
/* =========================================
   MOBILE FIX — ThaiTarot.ink
   ทำให้ layout มือถือกลับมาตรงกลาง
   ========================================= */

@media (max-width: 768px) {

  /* ปรับ layout ให้กลับมาเป็นคอลัมน์เดียว */
  .reading-layout {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 10px;
    gap: 14px;
  }

  /* Thumbnail ซ้าย–ขวาให้มาเรียงด้านล่างทั้งคู่ */
  .reading-thumb-col {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100%;
  }

  /* ขนาดไพ่ย่อมือถือ */
  .reading-card-thumb {
    width: 70px !important;
    height: 110px !important;
  }

  /* บอร์ด Tarot ให้เต็มจอแบบถูกต้อง */
  #boardWrapper {
    transform: scale(0.8) !important;
    transform-origin: top center !important;
    margin: 0 auto !important;
  }

  /* ปุ่มโหมดกลับมา wrap ได้ */
  .mode-switch {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 6px;
  }

  .mode-btn {
    flex: 1 1 48%;
    text-align: center;
  }

  .mode-btn.extra {
    flex: 1 1 100%;
  }

  /* เนื้อหา AI PRO ให้กว้างเต็มแต่ไม่เกินจอ */
  #proReadingPanel {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 8px;
  }

  .pro-card {
    padding: 12px 14px !important;
  }
}
/* =========================================
   FIX WIDTH – ให้ผลการทำนายกว้างเท่าบอร์ด
   ========================================= */

/* ai-pro-panel เดิมถูกล็อก 50% ไว้ใน inline style
   ตรงนี้บังคับให้กินเต็มความกว้างเหมือนบอร์ด */
.ai-pro-panel {
  width: 100% !important;
  max-width: 900px;               /* กว้างประมาณบอร์ด 800px + ขอบนิดหน่อย */
  margin: 24px auto 32px !important;
  position: relative;
  box-sizing: border-box;
}

/* readingWrapper – ให้กว้างเต็ม container */
#readingWrapper {
  flex: 1 1 auto;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 auto;
  padding: 12px 16px;
  border: 1px solid rgba(199,156,59,0.4);
  border-radius: 18px;
  box-sizing: border-box;
}

/* layout ผลการอ่านให้กว้างเท่ากันทั้งหมด */
.reading-layout {
  width: 100% !important;
  max-width: 100% !important;
  margin: 16px auto 24px;
}

/* mode-switch ให้กว้างเท่ากับ readingWrapper */
.mode-switch {
  width: 100% !important;
  max-width: 100% !important;
}

/* ------------ Mobile: ให้เต็มจอเหมือนบอร์ด ------------- */
@media (max-width: 768px) {

  .ai-pro-panel {
    max-width: 100% !important;
    padding: 0 8px;
  }

  #readingWrapper {
    padding: 10px 10px;
    margin-top: 10px;
  }

  .reading-layout {
    padding: 0;
  }
}
/* ============================================
   FIX: CENTER ALIGN – ThaiTarot.ink (Desktop/Mobile)
   ============================================ */

/* ให้ทั้งแผงผลการอ่านอยู่กลางจออย่างแท้จริง */
.ai-pro-panel,
#readingWrapper,
.reading-layout,
.mode-switch {
  margin-left: auto !important;
  margin-right: auto !important;
  left: 0 !important;
  right: 0 !important;
  position: relative !important;
  box-sizing: border-box !important;
}

/* reading-layout ถ้าเป็น flex ต้องให้มันอยู่กลาง */
.reading-layout {
  display: flex !important;
  flex-direction: column;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
}

/* ตัว wrapper ใหญ่สุดของผลทำนาย */
#readingWrapper {
  max-width: 900px !important;    /* คุมกลาง */
  width: 100% !important;
  margin: 0 auto !important;
  padding-left: 12px;
  padding-right: 12px;
  box-sizing: border-box !important;
}

/* ปุ่มสลับโหมด ให้อยู่กลางแบบชัวร์ */
.mode-switch {
  max-width: 900px !important;
  width: 100% !important;
  margin: 10px auto !important;
}

/* MOBILE — ไม่ให้หลุดขวาเด็ดขาด */
@media (max-width: 768px) {
  #readingWrapper,
  .ai-pro-panel,
  .reading-layout,
  .mode-switch {
    max-width: 100% !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}
/* =========================================
   RESET LAYOUT ผลการทำนายให้ตรงกลางจอ
   ========================================= */

/* แผงโหมด PRO / FREE ทั้งก้อน ให้อยู่กลางจอ ไม่หลุดขวา */
.ai-pro-panel {
  width: 100% !important;
  max-width: 900px;
  margin: 24px auto 32px !important;
  position: static !important;  /* รีเซ็ตจาก absolute เดิม */
  top: auto !important;
  left: auto !important;
  right: auto !important;
  box-sizing: border-box;
}

/* กล่องผลการอ่านทั้งหมด */
#readingWrapper {
  width: 100% !important;
  max-width: 900px;
  margin: 100px auto !important;
  padding: 12px 16px;
  box-sizing: border-box;
}

/* ====== Desktop: ซ้าย–กลาง–ขวา แบบเดิมที่สวยอยู่แล้ว ====== */
.reading-layout {
  width: 100% !important;
  max-width: 900px;
  margin: 16px auto 24px;
  display: grid !important;
  grid-template-columns: 96px minmax(0, 1fr) 96px; /* ซ้าย / กลาง / ขวา */
  gap: 20px;
  align-items: flex-start;
}

/* คอลัมน์ซ้าย–ขวาให้เรียงแนวตั้ง */
.reading-thumb-col {
  display: flex !important;
  flex-direction: column !important;
  align-items: center;
  gap: 8px;
}

/* ไพ่ย่อ */
.reading-card-thumb {
  width: 72px;
  height: 120px;
}

/* ====== Mobile: ให้ stack ลงมา และไม่ชิดขอบ ====== */
@media (max-width: 768px) {

  .ai-pro-panel,
  #readingWrapper,
  .reading-layout {
    max-width: 100% !important;
    padding-left: 8px;
    padding-right: 8px;
  }

  .reading-layout {
    grid-template-columns: 1fr;  /* เหลือคอลัมน์เดียว */
  }

  .reading-thumb-col {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .reading-card-thumb {
    width: 70px;
    height: 110px;
  }
}
#resultTitle{
	margin: 0px 0px 0px 100px
}
/* ================================
   Landing Page Styles – ThaiTarot.ink
   ================================ */

.landing-body {
  font-family: "Prompt", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #2a2215 0, #050505 55%, #000 100%);
  color: #f7f0d5;
}

.landing-app {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

/* HEADER */
.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.landing-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.landing-logo-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.landing-logo-text {
  display: flex;
  flex-direction: column;
}

.landing-logo-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 26px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.landing-logo-dot {
  color: #e0c17a;
}

.landing-logo-tagline {
  font-size: 12px;
  color: var(--text-muted);
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.landing-nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.15s ease;
}

.landing-nav a:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.landing-nav-cta {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent) !important;
}

/* HERO */
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  margin-bottom: 56px;
}

.landing-hero-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 34px;
  line-height: 1.3;
  margin: 0 0 12px;
}

.landing-hero-title span {
  color: var(--accent);
}

.landing-hero-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 18px;
}

.landing-hero-cta-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.landing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
}

.landing-btn.primary {
  background: linear-gradient(135deg, #e0c17a, #f5dca5);
  color: #261b0c;
  box-shadow: 0 8px 18px rgba(0,0,0,0.55);
}

.landing-btn.primary.large {
  padding: 11px 22px;
  font-size: 15px;
}

.landing-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(0,0,0,0.7);
}

.landing-btn.ghost {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}

.landing-btn.ghost:hover {
  background: rgba(224, 185, 74, 0.12);
}

.landing-hero-bullets {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.landing-hero-bullets li::before {
  content: "✦";
  margin-right: 6px;
  color: var(--accent);
}

.landing-hero-right {
  display: flex;
  justify-content: center;
}

.landing-hero-board {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 3 / 4;
  border-radius: 24px;
  border: 1px solid rgba(255, 215, 128, 0.65);
  background:
    radial-gradient(circle at top, rgba(255,214,160,0.4), transparent 55%),
    url("../images/hero-board-placeholder.jpg") center/cover no-repeat,
    #1a130b;
  box-shadow: 0 20px 40px rgba(0,0,0,0.8);
  position: relative;
  overflow: hidden;
}

.landing-hero-board-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(0,0,0,0.0), rgba(0,0,0,0.65) 70%);
}

.landing-hero-board-label {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(224,185,74,0.5);
}

/* GENERIC SECTION */
.landing-section {
  margin-bottom: 56px;
}

.landing-section-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 26px;
  margin: 0 0 6px;
}

.landing-section-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0 0 20px;
}

/* HOW IT WORKS */
.landing-how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.landing-how-card {
  background: rgba(10,10,10,0.75);
  border-radius: 14px;
  border: 1px solid rgba(199,156,59,0.5);
  padding: 14px 16px;
  font-size: 13px;
}

.landing-how-card h3 {
  margin: 4px 0 6px;
  font-size: 15px;
}

.landing-how-card p {
  margin: 0;
  color: var(--text-muted);
}

.landing-how-step {
  font-size: 12px;
  color: var(--accent);
}

/* FEATURES */
.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.landing-feature-card {
  background: rgba(7,7,7,0.8);
  border-radius: 14px;
  border: 1px solid rgba(224,185,74,0.4);
  padding: 14px 16px;
  font-size: 13px;
}

.landing-feature-card h3 {
  margin: 2px 0 6px;
  font-size: 15px;
}

.landing-feature-card p {
  margin: 0;
  color: var(--text-muted);
}

/* PRICING */
.landing-pricing-card {
  max-width: 640px;
  border-radius: 18px;
  border: 1px solid rgba(224,185,74,0.7);
  padding: 18px 18px 16px;
  background: radial-gradient(circle at top left, rgba(224,185,74,0.12), rgba(0,0,0,0.9));
  box-shadow: 0 18px 36px rgba(0,0,0,0.8);
}

.landing-pricing-plan {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.landing-pricing-list {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.landing-pricing-cta-wrap {
  margin-bottom: 8px;
}

.landing-pricing-note {
  font-size: 11px;
  color: var(--text-muted);
}

/* FAQ */
.landing-faq-item {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 10px 0;
  font-size: 13px;
}

.landing-faq-item h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.landing-faq-item p {
  margin: 0;
  color: var(--text-muted);
}

/* FOOTER */
.landing-footer {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.landing-footer a {
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
}

.landing-footer-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .landing-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .landing-nav {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .landing-hero {
    grid-template-columns: 1fr;
  }

  .landing-hero-right {
    order: -1;
    margin-bottom: 8px;
  }

  .landing-hero-title {
    font-size: 28px;
  }

  .landing-how-grid {
    grid-template-columns: 1fr;
  }

  .landing-features-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .landing-app {
    padding-inline: 12px;
  }

  .landing-logo-title {
    font-size: 22px;
  }

  .landing-nav {
    font-size: 13px;
    gap: 12px;
  }

  .landing-hero-board {
    max-width: 300px;
  }
}
.ai-error-box {
    background: #442222;
    color: #ffbaba;
    border-left: 4px solid #ff5555;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-size: 15px;
}
a {
  color: hotpink;
  background-color: yellow;
  font-weight: bold;
}