/**
 * Delos Tarot Styles
 *
 * Stunning 3D card animations with physics-based interactions.
 * Smooth flip animations with CSS3D transforms.
 *
 * @package DelosTarot
 */

/* ========================================================================
   VARIABLES & RESET
   ======================================================================== */

:root {
	--at-primary: #8b5cf6;
	--at-primary-light: #a78bfa;
	--at-primary-dark: #7c3aed;
	--at-secondary: #ec4899;
	--at-accent: #fbbf24;

	--at-dark-bg: #0f172a;
	--at-dark-surface: #1e293b;
	--at-dark-surface-light: #334155;
	--at-dark-text: #f1f5f9;
	--at-dark-text-muted: #94a3b8;

	--at-card-width: 180px;
	--at-card-height: 280px;
	--at-card-radius: 12px;

	--at-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
	--at-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.25);
	--at-shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
	--at-shadow-glow: 0 0 40px rgba(139, 92, 246, 0.3);

	--at-transition-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
	--at-transition-smooth: cubic-bezier(0.4, 0.0, 0.2, 1);

	/* Admin-customizable variables */
	--delosa-bg-color: linear-gradient(135deg, #0f172a 0%, #1a1f3a 100%);
	--delosa-card-back-color: linear-gradient(135deg, var(--at-primary) 0%, var(--at-primary-dark) 100%);
	--delosa-card-back-image: none;
	--delosa-reversed-rotation: 180deg;
	--delos-bg-image: none;
}

/* ========================================================================
   MAIN CONTAINER
   ======================================================================== */

.antigravity-tarot-app {
	max-width: 1200px;
	width: 100%;
	margin: 0 auto;
	padding: 2rem 1rem;
	box-sizing: border-box;
	/* CJK font support: Noto Sans JP for Japanese, Noto Sans KR for Korean */
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans JP", "Noto Sans KR", "Helvetica Neue", Arial, "Hiragino Sans", "Meiryo", "Malgun Gothic", sans-serif;
	color: var(--at-dark-text);
}

.tarot-container {
	background: var(--delosa-bg-color);
	background-image: var(--delos-bg-image);
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	border-radius: 24px;
	padding: 3rem;
	box-shadow: var(--at-shadow-lg);
	position: relative;
	overflow: hidden;
}

/* Dark overlay for background image readability */
.tarot-container::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	border-radius: 24px;
	pointer-events: none;
	z-index: 0;
	/* Only show overlay when background image is set */
	opacity: 0;
}

/* Show overlay when background image is applied via JavaScript */
.tarot-container[style*="--delos-bg-image: url"]::before,
.tarot-container.has-bg-image::before {
	opacity: 1;
}

/* Animated gradient effect layer */
.tarot-container::after {
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: radial-gradient(circle at 30% 50%,
			rgba(139, 92, 246, 0.08) 0%,
			transparent 50%);
	animation: gradientShift 15s ease infinite;
	pointer-events: none;
	z-index: 0;
}

@keyframes gradientShift {

	0%,
	100% {
		transform: translate(0, 0) rotate(0deg);
	}

	33% {
		transform: translate(5%, 5%) rotate(120deg);
	}

	66% {
		transform: translate(-5%, 5%) rotate(240deg);
	}
}

/* ========================================================================
   STEPS & TRANSITIONS
   ======================================================================== */

.tarot-step {
	display: none;
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.6s var(--at-transition-smooth),
		transform 0.6s var(--at-transition-smooth);
	position: relative;
	z-index: 2;
	/* Above container pseudo-elements */
}

.tarot-step.active {
	display: block;
	animation: stepFadeIn 0.6s var(--at-transition-smooth) forwards;
}

