/* La pêche aux étoiles */
:root {
	--night: #060917;
	--cream: #fff4dc;
	--gold: #ffd36b;
	--amber: #ff9d3c;
	--ice: #a9ecff;
	--rose: #ff8bd5;
	--lilac: #d9d4ff;
	--stroke: rgba(255, 255, 255, .14);
	--ui: 'Nunito', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
	--display: 'Fraunces', Georgia, 'Times New Roman', serif;
	--sat: env(safe-area-inset-top, 0px);
	--sab: env(safe-area-inset-bottom, 0px);
	--sal: env(safe-area-inset-left, 0px);
	--sar: env(safe-area-inset-right, 0px);
	--wy: 70vh;
}
* { box-sizing: border-box; }
html, body {
	margin: 0; height: 100%; overflow: hidden;
	background: var(--night); color: var(--cream);
	font-family: var(--ui); font-weight: 700;
	-webkit-tap-highlight-color: transparent;
	-webkit-user-select: none; user-select: none;
	overscroll-behavior: none;
	-webkit-font-smoothing: antialiased;
}
#c { position: fixed; left: 0; top: 0; display: block; touch-action: none; cursor: crosshair; }
body[data-mode="title"] #c, body[data-mode="end"] #c { cursor: pointer; }
.vignette {
	position: fixed; inset: 0; pointer-events: none; z-index: 1;
	background: radial-gradient(120% 90% at 50% 42%, transparent 58%, rgba(2, 3, 14, .55) 100%);
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; -webkit-appearance: none; appearance: none; padding: 0; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--ice); outline-offset: 3px; border-radius: 999px; }
[hidden] { display: none !important; }

