:root {
	--bg: #07061a;
	--surface: rgba(255, 255, 255, .05);
	--surface-hover: rgba(255, 255, 255, .09);
	--border: rgba(255, 255, 255, .1);
	--text: #f4f2ff;
	--text-muted: #a9a3c9;
	--pink: #ff3d9a;
	--purple: #8b5cf6;
	--cyan: #22d3ee;
	--gradient: linear-gradient(135deg, var(--pink) 0%, var(--purple) 50%, var(--cyan) 100%);
	--gradient-hot: linear-gradient(135deg, #ff3d9a 0%, #ff8a3d 100%);
	--gold: linear-gradient(135deg, #ffe259 0%, #ffa751 100%);
	--silver: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 100%);
	--bronze: linear-gradient(135deg, #f6b17a 0%, #b45f2b 100%);
	--radius: 18px;
	--shadow-glow: 0 10px 40px -10px rgba(139, 92, 246, .55);
}

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

html {
	background: var(--bg);
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
	color: var(--text);
	line-height: 1.55;
	background:
		radial-gradient(circle at 10% -10%, rgba(255, 61, 154, .28), transparent 40%),
		radial-gradient(circle at 95% 10%, rgba(34, 211, 238, .22), transparent 40%),
		radial-gradient(circle at 50% 110%, rgba(139, 92, 246, .3), transparent 50%),
		var(--bg);
	background-attachment: fixed;
}

a {
	color: var(--cyan);
}

a:hover {
	color: #fff;
}

:focus-visible {
	outline: 3px solid var(--cyan);
	outline-offset: 3px;
	border-radius: 8px;
}

/* Header */

.site-header {
	position: sticky;
	top: 0;
	z-index: 10;
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	background: rgba(7, 6, 26, .7);
	border-bottom: 1px solid var(--border);
}

.site-header nav {
	max-width: 960px;
	margin: 0 auto;
	padding: .9rem 1.25rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: .6rem;
	font-weight: 800;
	font-size: 1.2rem;
	letter-spacing: -.02em;
	color: var(--text);
	text-decoration: none;
}

.brand-logo {
	display: grid;
	place-items: center;
	width: 2.2rem;
	height: 2.2rem;
	border-radius: 10px;
	background: var(--gradient);
	color: #fff;
	font-size: .9rem;
	box-shadow: var(--shadow-glow);
}

/* Layout */

main {
	max-width: 960px;
	margin: 0 auto;
	padding: 2.5rem 1.25rem 4rem;
}

.site-footer {
	text-align: center;
	color: var(--text-muted);
	font-size: .85rem;
	padding: 2rem 1rem 3rem;
}

h1,
h2 {
	letter-spacing: -.03em;
	line-height: 1.15;
}

h1 {
	font-size: clamp(2rem, 5vw, 3.25rem);
	font-weight: 900;
	margin: 0 0 .75rem;
}

h2 {
	font-size: 1.5rem;
	font-weight: 800;
	margin: 2.5rem 0 .5rem;
}

.gradient-text {
	background: var(--gradient);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.muted {
	color: var(--text-muted);
	font-size: .92rem;
}

.hero {
	margin-bottom: 2rem;
}

.hero p {
	font-size: 1.1rem;
	color: var(--text-muted);
	max-width: 38rem;
}

.eyebrow {
	display: inline-block;
	padding: .3rem .8rem;
	margin-bottom: 1rem;
	border-radius: 999px;
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #fff;
	background: rgba(255, 61, 154, .15);
	border: 1px solid rgba(255, 61, 154, .45);
}

/* Buttons */

button,
.button {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .7rem 1.3rem;
	border: 0;
	border-radius: 999px;
	background: var(--gradient);
	background-size: 200% 200%;
	color: #fff;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	box-shadow: var(--shadow-glow);
	transition: transform .15s ease, box-shadow .2s ease, background-position .4s ease;
}

button:hover,
.button:hover {
	color: #fff;
	transform: translateY(-2px);
	background-position: 100% 0;
	box-shadow: 0 14px 44px -10px rgba(255, 61, 154, .7);
}

button:active,
.button:active {
	transform: translateY(0) scale(.97);
}

.button-ghost {
	background: transparent;
	border: 1px solid var(--border);
	box-shadow: none;
	color: var(--text);
}

.button-ghost:hover {
	background: var(--surface-hover);
	box-shadow: none;
}

/* List cards */

.list-search {
	max-width: 32rem;
	margin-top: 1.5rem;
}

.list-search label {
	margin-top: 0;
}

input[type=search] {
	width: 100%;
	padding: .8rem 1rem;
	border-radius: 12px;
	border: 1px solid var(--border);
	background: rgba(0, 0, 0, .3);
	color: var(--text);
	font: inherit;
}

input[type=search]:focus {
	outline: none;
	border-color: var(--purple);
	box-shadow: 0 0 0 4px rgba(139, 92, 246, .25);
}

.list-load-more {
	min-height: 3.5rem;
	margin-top: 1.5rem;
	display: flex;
	justify-content: center;
	align-items: center;
}

.cards {
	list-style: none;
	padding: 0;
	margin: 1.5rem 0 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.25rem;
}

.card {
	position: relative;
	padding: 1.5rem;
	border-radius: var(--radius);
	background: var(--surface);
	border: 1px solid var(--border);
	overflow: hidden;
	transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.card::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 4px;
	background: var(--gradient);
}

.card:hover {
	transform: translateY(-4px);
	background: var(--surface-hover);
	border-color: rgba(139, 92, 246, .6);
}

.card h2 {
	margin: 0 0 .5rem;
	font-size: 1.25rem;
}

.card h2 a {
	color: var(--text);
	text-decoration: none;
}

/* Makes the whole card clickable. */
.card h2 a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.card p {
	color: var(--text-muted);
	margin: 0 0 1rem;
}

.pill {
	display: inline-block;
	padding: .2rem .7rem;
	border-radius: 999px;
	font-size: .8rem;
	font-weight: 700;
	background: rgba(34, 211, 238, .12);
	color: var(--cyan);
}

/* Ranking */

.ranking {
	list-style: none;
	padding: 0;
	margin: 1.5rem 0 0;
	display: grid;
	gap: .75rem;
}

.ranked-item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.25rem;
	border-radius: var(--radius);
	background: var(--surface);
	border: 1px solid var(--border);
	transition: transform .2s ease, background .2s ease;
}

.ranked-item:hover {
	transform: translateX(4px);
	background: var(--surface-hover);
}

.ranked-item .rank {
	flex: none;
	display: grid;
	place-items: center;
	width: 3.25rem;
	height: 3.25rem;
	border-radius: 14px;
	font-size: 1.25rem;
	font-weight: 900;
	background: rgba(139, 92, 246, .18);
	color: #c4b5fd;
}

.ranked-item.rank-1 .rank,
.ranked-item.rank-2 .rank,
.ranked-item.rank-3 .rank {
	color: #1a1033;
}

.ranked-item.rank-1 .rank {
	background: var(--gold);
	box-shadow: 0 0 24px rgba(255, 200, 80, .55);
}

.ranked-item.rank-2 .rank {
	background: var(--silver);
}

.ranked-item.rank-3 .rank {
	background: var(--bronze);
}

.ranked-item.rank-1 {
	border-color: rgba(255, 200, 80, .5);
	background: linear-gradient(90deg, rgba(255, 200, 80, .12), var(--surface) 60%);
}

.ranked-item .item-body {
	flex: 1;
	min-width: 0;
}

.ranked-item .item-name {
	font-weight: 700;
	font-size: 1.05rem;
}

.ranked-item .item-body .muted {
	margin-top: .15rem;
}

.like-bar {
	height: 6px;
	margin-top: .6rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, .07);
	overflow: hidden;
}

.like-bar span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--gradient);
	transition: width .4s ease;
}

