/* Snow Stack — styles de l'interface HTML (la 3D et la toile 2D sont dessinées par le script). Police Fredoka, couleurs Kamori. */
:root { --uz: 1; --ink: #1d1b33; --cream: #fff6ec; --coral: #ff5a3d; --mint: #2bc4a0; --gold: #ffc93c; }
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #dfe8f3; color: #fff;
  font-family: Fredoka, 'Arial Rounded MT Bold', 'Segoe UI', sans-serif; font-weight: 600;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
#stage { position: fixed; inset: 0; }
#game, #hud { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; }
#hud { pointer-events: none; }
/* brume blanche sur les bords de l'écran (on est dans la neige) */
#stage::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 85% 75% at 50% 55%, rgba(240,246,255,0) 62%, rgba(240,246,255,0.55) 100%); }
#hud { z-index: 1; }
#ui { position: fixed; inset: 0; pointer-events: none; font-size: calc(var(--uz) * 18px); }
#ui .layer { position: absolute; inset: 0; pointer-events: none; }
#ui button, #ui .panel { pointer-events: auto; }
.no3d { position: absolute; inset: 0; display: grid; place-items: center; padding: 2em; text-align: center; font-size: 18px; color: var(--ink); }
svg.i { width: 1.25em; height: 1.25em; fill: currentColor; }
i.coin { display: inline-block; width: 0.9em; height: 0.9em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b0 0 18%, #ffc93c 20% 60%, #e8a400 62% 72%, #ffc93c 74%); vertical-align: -0.1em; margin-right: 0.25em; }

.icon-btn {
  font: inherit; width: 2.4em; height: 2.4em; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink);
  background: rgba(255, 246, 236, 0.92); box-shadow: 0 0.18em 0 rgba(29, 27, 51, 0.25); cursor: pointer;
}
.icon-btn:active { transform: translateY(0.1em); box-shadow: 0 0.08em 0 rgba(29, 27, 51, 0.25); }
.top-right { position: absolute; top: calc(0.6em + env(safe-area-inset-top, 0px)); right: 0.6em; display: flex; gap: 0.45em; }

.btn {
  font: inherit; font-size: 1.15em; font-weight: 700; color: #fff; border: 0; border-radius: 1em; padding: 0.55em 1.1em; margin: 0.3em 0;
  background: var(--gold); box-shadow: 0 0.24em 0 #c98d00; text-shadow: 0 0.08em 0 rgba(0, 0, 0, 0.18);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 0.45em; white-space: nowrap;
}
.btn:active { transform: translateY(0.16em); box-shadow: 0 0.08em 0 #c98d00; }
.btn.mint { background: var(--mint); box-shadow: 0 0.24em 0 #1a8a70; }
.btn.coral { background: var(--coral); box-shadow: 0 0.24em 0 #b8321c; }
.btn.grey { background: #8c88a8; box-shadow: 0 0.24em 0 #5a5678; }
.btn.purple { background: #8f6bff; box-shadow: 0 0.24em 0 #5a3ac8; }
.btn.big { font-size: 1.4em; }
.btn.small { font-size: 0.95em; }

/* Écran titre */
.title-screen {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  padding: calc(4em + env(safe-area-inset-top, 0px)) 1em calc(3em + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(rgba(29, 27, 51, 0.35), rgba(29, 27, 51, 0) 40%, rgba(29, 27, 51, 0) 70%, rgba(29, 27, 51, 0.35));
  transition: opacity 0.35s;
}
.title-screen.out { opacity: 0; }
.title-screen .logo { display: flex; flex-direction: column; align-items: center; line-height: 0.82; animation: wobble 2.4s ease-in-out infinite; }
.title-screen .logo span { font-weight: 700; font-size: 5.2em; letter-spacing: 0.02em; -webkit-text-stroke: 0.06em var(--ink); paint-order: stroke fill; text-shadow: 0 0.08em 0 var(--ink); }
.title-screen .logo .l1 { color: #ffffff; font-size: 6em; }
.title-screen .logo .l2 { color: var(--gold); }
.title-screen .tagline { margin-top: 1em; max-width: 17em; text-align: center; font-size: 1.05em; color: #fff; text-shadow: 0 0.1em 0.3em rgba(29, 27, 51, 0.8); }
.title-screen .spacer { flex: 1; }
.title-screen .tap { font-size: 1.3em; color: #fff; text-shadow: 0 0.1em 0.3em rgba(29, 27, 51, 0.9); animation: pulse 1.4s ease-in-out infinite; text-align: center; }
@keyframes wobble { 0%, 100% { transform: rotate(-3deg) scale(1, 1); } 50% { transform: rotate(-3deg) scale(1.04, 0.96); } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(0.96); } }

/* Panneaux */
.screen-dim { position: absolute; inset: 0; background: rgba(29, 27, 51, 0.55); display: flex; align-items: center; justify-content: center; pointer-events: auto; animation: fade 0.2s; }
.panel {
  background: var(--cream); color: var(--ink); border-radius: 1.4em; padding: 1.1em 1.1em 1.2em; width: min(92vw, 24em);
  box-shadow: 0 0.35em 0 rgba(29, 27, 51, 0.25), 0 1em 2.4em rgba(0, 0, 0, 0.35);
  display: flex; flex-direction: column; align-items: stretch; text-align: center; animation: pop 0.22s ease-out;
}
.panel h2 { margin: 0.1em 0 0.4em; font-size: 1.7em; color: var(--coral); }
.panel p { margin: 0.2em 0 0.7em; font-weight: 500; font-size: 0.95em; line-height: 1.35; color: #4a4668; }
.panel .row { display: flex; gap: 0.5em; }
.panel .row .btn { flex: 1; font-size: 0.95em; padding: 0.55em 0.4em; }
.panel .btn { width: 100%; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4em; margin: 0.2em 0 0.6em; }
.stats div { background: #fff; border-radius: 0.8em; padding: 0.45em 0.3em; display: flex; flex-direction: column; box-shadow: inset 0 0 0 0.1em rgba(29, 27, 51, 0.08); }
.stats b { font-size: 1.35em; }
.stats span { font-weight: 500; font-size: 0.72em; color: #6a668a; }
.big-gold { font-size: 2.2em; font-weight: 700; color: #e8a400; margin: 0.1em 0 0.4em; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(0.88); opacity: 0; } }

.dbg { position: fixed; left: 6px; bottom: 6px; z-index: 60; font: 12px monospace; color: #fff; background: rgba(0, 0, 0, 0.55); padding: 3px 6px; border-radius: 4px; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .title-screen .logo, .title-screen .tap { animation: none; } }
