/* Lithgeek Paint & Vote — house style: #0a0a0f, rainbow border, colour-coded cards, Orbitron + Exo 2, grid texture, fade-ups */
.lgv {
	--bg: #0a0a0f;
	--panel: #13131c;
	--panel-2: #1a1a26;
	--line: rgba(255, 255, 255, 0.09);
	--text: #ecebf5;
	--muted: #a3a2b8;
	--cyan: #00e5ff;
	--orange: #ff8a1f;
	--purple: #b46cff;
	--green: #3dff8f;
	--pink: #ff4fae;
	--c: var(--cyan);
	position: relative;
	isolation: isolate;
	overflow: hidden;
	max-width: 1180px;
	margin: 0 auto;
	padding: clamp(20px, 4vw, 56px);
	border-radius: 22px;
	background: var(--bg);
	color: var(--text);
	font-family: 'Exo 2', system-ui, sans-serif;
	font-size: 17px;
	line-height: 1.55;
	text-align: left;
}
.lgv *, .lgv *::before, .lgv *::after { box-sizing: border-box; }

/* Animated rainbow border */
.lgv::before {
	content: '';
	position: absolute;
	inset: 0;
	padding: 2px;
	border-radius: inherit;
	background: linear-gradient(90deg, var(--cyan), var(--orange), var(--purple), var(--green), var(--pink), var(--cyan));
	background-size: 300% 100%;
	animation: lgv-rainbow 9s linear infinite;
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	pointer-events: none;
	z-index: 3;
}
@keyframes lgv-rainbow { to { background-position: 300% 0; } }

/* Grid texture */
.lgv-gridbg {
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
	background-size: 34px 34px;
	-webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 85%);
	mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 20%, transparent 85%);
}

/* Colour tokens */
.lgv-c-cyan { --c: var(--cyan); }
.lgv-c-orange { --c: var(--orange); }
.lgv-c-purple { --c: var(--purple); }
.lgv-c-green { --c: var(--green); }
.lgv-c-pink { --c: var(--pink); }

/* Type */
.lgv h1, .lgv h2, .lgv h3 {
	font-family: 'Orbitron', 'Exo 2', sans-serif;
	color: var(--text);
	margin: 0;
	line-height: 1.1;
	letter-spacing: 0.01em;
}
.lgv p { margin: 0; }

/* Hero */
.lgv-hero { max-width: 760px; margin-bottom: clamp(28px, 5vw, 48px); }
.lgv-where { color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.lgv-title {
	font-size: clamp(2.1rem, 7vw, 4.4rem);
	font-weight: 900;
	background: linear-gradient(95deg, var(--orange) 0%, var(--pink) 45%, var(--purple) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent !important;
	margin-bottom: 18px !important;
}
.lgv-intro { font-size: 1.12rem; color: #d6d5e6; max-width: 62ch; margin-bottom: 18px; }
.lgv-status {
	display: inline-block;
	font-weight: 700;
	padding: 8px 14px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: var(--panel);
	margin-right: 10px;
	margin-bottom: 10px;
}
.lgv[data-state="open"] .lgv-status { border-color: var(--green); color: var(--green); }

/* Buttons */
.lgv-btn {
	appearance: none;
	font: 700 1rem/1 'Exo 2', sans-serif;
	padding: 14px 22px;
	border-radius: 12px;
	border: 0;
	cursor: pointer;
	color: #0a0a0f;
	background: var(--c);
	transition: transform 0.15s ease, opacity 0.15s ease;
}
.lgv-btn:hover:not(:disabled) { transform: translateY(-1px); }
.lgv-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.lgv-btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); padding: 8px 14px; }
.lgv button:focus-visible, .lgv a:focus-visible { outline: 3px solid var(--c); outline-offset: 3px; }

/* Banner for shared links */
.lgv-banner {
	margin: 0 0 28px;
	padding: 16px 18px;
	border-radius: 14px;
	background: var(--panel);
	border-left: 4px solid var(--c);
	font-weight: 600;
}

/* Steps */
.lgv-steps {
	list-style: none;
	counter-reset: step;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 14px;
	padding: 0;
	margin: 0 0 32px;
}
.lgv-steps li {
	counter-increment: step;
	position: relative;
	padding: 18px 18px 18px 64px;
	border-radius: 14px;
	background: var(--panel);
	border: 1px solid var(--line);
	border-top: 3px solid var(--c);
	color: var(--muted);
	margin: 0;
}
.lgv-steps li strong { color: var(--text); display: block; }
.lgv-steps li::before {
	content: counter(step);
	position: absolute;
	left: 18px;
	top: 16px;
	font: 900 1.7rem/1 'Orbitron', sans-serif;
	color: var(--c);
}

/* Age group jump links */
.lgv-jump { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.lgv-jump a {
	color: var(--c) !important;
	text-decoration: none !important;
	font-weight: 700;
	padding: 8px 14px;
	border: 1px solid var(--c);
	border-radius: 999px;
}

/* Group */
.lgv-group { margin-bottom: clamp(44px, 7vw, 72px); scroll-margin-top: 90px; }
.lgv-group-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--c); }
.lgv-group-head h2 { font-size: clamp(1.4rem, 3.6vw, 2rem); color: var(--c); }
.lgv-group-head p { color: var(--muted); }
.lgv-empty { color: var(--muted); padding: 22px; border: 1px dashed var(--line); border-radius: 14px; }

