/* Affirmation Cards - styles. No web fonts or images; uses the theme's font. */

/* ------------------------------------------------------------------ *
 * Theme tokens
 * ------------------------------------------------------------------ */
.afc-root {
	--afc-accent: #a78bfa;
	--afc-bg: #110f26;
	--afc-surface: #1b1838;
	--afc-surface-2: #252149;
	--afc-border: rgba(255, 255, 255, 0.12);
	--afc-text: #ece9ff;
	--afc-muted: #a8a3c7;
	--afc-good: #34d399;
	--afc-warn: #f87171;
	--afc-stage: radial-gradient(ellipse at 50% 40%, #1f1b44 0%, #0b0a1c 75%);
}

/* ------------------------------------------------------------------ *
 * Divi-proof reset. Divi (and Divi Builder on other themes) styles
 * p, ol, headings and links inside modules, sometimes with ID-level
 * selectors, so the essentials are pinned here.
 * ------------------------------------------------------------------ */
.afc-root, .afc-root * { box-sizing: border-box !important; }
.afc-root p, .afc-root ol, .afc-root li, .afc-root dl, .afc-root dt, .afc-root dd,
.afc-root h2, .afc-root h3 {
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	line-height: 1.5 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
}
.afc-root h2, .afc-root h3 { color: var(--afc-text) !important; font-family: inherit !important; }
.afc-root button { font-family: inherit !important; text-transform: none !important; letter-spacing: normal !important; line-height: 1.2 !important; box-shadow: none; }
.afc-root button::after, .afc-root .afc-btn::after { content: none !important; display: none !important; } /* Divi button arrow icons */
.afc-root a.afc-btn { color: var(--afc-text) !important; text-decoration: none !important; }
.afc-root a.afc-btn-primary { color: #fff !important; }

/* ------------------------------------------------------------------ *
 * Card + layout
 * ------------------------------------------------------------------ */
.afc-root {
	max-width: 760px;
	margin: 1.5rem auto;
	color: var(--afc-text);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	text-align: left;
}
.afc-card {
	padding: clamp(1.1rem, 3vw, 2rem);
	border-radius: 22px;
	background: var(--afc-bg);
	border: 1px solid var(--afc-border);
}
.afc-root .afc-h { font-size: clamp(1.35rem, 3.2vw, 1.75rem) !important; font-weight: 600 !important; }
.afc-root .afc-lead { color: var(--afc-muted); font-size: 1rem; max-width: 60ch; margin-top: 0.4rem !important; }
.afc-root .afc-footnote { margin-top: 1.1rem !important; font-size: 0.8rem; color: var(--afc-muted); }
.afc-root .afc-h:focus { outline: none; }

.afc-row { display: flex; flex-wrap: wrap; gap: 0.6rem; justify-content: center; margin-top: 1.2rem; }

/* ------------------------------------------------------------------ *
 * Buttons
 * ------------------------------------------------------------------ */
.afc-root .afc-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 46px;
	padding: 0.65rem 1.3rem !important;
	border-radius: 999px !important;
	border: 1px solid var(--afc-border) !important;
	background: var(--afc-surface) !important;
	color: var(--afc-text) !important;
	font-size: 0.97rem !important;
	font-weight: 500 !important;
	cursor: pointer;
	transition: border-color 0.2s, transform 0.1s, filter 0.2s;
	-webkit-tap-highlight-color: transparent;
}
.afc-root .afc-btn:hover { border-color: var(--afc-accent) !important; }
.afc-root .afc-btn:active { transform: scale(0.97); }
.afc-root .afc-btn:focus-visible, .afc-root .afc-c:focus-visible, .afc-root .afc-deck:focus-visible, .afc-root .afc-seg-btn:focus-visible, .afc-root .afc-sound:focus-visible, .afc-root .afc-mini:focus-visible {
	outline: 3px solid var(--afc-accent) !important;
	outline-offset: 3px;
}
.afc-root .afc-btn-primary {
	background: var(--afc-accent) !important;
	border-color: var(--afc-accent) !important;
	color: #fff !important;
	font-weight: 600 !important;
}
.afc-root .afc-btn-primary:hover { filter: brightness(1.08); }
.afc-root .afc-btn-quiet { background: transparent !important; color: var(--afc-muted) !important; }
.afc-root .afc-wide { min-width: min(100%, 15rem); }
.afc-root [hidden] { display: none !important; }

/* ------------------------------------------------------------------ *
 * Affirmation Cards
 * ------------------------------------------------------------------ */
.afc-root .afc-head { margin-bottom: 1.3rem; }
.afc-root .afc-controls { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: flex-start; padding: 1rem 1.1rem; border-radius: 16px; background: var(--afc-surface); border: 1px solid var(--afc-border); }
.afc-root .afc-section { display: flex; flex-direction: column; gap: 0.55rem; min-width: 0; }
.afc-root .afc-decks-wrap { flex: 1 1 360px; }
.afc-root .afc-side { flex: 0 0 auto; }
.afc-root .afc-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase !important; letter-spacing: 0.08em !important; color: var(--afc-muted); }
.afc-root .afc-decks { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.afc-root .afc-deck {
	display: inline-flex; align-items: center; gap: 0.45rem;
	min-height: 38px; padding: 0.35rem 0.85rem !important; margin: 0 !important;
	border-radius: 999px !important; border: 1px solid var(--afc-border) !important;
	background: transparent !important; color: var(--afc-muted) !important;
	font-size: 0.88rem !important; font-weight: 500 !important; cursor: pointer;
	transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.afc-root .afc-deck:hover { border-color: var(--afc-accent) !important; }
.afc-root .afc-deck.is-on { background: var(--afc-surface-2) !important; border-color: var(--afc-accent) !important; color: var(--afc-text) !important; }
.afc-root .afc-deck-n { font-size: 0.72rem; color: var(--afc-muted); font-variant-numeric: tabular-nums; }
.afc-root .afc-blurb { font-size: 0.85rem; color: var(--afc-muted); font-style: italic; min-height: 1.3em; }
.afc-root .afc-seg { display: inline-flex; gap: 0.25rem; padding: 0.25rem; border-radius: 999px; background: var(--afc-bg); border: 1px solid var(--afc-border); align-self: flex-start; }
.afc-root .afc-seg-btn {
	width: 42px; height: 34px; padding: 0 !important; margin: 0 !important;
	border-radius: 999px !important; border: 0 !important;
	background: transparent !important; color: var(--afc-muted) !important;
	font-size: 0.92rem !important; font-weight: 600 !important; cursor: pointer;
}
.afc-root .afc-seg-btn.is-on { background: var(--afc-accent) !important; color: #16112e !important; }
.afc-root .afc-sound {
	align-self: flex-start; min-height: 36px; margin-top: 0.35rem !important; padding: 0.3rem 0.9rem 0.3rem 0.7rem !important;
	border-radius: 999px !important; border: 1px solid var(--afc-border) !important;
	background: transparent !important; color: var(--afc-muted) !important; font-size: 0.85rem !important; cursor: pointer;
	display: inline-flex; align-items: center; gap: 0.45rem;
}
.afc-root .afc-sound::before { content: "" !important; display: inline-block !important; width: 8px; height: 8px; border-radius: 50%; background: var(--afc-muted); opacity: 0.6; }
.afc-root .afc-sound.is-on { color: var(--afc-text) !important; border-color: var(--afc-accent) !important; }
.afc-root .afc-sound.is-on::before { background: var(--afc-good); opacity: 1; box-shadow: 0 0 8px var(--afc-good); }

/* Table and cards */
.afc-root .afc-table { display: grid; gap: 1.1rem; margin: 1.6rem 0 0.4rem; justify-content: center; perspective: 1400px; }
.afc-root .afc-table.n-1 { grid-template-columns: minmax(0, 290px); }
.afc-root .afc-table.n-3 { grid-template-columns: repeat(3, minmax(0, 230px)); }
.afc-root .afc-table.n-5 { grid-template-columns: repeat(5, minmax(0, 170px)); gap: 0.8rem; }
.afc-root .afc-table.is-empty { grid-template-columns: 1fr; }
.afc-root .afc-empty { display: flex; flex-direction: column; align-items: center; gap: 0.6rem; padding: 2rem 1rem; border: 1px dashed var(--afc-border); border-radius: 18px; background: var(--afc-stage); color: var(--afc-muted); text-align: center; }
.afc-root .afc-empty .afc-art { width: 84px; height: 84px; color: var(--afc-accent); opacity: 0.8; }

.afc-root .afc-slot { display: flex; flex-direction: column; gap: 0.55rem; min-width: 0; animation: afc-deal 0.55s cubic-bezier(.2,.7,.3,1) both; }
@keyframes afc-deal { from { opacity: 0; transform: translateY(18px) rotate(-2deg); } to { opacity: 1; transform: none; } }

.afc-root .afc-c {
	position: relative; display: block; width: 100%; aspect-ratio: 2 / 3;
	padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 18px !important;
	background: transparent !important; color: inherit !important; cursor: pointer;
	font-size: inherit !important; font-weight: inherit !important; line-height: inherit !important; text-align: center;
	transition: transform 0.25s;
}
.afc-root .afc-c:not(.is-open):hover { transform: translateY(-4px); }
.afc-root .afc-c.is-open { cursor: default; }
.afc-root .afc-inner { position: absolute; inset: 0; display: block; transform-style: preserve-3d; transition: transform 0.9s cubic-bezier(.3,.7,.2,1); }
.afc-root .afc-c.is-open .afc-inner { transform: rotateY(180deg); }
.afc-root .afc-back, .afc-root .afc-face {
	position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
	border-radius: 18px; overflow: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden;
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}
.afc-root .afc-back {
	color: var(--afc-accent);
	background:
		radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.08), transparent 55%),
		repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 14px),
		linear-gradient(160deg, #2a2156 0%, #15112e 55%, #0d0b1f 100%);
	border: 1px solid rgba(255, 255, 255, 0.14);
}
.afc-root .afc-back::before { content: ""; position: absolute; inset: 9px; border: 1px solid var(--afc-accent); border-radius: 12px; opacity: 0.45; }
.afc-root .afc-back .afc-art { width: 62%; height: auto; filter: drop-shadow(0 0 12px rgba(167, 139, 250, 0.45)); }
.afc-root .afc-back-hint { position: absolute; bottom: 8%; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.18em; color: rgba(236, 233, 255, 0.55); }
.afc-root .afc-c:not(.is-open):hover .afc-back-hint, .afc-root .afc-c:focus-visible .afc-back-hint { color: #ece9ff; }
.afc-root .afc-face {
	transform: rotateY(180deg); gap: 0.7rem; padding: 12% 11%;
	background: radial-gradient(ellipse at 50% 35%, #2b2358 0%, #16122f 70%);
	border: 1px solid var(--afc-accent);
	color: var(--afc-text);
}
.afc-root .afc-face::after { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; pointer-events: none; }
.afc-root .afc-kicker { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; color: var(--afc-accent); }
.afc-root .afc-orn { color: var(--afc-accent); font-size: 1rem; line-height: 1; opacity: 0.8; }
.afc-root .afc-text { font-size: 1.12rem; line-height: 1.45; font-weight: 500; text-wrap: balance; }
.afc-root .afc-table.n-1 .afc-text { font-size: clamp(1.2rem, 3.4vw, 1.45rem); }
.afc-root .afc-table.n-5 .afc-text { font-size: 0.92rem; }
.afc-root .afc-table.n-5 .afc-kicker { font-size: 0.6rem; letter-spacing: 0.1em; }

.afc-root .afc-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem; visibility: hidden; opacity: 0; transition: opacity 0.4s 0.5s; }
.afc-root .afc-acts.is-on { visibility: visible; opacity: 1; }
.afc-root .afc-mini {
	min-height: 32px; padding: 0.25rem 0.75rem !important; margin: 0 !important;
	border-radius: 999px !important; border: 1px solid var(--afc-border) !important;
	background: var(--afc-surface) !important; color: var(--afc-text) !important;
	font-size: 0.8rem !important; font-weight: 500 !important; cursor: pointer;
}
.afc-root .afc-mini:hover { border-color: var(--afc-accent) !important; }
.afc-root .afc-keep.is-on { color: var(--afc-accent) !important; border-color: var(--afc-accent) !important; }
.afc-root .afc-listen.is-playing { background: var(--afc-accent) !important; color: #16112e !important; border-color: var(--afc-accent) !important; }

.afc-root .afc-row { margin-top: 1.4rem; }
.afc-root .afc-status { min-height: 1.4em; margin-top: 0.8rem !important; text-align: center; font-size: 0.9rem; color: var(--afc-muted); }

.afc-root .afc-kept { margin-top: 1.2rem; border: 1px solid var(--afc-border); border-radius: 14px; background: var(--afc-surface); }
.afc-root .afc-kept-sum { padding: 0.8rem 1rem; cursor: pointer; font-weight: 600; font-size: 0.95rem; color: var(--afc-text); }
.afc-root .afc-kept-sum:focus-visible { outline: 2px solid var(--afc-accent); outline-offset: 2px; border-radius: 14px; }
.afc-root .afc-kept-list { list-style: none !important; margin: 0 !important; padding: 0 1rem 0.8rem !important; }
.afc-root .afc-kept-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.6rem 0 !important; border-top: 1px solid var(--afc-border) !important; list-style: none !important; }
.afc-root .afc-kept-item::before { content: none !important; }
.afc-root .afc-kept-text { flex: 1 1 260px; font-style: italic; }
.afc-root .afc-kept-acts { display: flex; gap: 0.35rem; }
.afc-root .afc-footnote { text-align: center; max-width: 62ch; margin-left: auto !important; margin-right: auto !important; }

@media (max-width: 760px) {
	.afc-root .afc-table.n-5 { grid-template-columns: repeat(3, minmax(0, 170px)); }
}
@media (max-width: 560px) {
	.afc-root .afc-table.n-3, .afc-root .afc-table.n-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
	.afc-root .afc-table.n-3 .afc-slot:last-child:nth-child(odd), .afc-root .afc-table.n-5 .afc-slot:last-child:nth-child(odd) { grid-column: 1 / -1; width: calc(50% - 0.35rem); justify-self: center; }
	.afc-root .afc-table .afc-text { font-size: 0.92rem; }
	.afc-root .afc-table.n-1 .afc-text { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
	.afc-root .afc-slot { animation: none; }
	.afc-root .afc-inner { transition: none; }
	.afc-root .afc-c.is-open .afc-inner { transform: none; }
	.afc-root .afc-c.is-open .afc-back { opacity: 0; }
	.afc-root .afc-face { transform: none; opacity: 0; transition: opacity 0.4s; }
	.afc-root .afc-c.is-open .afc-face { opacity: 1; }
	.afc-root .afc-c:not(.is-open):hover { transform: none; }
}
