/* VOAP H5P Attempts — gate card + fullscreen modal.
   Tokens come from gg-design-system.css (wp-gamification-plugin); fallbacks
   keep this readable if that plugin is off. */

.voah5p {
	/* Same warm maroon/mauve pair the profile page uses — the old slate greys
	   read as cold against the cream card. */
	--voah5p-fg: #660c1b;
	--voah5p-muted: #93686f;
	margin: 18px 0;
}

/* ── Card ──────────────────────────────────────────────────────────────── */

.voah5p-card {
	position: relative;
	padding: 24px;
	border-radius: 18px;
	border: 1px solid rgba(255, 255, 255, .55);
	background:
		radial-gradient(120% 120% at 0% 0%, rgba(102, 12, 27, .18) 0%, rgba(102, 12, 27, .03) 52%, rgba(255, 255, 255, .78) 100%),
		linear-gradient(140deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .7));
	box-shadow: 0 24px 55px rgba(16, 24, 40, .16), inset 0 1px 0 rgba(255, 255, 255, .75);
	text-align: center;
}

.voah5p-card__title {
	margin: 0 0 8px;
	font-family: var(--gg-font-display, inherit);
	font-size: clamp(20px, 2.4vw, 26px);
	font-weight: 700;
	line-height: 1.2;
	color: var(--voah5p-fg);
}

.voah5p-card__desc {
	margin: 0 0 10px;
	font-size: 16px;
	line-height: 1.6;
	color: var(--voah5p-fg);
}

.voah5p-card__hint {
	margin: 0 auto 16px;
	max-width: 46ch;
	padding: 9px 14px;
	border-radius: var(--gg-radius-sm, 10px);
	background: rgba(255, 255, 255, .7);
	border: 1px solid rgba(102, 12, 27, .1);
	font-size: 14px;
	line-height: 1.5;
	color: var(--voah5p-muted);
}

.voah5p-card__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.voah5p-meta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-width: 150px;
	padding: 10px 16px;
	border-radius: var(--gg-radius-sm, 10px);
	background: rgba(255, 255, 255, .8);
	border: 1px solid rgba(102, 12, 27, .12);
}

.voah5p-meta--price {
	background: var(--voah5p-fg);
	border-color: var(--voah5p-fg);
}

.voah5p-meta__label {
	font-size: 13px;
	color: var(--voah5p-muted);
}

.voah5p-meta--price .voah5p-meta__label { color: rgba(255, 255, 255, .8); }
.voah5p-meta--price .voah5p-meta__value { color: #fff; }

.voah5p-meta__value {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--gg-font-display, inherit);
	font-size: 20px;
	font-weight: 700;
	color: var(--voah5p-fg);
}

/* Reward tile flips to a "nothing left to earn" state once the content is fully paid out. */
.voah5p-meta__claimed {
	display: none;
	font-size: 14px;
	font-weight: 700;
	color: var(--gg-emerald, #0e9f6e);
}

.voah5p-meta--reward.is-claimed .voah5p-meta__label,
.voah5p-meta--reward.is-claimed .voah5p-meta__value { display: none; }
.voah5p-meta--reward.is-claimed .voah5p-meta__claimed { display: block; }

.voah5p-card__balance {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 10px 0 0;
	font-size: 14px;
	color: var(--voah5p-muted);
}

.voah5p-card__balance strong {
	color: var(--voah5p-fg);
}

.voah5p-msg {
	margin: 10px 0 0;
	font-size: 14px;
	color: var(--voah5p-fg);
}

.voah5p-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 13px 28px;
	border: 0;
	border-radius: var(--gg-radius-pill, 999px);
	background: linear-gradient(140deg, #8c1a30, #660c1b);
	box-shadow: var(--gg-shadow, 0 4px 8px rgba(60, 30, 0, .18));
	color: #fff;
	font-family: var(--gg-font-display, inherit);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform var(--gg-dur-fast, .18s) var(--gg-ease, ease), box-shadow var(--gg-dur-fast, .18s) ease;
}

.voah5p-btn:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: var(--gg-shadow-lg, 0 12px 28px rgba(60, 30, 0, .2));
	color: #fff;
}

.voah5p-btn:disabled {
	opacity: .6;
	cursor: progress;
}

/* display:inline-flex above would otherwise beat the [hidden] attribute. */
.voah5p-btn[hidden] {
	display: none;
}

.voah5p-buy {
	background: linear-gradient(140deg, #ffc233, var(--gg-gold, #f4a900));
	color: #4a2c00;
}

.voah5p-buy:hover:not(:disabled) {
	color: #4a2c00;
}

/* ── Modal ─────────────────────────────────────────────────────────────── */

.voah5p-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.voah5p-modal[hidden] {
	display: none;
}

.voah5p-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(25, 10, 16, .68);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.voah5p-modal__box {
	position: relative;
	width: min(1100px, 100%);
	max-height: 92vh;
	overflow: auto;
	padding: 16px;
	border-radius: var(--gg-radius, 14px);
	background: #fff;
	box-shadow: var(--gg-shadow-lg, 0 20px 60px rgba(0, 0, 0, .3));
	/* No fill-mode: the box must end with transform:none, or H5P's fullscreen
	   (position:fixed) would be trapped by the transformed ancestor. */
	animation: voah5p-pop .28s var(--gg-spring, cubic-bezier(.34, 1.56, .64, 1));
}

@keyframes voah5p-pop {
	from { opacity: 0; transform: translateY(12px) scale(.97); }
	to   { opacity: 1; transform: none; }
}

/* The theme styles bare <button>s with its own gradient and white text, which beat the old
   single-class rule: the button rendered as a maroon slab, and the light translucent hover
   left white text on near-white. Hence the long selector, the explicit colour on every state,
   and background-image:none to drop the inherited gradient. */
.voah5p .voah5p-modal__box .voah5p-modal__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #660c1b;
	background-image: none;
	color: #fff;
	font-family: inherit;
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
	text-shadow: none;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .28);
	cursor: pointer;
	transition: background-color .15s ease, transform .15s ease;
}

.voah5p .voah5p-modal__box .voah5p-modal__close:hover,
.voah5p .voah5p-modal__box .voah5p-modal__close:focus-visible {
	/* Lighter than the base, so it still carries white text at full contrast. */
	background: #8d1327;
	background-image: none;
	color: #fff;
	transform: scale(1.08);
}

.voah5p .voah5p-modal__box .voah5p-modal__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.voah5p .voah5p-modal__box .voah5p-modal__close { transition: none; }
	.voah5p .voah5p-modal__box .voah5p-modal__close:hover { transform: none; }
}

.voah5p-modal__body {
	padding-top: 28px;
}

body.voah5p-open {
	overflow: hidden;
}

/* Landscape phones: give the puzzle the whole screen. */
@media (max-height: 520px) {
	.voah5p-modal { padding: 0; }
	.voah5p-modal__box { max-height: 100vh; border-radius: 0; padding: 6px; }
	.voah5p-modal__body { padding-top: 22px; }
}