.ranked-item .likes {
	flex: none;
	text-align: center;
	min-width: 3.5rem;
	font-size: 1.35rem;
	font-weight: 900;
	line-height: 1;
}

.ranked-item .likes small {
	display: block;
	margin-top: .2rem;
	font-size: .7rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--text-muted);
}

.ranked-item form {
	flex: none;
	margin: 0;
}

.like-button {
	padding: .55rem 1rem;
	background: transparent;
	border: 1px solid rgba(255, 61, 154, .6);
	box-shadow: none;
	color: #ff8cc6;
}

.like-button:hover {
	background: rgba(255, 61, 154, .15);
	box-shadow: 0 0 24px rgba(255, 61, 154, .35);
}

.like-button.liked {
	background: var(--gradient-hot);
	border-color: transparent;
	color: #fff;
	box-shadow: 0 0 24px rgba(255, 61, 154, .5);
	animation: pop .35s ease;
}

.contenders .ranked-item {
	opacity: .85;
}

.contenders .ranked-item .rank {
	background: rgba(255, 255, 255, .06);
	color: var(--text-muted);
}

/* Sharing */

.share-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-top: 1.25rem;
}

.share-label {
    font-weight: 700;
    font-size: .9rem;
}

.share-links {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.share-link,
.share-native {
    display: inline-flex;
    align-items: center;
    padding: .4rem .85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: none;
    color: var(--text);
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    transition: transform .15s ease, background .2s ease, border-color .2s ease;
}

.share-link:hover,
.share-native:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: none;
}

