/* Game: level card, weekly challenge, trophies, moments */
.game-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Level card: one column of three bands, split by hairlines */
.game-card { display: flex; flex-direction: column; gap: 0; padding: 0; }
.game-card > * { padding: 16px 18px; }
.game-card > * + * { border-top: 1px solid var(--line); }
.game-level { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.game-badge { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-family: var(--font-display); font-stretch: 75%; font-size: 1.9rem; font-weight: 900; line-height: 1; color: var(--bg); background: var(--ink); font-variant-numeric: tabular-nums; }
.game-name { min-width: 0; }
.game-name .label { margin-bottom: 1px; }
.game-name h2 { font-size: 1.45rem; line-height: 1.05; font-weight: 850; font-stretch: 88%; letter-spacing: -0.01em; }
.game-today { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.game-today b { font-family: var(--font-display); font-stretch: 80%; font-size: 1.5rem; font-weight: 850; color: var(--good); line-height: 1.05; }
.game-xp { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 7px; }
.game-bar { height: 6px; }
.game-bar > i { background: var(--ring-engage); transition: width 0.6s var(--ease); }
.game-xp-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; font-size: 0.84rem; font-weight: 600; }
.game-xp-row b { font-size: 0.95rem; font-weight: 800; }

.game-streak { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.game-flame { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: var(--fill); }
.game-flame.on { color: var(--ring-post); background: color-mix(in srgb, var(--ring-post) 14%, transparent); }
.game-flame svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }
.game-flame.on svg { fill: color-mix(in srgb, var(--ring-post) 35%, transparent); }
.game-streak-now { display: flex; align-items: baseline; gap: 8px; }
.game-streak-now div:first-child { font-weight: 650; }
.game-streak b, .game-best b { font-family: var(--font-display); font-stretch: 80%; font-weight: 850; font-size: 1.3rem; }
.game-best { display: flex; align-items: baseline; gap: 6px; padding-left: 14px; border-left: 1px solid var(--line); }
.game-best div:first-child { order: 2; }

.game-week { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.game-week-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 0.86rem; font-weight: 650; }
.game-week-head b { font-family: var(--font-display); font-size: 1rem; font-weight: 800; }
.game-dots { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.game-dots li { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.game-mini { width: 100%; max-width: 34px; aspect-ratio: 1; display: block; }
.game-mini circle { fill: none; stroke-width: 3.4; stroke-linecap: round; }
.game-mini .track.post { stroke: color-mix(in srgb, var(--ring-post) 16%, var(--surface)); }
.game-mini .track.engage { stroke: color-mix(in srgb, var(--ring-engage) 16%, var(--surface)); }
.game-mini .track.create { stroke: color-mix(in srgb, var(--ring-create) 16%, var(--surface)); }
.game-dots li.later .game-mini circle { stroke: var(--track); }
.game-letter { font-size: 0.72rem; font-weight: 700; color: var(--muted); line-height: 1; padding: 3px 0; }
.game-dots li.today .game-letter { color: var(--bg); background: var(--ink); border-radius: 999px; padding: 3px 7px; }
.game-dots li.on .game-mini { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--ring-create) 35%, transparent)); }

/* Rings that are full */
.rings .arc.game-ring-full { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--game-glow) 45%, transparent)); }
.rings .arc.game-ring-pulse { animation: game-ring-pulse 1.1s var(--spring) 0.15s 1 both; }
@keyframes game-ring-pulse {
	0% { stroke-width: 19px; }
	35% { stroke-width: 23px; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--game-glow) 80%, transparent)); }
	100% { stroke-width: 19px; }
}

/* Trophies */
.game-trophies { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 18px 10px; }
.game-trophy { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 4px 6px; min-width: 0; }
.game-trophy-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: var(--surface); background: var(--game-color); }
.game-trophy-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.game-trophy-name { font-weight: 700; font-size: 0.88rem; line-height: 1.25; }
.game-trophy-note { font-size: 0.76rem; color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.game-trophy.earned .game-trophy-note { color: var(--good); font-weight: 650; }
.game-trophy.locked .game-trophy-icon { color: var(--muted); background: transparent; box-shadow: inset 0 0 0 2px var(--track); }
.game-trophy.locked .game-trophy-name { color: var(--muted); }
@media (max-width: 560px) {
	.game-trophies { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Toasts and the XP float */
.game-toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 45; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.game-toast { display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 10px 18px 10px 12px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 650; font-size: 0.92rem; line-height: 1.3; box-shadow: 0 16px 36px -14px rgba(0, 0, 0, 0.6); animation: game-toast-in 0.4s var(--spring) both; }
.game-toast svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.game-toast.closed svg { color: var(--ring-create); }
.game-toast.trophy svg { color: var(--ring-post); }
.game-toast.level { padding: 8px 20px 8px 8px; border-radius: 18px; }
.game-toast.level small { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.7; }
.game-toast-badge { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-display); font-stretch: 75%; font-size: 1.4rem; font-weight: 900; background: var(--ring-engage); color: #FFFFFF; }
.game-toast.out { animation: game-toast-out 0.26s ease-in both; }
@keyframes game-toast-in { from { opacity: 0; transform: translateY(16px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes game-toast-out { to { opacity: 0; transform: translateY(8px); } }

.game-float { position: fixed; z-index: 45; pointer-events: none; transform: translate(-100%, -50%); padding: 3px 10px; border-radius: 999px; font-size: 0.85rem; font-weight: 800; color: var(--accent-ink); background: var(--good); white-space: nowrap; animation: game-float 1.6s var(--ease) both; }
@keyframes game-float {
	0% { opacity: 0; transform: translate(-100%, -20%) scale(0.8); }
	15% { opacity: 1; transform: translate(-100%, -50%) scale(1); }
	75% { opacity: 1; }
	100% { opacity: 0; transform: translate(-100%, -170%); }
}

@media (max-width: 719px) {
	.game-toasts { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
	.game-toast, .game-toast.out, .game-float, .rings .arc.game-ring-pulse { animation: none; }
	.game-bar > i { transition: none; }
}
