/**
 * Game Review Box — front-end styles.
 *
 * Layout: full-width title bar on top; cover + vertical metadata + score ring
 * beneath; 2x2 category scores; pros/cons; bottom line.
 * Theming is driven by CSS custom properties so dark/light is a token swap.
 */

.grb-review,
.grb-review *,
.grb-review *::before,
.grb-review *::after {
	box-sizing: border-box;
}

/* ---------------------------------------------------------------------------
 * Theme tokens — dark is the default.
 * ------------------------------------------------------------------------- */
.grb-review {
	--grb-card: #141419;
	--grb-card-2: #1b1b22;
	--grb-border: #2b2b35;
	--grb-titlebar-line: #2b2b35;
	--grb-text: #f3f3f6;
	--grb-muted: #9a9aa9;
	--grb-track: #26262f;
	--grb-ring-track: #2b2b35;
	--grb-head-from: #1c1c24;
	--grb-head-to: #141419;
	--grb-pc-bg: #1b1b22;
	--grb-cover-border: rgba(255, 255, 255, 0.08);

	--grb-s-exceptional: #1fc16b;
	--grb-s-great: #84cc16;
	--grb-s-good: #eab308;
	--grb-s-mediocre: #f97316;
	--grb-s-poor: #ef4444;
	--grb-ico-good-bg: rgba(31, 193, 107, 0.14);
	--grb-ico-bad-bg: rgba(239, 68, 68, 0.14);

	display: block;
	margin: 32px 0;
	border: 1px solid var(--grb-border);
	border-radius: 16px;
	overflow: hidden;
	background: var(--grb-card);
	color: var(--grb-text);
	font-family: inherit;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

/* Light theme — applied explicitly, or by the script in auto mode. */
.grb-review.grb-theme-light {
	--grb-card: #ffffff;
	--grb-card-2: #f5f5f8;
	--grb-border: #e4e4ea;
	--grb-titlebar-line: #e4e4ea;
	--grb-text: #1b1b22;
	--grb-muted: #6f6f7d;
	--grb-track: #ebebf0;
	--grb-ring-track: #e6e6ec;
	--grb-head-from: #f6f7f9;
	--grb-head-to: #ffffff;
	--grb-pc-bg: #f5f5f8;
	--grb-cover-border: rgba(0, 0, 0, 0.10);

	--grb-s-exceptional: #15a34a;
	--grb-s-great: #5f9c12;
	--grb-s-good: #bd870b;
	--grb-s-mediocre: #e35a0d;
	--grb-s-poor: #d72c2c;
	--grb-ico-good-bg: rgba(21, 163, 74, 0.12);
	--grb-ico-bad-bg: rgba(215, 44, 44, 0.12);

	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 28px rgba(0, 0, 0, 0.06);
}

/* Auto mode without JS: follow the visitor's device preference.
 * The bundled script refines this to match the site's own toggle. */
@media (prefers-color-scheme: light) {
	.grb-review.grb-theme-auto {
		--grb-card: #ffffff;
		--grb-card-2: #f5f5f8;
		--grb-border: #e4e4ea;
		--grb-titlebar-line: #e4e4ea;
		--grb-text: #1b1b22;
		--grb-muted: #6f6f7d;
		--grb-track: #ebebf0;
		--grb-ring-track: #e6e6ec;
		--grb-head-from: #f6f7f9;
		--grb-head-to: #ffffff;
		--grb-pc-bg: #f5f5f8;
		--grb-cover-border: rgba(0, 0, 0, 0.10);

		--grb-s-exceptional: #15a34a;
		--grb-s-great: #5f9c12;
		--grb-s-good: #bd870b;
		--grb-s-mediocre: #e35a0d;
		--grb-s-poor: #d72c2c;
		--grb-ico-good-bg: rgba(21, 163, 74, 0.12);
		--grb-ico-bad-bg: rgba(215, 44, 44, 0.12);

		box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 28px rgba(0, 0, 0, 0.06);
	}
}

/* Score tier → accent colour. Applied to .grb-head, .grb-ring, .grb-cat, .grb-bottom. */
.grb-tier-exceptional { --grb-c: var(--grb-s-exceptional); }
.grb-tier-great       { --grb-c: var(--grb-s-great); }
.grb-tier-good        { --grb-c: var(--grb-s-good); }
.grb-tier-mediocre    { --grb-c: var(--grb-s-mediocre); }
.grb-tier-poor        { --grb-c: var(--grb-s-poor); }

/* ---------------------------------------------------------------------------
 * In-box element resets — guard against theme bleed.
 * ------------------------------------------------------------------------- */
.grb-review h4,
.grb-review ul,
.grb-review li,
.grb-review p,
.grb-review b,
.grb-review span,
.grb-review div {
	margin: 0;
	padding: 0;
}

.grb-review ul {
	list-style: none;
}

.grb-review img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* ---------------------------------------------------------------------------
 * Header — title bar on top, then cover / metadata / score ring.
 * ------------------------------------------------------------------------- */
.grb-head {
	background: linear-gradient(150deg, var(--grb-head-from), var(--grb-head-to) 65%);
	border-bottom: 1px solid var(--grb-border);
}

/* Specificity bumped + !important on padding throughout to defeat Penci /
 * Soledad theme resets that zero padding inside .elementor-widget. */
html body .grb-review .grb-titlebar {
	padding: 22px 28px !important;
	border-bottom: 1px solid var(--grb-titlebar-line);
	font-size: 28px;
	font-weight: 800;
	letter-spacing: -0.015em;
	line-height: 1.15;
	color: var(--grb-text);
}

html body .grb-review .grb-head-row {
	display: flex;
	gap: 24px;
	padding: 24px 28px !important;
	align-items: center;
}

.grb-cover {
	width: 120px;
	min-width: 120px;
	aspect-ratio: 3 / 4;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid var(--grb-cover-border);
	background: #11131f;
}

.grb-cover-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.grb-cover-ph {
	display: block;
	width: 100%;
	height: 100%;
	background:
		radial-gradient(1px 1px at 22% 28%, rgba(255, 255, 255, 0.5), transparent),
		radial-gradient(1px 1px at 67% 17%, rgba(255, 255, 255, 0.4), transparent),
		radial-gradient(1px 1px at 80% 62%, rgba(255, 255, 255, 0.35), transparent),
		radial-gradient(1px 1px at 38% 78%, rgba(255, 255, 255, 0.45), transparent),
		linear-gradient(160deg, #3a2a6b, #1a2f5e 55%, #0e1330);
}

.grb-meta {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.grb-m {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.grb-k {
	font-size: 10px;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--grb-muted);
}

.grb-v {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--grb-text);
}

/* Score ring */
.grb-ring {
	position: relative;
	width: 120px;
	min-width: 120px;
	height: 120px;
}

/* Tinted backplate — a faded version of the tier colour, sized to sit just
 * inside the ring stroke. Gives the score a coloured "halo" instead of a
 * white/empty centre. */
.grb-ring::before {
	content: "";
	position: absolute;
	inset: 12px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--grb-c) 14%, transparent);
	z-index: 0;
	pointer-events: none;
}

