/* ── Fonts ──────────────────────────────────────────────────────────────────── */
@font-face {
	font-family: "Rounded Elegance";
	src: url("assets/Rounded_Elegance.ttf") format("truetype");
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Assistant";
	src:
		url("assets/assistant-latin-300-normal.woff2") format("woff2"),
		url("assets/assistant-latin-300-normal.woff") format("woff"),
		url("assets/assistant-latin-300-normal.ttf") format("truetype");
	font-weight: 300;
	font-style: normal;
	font-display: swap;
}

/* ── Palette ─────────────────────────────────────────────────────────────────
   #FFFFFF  white       — background
   #54C2C3  aqua        — primary accent, buttons, highlights
   #3A4450  almost-black — main text
   #000000  black       — headings, VS text
   ──────────────────────────────────────────────────────────────────────────── */

/* ── Reset & base ────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html,
body {
	height: 100%;
}

body {
	font-family: "Assistant", system-ui, sans-serif;
	font-weight: 300;
	background: #ffffff;
	color: #3a4450;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	overflow-x: hidden;
}

/* ── Top bar ─────────────────────────────────────────────────────────────────── */
#top-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 24px 12px;
	border-bottom: 1px solid #e8f6f6;
	flex-shrink: 0;
}

#app-title {
	font-family: "Rounded Elegance", serif;
	font-size: 1.15rem;
	color: #000000;
	letter-spacing: 0.01em;
}

#leaderboard-btn {
	background: none;
	border: none;
	font-family: "Assistant", system-ui, sans-serif;
	font-weight: 300;
	font-size: 0.85rem;
	color: #54c2c3;
	cursor: pointer;
	padding: 4px 0;
	letter-spacing: 0.02em;
	transition: opacity 0.2s;
}

#leaderboard-btn:hover {
	opacity: 0.7;
}

/* ── Voting view ─────────────────────────────────────────────────────────────── */
#voting-view {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px 20px 60px;
	gap: 0;
}

#voting-area {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 580px;
}

/* ── Quote buttons ───────────────────────────────────────────────────────────── */
.quote-button {
	background: #54c2c3;
	color: #ffffff;
	border: none;
	border-radius: 16px;
	padding: 22px 28px 16px;
	margin: 12px 0;
	width: 100%;
	max-width: 560px;
	min-height: 100px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	cursor: pointer;
	text-align: center;
	box-shadow: 0 4px 14px rgba(84, 194, 195, 0.25);
	transition:
		transform 0.18s ease,
		box-shadow 0.18s ease;
	/* animation will override transform, so keep it here only for hover */
}

.quote-button:hover:not(:disabled) {
	transform: scale(1.03);
	box-shadow: 0 6px 20px rgba(84, 194, 195, 0.38);
}

.quote-button:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.quote-text {
	font-family: "Assistant", system-ui, sans-serif;
	font-weight: 300;
	font-size: 1.05rem;
	line-height: 1.55;
	white-space: pre-line; /* preserves \n in dialogue quotes */
	color: #000000;
	word-break: break-word;
}

.quote-meta {
	font-family: "Assistant", system-ui, sans-serif;
	font-weight: 300;
	font-size: 0.7rem;
	color: rgba(0, 0, 0, 0.72);
	letter-spacing: 0.025em;
}

/* ── VS divider ─────────────────────────────────────────────────────────────── */
#vs-text {
	font-family: "Rounded Elegance", serif;
	font-size: 1.4rem;
	color: #000000;
	letter-spacing: 0.1em;
	margin: 2px 0;
	user-select: none;
}

/* ── Error message ───────────────────────────────────────────────────────────── */
#error-msg {
	font-size: 0.82rem;
	color: #e05555;
	margin-top: 14px;
	text-align: center;
	min-height: 1.2em;
}

/* ── Vote counter bar ────────────────────────────────────────────────────────── */
#vote-counter-bar {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	text-align: center;
	padding: 10px;
	background: rgba(255, 255, 255, 0.88);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	border-top: 1px solid #e8f6f6;
	z-index: 10;
}

