:root {
	--cyan: #35d8ff;
	--pink: #ff3cc8;
	--purple: #b44dff;
	--gold: #ffd24a;
	--green: #4dffc8;
	--ink: #e9f3ff;
	--panel: rgba(10, 8, 30, 0.55);
	--line: rgba(140, 200, 255, 0.22);
	--display: "Orbitron", "Segoe UI", system-ui, sans-serif;
	--text: "Rajdhani", "Segoe UI", system-ui, sans-serif;
}
html, body {
	margin: 0; padding: 0; height: 100%; overflow: hidden;
	background: #04030c; color: var(--ink);
	font-family: var(--text);
	touch-action: none; -webkit-user-select: none; user-select: none;
}
canvas#game { display: block; width: 100%; height: 100%; cursor: crosshair; }
body.playing canvas#game { cursor: none; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; }

.round {
	position: fixed; z-index: 40; width: 40px; height: 40px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center; cursor: pointer;
	background: var(--panel); border: 1px solid var(--line); font-size: 16px;
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
#sound-toggle { top: 12px; right: 12px; }
#sound-toggle.muted { opacity: 0.55; }
#pause-btn { top: 12px; right: 60px; font-size: 12px; letter-spacing: -2px; }

.btn {
	font-family: var(--display); font-weight: 800; letter-spacing: 0.12em;
	border: none; border-radius: 10px; padding: 13px 26px; cursor: pointer; color: #050414;
	background: linear-gradient(135deg, #5ae8ff, #b46bff 60%, #ff4fd8);
	box-shadow: 0 0 24px rgba(90, 200, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.5);
	transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 0 34px rgba(180, 110, 255, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn.big { font-size: 1.15rem; padding: 16px 40px; }
.btn.ghost { background: rgba(120, 180, 255, 0.08); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(140, 200, 255, 0.35); }
.btn.small { padding: 8px 14px; font-size: 0.75rem; min-width: 92px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; filter: grayscale(0.6); }

/* ---------- title ---------- */
.overlay {
	position: fixed; inset: 0; z-index: 30;
	display: flex; align-items: center; justify-content: center; padding: 18px; box-sizing: border-box;
}
#title { background: radial-gradient(ellipse at 50% 35%, rgba(20, 10, 60, 0.1), rgba(4, 3, 12, 0.55) 75%); }
.title-wrap { text-align: center; max-width: 620px; margin-top: -8vh; }
.logo { font-family: var(--display); font-weight: 900; line-height: 0.92; letter-spacing: 0.06em; }
.logo span { display: block; }
.logo .nova {
	font-size: clamp(3.2rem, 13vw, 7rem);
	background: linear-gradient(180deg, #ffffff 10%, #7ae6ff 55%, #2a7aff);
	-webkit-background-clip: text; background-clip: text; color: transparent;
	filter: drop-shadow(0 0 18px rgba(80, 200, 255, 0.75)) drop-shadow(0 0 40px rgba(60, 120, 255, 0.5));
}
.logo .strike {
	font-size: clamp(1.8rem, 7.2vw, 3.9rem); letter-spacing: 0.42em; margin-left: 0.42em;
	background: linear-gradient(90deg, #ff4fd8, #b46bff, #ff4fd8);
	-webkit-background-clip: text; background-clip: text; color: transparent;
	filter: drop-shadow(0 0 14px rgba(255, 60, 200, 0.8));
	animation: shimmer 3s linear infinite; background-size: 200% 100%;
}
@keyframes shimmer { to { background-position: 200% 0; } }
.tag { font-size: 1.15rem; color: #c6d6ff; margin: 18px auto 18px; max-width: 460px; text-shadow: 0 2px 8px #000; }
.title-stats { display: flex; justify-content: center; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.title-stats div {
	min-width: 110px; padding: 8px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line);
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.title-stats span { display: block; font-family: var(--display); font-size: 0.6rem; letter-spacing: 0.2em; color: #8aa6d8; }
.title-stats b { font-family: var(--display); font-size: 1.15rem; }
#menu-credits { color: var(--green); }
.title-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.how { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 22px; font-size: 0.95rem; color: #9fb3dd; }
.how b { color: var(--cyan); font-weight: 700; margin-right: 4px; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud button { pointer-events: auto; }
.panel {
	background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
	box-shadow: 0 0 20px rgba(60, 120, 255, 0.12), inset 0 0 20px rgba(60, 120, 255, 0.06);
}
.lbl { font-family: var(--display); font-size: 0.58rem; letter-spacing: 0.25em; color: #8aa6d8; }
.hud-top { position: absolute; top: 10px; left: 10px; right: 110px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.score-panel { padding: 8px 14px 10px; min-width: 170px; }
#score { font-family: var(--display); font-weight: 800; font-size: 1.7rem; line-height: 1.1; text-shadow: 0 0 12px rgba(90, 200, 255, 0.7); font-variant-numeric: tabular-nums; }
.combo-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.mult { font-family: var(--display); font-weight: 900; font-size: 0.9rem; padding: 1px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); }
.mult.m2, .mult.m3 { color: #050414; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.mult.m4, .mult.m5 { color: #050414; background: var(--purple); box-shadow: 0 0 14px var(--purple); }
.mult.m6, .mult.m7, .mult.m8 { color: #050414; background: var(--pink); box-shadow: 0 0 18px var(--pink); animation: pulse 0.5s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.12); } }
#combo-num { font-family: var(--display); font-size: 0.7rem; letter-spacing: 0.12em; color: var(--gold); }
.combo-track { height: 3px; margin-top: 6px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; overflow: hidden; }
#combo-bar { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--pink)); transform-origin: left; transform: scaleX(0); }
.wave { font-family: var(--display); font-weight: 800; letter-spacing: 0.2em; padding: 10px 16px; font-size: 0.85rem; color: #cfe2ff; }
.life-panel { padding: 8px 12px; text-align: right; }
#hp { display: flex; gap: 4px; justify-content: flex-end; margin: 4px 0 6px; }
#hp i { width: 16px; height: 9px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); transform: skewX(-20deg); }
#hp i.on { background: linear-gradient(90deg, #4dffc8, #35d8ff); box-shadow: 0 0 8px #35d8ff; }
#bombs { font-size: 1rem; color: #ff5af0; text-shadow: 0 0 8px #ff5af0; letter-spacing: 2px; min-height: 1.2em; }
#bombs .none { font-size: 0.7rem; color: #6a7aa0; text-shadow: none; letter-spacing: 0; }

#boss-bar { position: absolute; top: 92px; left: 50%; transform: translateX(-50%); width: min(560px, 80vw); text-align: center; }
#boss-name { font-family: var(--display); font-weight: 800; font-size: 0.75rem; letter-spacing: 0.35em; color: #ff8adf; text-shadow: 0 0 10px #ff3cc8; margin-bottom: 4px; }
.bar { height: 10px; border-radius: 6px; background: rgba(255, 60, 200, 0.12); border: 1px solid rgba(255, 90, 210, 0.5); overflow: hidden; }
#boss-fill { height: 100%; background: linear-gradient(90deg, #ff3c6a, #ff3cc8, #b44dff); transform-origin: left; box-shadow: 0 0 12px #ff3cc8; transition: transform 0.1s linear; }

.hud-bottom { position: absolute; bottom: 12px; left: 12px; right: 12px; display: flex; align-items: flex-end; gap: 10px; }
.weapon-panel { padding: 8px 12px; }
#weapon-name { font-family: var(--display); font-weight: 900; font-size: 0.9rem; letter-spacing: 0.18em; text-shadow: 0 0 10px currentColor; }
#weapon-lvl { display: flex; gap: 3px; margin-top: 5px; }
#weapon-lvl i { width: 14px; height: 5px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); }
#weapon-lvl i.on { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
#buffs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.buff { font-family: var(--display); font-size: 0.62rem; letter-spacing: 0.12em; padding: 5px 9px; border-radius: 6px; background: var(--panel); border: 1px solid; }
.b-m { color: #ffb030; border-color: rgba(255, 176, 48, 0.6); }
.b-s { color: #8ab4ff; border-color: rgba(138, 180, 255, 0.6); }
#crystal-count { font-family: var(--display); font-weight: 800; color: var(--green); text-shadow: 0 0 10px var(--green); padding: 9px 14px; margin-left: auto; }

#bomb-btn {
	display: none; position: absolute; right: 16px; bottom: 76px; width: 64px; height: 64px; border-radius: 50%;
	border: 2px solid rgba(255, 90, 240, 0.7); background: rgba(80, 10, 70, 0.55); color: #ffb0f4; font-size: 28px;
	box-shadow: 0 0 20px rgba(255, 90, 240, 0.5);
}
#bomb-btn.empty { opacity: 0.35; }
@media (hover: none) and (pointer: coarse) { #bomb-btn { display: block; } }

/* banners & pops */
#banner { position: fixed; z-index: 12; left: 0; right: 0; top: 34%; text-align: center; pointer-events: none; opacity: 0; }
#banner.show { animation: banner 2.2s ease-out forwards; }
.b-title { font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 7vw, 3.6rem); letter-spacing: 0.25em; color: #fff; text-shadow: 0 0 20px var(--cyan), 0 0 50px #2a7aff; }
.b-sub { font-family: var(--display); font-size: 0.85rem; letter-spacing: 0.3em; color: var(--gold); margin-top: 6px; text-shadow: 0 0 10px rgba(255, 200, 80, 0.6); }
@keyframes banner { 0% { opacity: 0; transform: scale(1.4); letter-spacing: 0.6em; } 15% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px); } }
#combo-pop { position: fixed; z-index: 12; left: 50%; top: 22%; transform: translateX(-50%); pointer-events: none; opacity: 0;
	font-family: var(--display); font-weight: 900; font-size: 1.4rem; letter-spacing: 0.15em; color: var(--gold); text-shadow: 0 0 16px #ff8a2a; }
#combo-pop.show { animation: pop 1s ease-out forwards; }
@keyframes pop { 0% { opacity: 0; transform: translateX(-50%) scale(0.6); } 20% { opacity: 1; transform: translateX(-50%) scale(1.15); } 100% { opacity: 0; transform: translateX(-50%) translateY(-24px) scale(1); } }
#warning { position: fixed; z-index: 13; left: 0; right: 0; top: 38%; text-align: center; pointer-events: none; }
#warning.show { animation: warn 0.4s steps(2) infinite; }
.w-text { font-family: var(--display); font-weight: 900; font-size: clamp(2.2rem, 8vw, 4rem); letter-spacing: 0.3em; color: #ff2050; text-shadow: 0 0 24px #ff0040; }
.w-sub { font-family: var(--display); font-size: 0.8rem; letter-spacing: 0.3em; color: #ff8aa0; }
.w-stripe { height: 14px; margin: 8px 0; background: repeating-linear-gradient(-45deg, rgba(255, 30, 70, 0.75) 0 16px, transparent 16px 32px); }
@keyframes warn { 50% { opacity: 0.35; } }

#floaters { position: fixed; inset: 0; z-index: 9; pointer-events: none; overflow: hidden; }
.floater { position: absolute; left: 0; top: 0; opacity: 0; font-family: var(--display); font-weight: 800; font-size: 0.85rem; color: #fff; text-shadow: 0 0 8px rgba(90, 200, 255, 0.9); white-space: nowrap; will-change: transform; }
.floater.big { font-size: 1.3rem; color: var(--gold); text-shadow: 0 0 12px #ff8a2a; }
.floater.pickup { font-size: 1rem; color: #b8ffde; text-shadow: 0 0 10px var(--green); }
.floater.bad { color: #ff7a8a; text-shadow: 0 0 10px #ff2050; }
.floater.graze { font-size: 0.75rem; color: #ffffff; }

/* ---------- cards ---------- */
.card {
	width: 100%; max-width: 440px; max-height: calc(100vh - 36px); overflow-y: auto; box-sizing: border-box;
	padding: 22px; border-radius: 18px; text-align: center;
	background: linear-gradient(160deg, rgba(20, 16, 54, 0.88), rgba(8, 6, 24, 0.92));
	border: 1px solid rgba(140, 200, 255, 0.25);
	box-shadow: 0 0 60px rgba(80, 60, 255, 0.25), inset 0 0 40px rgba(80, 120, 255, 0.06);
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	animation: rise 0.35s ease-out;
}
@keyframes rise { from { transform: translateY(20px) scale(0.97); opacity: 0; } }
.card h2 { font-family: var(--display); font-weight: 900; letter-spacing: 0.25em; margin: 0 0 10px; font-size: 1.3rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.card-head h2 { margin: 0; }
.credits { font-family: var(--display); font-weight: 800; color: var(--green); text-shadow: 0 0 10px var(--green); }
.sect { text-align: left; font-family: var(--display); font-size: 0.62rem; letter-spacing: 0.25em; color: #8aa6d8; margin: 14px 0 8px; }
.hangar-card { max-width: 540px; }
.upg { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; text-align: left; padding: 9px 10px; border-radius: 12px; background: rgba(120, 160, 255, 0.06); margin-bottom: 6px; }
.upg-ico { font-size: 1.3rem; text-align: center; color: var(--cyan); text-shadow: 0 0 10px var(--cyan); }
.upg-body b { display: block; font-size: 1rem; }
.upg-body span { font-size: 0.85rem; color: #9fb3dd; }
.pips { display: flex; gap: 3px; margin-top: 4px; }
.pips i { width: 16px; height: 5px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); }
.pips i.on { background: linear-gradient(90deg, var(--cyan), var(--purple)); box-shadow: 0 0 6px var(--cyan); }
#skin-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.skin { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; cursor: pointer; background: rgba(120, 160, 255, 0.06); border: 1px solid transparent; }
.skin.selected { border-color: var(--cyan); box-shadow: 0 0 14px rgba(53, 216, 255, 0.35); }
.skin.locked { opacity: 0.7; }
.skin .sw { width: 38px; height: 38px; border-radius: 10px; transform: rotate(45deg) scale(0.8); box-shadow: 0 0 12px rgba(255, 255, 255, 0.15); }
.skin b { font-size: 0.85rem; }
.skin small { font-size: 0.75rem; color: #9fb3dd; }
#hangar-close { width: 100%; }

.go-score { font-family: var(--display); font-weight: 900; font-size: 2.6rem; text-shadow: 0 0 20px var(--cyan); font-variant-numeric: tabular-nums; }
.badge { display: inline-block; margin: 4px 0; padding: 4px 12px; border-radius: 999px; font-family: var(--display); font-weight: 800; font-size: 0.65rem; letter-spacing: 0.2em; color: #050414; background: linear-gradient(90deg, var(--gold), #ff8a2a); box-shadow: 0 0 16px rgba(255, 180, 60, 0.6); animation: pulse 0.6s ease-in-out infinite alternate; }
.go-best { color: #9fb3dd; margin-bottom: 12px; }
.rows { text-align: left; background: rgba(120, 160, 255, 0.06); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.rows div { display: flex; justify-content: space-between; padding: 3px 0; font-size: 1rem; }
.rows b { font-family: var(--display); font-weight: 700; font-size: 0.9rem; }
.credits-rows b { color: var(--green); }
.credits-rows .tot { border-top: 1px solid rgba(140, 200, 255, 0.2); margin-top: 4px; padding-top: 6px; font-size: 1.1rem; }
.btn-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

@media (max-width: 600px) {
	.hud-top { right: 100px; }
	.score-panel { min-width: 120px; padding: 6px 10px; }
	#score { font-size: 1.25rem; }
	.wave { display: none; }
	#skin-list { grid-template-columns: repeat(2, 1fr); }
	.how { font-size: 0.85rem; }
}
@media (max-height: 520px) {
	.title-wrap { margin-top: 0; }
	.tag, .how { display: none; }
	.logo .nova { font-size: 3rem; }
	.logo .strike { font-size: 1.6rem; }
}
