/* Karty wyniku i pozycje rozkładu — oprawa z ramek i fragmentów kart.
 *
 * Dwa bloki aplikacji dostają tę samą ramę co panel pytania, tylko cieńszą:
 *
 *   • „Pozycje rozkładu” — lista pozycji przed rozłożeniem kart,
 *   • „Odkryte karty” — kafle z nazwą karty, jej pozycją i słowami kluczami.
 *
 * W kaflach odkrytych kart ikonę zastępuje medalion: okrągły kadr z ilustracji
 * tej właśnie karty. To mechanizm, nie zestaw obrazków — adres podaje `--karta`
 * (ustawia go `wynik.js`), a kadr liczy się z proporcji karty, więc działa dla
 * każdej z 78.
 *
 * Ramka idzie jako `border-image` z atlasu: same narożniki i wąskie próbki
 * krawędzi, bo środek i tak jest rozciągany.
 *
 * UWAGA na `!important`. Na stronie ładuje się `bootstrap.min.css`, a jego
 * klasy narzędziowe mają `!important` i kolidują nazwami z Tailwindem
 * aplikacji: `.border { border: 1px solid #dee2e6 !important }` oraz
 * `.p-4 { padding: 1.5rem !important }`. Skrót `border` kasuje przy okazji
 * `border-image`, więc bez `!important` rama nie ma prawa się pokazać.
 * To obejście, nie wzorzec — właściwą naprawą jest usunięcie Bootstrapa
 * z widoku aplikacji.
 */

/* ─────────────────────────  wspólna rama  ───────────────────────── */

.tarot-root [aria-label='Odkryte karty'] li > button,
.tarot-root section > ol.grid > li {
	border-style: solid !important;
	border-color: transparent !important;
	border-radius: 0 !important;
	border-image-source: url( gfx/ramka-atlas.png ) !important;
	border-image-slice: 53 111 !important;
	border-image-repeat: stretch !important;
	background:
		linear-gradient( 168deg, rgba( 30, 23, 58, 0.55 ), rgba( 15, 12, 34, 0.7 ) );
}

/* ─────────────────────  pozycje rozkładu  ───────────────────────── */

/* Nagłówek dostaje włoskowate linie po bokach — ten sam gest co w panelu. */
.tarot-root section:has( > ol.grid ) > h2 {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	max-width: 48rem;
	margin: 0 auto;
	font-family: 'Jost', system-ui, sans-serif;
	color: #ccb88a;
}

.tarot-root section:has( > ol.grid ) > h2::before,
.tarot-root section:has( > ol.grid ) > h2::after {
	content: '';
	flex: 1 1 auto;
	height: 1px;
	background: linear-gradient( 90deg, transparent, rgba( 201, 168, 76, 0.38 ), transparent );
}

.tarot-root section > ol.grid {
	gap: 1.1rem;
}

.tarot-root section > ol.grid > li {
	border-width: 14px 30px !important;
	border-image-width: 14px 30px !important;
	padding: 0.4rem 0.3rem 0.6rem !important;
}

.tarot-root section > ol.grid > li > span {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: 1.08rem;
	letter-spacing: 0.02em;
	color: #ddcfa8;
}

.tarot-root section > ol.grid > li > p {
	margin-top: 0.25rem;
	font-family: 'Jost', system-ui, sans-serif;
	font-size: 0.82rem;
	line-height: 1.45;
	color: #8b85ac;
}

/* ───────────────────────  odkryte karty  ────────────────────────── */

.tarot-root [aria-label='Odkryte karty'] ul {
	gap: 1.1rem;
}

.tarot-root [aria-label='Odkryte karty'] li > button {
	position: relative;
	border-width: 16px 34px !important;
	border-image-width: 16px 34px !important;
	padding: 0.45rem 0.4rem 0.6rem 4.4rem !important;
	transition: border-image-source 0.2s, background 0.2s;
}

/* Medalion: kadr z ilustracji tej karty. Karty są pionowe (ok. 2:3), więc przy
 * `background-size: 200% auto` okno pokazuje pas między 14% a 44% wysokości —
 * tam, gdzie stoi postać albo główny motyw. */
.tarot-root [aria-label='Odkryte karty'] li > button::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 0.15rem;
	width: 3.2rem;
	height: 3.2rem;
	margin-top: -1.6rem;
	border: 1px solid rgba( 201, 168, 76, 0.5 );
	border-radius: 9999px !important;
	background-color: rgba( 40, 30, 72, 0.7 );
	background-image: var( --karta, none );
	background-position: 50% 22%;
	background-repeat: no-repeat;
	background-size: 200% auto;
	box-shadow:
		0 0 0 3px rgba( 13, 13, 26, 0.9 ),
		inset 0 0 12px rgba( 0, 0, 0, 0.5 );
}

.tarot-root [aria-label='Odkryte karty'] li > button > p:first-child {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: 1.1rem;
	letter-spacing: 0.01em;
	color: #ddcfa8;
}

/* Orientacja karty: zieleń i czerwień z bazy wypadały jak status systemowy.
 * Zostaje ten sam podział, ale w barwach serwisu. */
.tarot-root [aria-label='Odkryte karty'] li > button > p:first-child > span {
	font-family: 'Jost', system-ui, sans-serif;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	font-size: 0.66rem;
	color: #a9c0a4;
}

.tarot-root [aria-label='Odkryte karty'] li > button > p:first-child > span.text-red-300 {
	color: #c8a0a8;
}

.tarot-root [aria-label='Odkryte karty'] li > button > p:nth-child( 2 ) {
	margin-top: 0.15rem;
	font-family: 'Jost', system-ui, sans-serif;
	font-size: 0.7rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: #8f88bb;
}

.tarot-root [aria-label='Odkryte karty'] li > button > p:nth-child( 3 ) {
	margin-top: 0.4rem;
	font-family: 'Jost', system-ui, sans-serif;
	font-size: 0.8rem;
	line-height: 1.45;
	color: #9a94ba;
}

.tarot-root [aria-label='Odkryte karty'] li > button:hover {
	background: linear-gradient( 168deg, rgba( 42, 32, 78, 0.65 ), rgba( 18, 14, 40, 0.75 ) );
}

/* ─────────────────────────────  wąsko  ──────────────────────────── */

@media ( max-width: 640px ) {
	.tarot-root [aria-label='Odkryte karty'] li > button {
		border-width: 12px 24px !important;
		border-image-width: 12px 24px !important;
		padding: 0.4rem 0.3rem 0.5rem 3.9rem !important;
	}

	.tarot-root section > ol.grid > li {
		border-width: 11px 23px !important;
		border-image-width: 11px 23px !important;
	}
}
