/* Much Water · styles du jeu (palette du site Doginal Kabosu) */
@font-face { font-family: "Anton"; font-weight: 400; font-display: swap; src: url("../fonts/anton.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 400; font-display: swap; src: url("../fonts/archivo-400.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 600; font-display: swap; src: url("../fonts/archivo-600.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 800; font-display: swap; src: url("../fonts/archivo-800.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("../fonts/jetbrains-mono-500.woff2") format("woff2"); }
@font-face { font-family: "Lalezar"; font-weight: 400; font-display: swap; src: url("../fonts/lalezar-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: swap; src: url("../fonts/plex-arabic-400.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 600 900; font-display: swap; src: url("../fonts/plex-arabic-700.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

:root {
	--ink: #0D0A06;
	--ink-2: #18120A;
	--ink-3: #231A0E;
	--line: #3B2E1A;
	--gold: #DDAE36;
	--gold-deep: #A98020;
	--cream: #F4DEC4;
	--muted: #BBA684;
	--shiba: #E8903E;
	--water: #6EC3F0;
	--miss: #E8603E;
	--panel: rgba(24, 18, 10, .78);
	--f-display: "Anton", "Impact", "Arial Narrow Bold", sans-serif;
	--f-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
	--f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
	--glow: 0 0 18px rgba(221, 174, 54, .45), 0 0 48px rgba(221, 174, 54, .18);
	box-sizing: border-box;
	padding-top: env(safe-area-inset-top, 0px);
	padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* le jeu garde ses teintes sombres, comme le site */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ink: #0D0A06; } }
:root[data-theme="dark"] { --ink: #0D0A06; }

html, body { height: 100%; margin: 0; }
*, *::before, *::after { box-sizing: border-box; }
body {
	background: var(--ink);
	color: var(--cream);
	font-family: var(--f-body);
	overflow: hidden;
	overscroll-behavior: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}
#stage { position: fixed; inset: 0; display: block; touch-action: none; z-index: 1; }
/* le nuage 3D : un petit canvas deplace par transform, au-dessus du decor, sous l'interface */
#cloud3d {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 2;
	pointer-events: none;
	will-change: transform;
}

/* ---------- HUD ---------- */
#hud {
	position: fixed;
	left: 0; right: 0;
	top: calc(env(safe-area-inset-top, 0px) + 14px);
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 12px;
	padding: 0 clamp(12px, 3vw, 40px);
	pointer-events: none;
	z-index: 5;
	transition: opacity .3s;
}
.panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 70px;
	padding: 10px 18px;
	border-radius: 16px;
	background: var(--panel);
	border: 1px solid var(--line);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}
.panel.wave { border-color: rgba(221, 174, 54, .5); min-width: 160px; }
.panel.left { justify-self: start; min-width: 150px; }
.panel.right { justify-self: end; min-width: 150px; }
.lab { font: 500 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.val { font: 400 1.9rem/1 var(--f-display); color: var(--cream); font-variant-numeric: tabular-nums; }
.panel.wave .lab { color: var(--gold); }
#hudMisses { display: flex; gap: 10px; padding-top: 2px; }
#hudMisses i { width: 18px; height: 18px; border-radius: 50%; background: rgba(244, 222, 196, .16); transition: background .25s, transform .25s; }
#hudMisses i.on { background: var(--miss); transform: scale(1.12); box-shadow: 0 0 12px rgba(232, 96, 62, .6); }
body:not(.playing) #hud { opacity: 0; }

#hudBottom {
	position: fixed;
	left: 50%;
	bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 20px;
	border-radius: 999px;
	background: var(--panel);
	border: 1px solid var(--line);
	pointer-events: none;
	z-index: 5;
	white-space: nowrap;
	transition: opacity .3s;
}
#hudBottom .paw { width: 20px; height: 20px; fill: var(--shiba); flex: none; }
#hudBottom .val { font-size: 1.45rem; color: var(--gold); }
#hudBottom .val.small { font-size: 1.1rem; color: var(--cream); }
#hudBottom .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
body:not(.playing) #hudBottom { opacity: 0; }
#hudScore.drain { color: var(--miss); text-shadow: 0 0 12px rgba(232, 96, 62, .45); }

/* ---------- Ecrans ---------- */
.screen {
	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	padding: 24px;
	z-index: 10;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: radial-gradient(ellipse at 50% 30%, rgba(13, 10, 6, .35), rgba(13, 10, 6, .86) 70%);
}
.screen[hidden] { display: none; }
.card { text-align: center; max-width: 540px; width: 100%; margin: auto; padding: 24px 0; }
.kicker { font: 500 12px/1 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 0 0 16px; }
.title {
	font-family: var(--f-display);
	font-weight: 400;
	line-height: .88;
	margin: 0;
	text-transform: uppercase;
	color: var(--cream);
}
.title .big { display: block; font-size: clamp(4.2rem, 18vw, 8.6rem); letter-spacing: .01em; }
.title .small { display: block; font-size: clamp(2.6rem, 11vw, 5.2rem); color: var(--gold); text-shadow: var(--glow); margin-top: .06em; }
.rules { margin: 26px auto 0; padding: 0; list-style: none; display: grid; gap: 9px; color: var(--cream); font-weight: 400; font-size: 1.02rem; line-height: 1.45; max-width: 460px; }
.rules b { color: var(--gold); font-weight: 800; }
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 210px;
	min-height: 54px;
	margin-top: 28px;
	padding: 0 34px;
	border: 2px solid var(--gold);
	border-radius: 999px;
	font: 800 1.1rem/1 var(--f-body);
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--ink);
	background: var(--gold);
	cursor: pointer;
	transition: transform .15s, background .15s, border-color .15s, box-shadow .2s;
	box-shadow: 0 0 26px rgba(221, 174, 54, .3);
}
.btn:hover, .btn:focus-visible { background: var(--cream); border-color: var(--cream); transform: translateY(-1px); outline: none; }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.btn.btn-small { min-width: 0; min-height: 46px; margin-top: 0; padding: 0 20px; font-size: .9rem; box-shadow: none; }
.note { margin-top: 20px; color: var(--muted); font-size: .85rem; }

.over-title { font: 500 13px/1.3 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0; }
.score-big { font: 400 clamp(4.4rem, 20vw, 7rem)/1 var(--f-display); color: var(--gold); text-shadow: var(--glow); margin: 14px 0 4px; font-variant-numeric: tabular-nums; }
.over-label { font: 400 clamp(1.4rem, 6vw, 2rem)/1 var(--f-display); text-transform: uppercase; color: var(--cream); letter-spacing: .02em; }
.over-points { margin-top: 12px; font: 600 1.05rem/1.2 var(--f-body); color: var(--muted); }
.over-points b { font: 400 1.6rem/1 var(--f-display); color: var(--cream); margin-inline-end: 4px; font-variant-numeric: tabular-nums; }
.best-line { margin-top: 10px; color: var(--muted); font-weight: 600; font-size: .95rem; }
.best-line b { color: var(--gold); }
.new-best { display: inline-block; margin-top: 12px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--gold); color: var(--gold); font: 500 12px/1 var(--f-mono); letter-spacing: .14em; }
.new-best[hidden] { display: none; }
.stats { margin-top: 14px; color: var(--muted); font: 500 12px/1.6 var(--f-mono); letter-spacing: .04em; }

/* ---------- Liens ---------- */
.back {
	display: inline-block;
	margin-top: 18px;
	color: var(--muted);
	font-weight: 600;
	font-size: .92rem;
	text-decoration: none;
	border-bottom: 1px solid var(--line);
	transition: color .2s, border-color .2s;
}
.back:hover, .back:focus-visible { color: var(--gold); border-color: var(--gold); outline: none; }
.langs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; margin: 22px auto 0; max-width: 460px; }
.langs a { padding: 7px 11px; border-radius: 9px; border: 1px solid transparent; color: var(--muted); font: 600 .85rem/1.2 var(--f-body); text-decoration: none; transition: color .2s, border-color .2s; }
.langs a:hover, .langs a:focus-visible { color: var(--cream); border-color: var(--line); outline: none; }
.langs a[aria-current="true"] { color: var(--gold); border-color: rgba(221, 174, 54, .5); }
.langs a[lang="ar"] { font-family: "IBM Plex Sans Arabic", var(--f-body); }
.langs a[lang="zh-Hans"] { font-family: var(--f-body), "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif; }
.langs a[lang="ja"] { font-family: var(--f-body), "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans CJK JP", sans-serif; }

/* ---------- Classement ---------- */
.board {
	margin: 26px auto 0;
	max-width: 380px;
	text-align: start;
	padding: 14px 14px 12px;
	border-radius: 16px;
	background: rgba(24, 18, 10, .82);
	border: 1px solid var(--line);
}
.board[hidden] { display: none; }
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.board-title { font: 500 11px/1 var(--f-mono); letter-spacing: .14em; color: var(--muted); }
.board-period { font: 800 .8rem/1 var(--f-body); color: var(--gold); }
.board-cols, .board-list li {
	display: grid;
	grid-template-columns: 2em minmax(0, 1fr) 4.4em 4.8em;
	align-items: center;
	gap: 8px;
	padding: 0 8px;
}
.board-cols { padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.board-cols span { font: 500 10px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: end; white-space: nowrap; }
.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.board-list li { padding: 7px 8px; border-radius: 10px; font-weight: 600; font-size: .95rem; color: var(--cream); }
.board-list li:nth-child(1) .b-rank { color: var(--gold); }
.board-list li.me { background: rgba(221, 174, 54, .14); box-shadow: inset 0 0 0 1px rgba(221, 174, 54, .5); }
.b-rank { font: 400 1.05rem/1 var(--f-display); color: var(--muted); }
.b-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
.b-shibas { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; font: 400 1.1rem/1 var(--f-display); color: var(--gold); font-variant-numeric: tabular-nums; }
.b-shibas svg { width: 13px; height: 13px; fill: var(--shiba); flex: none; }
.b-score { text-align: end; font: 500 .82rem/1 var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.board-list .board-empty { display: block !important; color: var(--muted); font-weight: 600; text-align: center; }
.board-reset { margin: 8px 0 0; text-align: end; font: 500 11px/1.3 var(--f-mono); color: var(--muted); }
.board-reset:empty { display: none; }

/* ---------- Saisie du pseudo ---------- */
.submit { margin: 22px auto 0; max-width: 380px; }
.submit[hidden] { display: none; }
.submit-label { display: block; font-weight: 800; color: var(--cream); margin-bottom: 10px; }
.submit-row { display: flex; gap: 8px; }
.submit-row input {
	flex: 1;
	min-width: 0;
	padding: 12px 16px;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: var(--ink-2);
	color: var(--cream);
	font: 600 1rem var(--f-mono);
	outline: none;
	-webkit-user-select: text;
	user-select: text;
}
.submit-row input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(221, 174, 54, .2); }
.submit-msg { min-height: 1.2em; margin: 8px 0 0; font-weight: 600; font-size: .88rem; color: var(--muted); }
.submit-msg.error { color: #F2A27E; }

/* ---------- Resultat et partage ---------- */
.result[hidden] { display: none; }
.result-rank { margin: 20px 0 0; font: 400 1.6rem/1.15 var(--f-display); text-transform: uppercase; color: var(--gold); text-shadow: var(--glow); }
.share {
	display: inline-flex;
	align-items: center;
	margin-top: 16px;
	padding: 11px 20px;
	border-radius: 999px;
	border: 2px solid var(--gold);
	color: var(--cream);
	font: 800 .9rem/1 var(--f-body);
	letter-spacing: .04em;
	text-decoration: none;
	transition: background .15s, color .15s;
}
.share:hover, .share:focus-visible { background: var(--gold); color: var(--ink); outline: none; }
.share-row { margin-top: 18px; }
.share.share-x { margin-top: 0; }
.share-hint { margin: 8px 0 0; font-size: .82rem; font-weight: 600; color: var(--muted); }
.share-hint[hidden] { display: none; }

/* ---------- Mode inclinaison ---------- */
.tilt {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin-top: 22px;
	padding: 10px 16px 10px 12px;
	border-radius: 14px;
	background: var(--ink-2);
	border: 1px solid var(--line);
	cursor: pointer;
	text-align: start;
	position: relative;
}
.tilt[hidden] { display: none; }
.tilt input { position: absolute; opacity: 0; pointer-events: none; }
.tilt-switch { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line); transition: background .2s; }
.tilt-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--cream); transition: transform .2s; }
.tilt input:checked + .tilt-switch { background: var(--gold); }
.tilt input:checked + .tilt-switch::after { transform: translateX(18px); background: var(--ink); }
.tilt input:focus-visible + .tilt-switch { box-shadow: 0 0 0 3px rgba(221, 174, 54, .45); }
.tilt-text { font-weight: 800; color: var(--cream); line-height: 1.25; }
.tilt-text small { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }

