/**
 * "Uzmini vārdu, ja sanāk" campaign & game styles.
 *
 * Follows the Figma design (file QiItmrsSqgCmgMPDd58hpJ). Scoped under .uv.
 * Multi-screen flow: .uv-screen views toggle; .uv-modal overlays sit on top.
 *
 * Font: Tele2 Slab (see assets/fonts/fonts.css). Falls back to a slab-serif
 * stack until the brand .woff2 files are bundled.
 */

.uv {
	--uv-blue: #0086ff;
	--uv-black: #000000;
	--uv-green: #87da00;
	--uv-yellow: #f1dd00;
	--uv-grey: #b0b0b0;
	--uv-tip-bg: #f3f3f3;

	--uv-font: "Tele2 Slab", "Roboto Slab", "Rockwell", Georgia, serif;

	font-family: var(--uv-font);
	color: var(--uv-black);
	line-height: 1.35;
	-webkit-font-smoothing: antialiased;
}

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

.uv img {
	max-width: 100%;
	height: auto;
}

/* Reset the page chrome so the campaign fills the viewport. */
body.home {
	margin: 0;
	background: #fff;
}

/* Tech-grid background (Figma "foons") ----------------------------------- */

.uv-tech-bg {
	background-color: #dcefff;
	background-image: url("../images/bg-tech.png");
	background-size: cover;
	background-position: top center;
	background-repeat: no-repeat;
}

/* Screens ---------------------------------------------------------------- */

.uv-screen[hidden] {
	display: none;
}

.uv-screen--game {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 100vh;
	padding: 40px 16px 60px;
}


/* Brand lockup ----------------------------------------------------------- */

.uv-lockup--hero {
	display: block;
	width: min(410px, 72vw);
	margin: 4px auto 0;
}

.uv-lockup--game {
	display: block;
	width: min(290px, 62vw);
	margin: 10px auto 24px;
}

/* Hero ------------------------------------------------------------------- */

.uv-hero {
	background: var(--uv-blue);
	color: #fff;
	text-align: center;
	padding: 46px 20px 56px;
}

.uv-hero__lead {
	font-size: clamp(1.15rem, 3.5vw, 1.625rem);
	line-height: 1.35;
	margin: 20px auto 24px;
	max-width: 900px;
}

/* Legal page (Noteikumi) ------------------------------------------------- */

.uv-hero--legal {
	padding-bottom: 44px;
}

.uv-lockup-link {
	display: inline-block;
	line-height: 0;
}

.uv-legal__title {
	margin: 18px 0 0;
	color: #fff;
	font-weight: 900;
	font-size: clamp(2rem, 6vw, 3rem);
	text-transform: uppercase;
	text-align: center;
}

.uv-legal {
	display: flex;
	justify-content: center;
	padding: 44px 20px 80px;
}

.uv-legal__card {
	width: 100%;
	max-width: 860px;
	background: #fff;
	padding: 48px clamp(20px, 5vw, 56px);
	box-shadow: 0 20px 50px rgba(12, 42, 92, 0.14);
	font-size: 1.05rem;
	line-height: 1.65;
}

.uv-legal__card h1,
.uv-legal__card h2,
.uv-legal__card h3,
.uv-legal__card h4 {
	font-weight: 900;
	line-height: 1.2;
	margin: 1.6em 0 0.5em;
}

.uv-legal__card h1:first-child,
.uv-legal__card h2:first-child {
	margin-top: 0;
}

.uv-legal__card p {
	margin: 0 0 1em;
}

.uv-legal__card a {
	color: var(--uv-blue);
}

.uv-legal__card ul,
.uv-legal__card ol {
	margin: 0 0 1em;
	padding-left: 1.4em;
}

.uv-legal__card li {
	margin-bottom: 0.4em;
}

.uv-legal__back {
	margin-top: 44px !important;
	font-weight: 700;
}

/* Buttons ---------------------------------------------------------------- */

.uv-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	font-family: var(--uv-font);
	font-weight: 700;
	font-size: 1.25rem;
	line-height: 1;
	min-width: 200px;
	height: 60px;
	padding: 0 24px;
	border: 0;
	border-radius: 0;
	cursor: pointer;
	transition: filter 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.uv-btn:hover {
	filter: brightness(0.95);
}

.uv-btn--solid {
	background: var(--uv-blue);
	color: #fff;
}

.uv-btn--ghost {
	background: #fff;
	color: var(--uv-blue);
}

.uv-arrow {
	width: 30px;
	height: 12px;
	flex: 0 0 auto;
}

/* Prize pool ------------------------------------------------------------- */

.uv-prizes {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 32px 20px 44px;
}

.uv-badge {
	display: inline-block;
	font-weight: 800;
	color: #fff;
	background: var(--uv-black);
	font-size: clamp(1.5rem, 5vw, 2.25rem);
	line-height: 1;
	padding: 8px 22px;
}

