/* ==== Thầy Phong Vũ – Bói Bài Tarot ==== */

.tpv-tarot {
	position: relative;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding: 56px 20px 40px;
	overflow: hidden;
	background: radial-gradient(ellipse at 50% -10%, #3b2a63 0%, #241a45 40%, #120d29 80%, #0a0719 100%);
	color: #e9e2f5;
	font-family: Georgia, 'Times New Roman', serif;
	text-align: center;
}
.tpv-tarot *, .tpv-tarot *::before, .tpv-tarot *::after { box-sizing: border-box; }

/* --- Starfield --- */
.tpv-stars {
	position: absolute; inset: 0; pointer-events: none;
	background-image:
		radial-gradient(1.5px 1.5px at 12% 18%, #fff9e6 60%, transparent 100%),
		radial-gradient(1px 1px at 28% 62%, #ffffffcc 60%, transparent 100%),
		radial-gradient(2px 2px at 41% 31%, #ffe9a8cc 60%, transparent 100%),
		radial-gradient(1px 1px at 57% 12%, #ffffffb3 60%, transparent 100%),
		radial-gradient(1.5px 1.5px at 66% 47%, #fff3cccc 60%, transparent 100%),
		radial-gradient(1px 1px at 78% 24%, #ffffffcc 60%, transparent 100%),
		radial-gradient(2px 2px at 87% 66%, #ffe9a8b3 60%, transparent 100%),
		radial-gradient(1px 1px at 8% 82%, #ffffff99 60%, transparent 100%),
		radial-gradient(1.5px 1.5px at 48% 86%, #fff3cc99 60%, transparent 100%),
		radial-gradient(1px 1px at 93% 88%, #ffffffb3 60%, transparent 100%);
	animation: tpv-twinkle 5s ease-in-out infinite alternate;
}
@keyframes tpv-twinkle { from { opacity: .55; } to { opacity: 1; } }

/* --- Header --- */
.tpv-head { position: relative; max-width: 760px; margin: 0 auto 34px; }
.tpv-moon { font-size: 44px; color: #f0d98c; text-shadow: 0 0 22px #f0d98c88; line-height: 1; }
.tpv-brand {
	margin: 14px 0 4px; letter-spacing: .35em; text-transform: uppercase;
	font-size: 13px; color: #c9a84c;
}
.tpv-title {
	margin: 0 0 14px; font-family: 'Playfair Display', Georgia, serif;
	font-size: clamp(34px, 6vw, 56px); font-weight: 700; color: #f5e9c8;
	text-shadow: 0 2px 24px rgba(201, 168, 76, .35);
}
.tpv-title::after {
	content: ""; display: block; width: 180px; height: 1px; margin: 18px auto 0;
	background: linear-gradient(90deg, transparent, #c9a84c, transparent);
}
.tpv-sub { margin: 0; font-style: italic; color: #b7abd6; font-size: 16px; }

/* --- Steps --- */
.tpv-step { display: none; position: relative; max-width: 860px; margin: 0 auto; }
.tpv-step.is-active { display: block; animation: tpv-fadein .6s ease; }
@keyframes tpv-fadein { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* --- Question input --- */
.tpv-q-label { display: block; margin-bottom: 10px; color: #d8cdee; font-size: 15px; }
.tpv-q-input {
	width: 100%; max-width: 560px; padding: 13px 18px; margin: 0 auto;
	background: rgba(255, 255, 255, .06); border: 1px solid #5a4a8a; border-radius: 999px;
	color: #f3edfb; font-size: 15px; font-family: inherit; text-align: center; outline: none;
}
.tpv-q-input:focus { border-color: #c9a84c; box-shadow: 0 0 0 3px rgba(201, 168, 76, .18); }
.tpv-q-input::placeholder { color: #8d80b3; font-style: italic; }

/* --- Spread choice --- */
.tpv-spread-label { margin: 30px 0 16px; letter-spacing: .2em; text-transform: uppercase; font-size: 13px; color: #c9a84c; }
.tpv-spreads { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.tpv-spread {
	flex: 0 1 250px; padding: 22px 18px; cursor: pointer;
	background: linear-gradient(160deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
	border: 1px solid #5a4a8a; border-radius: 14px; color: inherit; font-family: inherit;
	transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.tpv-spread:hover {
	transform: translateY(-4px); border-color: #c9a84c;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 18px rgba(201, 168, 76, .25);
}
.tpv-spread-icon { display: block; font-size: 24px; margin-bottom: 10px; filter: sepia(1) hue-rotate(-15deg) saturate(2); }
.tpv-spread-name { display: block; font-family: 'Playfair Display', Georgia, serif; font-size: 20px; color: #f5e9c8; margin-bottom: 6px; }
.tpv-spread-desc { display: block; font-size: 13.5px; color: #b7abd6; font-style: italic; }

/* --- Card picking fan --- */
.tpv-pick-hint { font-size: 17px; color: #d8cdee; margin-bottom: 4px; }
.tpv-pick-hint b { color: #f0d98c; }
.tpv-fan { display: flex; flex-wrap: wrap; justify-content: center; padding: 18px 0 6px; }
.tpv-back {
	width: 86px; height: 140px; margin: 6px -14px; cursor: pointer; border: none; padding: 0;
	border-radius: 9px; position: relative;
	background:
		radial-gradient(circle at 50% 38%, rgba(240, 217, 140, .28) 0 8%, transparent 9%),
		repeating-conic-gradient(from 0deg at 50% 38%, rgba(201,168,76,.5) 0deg 4deg, transparent 4deg 24deg),
		radial-gradient(circle at 50% 38%, #453173 0%, #2a1d52 55%, #1a1138 100%);
	border-radius: 9px;
	box-shadow: inset 0 0 0 2px #c9a84c, inset 0 0 0 5px #1a1138, inset 0 0 0 6px rgba(201,168,76,.5), 0 6px 14px rgba(0,0,0,.5);
	transition: transform .22s ease, box-shadow .22s ease;
}
.tpv-back::after {
	content: "✶"; position: absolute; left: 0; right: 0; top: 30%;
	color: #f0d98c; font-size: 20px; text-shadow: 0 0 10px #f0d98c99;
}
.tpv-back::before {
	content: "☽  ✦  ☾"; position: absolute; left: 0; right: 0; bottom: 12px;
	color: rgba(240, 217, 140, .7); font-size: 11px; letter-spacing: 2px;
}
.tpv-back:hover { transform: translateY(-14px) scale(1.04); z-index: 5; }
.tpv-back.is-picked {
	transform: translateY(-18px) scale(1.06); z-index: 6;
	box-shadow: inset 0 0 0 2px #f0d98c, inset 0 0 0 5px #1a1138, inset 0 0 0 6px rgba(240,217,140,.7),
		0 0 24px rgba(240, 217, 140, .55), 0 10px 18px rgba(0,0,0,.5);
}
.tpv-back:disabled { cursor: default; opacity: .45; }
.tpv-back.is-picked:disabled { opacity: 1; }
.tpv-pick-count { min-height: 24px; color: #c9a84c; letter-spacing: .1em; font-size: 14px; margin-top: 10px; }

/* --- Reader block --- */
.tpv-reader { margin-bottom: 26px; }
.tpv-reader-orb { font-size: 34px; display: inline-block; animation: tpv-float 3.4s ease-in-out infinite; }
@keyframes tpv-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.tpv-reader-name {
	font-family: 'Playfair Display', Georgia, serif; font-size: 26px; color: #f5e9c8; margin: 8px 0 4px;
}
.tpv-reader-q { color: #b7abd6; font-style: italic; margin: 0; font-size: 15px; }

/* --- Result cards --- */
.tpv-results { display: flex; flex-direction: column; gap: 26px; }
.tpv-result {
	display: flex; gap: 26px; align-items: flex-start; text-align: left;
	background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.015));
	border: 1px solid #4d3f7d; border-radius: 16px; padding: 26px;
	opacity: 0; transform: translateY(24px);
	animation: tpv-rise .7s ease forwards;
}
@keyframes tpv-rise { to { opacity: 1; transform: none; } }
.tpv-result-imgwrap { flex: 0 0 190px; perspective: 900px; }
.tpv-flip { position: relative; width: 190px; height: 322px; transform-style: preserve-3d; transition: transform 1.8s cubic-bezier(.25,.8,.25,1); }
.tpv-flip.is-glowing { animation: tpv-preflip .65s ease; }
@keyframes tpv-preflip {
	0%, 100% { filter: none; }
	50% { filter: drop-shadow(0 0 26px rgba(240, 217, 140, .95)) brightness(1.25); }
}
.tpv-flip.is-flipped { transform: rotateY(180deg); }
.tpv-flip-face {
	position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
	border-radius: 12px; overflow: hidden;
	box-shadow: 0 10px 26px rgba(0,0,0,.55), 0 0 0 1px rgba(201,168,76,.55);
}
.tpv-flip-front {
	background:
		radial-gradient(circle at 50% 40%, rgba(240, 217, 140, .28) 0 7%, transparent 8%),
		repeating-conic-gradient(from 0deg at 50% 40%, rgba(201,168,76,.5) 0deg 4deg, transparent 4deg 24deg),
		radial-gradient(circle at 50% 40%, #453173 0%, #2a1d52 55%, #1a1138 100%);
}
.tpv-flip-back { transform: rotateY(180deg); background: #1a1138; }
.tpv-flip-back img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpv-flip-back img.is-reversed { transform: rotate(180deg); }
.tpv-cardname-fallback {
	display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px;
	width: 100%; height: 100%; padding: 16px;
	background:
		radial-gradient(circle at 50% 24%, rgba(240,217,140,.25) 0 10%, transparent 11%),
		linear-gradient(170deg, #3b2a63, #1a1138);
	border: 6px double #c9a84c; border-radius: 12px;
}
.tpv-cardname-fallback .tpv-fb-star { font-size: 30px; color: #f0d98c; text-shadow: 0 0 14px #f0d98c99; }
.tpv-cardname-fallback .tpv-fb-name {
	font-family: 'Playfair Display', Georgia, serif; font-size: 19px; color: #f5e9c8; text-align: center; line-height: 1.3;
}
.tpv-cardname-fallback.is-reversed { transform: rotate(180deg); }
.tpv-result-body { flex: 1 1 auto; min-width: 0; }
.tpv-pos {
	display: inline-block; margin-bottom: 8px; padding: 4px 14px; border: 1px solid #c9a84c; border-radius: 999px;
	color: #f0d98c; font-size: 12px; letter-spacing: .25em; text-transform: uppercase;
}
.tpv-result-name { font-family: 'Playfair Display', Georgia, serif; font-size: 26px; color: #f5e9c8; margin: 4px 0 2px; }
.tpv-orient { font-size: 14px; font-style: italic; color: #b7abd6; margin: 0 0 14px; }
.tpv-orient.is-rev { color: #e0a1a1; }
.tpv-meaning { color: #ded5f0; line-height: 1.75; font-size: 15.5px; margin: 0 0 16px; }
.tpv-readmore {
	display: inline-block; color: #f0d98c !important; border-bottom: 1px solid rgba(240,217,140,.5);
	font-size: 14px; letter-spacing: .05em; text-decoration: none;
}
.tpv-readmore:hover { color: #fff !important; border-color: #fff; }

/* --- Outro --- */
.tpv-outro { margin-top: 34px; }
.tpv-note {
	max-width: 620px; margin: 0 auto 24px; color: #9d90c4; font-size: 13.5px; font-style: italic; line-height: 1.7;
}
.tpv-again {
	cursor: pointer; padding: 14px 38px; font-family: 'Playfair Display', Georgia, serif; font-size: 17px;
	color: #1a1138; background: linear-gradient(160deg, #f0d98c, #c9a84c); border: none; border-radius: 999px;
	box-shadow: 0 6px 22px rgba(201, 168, 76, .4); transition: transform .25s ease, box-shadow .25s ease;
}
.tpv-again:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(201, 168, 76, .55); }

/* --- Footer --- */
.tpv-foot { margin-top: 48px; }
.tpv-foot p { margin: 0; color: #7a6da6; font-size: 12.5px; letter-spacing: .15em; text-transform: uppercase; }

/* --- Dealing the fan in --- */
.tpv-deal { opacity: 0; animation: tpv-dealin .55s cubic-bezier(.2,.9,.3,1.2) forwards; }
@keyframes tpv-dealin {
	from { opacity: 0; transform: translateY(60px) rotate(14deg) scale(.6); }
	to   { opacity: 1; transform: none; }
}
/* Once all cards are picked, the rest of the deck dissolves away */
.tpv-fan.is-done .tpv-back:not(.is-picked) {
	opacity: 0; transform: translateY(30px) scale(.85);
	transition: opacity 1.1s ease, transform 1.1s ease;
}
.tpv-fan.is-done .tpv-back.is-picked { animation: tpv-chosen 1.4s ease-in-out infinite alternate; }
@keyframes tpv-chosen {
	from { box-shadow: inset 0 0 0 2px #f0d98c, inset 0 0 0 5px #1a1138, inset 0 0 0 6px rgba(240,217,140,.7), 0 0 18px rgba(240,217,140,.45), 0 10px 18px rgba(0,0,0,.5); }
	to   { box-shadow: inset 0 0 0 2px #fff3cc, inset 0 0 0 5px #1a1138, inset 0 0 0 6px rgba(255,243,204,.9), 0 0 40px rgba(240,217,140,.9), 0 10px 18px rgba(0,0,0,.5); }
}

/* --- Sparkles on pick --- */
.tpv-sparkle {
	position: absolute; z-index: 40; pointer-events: none;
	color: #f0d98c; font-size: 15px; text-shadow: 0 0 8px #f0d98c;
	animation: tpv-sparkle 1.3s ease-out forwards;
}
@keyframes tpv-sparkle {
	0% { opacity: 0; transform: translateY(6px) scale(.4); }
	25% { opacity: 1; }
	100% { opacity: 0; transform: translateY(-46px) scale(1.15) rotate(40deg); }
}

/* --- Reading interlude (Thầy Phong Vũ) --- */
.tpv-reading-scene { padding: 26px 0 10px; }
.tpv-avatar-ring {
	position: relative; display: inline-flex; align-items: center; justify-content: center;
	width: 148px; height: 148px; border-radius: 50%; padding: 6px;
	background: conic-gradient(#c9a84c, #f0d98c, #7a5fb0, #c9a84c);
	animation: tpv-ringspin 7s linear infinite, tpv-ringglow 2.6s ease-in-out infinite alternate;
}
@keyframes tpv-ringspin { to { transform: rotate(360deg); } }
@keyframes tpv-ringglow {
	from { box-shadow: 0 0 22px rgba(201, 168, 76, .35); }
	to   { box-shadow: 0 0 52px rgba(240, 217, 140, .75); }
}
.tpv-avatar {
	width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block;
	border: 3px solid #1a1138;
	animation: tpv-ringspin 7s linear infinite reverse; /* keep the photo upright */
}
.tpv-avatar-fallback { display: flex; align-items: center; justify-content: center; font-size: 56px; background: #1a1138; }
.tpv-avatar-ring-sm { width: 96px; height: 96px; padding: 4px; margin-bottom: 4px; }
.tpv-reading-name {
	margin: 22px 0 6px; font-family: 'Playfair Display', Georgia, serif;
	font-size: 28px; color: #f5e9c8; letter-spacing: .04em;
}
.tpv-reading-msg {
	min-height: 56px; max-width: 520px; margin: 0 auto;
	color: #d8cdee; font-style: italic; font-size: 17px; line-height: 1.6;
	opacity: 0; transform: translateY(8px);
	transition: opacity .5s ease, transform .5s ease;
}
.tpv-reading-msg.is-in { opacity: 1; transform: none; }
.tpv-candles { margin-top: 26px; display: flex; gap: 26px; justify-content: center; }
.tpv-candle { font-size: 26px; animation: tpv-flicker 1.6s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(255, 190, 90, .8)); }
.tpv-candle:nth-child(2) { animation-delay: .5s; }
.tpv-candle:nth-child(3) { animation-delay: 1s; }
@keyframes tpv-flicker {
	0%, 100% { opacity: .65; transform: scale(1); }
	40% { opacity: 1; transform: scale(1.12); }
	60% { opacity: .8; }
}

/* --- Typed greeting from thầy --- */
.tpv-reader-greet {
	max-width: 640px; min-height: 30px; margin: 14px auto 0;
	color: #e9dfc4; font-size: 16px; font-style: italic; line-height: 1.7;
}
.tpv-reader-greet.is-typing::after {
	content: "▮"; margin-left: 2px; color: #f0d98c; animation: tpv-caret 1s steps(1) infinite;
}
@keyframes tpv-caret { 50% { opacity: 0; } }

/* --- Mobile --- */
@media (max-width: 680px) {
	.tpv-result { flex-direction: column; align-items: center; text-align: center; }
	.tpv-result-body { text-align: left; }
	.tpv-result-name, .tpv-pos-wrap { text-align: center; }
	.tpv-back { width: 64px; height: 104px; margin: 5px -10px; }
	.tpv-flip, .tpv-result-imgwrap { width: 170px; }
	.tpv-flip { height: 288px; }
}