.grb-ring svg {
	display: block;
	width: 120px;
	height: 120px;
	transform: rotate(-90deg);
	position: relative;
	z-index: 1;
}

/* !important defends against theme CSS that paints SVG circles white. */
.grb-ring-bg {
	fill: none !important;
	stroke: var(--grb-ring-track);
	stroke-width: 9;
}

.grb-ring-fill {
	fill: none !important;
	stroke: var(--grb-c);
	stroke-width: 9;
	stroke-linecap: round;
	stroke-dasharray: 326.73;
	/* Correct final state by default — safe when JS is unavailable. */
	stroke-dashoffset: var(--grb-offset);
}

.grb-ring-num {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 2;
}

.grb-ring-num b {
	font-size: 30px;
	font-weight: 800;
	line-height: 1;
	color: var(--grb-text);
	background: transparent;
}

.grb-ring-num span {
	font-size: 9px;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--grb-muted);
	margin-top: 3px;
}

/* ---------------------------------------------------------------------------
 * Category scores — 2x2 grid.
 * ------------------------------------------------------------------------- */
html body .grb-review .grb-cats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px 26px;
	padding: 20px 28px !important;
	border-bottom: 1px solid var(--grb-border);
}

.grb-cat-top {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 6px;
}

.grb-cat-name {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--grb-text);
}