/* Cards */
.lgv-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
	gap: 16px;
}
.lgv-card {
	position: relative;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 16px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.lgv-card.is-picked { border-color: var(--c); box-shadow: 0 0 0 2px var(--c), 0 10px 34px -10px var(--c); }
.lgv-card.is-highlight { animation: lgv-pulse 1.4s ease-in-out 3; }
@keyframes lgv-pulse { 50% { box-shadow: 0 0 0 4px var(--c), 0 0 40px 0 var(--c); } }

.lgv-pick {
	all: unset;
	display: block;
	width: 100%;
	cursor: pointer;
}
.lgv[data-state="open"] .lgv-group:not(.is-voted) .lgv-pick:hover .lgv-photo img { transform: scale(1.04); }
.lgv-photo { position: relative; display: block; aspect-ratio: 1; background: var(--panel-2); overflow: hidden; }
.lgv-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.lgv-nophoto { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 0.9rem; }

/* The rank badge: the one bold moment */
.lgv-rank {
	position: absolute;
	top: 10px;
	left: 10px;
	min-width: 54px;
	height: 54px;
	padding: 0 10px;
	display: none;
	place-items: center;
	border-radius: 14px;
	background: var(--c);
	color: #0a0a0f;
	font: 900 1.25rem/1 'Orbitron', sans-serif;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.lgv-card.is-picked .lgv-rank { display: grid; animation: lgv-pop 0.28s cubic-bezier(.3, 1.6, .6, 1); }
@keyframes lgv-pop { from { transform: scale(0.4); opacity: 0; } }

.lgv-meta { display: flex; align-items: baseline; gap: 10px; padding: 12px 14px 4px; }
.lgv-no { font: 900 1.45rem/1 'Orbitron', sans-serif; color: var(--c); }
.lgv-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.lgv-name small { display: block; color: var(--muted); font-weight: 400; font-size: 0.82rem; }
.lgv-actions { display: flex; gap: 6px; padding: 8px 12px 12px; }
.lgv-mini {
	appearance: none;
	flex: 1;
	font: 600 0.85rem/1 'Exo 2', sans-serif;
	padding: 9px 6px;
	border-radius: 9px;
	border: 1px solid var(--line);
	background: transparent;
	color: var(--muted);
	cursor: pointer;
}
.lgv-mini:hover { color: var(--text); border-color: var(--c); }

/* Ballot tray — sticks to the bottom while you scroll the group */
.lgv-ballot {
	position: sticky;
	bottom: 12px;
	z-index: 4;
	margin-top: 22px;
	padding: 14px;
	border-radius: 18px;
	background: rgba(19, 19, 28, 0.94);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	border: 1px solid var(--c);
	box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.8);
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 12px;
	align-items: center;
}
.lgv-slots { display: flex; gap: 8px; }
.lgv-slot {
	appearance: none;
	flex: 1;
	min-width: 0;
	padding: 8px 10px;
	border-radius: 12px;
	border: 1px dashed var(--line);
	background: var(--panel-2);
	color: var(--muted);
	text-align: left;
	cursor: default;
}
.lgv-slot.is-filled { border-style: solid; border-color: var(--c); color: var(--text); cursor: pointer; }
.lgv-slot-rank { display: block; font-size: 0.75rem; font-weight: 600; }
.lgv-slot-val { display: block; font: 900 1.2rem/1.2 'Orbitron', sans-serif; }
.lgv-slot.is-filled .lgv-slot-val { color: var(--c); }
.lgv-ballot-go { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.lgv-msg { grid-column: 1 / -1; font-weight: 600; min-height: 0; }
.lgv-msg:empty { display: none; }
.lgv-msg.is-error { color: var(--pink); }
.lgv-msg.is-ok { color: var(--green); }
.cf-turnstile { min-width: 180px; }

.lgv-voted-note, .lgv-shut-note {
	display: none;
	margin-top: 20px;
	padding: 14px 18px;
	border-radius: 14px;
	background: var(--panel);
	border-left: 4px solid var(--c);
	font-weight: 600;
}
.lgv-group.is-voted .lgv-ballot { display: none; }
.lgv-group.is-voted .lgv-voted-note { display: block; }
.lgv:not([data-state="open"]) .lgv-ballot { display: none; }
.lgv:not([data-state="open"]) .lgv-group:not(.is-voted) .lgv-shut-note { display: block; }
.lgv:not([data-state="open"]) .lgv-pick, .lgv-group.is-voted .lgv-pick { cursor: default; }

/* Results */
.lgv-results { margin-bottom: 48px; }
.lgv-results h2 { font-size: clamp(1.4rem, 3.6vw, 2rem); margin-bottom: 18px; }
.lgv-results { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.lgv-results > h2 { grid-column: 1 / -1; }
.lgv-res { padding: 18px; border-radius: 16px; background: var(--panel); border-top: 3px solid var(--c); }
.lgv-res h3 { font-size: 1rem; color: var(--c); margin-bottom: 10px; }
.lgv-res ol { margin: 0; padding-left: 1.3em; }
.lgv-res li { padding: 4px 0; font-weight: 600; }
.lgv-res li span { color: var(--muted); font-weight: 400; }

/* Footer */
.lgv-rules { max-width: 70ch; color: var(--muted); font-size: 0.95rem; display: grid; gap: 10px; }
.lgv-rules strong { color: var(--text); }
.lgv-prize { color: var(--orange) !important; font-weight: 700; font-size: 1.05rem; }

/* Lightbox + toast */
.lgv-lightbox {
	max-width: min(92vw, 900px);
	padding: 0;
	border: 2px solid var(--cyan);
	border-radius: 18px;
	background: var(--bg);
	color: var(--text);
	overflow: hidden;
}
.lgv-lightbox::backdrop { background: rgba(5, 5, 10, 0.86); }
.lgv-lightbox img { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; }
.lgv-close { display: block; margin: 12px auto; --c: var(--cyan); }
.lgv-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translate(-50%, 30px);
	opacity: 0;
	pointer-events: none;
	padding: 12px 18px;
	border-radius: 12px;
	background: var(--text);
	color: #0a0a0f;
	font-weight: 700;
	z-index: 9999;
	transition: opacity 0.2s ease, transform 0.2s ease;
}
.lgv-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Fade-ups (only once JS is running, so content never hides without it) */
.lgv.lgv-js .lgv-fade, .lgv.lgv-js .lgv-card { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.2s ease, border-color 0.2s ease; }
.lgv.lgv-js .lgv-fade.is-in, .lgv.lgv-js .lgv-card.is-in { opacity: 1; transform: none; }

/* Mobile */
@media (max-width: 640px) {
	.lgv { border-radius: 14px; font-size: 16px; }
	.lgv-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.lgv-rank { min-width: 42px; height: 42px; font-size: 1rem; top: 8px; left: 8px; }
	.lgv-no { font-size: 1.2rem; }
	.lgv-ballot { grid-template-columns: 1fr; bottom: 8px; }
	.lgv-ballot-go { justify-content: stretch; }
	.lgv-ballot-go .lgv-submit { flex: 1; }
	.lgv-steps li { padding-left: 56px; }
}

@media (prefers-reduced-motion: reduce) {
	.lgv::before, .lgv-card.is-highlight, .lgv-card.is-picked .lgv-rank { animation: none; }
	.lgv.lgv-js .lgv-fade, .lgv.lgv-js .lgv-card { opacity: 1; transform: none; transition: none; }
	.lgv-photo img { transition: none; }
}