#vote-counter {
	font-size: 0.78rem;
	color: #3a4450;
	opacity: 0.6;
}

/* ── Leaderboard view ────────────────────────────────────────────────────────── */
#leaderboard-view {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 32px 24px 80px;
	overflow-y: auto;
}

#leaderboard-title {
	font-family: "Rounded Elegance", serif;
	font-size: 1.6rem;
	color: #000000;
	letter-spacing: 0.04em;
	margin-bottom: 28px;
}

#leaderboard-list {
	list-style: none;
	width: 100%;
	max-width: 640px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

#leaderboard-list li {
	display: grid;
	grid-template-columns: 2.2rem 1fr auto;
	align-items: start;
	gap: 12px;
	padding: 16px 18px;
	background: #f7fdfd;
	border-radius: 12px;
	border: 1px solid #d6f0f0;
}

.lb-rank {
	font-family: "Rounded Elegance", serif;
	font-size: 1.3rem;
	color: #54c2c3;
	line-height: 1.4;
	text-align: right;
	padding-top: 1px;
}

.lb-quote {
	font-family: "Assistant", system-ui, sans-serif;
	font-weight: 300;
	font-size: 0.95rem;
	color: #3a4450;
	line-height: 1.55;
	white-space: pre-line;
	word-break: break-word;
}

.lb-elo {
	font-family: "Assistant", system-ui, sans-serif;
	font-weight: 300;
	font-size: 0.78rem;
	color: #54c2c3;
	white-space: nowrap;
	padding-top: 3px;
}

#back-btn {
	margin-top: 32px;
	background: none;
	border: 1.5px solid #54c2c3;
	color: #54c2c3;
	border-radius: 8px;
	padding: 10px 22px;
	font-family: "Assistant", system-ui, sans-serif;
	font-weight: 300;
	font-size: 0.9rem;
	cursor: pointer;
	transition:
		background 0.18s,
		color 0.18s;
}

#back-btn:hover {
	background: #54c2c3;
	color: #ffffff;
}

/* ── Button animations ───────────────────────────────────────────────────────── */
@keyframes leaveUp {
	0% {
		transform: translateY(0) scale(1);
		opacity: 1;
	}
	100% {
		transform: translateY(-130%) scale(0.85);
		opacity: 0;
	}
}
@keyframes leaveDown {
	0% {
		transform: translateY(0) scale(1);
		opacity: 1;
	}
	100% {
		transform: translateY(130%) scale(0.85);
		opacity: 0;
	}
}
@keyframes enterFromTop {
	0% {
		transform: translateY(-130%) scale(0.85);
		opacity: 0;
	}
	100% {
		transform: translateY(0) scale(1);
		opacity: 1;
	}
}
@keyframes enterFromBottom {
	0% {
		transform: translateY(130%) scale(0.85);
		opacity: 0;
	}
	100% {
		transform: translateY(0) scale(1);
		opacity: 1;
	}
}

.quote-button.anim-leave-up {
	/*animation: leaveUp 0.55s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;*/
	animation: leaveUp 0.3s ease-in forwards;
}
.quote-button.anim-leave-down {
	animation: leaveDown 0.3s ease-in forwards;
}
.quote-button.anim-enter-top {
	animation: enterFromTop 0.3s ease-out forwards;
}
.quote-button.anim-enter-bot {
	animation: enterFromBottom 0.3s ease-out forwards;
}

/* ── View transitions ────────────────────────────────────────────────────────── */
#voting-view,
#leaderboard-view {
	transition: opacity 0.25s ease;
}
#voting-view[hidden],
#leaderboard-view[hidden] {
	display: none;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
	.quote-text {
		font-size: 0.95rem;
	}
	.quote-button {
		padding: 18px 20px 14px;
		border-radius: 13px;
	}
	#leaderboard-list li {
		grid-template-columns: 1.8rem 1fr auto;
		gap: 8px;
		padding: 12px 14px;
	}
}