.grb-cat-val {
	font-size: 13.5px;
	font-weight: 800;
	color: var(--grb-c);
}

.grb-bar {
	height: 7px;
	border-radius: 999px;
	background: var(--grb-track);
	overflow: hidden;
}

.grb-bar-fill {
	height: 100%;
	border-radius: 999px;
	background: var(--grb-c);
	/* Filled by default — safe when JS is unavailable. */
	width: var(--grb-w);
}

/* ---------------------------------------------------------------------------
 * Pros / cons.
 * ------------------------------------------------------------------------- */
html body .grb-review .grb-pc {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 22px;
	padding: 20px 28px !important;
	border-bottom: 1px solid var(--grb-border);
	background: var(--grb-pc-bg);
}

.grb-pc-single {
	grid-template-columns: 1fr;
}

.grb-pc h4 {
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin-bottom: 9px;
	color: var(--grb-muted);
	font-weight: 700;
}

.grb-pc ul {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.grb-pc li {
	font-size: 12.5px;
	display: flex;
	gap: 8px;
	align-items: flex-start;
	color: var(--grb-text);
}

.grb-ico {
	width: 16px;
	height: 16px;
	min-width: 16px;
	border-radius: 50%;
	margin-top: 1px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	font-weight: 900;
	line-height: 1;
}

.grb-pros .grb-ico {
	background: var(--grb-ico-good-bg);
	color: var(--grb-s-exceptional);
}

.grb-cons .grb-ico {
	background: var(--grb-ico-bad-bg);
	color: var(--grb-s-poor);
}

/* ---------------------------------------------------------------------------
 * Bottom line.
 * ------------------------------------------------------------------------- */
/* Specificity bumped + !important — Penci's theme CSS uses very broad
 * high-specificity overrides inside .elementor-widget. Belt-and-braces. */
html body .grb-review .grb-bottom {
	padding: 22px 28px 24px !important;
	display: flex;
	gap: 13px;
	align-items: center;
}

.grb-bottom-bar {
	width: 3px;
	align-self: stretch;
	min-height: 34px;
	border-radius: 2px;
	background: var(--grb-c);
}

.grb-bottom-text {
	font-size: 13px;
	color: var(--grb-text);
}

.grb-bottom-text b {
	display: block;
	font-size: 10px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--grb-muted);
	margin-bottom: 2px;
	font-weight: 700;
}

/* ---------------------------------------------------------------------------
 * Animations — only when JavaScript is present (avoids a no-JS flash).
 * .grb-has-js is set on <html>; .grb-seen is added when the box scrolls in.
 * ------------------------------------------------------------------------- */
.grb-has-js .grb-bar-fill {
	width: 0;
	transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.grb-has-js .grb-review.grb-seen .grb-bar-fill {
	width: var(--grb-w);
}

.grb-has-js .grb-ring-fill {
	stroke-dashoffset: 326.73;
	transition: stroke-dashoffset 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.grb-has-js .grb-review.grb-seen .grb-ring-fill {
	stroke-dashoffset: var(--grb-offset);
}

@media (prefers-reduced-motion: reduce) {
	.grb-has-js .grb-bar-fill {
		width: var(--grb-w);
		transition: none;
	}
	.grb-has-js .grb-ring-fill {
		stroke-dashoffset: var(--grb-offset);
		transition: none;
	}
}

/* ---------------------------------------------------------------------------
 * Responsive.
 * ------------------------------------------------------------------------- */
@media (max-width: 600px) {
	html body .grb-review .grb-titlebar {
		font-size: 23px;
		padding: 18px 20px !important;
	}
	html body .grb-review .grb-head-row {
		flex-wrap: wrap;
		justify-content: center;
		text-align: center;
		padding: 20px !important;
		gap: 18px;
	}
	.grb-meta {
		order: 3;
		flex-basis: 100%;
		align-items: center;
	}
	.grb-m {
		align-items: center;
	}
	html body .grb-review .grb-cats,
	html body .grb-review .grb-pc {
		grid-template-columns: 1fr;
		padding: 18px 20px !important;
	}
	html body .grb-review .grb-bottom {
		padding: 16px 20px 18px !important;
	}
}
