@font-face {
	font-family: "Ginto Discord";
	src: url("./fonts/Ginto Discord/ABCGintoDiscord-Regular.woff2");
}

@font-face {
	font-family: "Ginto Discord Nord";
	src: url("./fonts/Ginto Discord Nord/ABCGintoDiscordNord-BlackItalic.woff2");
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--navy: #2b2a52;
	--paper: #f6f5f2;
}

html, body {
	width: 100vw;
	height: 100vh;
	overflow: hidden;
}

/* ── Page ── */
#player-body {
	position: relative;
	/* establish a stacking context so the z-index:-1 tint paints above
	   this element's background instead of dropping behind it */
	isolation: isolate;
	width: 100%;
	height: 100%;
	/* scale the whole uploader up to fill more of the screen; centered in the
	   viewport so the overflow just crops the decorative background edges */
	transform: scale(1.2);
	transform-origin: center center;
	background: radial-gradient(125% 105% at 50% 22%, #f7f6f3 0%, #efece8 65%, #e7e4df 100%);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

/* Faint full-page status tint — fades in on upload result, sits behind the UI */
#player-body::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.6s ease;
}

body.upload-success #player-body::after {
	background: radial-gradient(120% 110% at 50% 30%, rgba(53, 237, 126, 0.20) 0%, transparent 60%);
	opacity: 1;
}

body.upload-error #player-body::after {
	background: radial-gradient(120% 110% at 50% 30%, rgba(240, 71, 71, 0.20) 0%, transparent 60%);
	opacity: 1;
}

/* ── Top section ── */
#top-section {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 20px;
	margin-bottom: 40px;
}

#top-logo {
	width: 72px;
	height: auto;
	user-select: none;
}

#dropZoneTextHeader {
	font-family: 'Space Mono', monospace;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.34em;
	text-transform: uppercase;
	color: var(--navy);
	max-width: 80vw;
	/* compensate the right-side letter-spacing for true centering */
	text-indent: 0.34em;
}

#dropZoneTextParagraph {
	font-family: 'Space Mono', monospace;
	font-size: 11px;
	font-weight: 400;
	letter-spacing: 0.2em;
	line-height: 2;
	text-transform: uppercase;
	color: var(--navy);
	max-width: 80vw;
	text-indent: 0.2em;
}


/* ─────────────────────────────────────────
   CD slot + disc
   ───────────────────────────────────────── */
#cd-zone {
	position: relative;
	width: 560px;
	height: 286px;
}

/* ── Faint upload drop box behind the disc (web-style drop zone) ── */
#drop-frame {
	position: absolute;
	top: -24px;
	left: -40px;
	right: -40px;
	bottom: -46px;
	border: 2px dashed rgba(43, 42, 82, 0.22);
	border-radius: 22px;
	background: rgba(43, 42, 82, 0.012);
	z-index: 0;
	pointer-events: none;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding-bottom: 14px;
	transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, opacity 0.4s ease;
}

/* Idle interactivity hint: a faint purple glow rises, then emanates outward
   and dissipates to nothing before restarting — a soft, ephemeral pulse.
   Driven purely by the shadow's alpha/spread (no element-opacity / scale). */
#drop-frame::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 22px;
	pointer-events: none;
	animation: drop-pulse 2.4s ease-out infinite;
}

@keyframes drop-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(90, 85, 160, 0); }
	18%  { box-shadow: 0 0 16px 1px rgba(90, 85, 160, 0.24); }
	100% { box-shadow: 0 0 36px 11px rgba(90, 85, 160, 0); }
}

/* Stop pulsing once the user is interacting or the upload has begun. */
body.dragging #drop-frame::after,
#cd-zone:hover #drop-frame::after,
body.uploading #drop-frame::after {
	animation: none;
	opacity: 0;
}

#drop-hint {
	font-family: 'Space Mono', monospace;
	font-size: 10px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: rgba(43, 42, 82, 0.42);
	transition: color 0.3s ease;
}