.uv-prizes__draw {
	font-size: 1.25rem;
	margin: 12px 0 40px;
}

.uv-heading {
	font-weight: 900;
	font-size: clamp(1.7rem, 6vw, 2.25rem);
	margin: 30px 0 10px;
}

.uv-heading--sm {
	font-size: clamp(1.5rem, 5.5vw, 2rem);
	margin-top: 44px;
}

.uv-prizes__text {
	font-size: 1.25rem;
	margin: 0 auto 8px;
	max-width: 760px;
}

.uv-prizes__phone {
	width: 260px;
	margin: 16px auto 8px;
}

.uv-prizes__promo {
	width: 318px;
	margin: 20px auto 8px;
}

/* Terms checkbox --------------------------------------------------------- */

.uv-terms {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 30px 0 22px;
	font-size: 1.125rem;
}

.uv-terms__label {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
}

.uv-terms input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.uv-terms__box {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	border: 2px solid var(--uv-blue);
	border-radius: 3px;
	color: #fff;
	display: grid;
	place-items: center;
}

.uv-terms__box svg {
	width: 16px;
	height: 16px;
	visibility: hidden;
}

.uv-terms input:checked + .uv-terms__box {
	background: var(--uv-blue);
}

.uv-terms input:checked + .uv-terms__box svg {
	visibility: visible;
}

.uv-terms input:focus-visible + .uv-terms__box {
	outline: 2px solid var(--uv-blue);
	outline-offset: 2px;
}

.uv-terms__link {
	color: inherit;
}

.uv-terms--nudge {
	animation: uv-shake 0.4s ease;
}

/* Game board ------------------------------------------------------------- */

.uv-board {
	--tile: clamp(42px, 11.5vw, 70px);
	display: grid;
	grid-auto-rows: var(--tile);
	gap: 5px;
	justify-content: center;
	margin: 6px auto 30px;
}

.uv-board__row {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: var(--tile);
	gap: 5px;
}

.uv-tile {
	width: var(--tile);
	height: var(--tile);
	display: grid;
	place-items: center;
	background: #fff;
	font-weight: 900;
	font-size: calc(var(--tile) * 0.6);
	line-height: 1;
	text-transform: uppercase;
	color: var(--uv-black);
}

.uv-tile--filled {
	animation: uv-pop 0.1s ease;
}