@keyframes stepFadeIn {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.step-header {
	text-align: center;
	margin-bottom: 3rem;
}

.step-title {
	font-size: 2.5rem;
	font-weight: 700;
	margin: 0 0 1rem 0;
	background: linear-gradient(135deg, var(--at-primary-light), var(--at-secondary));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.step-description {
	font-size: 1.125rem;
	color: var(--at-dark-text-muted);
	margin: 0;
}

/* ========================================================================
   FORM ELEMENTS
   ======================================================================== */

.question-form {
	max-width: 600px;
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
	padding: 0;
	/* Parent handles padding */
}

.form-group {
	margin-bottom: 2rem;
}

.form-label {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--at-primary-light);
	margin-bottom: 0.5rem;
}

.tarot-question-input,
.spread-select {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	/* Prevent overflow from padding */
	background: var(--at-dark-surface);
	border: 2px solid var(--at-dark-surface-light);
	border-radius: 12px;
	padding: 1rem;
	font-size: 1rem;
	color: var(--at-dark-text);
	transition: all 0.3s var(--at-transition-smooth);
}

.tarot-question-input:focus,
.spread-select:focus {
	outline: none;
	border-color: var(--at-primary);
	box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.tarot-question-input::placeholder {
	color: var(--at-dark-text-muted);
}

/* ========================================================================
   BUTTONS
   ======================================================================== */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 1rem 2rem;
	font-size: 1rem;
	font-weight: 600;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.3s var(--at-transition-spring);
	position: relative;
	overflow: hidden;
	/* Mobile touch improvements */
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	z-index: 5;
	/* Ensure buttons are above all overlays */
	/* iOS Safari specific fixes */
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	user-select: none;
	-webkit-user-select: none;
}

.btn-primary {
	background: linear-gradient(135deg, var(--at-primary), var(--at-primary-dark));
	color: white;
	box-shadow: var(--at-shadow-md), var(--at-shadow-glow);
}

.btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: var(--at-shadow-lg), var(--at-shadow-glow);
}

.btn-primary:active {
	transform: translateY(0);
}

.btn-secondary {
	background: var(--at-dark-surface);
	color: var(--at-dark-text);
	border: 2px solid var(--at-dark-surface-light);
}

.btn-secondary:hover {
	border-color: var(--at-primary);
	transform: translateY(-2px);
}

.btn-icon {
	font-size: 1.5rem;
	display: none;
	/* Hide icons on buttons */
}

.btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none !important;
}

/* Button ripple effect */
.btn::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	transform: translate(-50%, -50%);
	transition: width 0.6s, height 0.6s;
	pointer-events: none;
	/* Ensure ripple doesn't block clicks */
}

.btn:active::before {
	width: 300px;
	height: 300px;
}

/* ========================================================================
   CARD DECK & SHUFFLE ANIMATION
   ======================================================================== */

.card-deck-container {
	perspective: 1500px;
	min-height: 400px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 2rem 0;
}

.card-deck {
	position: relative;
	width: var(--at-card-width);
	height: var(--at-card-height);
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;
	pointer-events: auto;
	/* Explicitly receive touch events */
}

/* Visual hint that deck is tappable */
.card-deck:active {
	transform: scale(0.98);
}

.tarot-card-back {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: var(--delosa-card-back-color);
	background-image: var(--delosa-card-back-image);
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	border-radius: var(--at-card-radius);
	box-shadow: var(--at-shadow-md);
	transform-style: preserve-3d;
	transform: translateZ(0) rotateY(0deg);
	transition: transform 0.6s var(--at-transition-spring);
	/* Allow parent to receive touch events */
	pointer-events: none;
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;
}

.card-deck.shuffling .tarot-card-back {
	animation: shuffleCard 1.5s var(--at-transition-spring) infinite;
	animation-delay: calc(var(--index) * 0.1s);
}

@keyframes shuffleCard {

	0%,
	100% {
		transform: translateY(0) rotateY(0deg) rotateZ(0deg);
	}

	25% {
		transform: translateY(-20px) rotateY(15deg) rotateZ(-5deg);
	}

	50% {
		transform: translateY(-30px) rotateY(-10deg) rotateZ(5deg);
	}

	75% {
		transform: translateY(-20px) rotateY(10deg) rotateZ(-3deg);
	}
}

/* ========================================================================
   3D CARD FLIP - THE "ANTIGRAVITY" EFFECT
   ======================================================================== */

.tarot-card-wrapper {
	perspective: 1500px;
	-webkit-perspective: 1500px;
	margin: 1rem;
	display: inline-block;
	/* Force above all overlays */
	position: relative;
	z-index: 10;
	/* iOS Safari GPU layer promotion */
	-webkit-transform: translateZ(0);
	transform: translateZ(0);
	/* iOS touch interaction fixes */
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;
	touch-action: manipulation;
	cursor: pointer;
	/* iOS needs this for tap recognition */
	-webkit-tap-highlight-color: rgba(139, 92, 246, 0.3);
	/* Visual feedback */
}