.share-native {
    background: var(--gradient);
    border-color: transparent;
}

.share-native.copied {
    background: linear-gradient(135deg, #22c55e, #14b8a6);
}

.share-x:hover { background: #000; border-color: #fff; }
.share-facebook:hover { background: #1877f2; border-color: #1877f2; }
.share-whatsapp:hover { background: #25d366; border-color: #25d366; color: #052e16; }
.share-reddit:hover { background: #ff4500; border-color: #ff4500; }
.share-bluesky:hover { background: #1185fe; border-color: #1185fe; }

.share-menu {
    position: relative;
    flex: none;
}

.share-menu summary {
    list-style: none;
    cursor: pointer;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 1.05rem;
    transition: background .2s ease, color .2s ease;
}

.share-menu summary::-webkit-details-marker {
    display: none;
}

.share-menu summary:hover,
.share-menu[open] summary {
    background: var(--surface-hover);
    color: #fff;
}

.share-menu .share-links {
    position: absolute;
    right: 0;
    top: calc(100% + .5rem);
    z-index: 5;
    flex-direction: column;
    min-width: 11rem;
    padding: .6rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #141133;
    box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .7);
}

.ranked-item {
    scroll-margin-top: 6rem;
}

.ranked-item:has(.share-menu[open]) {
    z-index: 6;
}

/* Highlights an entry opened from a shared link. */
.ranked-item:target {
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(255, 61, 154, .35), var(--shadow-glow);
}

/* Forms */

.panel {
	margin-top: 1.5rem;
	padding: 1.75rem;
	border-radius: var(--radius);
	background: var(--surface);
	border: 1px solid var(--border);
}

.panel h2 {
	margin-top: 0;
}

label {
	display: block;
	margin: 1.1rem 0 .4rem;
	font-weight: 700;
}

input[type=text],
input[type=number],
input[type=email],
input[type=password],
input[type=datetime-local],
textarea {
	width: 100%;
	padding: .8rem 1rem;
	border-radius: 12px;
	border: 1px solid var(--border);
	background: rgba(0, 0, 0, .3);
	color: var(--text);
	font: inherit;
	transition: border-color .2s ease, box-shadow .2s ease;
}

input::placeholder,
textarea::placeholder {
	color: #6f6a91;
}

input:focus,
textarea:focus {
	outline: none;
	border-color: var(--purple);
	box-shadow: 0 0 0 4px rgba(139, 92, 246, .25);
}

.form-actions {
	display: flex;
	align-items: center;
	gap: .75rem;
	margin-top: 1.5rem;
}

input[type=datetime-local] {
	color-scheme: dark;
}

.checkbox {
	display: flex;
	align-items: flex-start;
	gap: .7rem;
	font-weight: 500;
	color: var(--text-muted);
}

.checkbox input {
	flex-shrink: 0;
	width: 1.2rem;
	height: 1.2rem;
	margin-top: .15rem;
	accent-color: var(--pink);
}

.panel.narrow {
	max-width: 420px;
}

.panel-heading {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: .5rem;
}

/* Competitions */

.pill-prize {
	background: var(--gold);
	color: #3b2300;
}

.pill-success {
	background: rgba(52, 211, 153, .15);
	color: #6ee7b7;
}

.card .pill-prize {
	margin-left: .35rem;
}

.competition {
	position: relative;
	margin: 1.5rem 0;
	padding: 1.75rem;
	border-radius: var(--radius);
	background:
		linear-gradient(var(--bg), var(--bg)) padding-box,
		linear-gradient(135deg, #ffe259, var(--pink), var(--purple)) border-box;
	border: 2px solid transparent;
	box-shadow: 0 18px 50px -20px rgba(255, 166, 81, .55);
	scroll-margin-top: 6rem;
}

.competition h2 {
	margin: .6rem 0 .4rem;
	font-size: clamp(1.4rem, 3vw, 1.9rem);
}

.competition-badge {
	display: inline-block;
	padding: .3rem .85rem;
	border-radius: 999px;
	background: var(--gold);
	color: #3b2300;
	font-weight: 800;
	font-size: .8rem;
	text-transform: uppercase;
	letter-spacing: .08em;
}

.competition-status {
	font-size: 1.05rem;
}

.competition .steps {
	margin: 1rem 0;
	padding-left: 1.3rem;
	color: var(--text-muted);
}

.competition .steps li {
	margin: .3rem 0;
}

.competition-form {
	max-width: 480px;
}

.visit-count {
	font-size: 1.3rem;
	margin-right: .4rem;
}

.ref-link {
	margin-top: 1rem;
	font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
	font-size: .9rem;
}

/* Admin */

.nav-actions {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.nav-link {
	color: var(--text-muted);
	font-weight: 700;
	text-decoration: none;
}

.nav-link:hover {
	color: var(--text);
}

.admin-hero {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
}

.button-secondary {
	background: transparent;
	border: 1px solid var(--border);
	box-shadow: none;
	color: var(--text);
}

.button-secondary:hover {
	background: var(--surface-hover);
	box-shadow: none;
}

.button-small {
	padding: .4rem .9rem;
	font-size: .85rem;
}

button:disabled {
	opacity: .45;
	cursor: not-allowed;
	transform: none;
}

.table-wrap {
	overflow-x: auto;
	margin-top: 1rem;
}

.admin-table {
	width: 100%;
	border-collapse: collapse;
}

.admin-table th,
.admin-table td {
	padding: .75rem .6rem;
	text-align: left;
	border-bottom: 1px solid var(--border);
	vertical-align: top;
}

.admin-table th {
	color: var(--text-muted);
	font-size: .8rem;
	text-transform: uppercase;
	letter-spacing: .06em;
}

.admin-table .winner-row {
	background: rgba(255, 226, 89, .08);
}

.small {
	font-size: .8rem;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Moderation */

.notice {
	margin: 0 0 1.5rem;
	padding: 1rem 1.2rem;
	border-radius: 14px;
	background: rgba(251, 191, 36, .1);
	border: 1px solid rgba(251, 191, 36, .4);
	color: #fde68a;
}

.notice-action {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
}

.pill-warning {
	background: rgba(251, 191, 36, .15);
	color: #fcd34d;
}

.pending-suggestions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .4rem;
	margin: .5rem 0 1rem;
}

.review-list {
	list-style: none;
	padding: 0;
	margin: 1rem 0 0;
	display: grid;
	gap: .75rem;
}

.review-card {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 1.2rem;
	border-radius: 14px;
	background: rgba(0, 0, 0, .25);
	border: 1px solid var(--border);
}

.review-body {
	flex: 1 1 300px;
	min-width: 0;
}

.review-body h3 {
	margin: 0 0 .3rem;
}

.review-body p {
	margin: .25rem 0;
	overflow-wrap: anywhere;
}

.review-actions {
	display: flex;
	gap: .5rem;
}

.button-danger {
	background: rgba(255, 61, 100, .15);
	border: 1px solid rgba(255, 61, 100, .5);
	box-shadow: none;
	color: #ff8fa3;
}

.button-danger:hover {
	background: rgba(255, 61, 100, .3);
	box-shadow: none;
	color: #fff;
}

/* Messages */

p.success {
	padding: .9rem 1.1rem;
	border-radius: 12px;
	background: rgba(52, 211, 153, .12);
	border: 1px solid rgba(52, 211, 153, .4);
	color: #6ee7b7;
}

.empty-state {
	padding: 2.5rem 1.5rem;
	text-align: center;
	border-radius: var(--radius);
	border: 1px dashed var(--border);
	color: var(--text-muted);
}

.error,
.field-validation-error,
.validation-summary-errors {
	color: #ff8fa3;
}

p.error {
	padding: .9rem 1.1rem;
	border-radius: 12px;
	background: rgba(255, 61, 100, .12);
	border: 1px solid rgba(255, 61, 100, .4);
}

.validation-summary-errors ul {
	margin: 0;
	padding-left: 1.2rem;
}

@keyframes pop {
	0% { transform: scale(1); }
	40% { transform: scale(1.18); }
	100% { transform: scale(1); }
}

@media (max-width: 600px) {
	.ranked-item {
		flex-wrap: wrap;
		gap: .75rem;
	}

	.ranked-item .item-body {
		flex-basis: calc(100% - 4.5rem);
	}

	.ranked-item .likes {
		margin-left: 4.25rem;
		text-align: left;
	}

	.ranked-item form {
		margin-left: auto;
	}
}

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