/* Buttons */
.btn-play {
	position: relative;
	display: inline-flex; align-items: center; justify-content: center; gap: .5em;
	font-weight: 900; font-size: clamp(20px, 2vw, 25px); letter-spacing: .01em;
	padding: .78em 2em .82em 1.75em; border-radius: 999px;
	color: #3a1d02;
	background: linear-gradient(180deg, #fff3c2 0%, #ffd56e 42%, #ffa04a 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -4px 0 rgba(170, 70, 0, .32), 0 10px 30px rgba(255, 150, 50, .42), 0 0 70px rgba(255, 200, 100, .3);
	transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s;
}
.btn-play svg { width: 1.05em; height: 1.05em; margin-top: -.08em; }
.btn-play:hover { transform: translateY(-2px) scale(1.035); }
.btn-play:active { transform: scale(.96); }
.btn-ghost {
	font-weight: 800; font-size: 16px; padding: .8em 1.35em; border-radius: 999px;
	background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .26);
	color: #f3f0ff; transition: background .2s, transform .18s;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .14); }
.btn-ghost:active { transform: scale(.96); }
.icon-btn {
	width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
	background: rgba(8, 10, 32, .55); box-shadow: inset 0 0 0 1px var(--stroke);
	color: #f1eeff; transition: background .2s, transform .15s;
}
.icon-btn:hover { background: rgba(30, 34, 80, .7); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .i-off { display: none; }
.icon-btn.is-muted .i-on { display: none; }
.icon-btn.is-muted .i-off { display: block; }
.icon-btn.is-muted { color: #b9b4dd; }

.corner {
	position: fixed; z-index: 8; top: calc(12px + var(--sat)); right: calc(14px + var(--sar));
	display: flex; gap: 8px;
}
#btn-pause { display: none; }
body[data-mode="play"] #btn-pause { display: grid; }

/* HUD */
.hud {
	position: fixed; z-index: 4; left: 0; right: 0; top: 0;
	display: grid; grid-template-columns: 1fr auto 1fr; align-items: start;
	padding: calc(12px + var(--sat)) calc(116px + var(--sar)) 0 calc(14px + var(--sal));
	pointer-events: none; opacity: 0; transform: translateY(-12px);
	transition: opacity .45s ease, transform .45s ease;
}
body[data-mode="play"] .hud, body[data-mode="paused"] .hud, body[data-mode="ending"] .hud { opacity: 1; transform: none; }
.pill {
	display: inline-flex; align-items: center; gap: 9px;
	background: rgba(6, 8, 28, .58); box-shadow: inset 0 0 0 1px var(--stroke);
	border-radius: 999px; padding: 0 17px; height: 44px;
}
.pill b { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; color: #fff; letter-spacing: .01em; }
.pill-lbl { font-size: 11.5px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.pill-score b { min-width: 2ch; display: inline-block; transform-origin: 0 55%; }
.pill-score b.bump { animation: bump .35s cubic-bezier(.3, 1.8, .5, 1); }
.pill-time { justify-self: center; color: var(--lilac); }
.pill-time svg { width: 18px; height: 18px; color: #fff1c9; }
.pill-time.hurry { animation: hurry .5s ease-in-out infinite alternate; }
.pill-time.hurry b { color: #ffd3dc; }
.hud-defi { margin: 6px 0 0 6px; font-size: 13px; font-weight: 800; color: #ffc6ea; }
.hud-defi.won { color: var(--gold); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.32); color: var(--gold); } 100% { transform: scale(1); } }
@keyframes hurry { to { box-shadow: inset 0 0 0 1.5px rgba(255, 120, 150, .8), 0 0 22px rgba(255, 90, 130, .45); } }

/* Banner */
.banner {
	position: fixed; z-index: 3; left: 0; right: 0; top: 24%; margin: 0;
	text-align: center; pointer-events: none; opacity: 0; padding: 0 16px;
}
.banner p { margin: 0; }
.banner.show { animation: banner 2.4s cubic-bezier(.2, .8, .2, 1) both; }
.banner-k { font-size: 13px; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: 4px !important; }
.banner-t {
	font-family: var(--display); font-weight: 900; font-style: italic;
	font-variation-settings: 'SOFT' 100, 'WONK' 1;
	font-size: clamp(38px, 6.2vw, 78px); line-height: 1; color: #fff3cf;
	text-shadow: 0 0 34px rgba(255, 180, 80, .65), 0 3px 0 rgba(110, 40, 0, .45);
}
.banner-s { font-weight: 800; font-size: clamp(15px, 1.5vw, 19px); color: #e4e0ff; margin-top: 10px !important; text-shadow: 0 2px 12px rgba(0, 0, 20, .8); }
.banner.alt .banner-t { color: #ffe2f4; text-shadow: 0 0 34px rgba(255, 110, 200, .7), 0 3px 0 rgba(90, 0, 60, .5); }
.banner.cool .banner-t { color: #e8fbff; text-shadow: 0 0 34px rgba(120, 220, 255, .7), 0 3px 0 rgba(0, 40, 90, .5); }
@keyframes banner {
	0% { opacity: 0; transform: translateY(18px) scale(.86); }
	12% { opacity: 1; transform: none; }
	78% { opacity: 1; transform: none; }
	100% { opacity: 0; transform: translateY(-14px) scale(1.02); }
}

/* Coach */
.coach {
	position: fixed; z-index: 3; left: 50%; top: calc(var(--wy) + 28px); transform: translateX(-50%);
	margin: 0; width: max-content; max-width: calc(100% - 32px); text-align: center;
	padding: 10px 18px; border-radius: 999px; font-size: 15px; font-weight: 800; color: #fff;
	background: rgba(8, 10, 34, .72); box-shadow: inset 0 0 0 1px rgba(169, 236, 255, .35), 0 0 30px rgba(120, 210, 255, .2);
	pointer-events: none; animation: coach 1.6s ease-in-out infinite alternate;
}
@keyframes coach { from { box-shadow: inset 0 0 0 1px rgba(169, 236, 255, .3), 0 0 18px rgba(120, 210, 255, .12); } to { box-shadow: inset 0 0 0 1px rgba(169, 236, 255, .7), 0 0 36px rgba(120, 210, 255, .35); } }

/* Screens */
.screen {
	position: fixed; inset: 0; z-index: 5;
	display: flex; flex-direction: column; align-items: center; text-align: center;
	padding: calc(22px + var(--sat)) calc(16px + var(--sar)) calc(40px + var(--sab)) calc(16px + var(--sal));
	pointer-events: none;
}
.screen button, .screen input, .screen .card { pointer-events: auto; }

/* Title screen */
.screen-title { justify-content: flex-start; padding-top: calc(max(6vh, 50px) + var(--sat)); transition: opacity .5s ease, transform .5s ease; }
.screen-title.out { opacity: 0; transform: translateY(-24px) scale(.98); }
.kicker {
	margin: 0 0 .25em; display: inline-flex; align-items: center; gap: .55em;
	font-family: var(--display); font-style: italic; font-weight: 700;
	font-variation-settings: 'SOFT' 100, 'WONK' 1;
	font-size: clamp(19px, 2.1vw, 27px); color: var(--gold); letter-spacing: .01em;
	text-shadow: 0 0 20px rgba(255, 180, 80, .45);
	animation: fadeUp .9s .1s cubic-bezier(.2, .8, .2, 1) both;
}
.kicker svg { width: .8em; height: .8em; animation: spin 6s linear infinite; }
.kicker svg:last-child { animation-direction: reverse; }
.title-wrap { position: relative; }
.title, .title-glow {
	margin: 0; font-family: var(--display); font-weight: 900;
	font-variation-settings: 'SOFT' 100, 'WONK' 1;
	line-height: .9; letter-spacing: -.012em;
}
.title .l1, .title-glow .l1 { display: block; font-size: clamp(50px, 8.4vw, 124px); }
.title .l2, .title-glow .l2 { display: block; font-style: italic; font-size: clamp(60px, 11.4vw, 162px); margin-top: -.04em; }
.title-glow {
	position: absolute; inset: 0; color: #ffae45; filter: blur(22px); opacity: 0;
	animation: glowIn 1.6s .9s ease both, breathe 4s 2.5s ease-in-out infinite alternate;
	pointer-events: none;
}
.ch { display: inline-block; animation: rise 1.05s cubic-bezier(.18, 1.25, .35, 1) both; animation-delay: calc(.25s + var(--i) * 55ms); }
.ch > i {
	display: inline-block; font-style: inherit; padding: 0 .03em;
	background: linear-gradient(180deg, #fffdf3 10%, #ffe7a3 46%, #ffb44f 88%, #ff9a3a 100%);
	-webkit-background-clip: text; background-clip: text; color: transparent;
	animation: bob 3.4s ease-in-out infinite; animation-delay: calc(var(--i) * -170ms);
}
@keyframes rise {
	0% { opacity: 0; transform: translateY(.55em) scale(.4) rotate(-14deg); }
	60% { opacity: 1; }
	100% { opacity: 1; transform: none; }
}
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-.055em) rotate(-1.5deg); } }
@keyframes glowIn { to { opacity: .5; } }
@keyframes breathe { from { opacity: .5; } to { opacity: .3; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.defi {
	margin: 20px 0 0; padding: .6em 1.2em; border-radius: 999px;
	font-weight: 900; font-size: clamp(15px, 1.5vw, 18px); color: #ffe0f3;
	background: rgba(120, 30, 90, .35); box-shadow: inset 0 0 0 1.5px rgba(255, 139, 213, .6), 0 0 34px rgba(255, 110, 200, .3);
	animation: fadeUp .8s 1.2s both, defiGlow 1.8s 2s ease-in-out infinite alternate;
}
@keyframes defiGlow { to { box-shadow: inset 0 0 0 1.5px rgba(255, 170, 225, .95), 0 0 46px rgba(255, 110, 200, .5); } }
.t-mid { margin-top: clamp(22px, 5vh, 54px); display: flex; flex-direction: column; align-items: center; gap: 12px; animation: fadeUp .8s 1.05s both; }
.t-mid .btn-play { animation: playPulse 2.4s 2s ease-in-out infinite; }
@keyframes playPulse { 0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -4px 0 rgba(170, 70, 0, .32), 0 10px 30px rgba(255, 150, 50, .42), 0 0 50px rgba(255, 200, 100, .25); } 50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -4px 0 rgba(170, 70, 0, .32), 0 10px 34px rgba(255, 150, 50, .55), 0 0 90px rgba(255, 200, 100, .5); } }
.best { margin: 0; font-size: 14px; color: var(--lilac); }
.best b { color: var(--gold); }
.t-bot { margin-top: auto; padding-bottom: 10px; display: flex; flex-direction: column; align-items: center; gap: 12px; animation: fadeUp .8s 1.3s both; }
.howto { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 182px)); gap: 12px; }
.howto li {
	display: flex; flex-direction: column; align-items: center; gap: 8px;
	padding: 13px 12px 14px; border-radius: 18px;
	background: rgba(7, 9, 32, .62); box-shadow: inset 0 0 0 1px var(--stroke);
	font-size: 14px; line-height: 1.28; font-weight: 750; color: #ebe8ff; text-wrap: balance;
}
.howto svg { width: 36px; height: 36px; flex: none; }
.controls { margin: 0; font-size: 13px; font-weight: 700; color: #b8b3e0; }
.controls kbd {
	font: 800 12px var(--ui); color: #fff; padding: 1px 6px 2px; border-radius: 6px;
	background: rgba(255, 255, 255, .1); box-shadow: inset 0 -1.5px 0 rgba(255, 255, 255, .18), inset 0 0 0 1px rgba(255, 255, 255, .2);
}

/* Cards */
.card {
	width: min(500px, 100%);
	background: linear-gradient(180deg, rgba(16, 18, 56, .9), rgba(8, 9, 30, .94));
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .13), inset 0 1px 0 rgba(255, 255, 255, .1), 0 30px 80px rgba(0, 0, 10, .55);
	border-radius: 28px; padding: 22px 22px 20px;
}
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.screen-pause { justify-content: center; background: rgba(4, 5, 18, .45); pointer-events: auto; }
.card-pause { display: flex; flex-direction: column; align-items: center; gap: 16px; width: min(360px, 100%); padding: 28px 22px 24px; }
.card-pause h2 { margin: 0; font-family: var(--display); font-style: italic; font-weight: 900; font-variation-settings: 'SOFT' 100, 'WONK' 1; font-size: 44px; color: #fff3cf; }

/* End screen */
.screen-end { justify-content: flex-end; padding-bottom: calc(44px + var(--sab)); }
.card-end { opacity: 0; transform: translateY(40px) scale(.96); transition: opacity .6s ease, transform .7s cubic-bezier(.2, 1.2, .3, 1); padding-top: 18px; }
.screen-end.s1 .card-end { opacity: 1; transform: none; }
.end-k { margin: 0; font-size: 12.5px; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.end-score { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-top: 2px; }
.end-score b {
	font-family: var(--display); font-weight: 900; font-variation-settings: 'SOFT' 100, 'WONK' 1;
	font-size: clamp(54px, 9vw, 76px); line-height: 1; font-variant-numeric: tabular-nums;
	background: linear-gradient(180deg, #fffdf3 10%, #ffe7a3 50%, #ffae4a 95%);
	-webkit-background-clip: text; background-clip: text; color: transparent;
	filter: drop-shadow(0 0 18px rgba(255, 170, 70, .35));
}
.end-score span { font-size: 18px; font-weight: 900; color: var(--lilac); }
.rank {
	margin: 4px 0 0; display: inline-flex; align-items: center; gap: 8px;
	font-family: var(--display); font-style: italic; font-weight: 800; font-variation-settings: 'SOFT' 100, 'WONK' 1;
	font-size: clamp(21px, 2.4vw, 27px); color: #fff0c8;
}
.rank svg { width: 22px; height: 22px; color: var(--gold); filter: drop-shadow(0 0 8px rgba(255, 200, 90, .7)); }
.more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .7s cubic-bezier(.2, .9, .2, 1); }
.more-in { overflow: hidden; min-height: 0; opacity: 0; transition: opacity .5s .2s; }
.screen-end.s2 .more { grid-template-rows: 1fr; }
.screen-end.s2 .more-in { opacity: 1; }
.end-stats { margin: 12px 0 0; font-size: 14px; color: #cfcaf4; font-weight: 750; }
.end-note { margin: 4px 0 0; font-size: 14px; color: var(--gold); font-weight: 850; }
.end-note:empty { display: none; }
.end-defi { margin: 6px 0 0; font-size: 15px; font-weight: 900; color: #ffc6ea; }
.who { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 14px 0 14px; }
.who-l { font-size: 12.5px; font-weight: 800; color: #aaa5d6; margin-right: 2px; }
.who button {
	font-size: 14px; font-weight: 850; padding: 6px 12px 7px; border-radius: 999px; color: #dcd8ff;
	box-shadow: inset 0 0 0 1.3px rgba(255, 255, 255, .2); transition: background .15s, color .15s;
}
.who button[aria-checked="true"] { background: var(--gold); color: #3a1d02; box-shadow: none; }
.share { margin-top: 14px; }
.share-msg { margin: 0 0 8px; font-size: 14px; font-weight: 850; color: #c8f4ff; }
.share-link {
	width: 100%; font: 700 13px var(--ui); color: #fff; padding: 10px 12px; border-radius: 12px; border: 0;
	background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1px rgba(169, 236, 255, .4);
	-webkit-user-select: all; user-select: all; text-overflow: ellipsis;
}
.skip {
	position: fixed; left: 0; right: 0; bottom: calc(14px + var(--sab)); margin: 0;
	font-size: 13px; font-weight: 800; color: #b8b3e0; opacity: 0; transition: opacity .6s; pointer-events: none;
}
.screen-end.hint .skip { opacity: .85; }
.screen-end.s2 .skip { opacity: 0; }

.credits {
	position: fixed; z-index: 6; left: 0; right: 0; bottom: calc(10px + var(--sab));
	text-align: center; font-size: 12px; font-weight: 700; color: rgba(220, 216, 255, .62);
	padding: 0 16px; pointer-events: none; transition: opacity .4s;
}
body[data-mode="play"] .credits, body[data-mode="ending"] .credits { opacity: 0; }
body[data-mode="end"] .credits { opacity: 0; }
body[data-mode="end"].done .credits { opacity: 1; }

@media (max-width: 760px) {
	.howto { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; width: 100%; max-width: 420px; }
	.howto li { flex-direction: row; text-align: left; font-size: 12px; line-height: 1.22; padding: 8px 9px; gap: 8px; border-radius: 14px; min-height: 50px; }
	.howto svg { width: 24px; height: 24px; }
	.controls { display: none; }
	.t-bot { padding-bottom: 4px; }
	.who { gap: 5px; margin: 12px 0; }
	.who-l { font-size: 12px; }
	.who button { font-size: 13px; padding: 5px 10px 6px; }
	.hud { padding-right: calc(110px + var(--sar)); padding-left: calc(12px + var(--sal)); grid-template-columns: auto 1fr; }
	.pill-time { justify-self: end; }
	.pill { height: 42px; padding: 0 14px; }
	.pill b { font-size: 21px; }
	.pill-lbl { font-size: 10.5px; }
	.corner { right: calc(12px + var(--sar)); gap: 6px; }
	.icon-btn { width: 42px; height: 42px; }
	.controls { font-size: 12px; max-width: 340px; }
	.card { padding: 18px 16px 16px; border-radius: 24px; }
	.screen-end { padding-bottom: calc(38px + var(--sab)); }
	.end-stats { font-size: 13px; }
	.btn-ghost { font-size: 15px; }
	.coach { font-size: 14px; }
}
@media (max-height: 560px) {
	.t-bot { display: none; }
	.screen-title { padding-top: calc(20px + var(--sat)); }
}
@media (prefers-reduced-motion: reduce) {
	.ch, .ch > i, .kicker svg, .t-mid .btn-play, .title-glow, .coach, .defi { animation-duration: .01s !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; }
	.title-glow { opacity: .4; }
	.banner.show { animation-name: bannerSoft; }
	@keyframes bannerSoft { 0% { opacity: 0; } 12% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
}