.tarot-card {
	position: relative;
	width: var(--at-card-width);
	height: var(--at-card-height);
	/* iOS Safari 3D rendering - MUST be on the rotating element */
	-webkit-transform-style: preserve-3d;
	transform-style: preserve-3d;
	/* Default: Show front face (card is "flipped" to reveal front) */
	-webkit-transform: rotateY(180deg);
	transform: rotateY(180deg);
	transition: transform 0.8s var(--at-transition-spring);
	-webkit-transition: -webkit-transform 0.8s var(--at-transition-spring);
	/* Hardware acceleration for iOS */
	will-change: transform;
	cursor: pointer;
	/* iOS touch interaction fixes */
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
}

/* Interactive flip state - toggles card back to face-down */
.tarot-card.is-flipped {
	-webkit-transform: rotateY(0deg);
	transform: rotateY(0deg);
}

/* CRITICAL: Antigravity hover effect */
.tarot-card:hover {
	transform: rotateY(180deg) translateY(-15px) rotateZ(2deg) scale(1.05);
	filter: drop-shadow(0 25px 50px rgba(139, 92, 246, 0.4));
}

.tarot-card.is-flipped:hover {
	transform: rotateY(0deg) translateY(-15px) rotateZ(2deg) scale(1.05);
}

.tarot-card.reversed {
	/* Admin-controllable: Set --delosa-reversed-rotation to 0deg for upright display */
	transform: rotateY(180deg) rotateZ(var(--delosa-reversed-rotation));
}

.tarot-card.reversed:hover {
	transform: rotateY(180deg) rotateZ(var(--delosa-reversed-rotation)) translateY(-15px) scale(1.05);
}

/* ========================================================================
   CARD FACES - iOS Z-INDEX SWAP TECHNIQUE
   This ensures face visibility even when preserve-3d fails on iOS
   ======================================================================== */

.card-face {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border-radius: var(--at-card-radius);
	/* iOS Safari explicit vendor prefixes */
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	/* Hardware acceleration */
	-webkit-transform: translateZ(0);
	transform: translateZ(0);
	will-change: transform, z-index;
	overflow: hidden;
	box-shadow: var(--at-shadow-md);
	/* iOS touch fixes */
	-webkit-touch-callout: none;
	-webkit-user-select: none;
	user-select: none;
	pointer-events: none;
	/* Let parent handle events */
	/* Smooth z-index transitions */
	transition: z-index 0s 0.4s;
	/* Delay z-index change until mid-flip */
}

/* FRONT FACE: Visible by default (card starts rotated 180deg) */
.card-face.card-front {
	background: transparent !important;
	background-color: transparent !important;
	-webkit-transform: rotateY(0deg) translateZ(1px);
	transform: rotateY(0deg) translateZ(1px);
	z-index: 2;
	/* On top when card is showing front */
	padding: 0 !important;
	border: none !important;
	box-shadow: none !important;
	overflow: hidden !important;
}

/* BACK FACE: Hidden by default */
.card-back {
	background: var(--delosa-card-back-color);
	background-image: var(--delosa-card-back-image);
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	-webkit-transform: rotateY(180deg) translateZ(1px);
	transform: rotateY(180deg) translateZ(1px);
	z-index: 1;
	/* Behind when card is showing front */
	display: flex;
	align-items: center;
	justify-content: center;
}

/* iOS Z-INDEX SWAP: When card is flipped back to face-down */
.tarot-card.is-flipped .card-front {
	z-index: 1;
	/* Send to back */
}

.tarot-card.is-flipped .card-back {
	z-index: 2;
	/* Bring to front */
}

/* FULL-BLEED IMAGE: Force image to cover entire card face */
.card-face.card-front img {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	border-radius: var(--at-card-radius);
	display: block !important;
	margin: 0 !important;
	padding: 0 !important;
	/* Exit 3D context and flip horizontally to counter parent's rotateY(180deg) */
	-webkit-transform-style: flat;
	transform-style: flat;
	-webkit-transform: scaleX(-1) !important;
	transform: scaleX(-1) !important;
}

.card-name {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	font-weight: 600;
	text-align: center;
	color: var(--at-dark-bg);
	/* Exit 3D context and flip horizontally to counter parent's rotateY(180deg) */
	display: inline-block;
	-webkit-transform-style: flat;
	transform-style: flat;
	-webkit-transform: scaleX(-1) !important;
	transform: scaleX(-1) !important;
}

/* Only show emoji when no custom image is set */
.card-back::before {
	content: '✨';
	font-size: 4rem;
	opacity: 0.6;
}