/* ---------- Indice de deplacement ---------- */
.move-hint { position: fixed; left: 0; top: 0; z-index: 4; pointer-events: none; transition: opacity .35s; }
.move-hint[hidden] { display: none; }
.move-hint.is-gone { opacity: 0; }
.hint-inner { display: flex; align-items: center; gap: 26px; transform: translateX(-50%); filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .6)); }
.hint-hand { width: 36px; height: 47px; animation: hint-swipe 1.6s ease-in-out infinite; }
.hint-hand path { fill: var(--cream); stroke: var(--ink); stroke-width: 2.4; stroke-linejoin: round; }
.hint-phone { display: none; width: 26px; height: 42px; animation: hint-tilt 1.8s ease-in-out infinite; transform-origin: 50% 85%; }
.hint-phone rect:first-child { fill: var(--cream); }
.hint-phone .screen, .hint-phone circle { fill: var(--ink-3); }
.move-hint.is-tilt .hint-hand { display: none; }
.move-hint.is-tilt .hint-phone { display: block; }
.hint-arrow { width: 10px; height: 16px; opacity: .8; }
.hint-arrow path { fill: none; stroke: var(--gold); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.hint-arrow.left { animation: hint-nudge-l 1.6s ease-in-out infinite; }
.hint-arrow.right { animation: hint-nudge-r 1.6s ease-in-out infinite; }
@keyframes hint-swipe { 0%, 100% { transform: translateX(-16px) rotate(-6deg); } 50% { transform: translateX(16px) rotate(6deg); } }
@keyframes hint-tilt { 0%, 100% { transform: rotate(-16deg); } 50% { transform: rotate(16deg); } }
@keyframes hint-nudge-l { 0%, 100% { transform: translateX(-4px); opacity: .9; } 50% { transform: translateX(2px); opacity: .35; } }
@keyframes hint-nudge-r { 0%, 100% { transform: translateX(-2px); opacity: .35; } 50% { transform: translateX(4px); opacity: .9; } }

/* ---------- Message bref ---------- */
.toast {
	position: fixed;
	left: 50%;
	top: calc(env(safe-area-inset-top, 0px) + 96px);
	transform: translateX(-50%);
	z-index: 20;
	max-width: calc(100vw - 32px);
	padding: 10px 18px;
	border-radius: 999px;
	background: rgba(13, 10, 6, .94);
	border: 1px solid var(--gold);
	color: var(--cream);
	font-weight: 600;
	font-size: .9rem;
	text-align: center;
}
.toast[hidden] { display: none; }

/* ---------- Pourboire ---------- */
.donate-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 14px;
	padding: 8px 14px;
	border-radius: 999px;
	border: 1px solid rgba(221, 174, 54, .55);
	background: var(--ink-2);
	color: var(--gold);
	font: 800 .82rem var(--f-body);
	cursor: pointer;
	transition: background .2s, border-color .2s;
}
.donate-btn svg { width: 14px; height: 14px; fill: currentColor; flex: none; }
.donate-btn:hover, .donate-btn:focus-visible { background: rgba(221, 174, 54, .14); border-color: var(--gold); outline: none; }
.board .donate-btn { display: flex; margin: 12px auto 2px; }
.over-donate { margin-top: 4px; }
.over-donate:empty { display: none; }
.donate-sheet {
	position: fixed;
	inset: 0;
	z-index: 30;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(13, 10, 6, .78);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}