/* Mouse-hover AND file drag-over: light up like a real drop target */
body.dragging #drop-frame,
#cd-zone:hover #drop-frame {
	border-color: rgba(90, 85, 160, 0.85);
	background: rgba(90, 85, 160, 0.08);
	box-shadow: 0 0 0 4px rgba(90, 85, 160, 0.08), 0 0 26px rgba(90, 85, 160, 0.18);
}

body.dragging #drop-hint,
#cd-zone:hover #drop-hint {
	color: rgba(90, 85, 160, 0.95);
}

/* Once a file is dropped, the box steps aside */
body.uploading #drop-frame {
	opacity: 0;
}

/* Result settled: tear down the whole uploader (box, slot, disc, LED) so the
   page no longer looks uploadable. Only the centered status text + page tint
   remain. #drop-frame lives inside #cd-zone, so this removes the box too. */
body.upload-done #cd-zone {
	display: none;
}

/* With the uploader gone, the flex column centers the status text. */
body.upload-done #top-section {
	margin-bottom: 0;
}

/* The assembly clips the disc's top at the slot line, so the disc looks
   like it's emerging from the slot. upload.js clones #dropZoneContainer
   (inside #platter), so the insertion animation on #platter survives. */
#cd-assembly {
	position: absolute;
	top: 0;
	left: 0;
	width: 560px;
	height: 284px;
	overflow: hidden;
	filter: drop-shadow(0 16px 20px rgba(0, 0, 0, 0.12));
	z-index: 2;
}

#platter {
	position: absolute;
	top: -39px;
	left: 20px;
	width: 520px;
	height: 322px;
	transition: transform 0.4s ease;
}

/* Anticipation on hover / drag-over: disc nudges toward the slot */
body.dragging #platter,
#cd-zone:hover #platter {
	transform: translateY(-10px);
}

/* ── The disc (drop zone) — full-disc CS brand label, foreshortened ── */
/* background-color is plain so upload.js can flash it green/red. */
#dropZoneContainer {
	position: absolute;
	top: 0;
	left: 0;
	width: 520px;
	height: 520px;
	border-radius: 50%;
	transform-origin: center top;
	transform: scaleY(0.62);
	background-color: var(--paper);
	background-image: repeating-linear-gradient(
		90deg,
		rgba(90, 85, 160, 0.05) 0 1px,
		transparent 1px 4px
	);
	border: 1px solid rgba(0, 0, 0, 0.07);
	cursor: pointer;
	overflow: hidden;
	box-shadow:
		inset 0 0 0 7px rgba(255, 255, 255, 0.35),
		inset 0 0 22px rgba(0, 0, 0, 0.04);
}

/* Spinning "reading" gleam shown only while uploading. A light sweep orbits
   the disc; the disc's scaleY foreshortens it, so it reads like a CD spinning
   in the drive. Masked to a ring so the label/hub stay clean. */
#disc-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 480px;
	height: 480px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.3s ease;
	z-index: 1;
	background: conic-gradient(
		from 0deg,
		rgba(90, 85, 160, 0) 0deg,
		rgba(90, 85, 160, 0) 205deg,
		rgba(90, 85, 160, 0.16) 300deg,
		rgba(255, 255, 255, 0.6) 350deg,
		rgba(90, 85, 160, 0) 360deg
	);
	-webkit-mask: radial-gradient(closest-side, transparent 36%, #000 39%);
	mask: radial-gradient(closest-side, transparent 36%, #000 39%);
}

body.uploading #disc-spinner {
	opacity: 1;
	animation: disc-spin 1.1s linear infinite;
}

@keyframes disc-spin {
	to { transform: translate(-50%, -50%) rotate(360deg); }
}

#record-logo {
	position: absolute;
	top: 140px;
	left: 50%;
	transform: translateX(-50%);
	width: 104px;
	height: auto;
	user-select: none;
	pointer-events: none;
	z-index: 2;
}

/* CD centre hole with its clear hub ring */
#record-hole {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: #edece8;
	box-shadow:
		0 0 0 11px rgba(255, 255, 255, 0.45),
		inset 0 0 0 1px rgba(0, 0, 0, 0.12),
		inset 0 2px 4px rgba(0, 0, 0, 0.16);
	z-index: 3;
}