/* Hide emoji when custom card back image is applied */
.card-back.has-custom-back::before {
	display: none;
}

/* Card reveal animation */
.tarot-card-wrapper {
	opacity: 0;
	transform: translateY(50px) scale(0.8);
	transition: opacity 0.6s var(--at-transition-smooth),
		transform 0.6s var(--at-transition-spring);
	transition-delay: calc(var(--card-index) * 0.15s);
}

.tarot-card-wrapper.revealed {
	opacity: 1;
	transform: translateY(0) scale(1);
}

/* Card position label - outside the 3D flip context */
.card-position {
	text-align: center;
	margin-top: 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--at-primary-light);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	/* Ensure label stays outside 3D context */
	position: relative;
	z-index: 10;
	transform-style: flat;
}

/* Card name label - OUTSIDE the 3D flip context (Solution B: DOM Separation)
   This element is a sibling of .tarot-card, not a child.
   It naturally stays upright because it's not inside the rotating container. */
.card-label-static {
	text-align: center;
	margin-top: 0.75rem;
	font-size: 1rem;
	font-weight: 700;
	color: var(--at-dark-text);
	/* No transforms needed - this is outside the 3D context */
	position: relative;
	z-index: 10;
	/* Ensure no 3D inheritance */
	transform-style: flat;
	transform: none;
}

/* ========================================================================
   SPREAD LAYOUTS
   ======================================================================== */

.spread-layout {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2rem;
	margin: 3rem 0;
	min-height: 400px;
}

/* Single Card */
.spread-layout.spread-single-card {
	justify-content: center;
}

/* Three Card Spread */
.spread-layout.spread-three-card {
	justify-content: center;
}

/* Celtic Cross */
.spread-layout.spread-celtic-cross {
	display: grid;
	grid-template-columns: repeat(4, var(--at-card-width));
	grid-template-rows: repeat(4, auto);
	gap: 1.5rem;
	justify-content: center;
}

.spread-celtic-cross .tarot-card-wrapper:nth-child(1) {
	grid-column: 2;
	grid-row: 2;
}

.spread-celtic-cross .tarot-card-wrapper:nth-child(2) {
	grid-column: 2;
	grid-row: 2;
	transform: rotate(90deg);
}

.spread-celtic-cross .tarot-card-wrapper:nth-child(3) {
	grid-column: 2;
	grid-row: 3;
}

.spread-celtic-cross .tarot-card-wrapper:nth-child(4) {
	grid-column: 2;
	grid-row: 1;
}

.spread-celtic-cross .tarot-card-wrapper:nth-child(5) {
	grid-column: 3;
	grid-row: 2;
}

.spread-celtic-cross .tarot-card-wrapper:nth-child(6) {
	grid-column: 1;
	grid-row: 2;
}

.spread-celtic-cross .tarot-card-wrapper:nth-child(7),
.spread-celtic-cross .tarot-card-wrapper:nth-child(8),
.spread-celtic-cross .tarot-card-wrapper:nth-child(9),
.spread-celtic-cross .tarot-card-wrapper:nth-child(10) {
	grid-column: 4;
}

/* ========================================================================
   INTERPRETATION
   ======================================================================== */

.reading-interpretation {
	background: var(--at-dark-surface);
	border-radius: 16px;
	padding: 2rem;
	margin: 2rem 0;
	border: 1px solid var(--at-dark-surface-light);
}

.interpretation-header h3 {
	margin: 0 0 1.5rem 0;
	font-size: 1.5rem;
	color: var(--at-primary-light);
}

.interpretation-content {
	line-height: 1.8;
	color: var(--at-dark-text);
}

.interpretation-content h2 {
	font-size: 1.25rem;
	margin: 1.5rem 0 0.75rem 0;
	color: var(--at-primary-light);
}

.interpretation-content h3 {
	font-size: 1.125rem;
	margin: 1.25rem 0 0.5rem 0;
	color: var(--at-accent);
}

.interpretation-content p {
	margin: 0.75rem 0;
}

.interpretation-notice {
	background: rgba(251, 191, 36, 0.1);
	border-left: 4px solid var(--at-accent);
	padding: 1rem;
	margin-bottom: 1.5rem;
	border-radius: 8px;
	font-size: 0.875rem;
}

/* ========================================================================
   LOADING & ERROR STATES
   ======================================================================== */

.tarot-loading {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 0.95);
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	z-index: 100;
	border-radius: 24px;
}