.donate-sheet[hidden] { display: none; }
.donate-card {
	position: relative;
	width: min(420px, 100%);
	padding: 26px 22px 20px;
	border-radius: 20px;
	text-align: center;
	background: radial-gradient(ellipse at 20% 0%, rgba(221, 174, 54, .14), var(--ink-2) 65%);
	border: 1px solid var(--gold);
	box-shadow: 0 20px 50px rgba(0, 0, 0, .55);
}
.donate-close {
	position: absolute;
	top: 8px;
	inset-inline-end: 10px;
	width: 36px;
	height: 36px;
	border: 1px solid var(--line);
	border-radius: 50%;
	background: transparent;
	color: var(--muted);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
}
.donate-close:hover, .donate-close:focus-visible { color: var(--cream); border-color: var(--gold); outline: none; }
.donate-title { margin: 0; font: 400 1.7rem/1.05 var(--f-display); text-transform: uppercase; color: var(--cream); padding: 0 24px; }
.donate-text { margin: 10px 0 0; color: var(--cream); font-size: .92rem; line-height: 1.5; }
.donate-addr { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 8px 8px 8px 12px; border-radius: 14px; background: var(--ink); border: 1px solid var(--line); }
.donate-addr code { flex: 1; min-width: 0; overflow-wrap: anywhere; text-align: left; font: 500 .78rem/1.35 var(--f-mono); color: var(--cream); -webkit-user-select: all; user-select: all; }
.donate-open { margin-top: 14px; }
.donate-note { margin: 10px 0 0; font: 500 11px/1.4 var(--f-mono); color: var(--muted); }