#disc-script {
	position: absolute;
	top: 300px;
	left: 50%;
	transform: translateX(-50%);
	font-family: 'Caveat', cursive;
	font-size: 40px;
	font-weight: 600;
	line-height: 1.0;
	color: var(--navy);
	text-align: center;
	white-space: nowrap;
	z-index: 2;
}

#disc-credits {
	position: absolute;
	top: 392px;
	left: 50%;
	transform: translateX(-50%);
	font-family: 'Ginto Discord Nord', sans-serif;
	font-size: 9px;
	letter-spacing: 0.04em;
	line-height: 1.7;
	color: var(--navy);
	text-align: center;
	white-space: nowrap;
	z-index: 2;
}

/* ── Slot receiver — split into two halves so the disc threads through ──
   Top half: z-index 4 (above the disc). Bottom: 0 of cd-zone = clip edge.
   Bottom half: z-index 1 (behind the disc). Top: 0 of cd-zone.
   Together they look like one receiver panel; the disc enters the slit
   at the seam between the two halves.                                   */

#cd-slot-top {
	position: absolute;
	top: -14px;
	/* centered on the cd-zone (center x=280): -10 + 580/2 = 280 */
	left: -10px;
	width: 580px;
	height: 14px;
	border-radius: 10px 10px 0 0;
	background: linear-gradient(180deg, #ffffff 0%, #ebebE6 100%);
	box-shadow:
		0 10px 20px rgba(0, 0, 0, 0.13),
		inset 0 1px 0 rgba(255, 255, 255, 0.95);
	z-index: 4;
}

/* The dark slit opening — aligned to the disc edges (x=26–534),
   leaving a 36px bezel on each side; the right bezel holds the LED. */
#cd-slot-top::before {
	content: '';
	position: absolute;
	left: 36px;
	right: 36px;
	bottom: 0;
	height: 2.5px;
	border-radius: 2px;
	background: #26263a;
	box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.6);
	transition: box-shadow 0.3s ease, background 0.3s ease;
}

body.dragging #cd-slot-top::before,
#cd-zone:hover #cd-slot-top::before {
	background: #3a3a6a;
	box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.6), 0 0 11px 1px rgba(90, 85, 160, 0.6);
}

#cd-slot-bottom {
	position: absolute;
	top: 0;
	/* same position/width as top so the two halves align */
	left: -10px;
	width: 580px;
	height: 14px;
	border-radius: 0 0 10px 10px;
	background: linear-gradient(180deg, #e2e1dc 0%, #d8d7d1 100%);
	box-shadow: inset 0 -1px 2px rgba(0, 0, 0, 0.08);
	z-index: 1;
}

/* ── LED status indicator — right of the slot receiver ── */
#led-dot {
	position: absolute;
	/* slot seam is at y=0 of cd-zone; center the 8px dot on that line */
	top: -4px;
	/* right bezel spans x=534–570; center the dot at x=552 → right=4px */
	right: 4px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	z-index: 5;
	/* idle: off */
	background: rgba(43, 42, 82, 0.18);
	box-shadow: 0 0 0 2px rgba(43, 42, 82, 0.07);
	transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* ready: purple, matches slot glow */
body.dragging #led-dot,
#cd-zone:hover #led-dot {
	background: rgba(90, 85, 160, 0.88);
	box-shadow: 0 0 7px 2px rgba(90, 85, 160, 0.45);
}

/* uploading: amber pulse */
body.uploading #led-dot {
	animation: led-pulse 0.75s ease-in-out infinite alternate;
}

@keyframes led-pulse {
	from { background: #c98510; box-shadow: 0 0 4px 1px rgba(201, 133, 16, 0.4); }
	to   { background: #f0a820; box-shadow: 0 0 10px 3px rgba(240, 168, 32, 0.65); }
}

/* success / error: override the pulse */
body.upload-success #led-dot {
	background: #35ed7e;
	box-shadow: 0 0 8px 2px rgba(53, 237, 126, 0.55);
	animation: none;
}

body.upload-error #led-dot {
	background: #F04747;
	box-shadow: 0 0 8px 2px rgba(240, 71, 71, 0.55);
	animation: none;
}

.hide {
	display: none;
}