.loading-spinner {
	width: 60px;
	height: 60px;
	border: 4px solid var(--at-dark-surface-light);
	border-top-color: var(--at-primary);
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

.loading-text {
	font-size: 1.125rem;
	color: var(--at-dark-text-muted);
	margin: 0;
}

.tarot-error {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 2rem;
	background: rgba(220, 38, 38, 0.1);
	border: 2px solid rgba(220, 38, 38, 0.3);
	border-radius: 16px;
	margin: 2rem 0;
}

.error-icon {
	font-size: 3rem;
}

.error-message {
	color: #fca5a5;
	text-align: center;
	margin: 0;
}

.reading-actions {
	text-align: center;
	margin-top: 2rem;
}

/* ========================================================================
   RESPONSIVE - Mobile First Design
   ======================================================================== */

@media (max-width: 768px) {
	.tarot-container {
		padding: 2rem 1rem;
		border-radius: 16px;
	}

	.step-title {
		font-size: 1.75rem;
	}

	.step-description {
		font-size: 1rem;
	}

	:root {
		--at-card-width: 140px;
		--at-card-height: 220px;
	}

	/* Vertical layout for card spreads on mobile */
	.spread-layout {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 1.5rem;
		overflow-x: hidden;
		/* Prevent horizontal scroll */
		max-width: 100%;
	}

	.spread-layout.spread-celtic-cross {
		grid-template-columns: repeat(2, var(--at-card-width));
		gap: 1rem;
	}

	/* 44px minimum touch targets for accessibility */
	.btn {
		min-height: 48px;
		min-width: 48px;
		padding: 1rem 1.5rem;
		font-size: 1rem;
	}

	/* Improve touch response on cards */
	.tarot-card-wrapper {
		touch-action: manipulation;
		-webkit-tap-highlight-color: transparent;
	}

	/* Prevent card hover effects on touch devices */
	@media (hover: none) {
		.tarot-card:hover {
			transform: rotateY(180deg);
			filter: none;
		}

		.tarot-card.reversed:hover {
			transform: rotateY(180deg) rotateZ(var(--delosa-reversed-rotation));
		}
	}

	/* Form improvements */
	.tarot-question-input,
	.spread-select {
		font-size: 16px;
		/* Prevent iOS zoom on focus */
		min-height: 48px;
		touch-action: manipulation;
		-webkit-tap-highlight-color: transparent;
	}

	/* Interpretation readability */
	.reading-interpretation {
		padding: 1.5rem;
	}

	.interpretation-content {
		font-size: 1rem;
		line-height: 1.7;
	}
}

/* Extra small devices (phones in portrait) */
@media (max-width: 480px) {
	:root {
		--at-card-width: 120px;
		--at-card-height: 190px;
	}

	.tarot-container {
		padding: 1.5rem 1rem;
	}

	.step-title {
		font-size: 1.5rem;
	}

	.btn {
		width: 100%;
		justify-content: center;
	}
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
	.spread-layout {
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: center;
	}

	:root {
		--at-card-width: 100px;
		--at-card-height: 155px;
	}
}

/* ========================================================================
   BRUTE-FORCE FIX: UN-MIRROR CARD TEXT AND IMAGES
   The parent .tarot-card rotates 180deg, causing all content to appear mirrored.
   This section applies aggressive counter-transforms with !important.
   ======================================================================== */

/* Target ALL text and images inside the card front face */
.antigravity-tarot-app .tarot-card .card-front img,
.antigravity-tarot-app .tarot-card .card-front .card-name,
.antigravity-tarot-app .tarot-card .card-front span,
.antigravity-tarot-app .tarot-card .card-front h1,
.antigravity-tarot-app .tarot-card .card-front h2,
.antigravity-tarot-app .tarot-card .card-front h3,
.antigravity-tarot-app .tarot-card .card-front p,
.tarot-card .card-front img,
.tarot-card .card-front .card-name {
	/* CRITICAL: Display must be block or inline-block for transform to work */
	display: block !important;
	/* Counter the parent's rotateY(180deg) */
	-webkit-transform: rotateY(180deg) !important;
	transform: rotateY(180deg) !important;
	/* Ensure backface is visible after counter-rotation */
	-webkit-backface-visibility: visible !important;
	backface-visibility: visible !important;
	/* Force flat 3D context for this element */
	-webkit-transform-style: flat !important;
	transform-style: flat !important;
}