/* ---------- Petits ecrans ---------- */
@media (max-width: 640px) {
	#hud { gap: 8px; }
	.panel { min-height: 56px; padding: 8px 10px; border-radius: 13px; gap: 5px; }
	.panel.left, .panel.right, .panel.wave { min-width: 0; }
	.val { font-size: 1.4rem; }
	.lab { font-size: 9.5px; letter-spacing: .08em; }
	#hudMisses { gap: 6px; }
	#hudMisses i { width: 14px; height: 14px; }
	#hudBottom { padding: 7px 16px; gap: 8px; }
	#hudBottom .val { font-size: 1.2rem; }
	#hudBottom .val.small { font-size: .95rem; }
	#hudBottom .paw { width: 17px; height: 17px; }
	.rules { font-size: .95rem; }
	.board-cols, .board-list li { grid-template-columns: 1.8em minmax(0, 1fr) 4em 4.4em; gap: 6px; }
}
@media (max-height: 560px) {
	.title .big { font-size: clamp(3rem, 12vh, 5rem); }
	.title .small { font-size: clamp(2rem, 8vh, 3.2rem); }
	.rules { margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.btn, .share { transition: none; }
	.hint-hand, .hint-phone, .hint-arrow { animation: none; }
}

/* ---------- Chinois et japonais : polices systeme pour les caracteres ---------- */
html[lang="zh-Hans"] { --cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Noto Sans SC", sans-serif; }
html[lang="ja"] { --cjk: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Meiryo", "Noto Sans CJK JP", "Source Han Sans JP", "Noto Sans JP", sans-serif; }
html:is([lang="zh-Hans"], [lang="ja"]) {
	--f-display: "Anton", var(--cjk);
	--f-body: "Archivo", var(--cjk);
	--f-mono: "JetBrains Mono", var(--cjk);
}
:is([lang="zh-Hans"], [lang="ja"]) :is(.title, .over-label, .result-rank, .donate-title, .val, .b-rank) { font-weight: 900; font-synthesis: none; }
:is([lang="zh-Hans"], [lang="ja"]) .title { line-height: 1.05; }
:is([lang="zh-Hans"], [lang="ja"]) .title .big { font-size: clamp(3.4rem, 15vw, 7rem); }
:is([lang="zh-Hans"], [lang="ja"]) .title .small { font-size: clamp(2.2rem, 9vw, 4.2rem); }
:is([lang="zh-Hans"], [lang="ja"]) :is(.lab, .kicker, .board-title, .over-title, .stats, .btn) { letter-spacing: .04em; }
:is([lang="zh-Hans"], [lang="ja"]) .rules { line-height: 1.7; }
[lang="ja"] body { line-break: strict; }

/* ---------- Arabe : de droite a gauche ---------- */
html[lang="ar"] {
	--f-display: "Anton", "Lalezar", sans-serif;
	--f-body: "Archivo", "IBM Plex Sans Arabic", sans-serif;
	--f-mono: "JetBrains Mono", "IBM Plex Sans Arabic", monospace;
}
[lang="ar"] body *:not(svg):not(code) { letter-spacing: 0 !important; }
[lang="ar"] .title { line-height: 1.12; }
[lang="ar"] .rules { line-height: 1.75; }
[lang="ar"] :is(.lab, .kicker, .board-title, .over-title, .stats, .board-reset, .new-best, .board-cols span, .donate-note) { font-size: 13px; font-weight: 600; line-height: 1.5; }
[lang="ar"] .lab { font-size: 12px; }
[lang="ar"] .btn { font-weight: 700; }
[dir="rtl"] .tilt { padding: 10px 12px 10px 16px; }
[dir="rtl"] .tilt input:checked + .tilt-switch::after { transform: translateX(18px); }
[dir="rtl"] .donate-addr { padding: 8px 12px 8px 8px; }
@media (max-width: 640px) {
	[lang="ar"] .lab { font-size: 11px; }
}
.move-hint, .hint-inner { direction: ltr; }
/* écran de fin : le nuage reste en fond, discret, derrière les résultats */
#screenOver { background: radial-gradient(ellipse at 50% 30%, rgba(13, 10, 6, .8), rgba(13, 10, 6, .93) 70%); }

/* ---------- Devise : Do Only Good Everyday ---------- */
.motto { margin: 16px 0 0; font: 500 13px/1.4 var(--f-mono); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.motto b { color: var(--gold); font-weight: 500; }
.motto-end { margin-top: 20px; font-size: 11px; }
html[lang] body p.motto { letter-spacing: .24em !important; font-family: "JetBrains Mono", ui-monospace, monospace; }
@media (max-width: 640px) { .motto { font-size: 11px; letter-spacing: .18em; } html[lang] body p.motto { letter-spacing: .18em !important; } }

/* ---------- Gestes tactiles : la page ne bouge jamais pendant la partie ---------- */
html, body { overscroll-behavior: none; }
body.playing, body.playing #stage { touch-action: none; }
body.playing { position: fixed; inset: 0; }

/* une vie qui revient (tous les 4 shibas) : les pastilles s'illuminent en vert */
#hudMisses.heal i:not(.on) { background: var(--ok, #7FCB8A); box-shadow: 0 0 12px rgba(127, 203, 138, .7); animation: heal-pop .5s ease-out 2; }
@keyframes heal-pop { 0% { transform: scale(1); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }
#hudMisses i.new { background: var(--ok, #7FCB8A); box-shadow: 0 0 12px rgba(127, 203, 138, .7); animation: life-in .6s cubic-bezier(.3, 1.6, .5, 1) both, heal-pop .5s ease-out .6s 2; }
@keyframes life-in { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #hudMisses.heal i:not(.on), #hudMisses i.new { animation: none; } }
