/*
 * teaser.css — game teasers ([swatching_game], inc/teasers.php).
 * Self-contained (articles don't load the game styles). --ac is the game's accent.
 */

.sw-teaser {
	--tz-card: #16161d;
	--tz-card-2: #1f1f28;
	--tz-rim: rgba(255, 255, 255, 0.1);
	--tz-text-2: #a9acb8;
	--tz-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
	position: relative;
	clear: both;
	margin: 36px 0;
	padding: 18px;
	overflow: hidden;
	border-radius: 22px;
	background:
		radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--ac) 18%, transparent), transparent 60%),
		var(--tz-card);
	box-shadow: inset 0 0 0 1px var(--tz-rim), 0 20px 40px -24px var(--ac);
	color: #fff;
	font-family: 'Figtree', system-ui, sans-serif;
	text-align: center;
}
.sw-teaser::before {
	content: '';
	position: absolute;
	inset: 0 0 auto;
	height: 4px;
	background: var(--ac);
}

.sw-teaser-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.sw-teaser-kicker { display: inline-flex; align-items: center; gap: 8px; color: var(--tz-text-2); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.sw-teaser-kicker i { width: 9px; height: 9px; border-radius: 50%; background: var(--ac); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ac) 25%, transparent); }
.sw-teaser a.sw-teaser-daily { padding: 0; color: #fff; font-size: 0.82rem; font-weight: 800; text-decoration: none; }
.sw-teaser a.sw-teaser-daily:hover { color: #fff; text-decoration: underline; }

.sw-teaser-title { margin: 6px 0 14px; color: #fff; font-size: clamp(1.15rem, 3.4vw, 1.45rem); font-weight: 900; letter-spacing: -0.02em; line-height: 1.2; }

.sw-teaser-board { display: flex; flex-direction: column; align-items: center; gap: 12px; }

.sw-teaser-msg { min-height: 1.5em; margin: 12px 0 0; color: var(--tz-text-2); font-size: 0.95rem; font-weight: 700; line-height: 1.45; }
.sw-teaser-msg:empty { min-height: 0; }
.sw-teaser-msg.is-good { color: #4ade80; }
.sw-teaser-msg.is-bad { color: #fca5a5; }

.sw-teaser-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; }
.sw-teaser a.sw-teaser-cta,
.sw-teaser .sw-teaser-again {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 44px; padding: 0 20px;
	border: 0; border-radius: 999px;
	font: 800 0.95rem 'Figtree', system-ui, sans-serif;
	text-decoration: none; cursor: pointer;
	transition: transform 200ms var(--tz-spring), background-color 150ms ease;
}
.sw-teaser a.sw-teaser-cta { background: #fff; color: #000; font-weight: 800; }
.sw-teaser a.sw-teaser-cta:hover { color: #000; background: #ececec; transform: translateY(-1px); }
.sw-teaser-again[hidden] { display: none; }
.sw-teaser-again { background: var(--tz-card-2); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); }
.sw-teaser-again:hover { background: #2a2a35; }
/* After a round the button to the full game gets a little pulse */
.sw-teaser.is-done .sw-teaser-cta { animation: tz-pulse 1.6s ease-in-out 2; }
@keyframes tz-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ac) 35%, transparent); } }

.sw-teaser button { font-family: inherit; }

/* ---------- Hex Guess: three color buttons ---------- */
.tz-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(100%, 420px); }
.tz-choices button {
	display: flex; align-items: flex-end; justify-content: center;
	aspect-ratio: 1; padding: 0 0 10px;
	border: 0; border-radius: 16px; cursor: pointer;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 8px 18px rgba(0, 0, 0, 0.35);
	transition: transform 200ms var(--tz-spring), opacity 200ms ease;
}
.tz-choices button:hover:not(:disabled) { transform: translateY(-3px); }
.tz-choices button span { padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; font: 700 0.75rem 'Source Code Pro', ui-monospace, monospace; }
.tz-choices button:disabled { cursor: default; opacity: 0.55; }
.tz-choices button.is-right { opacity: 1; box-shadow: 0 0 0 3px #22c55e, 0 0 24px rgba(34, 197, 94, 0.4); }
.tz-choices button.is-wrong { opacity: 1; box-shadow: 0 0 0 3px #ef4444; }

/* ---------- Hue Match: stacked swatches + slider ---------- */
.tz-stack { width: min(100%, 360px); overflow: hidden; border-radius: 18px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); }
.tz-sw { position: relative; height: 84px; }
.tz-sw em { position: absolute; left: 10px; top: 10px; padding: 2px 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0.68rem; font-style: normal; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.tz-slider { display: flex; flex-direction: column; gap: 6px; width: min(100%, 360px); color: var(--tz-text-2); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-align: left; text-transform: uppercase; }
.tz-slider input { width: 100%; height: 16px; margin: 0; border-radius: 999px; background: var(--track, #333); -webkit-appearance: none; appearance: none; cursor: pointer; }
.tz-slider input::-webkit-slider-thumb { width: 26px; height: 26px; border-radius: 50%; background: transparent; box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(0, 0, 0, 0.5); -webkit-appearance: none; appearance: none; }
.tz-slider input::-moz-range-thumb { width: 20px; height: 20px; border: 3px solid #fff; border-radius: 50%; background: transparent; }
.tz-go { min-height: 42px; padding: 0 22px; border: 0; border-radius: 999px; background: #fff; color: #000; font-weight: 800; cursor: pointer; }
.tz-go:disabled { opacity: 0.4; cursor: default; }

/* ---------- Odd One Out: a square grid ---------- */
.tz-grid { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; width: min(100%, 300px); }
.tz-grid button { position: relative; aspect-ratio: 1; border: 0; border-radius: 10px; cursor: pointer; animation: tz-in 260ms var(--tz-spring) backwards; transition: transform 160ms var(--tz-spring); }
@media (hover: hover) { .tz-grid button:hover { transform: scale(1.04); } }
.tz-grid button.is-out { opacity: 0.35; cursor: default; }
.tz-grid button.is-out::after { content: '✕'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 900; }
.tz-grid button.is-right { box-shadow: 0 0 0 3px #fff; }
@keyframes tz-in { from { transform: scale(0.6); opacity: 0; } }

/* ---------- Color Grid: one row ---------- */
.tz-row { display: flex; gap: 6px; width: min(100%, 420px); border-radius: 14px; transition: gap 300ms ease; }
.tz-row button { flex: 1; aspect-ratio: 1; border: 0; border-radius: 10px; cursor: pointer; transition: transform 200ms var(--tz-spring); }
.tz-row button.is-picked { transform: translateY(-6px) scale(1.06); box-shadow: 0 0 0 3px #fff, 0 10px 18px rgba(0, 0, 0, 0.45); }
.tz-row.is-solved { gap: 0; overflow: hidden; }
.tz-row.is-solved button { border-radius: 0; opacity: 0; }

/* ---------- Brand Colors: palette bars ---------- */
.tz-palettes { display: grid; gap: 8px; width: min(100%, 420px); }
.tz-palettes button { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--tz-rim); cursor: pointer; transition: transform 200ms var(--tz-spring); }
.tz-palettes button:hover:not(:disabled) { transform: translateY(-2px); }
.tz-palettes button:disabled { cursor: default; opacity: 0.5; }
.tz-palettes button.is-right { opacity: 1; box-shadow: inset 0 0 0 3px #22c55e; }
.tz-palettes button.is-wrong { opacity: 1; box-shadow: inset 0 0 0 3px #ef4444; }
.tz-palettes em { color: #fff; font-size: 0.85rem; font-style: normal; font-weight: 800; }
.tz-bar { display: flex; height: 44px; overflow: hidden; border-radius: 10px; }
.tz-bar i { display: block; }

@media (prefers-reduced-motion: reduce) {
	.sw-teaser *, .sw-teaser { animation: none !important; transition: none !important; }
}

/* ---------- Color of the day ---------- */
.cotd-swatch {
	display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 4px;
	width: 100%; min-height: 150px; padding: 16px 18px;
	border: 0; border-radius: 18px; cursor: copy; text-align: left;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 14px 30px -14px rgba(0, 0, 0, 0.6);
	transition: transform 200ms var(--tz-spring);
}
.cotd-swatch:hover { transform: translateY(-2px); }
.cotd-swatch b { font: 600 clamp(2rem, 8vw, 2.8rem)/1 'Source Code Pro', ui-monospace, monospace; letter-spacing: -0.03em; }
.cotd-swatch span { font: 600 0.8rem 'Source Code Pro', ui-monospace, monospace; opacity: 0.85; }
.cotd-swatch em { margin-top: 6px; padding: 2px 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.18); font-size: 0.7rem; font-style: normal; font-weight: 800; }
.cotd-bar { display: flex; width: 100%; height: 52px; overflow: hidden; border-radius: 14px; }
.cotd-bar button { flex: 1; display: flex; align-items: flex-end; justify-content: center; padding: 0 0 6px; border: 0; cursor: copy; transition: flex 240ms var(--tz-spring); }
.cotd-bar button:hover { flex: 1.5; }
.cotd-bar span { font: 700 0.62rem 'Source Code Pro', ui-monospace, monospace; }
.cotd-name { margin: 0; color: var(--tz-text-2); font-size: 0.88rem; }
.cotd-name b { color: #fff; }
.sw-cotd .sw-teaser-title { display: none; }

/* ---------- Embeds: credit line ---------- */
.sw-teaser-credit { margin: 14px 0 0; color: var(--tz-text-2); font-size: 0.78rem; font-weight: 600; }
.sw-teaser .sw-teaser-credit a { padding: 0; color: #fff; font-weight: 800; text-decoration: none; }
.sw-teaser .sw-teaser-credit a:hover { text-decoration: underline; }

/* Inside articles: the article's own link styles (underline effects, white text,
   padding) must not touch the teaser's buttons and links */
.sw-teaser a::before,
.sw-teaser a::after { content: none !important; display: none !important; }

/* Hex Guess: the code's red, green, and blue pairs in their own colors */
.tz-code { font-family: 'Source Code Pro', ui-monospace, monospace; letter-spacing: 0.02em; white-space: nowrap; }
.tz-code em { font-style: normal; }
.tz-r { color: #ff8a8a; }
.tz-g { color: #74e897; }
.tz-b { color: #7fbcff; }
.sw-teaser-msg b.tz-r, .sw-teaser-msg b.tz-g, .sw-teaser-msg b.tz-b { font-weight: 800; }

/* Embeds: no accent bar or colored glow; just the card */
.sw-teaser--embed { background: var(--tz-card); box-shadow: inset 0 0 0 1px var(--tz-rim); }
.sw-teaser--embed::before { content: none; }

/* Same subtle gloss as the game tiles: top highlight, bottom shade, faint edge */
.tz-choices button,
.tz-grid button,
.tz-row button {
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -3px 0 rgba(0, 0, 0, 0.16), inset 0 0 0 1px rgba(0, 0, 0, 0.14), 0 6px 14px rgba(0, 0, 0, 0.3);
}
.tz-row.is-solved button { box-shadow: none; }