.uv-tile--correct { background: var(--uv-green); color: #fff; }
.uv-tile--present { background: var(--uv-yellow); color: #fff; }
.uv-tile--absent  { background: var(--uv-grey);  color: #fff; }

@keyframes uv-pop {
	from { transform: scale(0.88); }
	to   { transform: scale(1); }
}

.uv-board__row--invalid {
	animation: uv-shake 0.4s ease;
}

@keyframes uv-shake {
	0%, 100% { transform: translateX(0); }
	20%, 60% { transform: translateX(-6px); }
	40%, 80% { transform: translateX(6px); }
}

.uv-message {
	min-height: 1.4rem;
	font-weight: 700;
	color: var(--uv-blue);
	margin: 0 0 10px;
	text-align: center;
}

/* Keyboard --------------------------------------------------------------- */

.uv-keyboard {
	display: flex;
	flex-direction: column;
	gap: 7px;
	width: 100%;
	max-width: 680px;
	margin: 10px auto 0;
}

.uv-keyboard__row {
	display: flex;
	justify-content: center;
	gap: 6px;
}

.uv-key {
	/* Fill the row and shrink to fit (so 13 keys never overflow on mobile);
	   the max-width cap keeps keys uniform and tidy on wider screens. */
	flex: 1 1 0;
	min-width: 0;
	max-width: 46px;
	height: clamp(48px, 12vw, 58px);
	display: grid;
	place-items: center;
	background: #fff;
	border: 0;
	border-radius: 8px;
	font-family: var(--uv-font);
	font-weight: 800;
	font-size: clamp(0.95rem, 4.2vw, 1.6rem);
	line-height: 1;
	color: var(--uv-blue);
	cursor: pointer;
	box-shadow: 0 2px 3px rgba(12, 42, 92, 0.12);
	-webkit-tap-highlight-color: transparent;
	transition: filter 0.1s ease, transform 0.05s ease;
}

.uv-key:hover {
	filter: brightness(0.96);
}

.uv-key:active {
	transform: translateY(1px);
}

.uv-key--action {
	flex-grow: 1.5;
	max-width: 76px;
	background: var(--uv-blue);
	color: #fff;
}

.uv-key--action svg {
	width: 26px;
	height: 26px;
}

.uv-key--correct { background: var(--uv-green); color: #fff; }
.uv-key--present { background: var(--uv-yellow); color: #fff; }
.uv-key--absent  { background: var(--uv-grey);  color: #fff; }

/* Rules link ------------------------------------------------------------- */

.uv-rules-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 30px;
	background: none;
	border: 0;
	font-family: var(--uv-font);
	font-weight: 700;
	font-size: 1.25rem;
	color: var(--uv-black);
	text-decoration: underline;
	cursor: pointer;
}

/* Modals ----------------------------------------------------------------- */

.uv-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: grid;
	place-items: center;
	padding: 24px 16px;
	overflow-y: auto;
}

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

.uv-modal__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(20, 40, 70, 0.7);
}

.uv-modal__panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 947px;
	background: #fff;
	padding: 46px 40px 44px;
	text-align: center;
	animation: uv-modal-in 0.2s ease;
}

@keyframes uv-modal-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

.uv-modal__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	background: none;
	border: 0;
	border-radius: 999px;
	color: var(--uv-black);
	cursor: pointer;
	transition: background 0.12s ease;
}

.uv-modal__close:hover {
	background: rgba(0, 0, 0, 0.07);
}

.uv-modal__title {
	font-weight: 900;
	font-size: clamp(1.7rem, 5vw, 2.25rem);
	margin: 0 0 16px;
}

.uv-modal__lead {
	font-size: 1.25rem;
	line-height: 1.4;
	margin: 0 auto 22px;
	max-width: 786px;
}

.uv-modal__subhead {
	font-weight: 900;
	font-size: 1.25rem;
	margin: 6px 0 4px;
}

.uv-modal__phone {
	width: 200px;
	margin: 8px auto 18px;
}

/* Rules legend ----------------------------------------------------------- */

.uv-legend {
	list-style: none;
	padding: 0;
	margin: 24px auto;
	max-width: 470px;
	text-align: left;
	display: grid;
	gap: 18px;
}

.uv-legend li {
	display: flex;
	align-items: center;
	gap: 18px;
	font-size: 1.25rem;
}

.uv-legend__swatch {
	width: 60px;
	height: 60px;
	flex: 0 0 auto;
}

.uv-legend__swatch--correct { background: var(--uv-green); }
.uv-legend__swatch--present { background: var(--uv-yellow); }
.uv-legend__swatch--absent  { background: var(--uv-grey); }

.uv-tip {
	background: var(--uv-tip-bg);
	padding: 20px 24px;
	margin: 0 auto 28px;
	font-size: 1.25rem;
	line-height: 1.45;
}

.uv-tip strong {
	font-weight: 900;
}

/* Faces (win / lose) ----------------------------------------------------- */

.uv-face {
	display: inline-block;
	line-height: 0;
	margin-bottom: 10px;
}

.uv-face--happy { color: var(--uv-blue); }
.uv-face--sad   { color: #ff2d2d; }

/* Instagram field (win) -------------------------------------------------- */

.uv-ig {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	margin: 0 auto;
}

.uv-ig label {
	font-size: 1.25rem;
}

.uv-ig input {
	width: 400px;
	max-width: 100%;
	height: 50px;
	padding: 0 16px;
	border: 2px solid var(--uv-blue);
	border-radius: 0;
	font-family: var(--uv-font);
	font-weight: 700;
	font-size: 1.25rem;
	text-align: center;
	color: var(--uv-black);
}

.uv-ig input::placeholder {
	color: var(--uv-black);
	opacity: 1;
}

.uv-ig__msg {
	min-height: 1.2rem;
	margin: 4px 0 0;
	font-weight: 700;
}

.uv-ig__msg--ok  { color: #1a8a1a; }
.uv-ig__msg--err { color: #d12b2b; }

.uv-modal__note {
	font-size: 1rem;
	margin: 18px 0 0;
}

.uv-modal__note a {
	color: var(--uv-black);
}

/* Responsive tweaks ------------------------------------------------------ */

@media (max-width: 620px) {
	.uv-modal__panel {
		padding: 40px 20px 32px;
	}

	.uv-legend__swatch {
		width: 44px;
		height: 44px;
	}

	/* Give the keyboard as much width as possible on phones. */
	.uv-screen--game {
		padding-left: 8px;
		padding-right: 8px;
	}

	.uv-keyboard {
		gap: 6px;
		max-width: 100%;
	}

	.uv-keyboard__row {
		gap: 4px;
	}

	.uv-key {
		height: 52px;
		border-radius: 6px;
		box-shadow: 0 1px 2px rgba(12, 42, 92, 0.14);
	}

	.uv-key--action svg {
		width: 20px;
		height: 20px;
	}
}

@media (max-width: 380px) {
	.uv-key {
		height: 48px;
		font-size: 0.9rem;
	}

	.uv-keyboard__row {
		gap: 3px;
	}
}
