/* Hóesés a neveden – stílusok (rendszerfontok, nincs külső erőforrás) */

:root {
  --ink: #eef3ff;
  --muted: rgba(220, 230, 255, 0.62);
  --glass: rgba(9, 16, 34, 0.74);   /* nincs backdrop-filter: az animált vászon fölött minden képkockán újra kellene mosnia */
  --line: rgba(200, 215, 255, 0.18);
  --warm: #f6c28a;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial,
          "Noto Sans", "DejaVu Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #050a17;
  color: var(--ink);
  font-family: var(--font);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* Rétegek: statikus ég → betűk (statikus, CSS-sel animálva) → képkockánkénti hó és pelyhek. */
.layer,
.letters {
  position: fixed;
  left: 0;
  top: 0;
  display: block;
  pointer-events: none;
}
#scene { touch-action: manipulation; }

.letters {
  transition: opacity 1.1s cubic-bezier(0.2, 0.7, 0.3, 1), transform 1.1s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.letters.enter { opacity: 0; transform: translateY(12px); }
.letters.leave { opacity: 0; transition-duration: 0.85s; }

.ui {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left));
  pointer-events: none;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.9s ease 0.3s, transform 0.9s ease 0.3s;
}
.ready .ui { opacity: 1; transform: none; }
.ui > * { pointer-events: auto; }

.name-form {
  display: flex;
  flex: 0 1 440px;
  min-width: 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.name-form input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 14px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 500 16px/1.2 var(--font);   /* 16px: iOS nem nagyít rá */
}
.name-form input::placeholder { color: var(--muted); }
.name-form:focus-within { border-color: rgba(246, 194, 138, 0.6); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font: 600 15px/1.2 var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { background: rgba(255, 255, 255, 0.16); }
.btn:focus-visible { outline: 2px solid var(--warm); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: default; }

.btn-go {
  border-color: transparent;
  background: linear-gradient(180deg, #ffd7a8, #e9965b);
  color: #3a1d0b;
}
.btn-go:hover { background: linear-gradient(180deg, #ffe2bd, #f0a46c); }

.btn-sound {
  flex: 0 0 auto;
  background: var(--glass);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
.btn-sound .icon { width: 18px; height: 18px; }
.btn-sound .icon-on { display: none; }
.btn-sound.is-on { border-color: rgba(246, 194, 138, 0.6); color: #ffe4c2; }
.btn-sound.is-on .icon-on { display: block; }
.btn-sound.is-on .icon-off { display: none; }

.hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: max(10px, env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  pointer-events: none;
  opacity: 0;
  animation: hint 7s ease 1.2s forwards;
}
@keyframes hint {
  0% { opacity: 0; }
  15%, 70% { opacity: 1; }
  100% { opacity: 0; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.noscript {
  position: fixed;
  inset: 40% 0 auto;
  text-align: center;
}

.debug {
  position: fixed;
  left: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.6);
  font: 12px/1.3 ui-monospace, monospace;
  color: #bfe;
  pointer-events: none;
}

/* Keskeny kijelzőn a hanggomb csak ikon (a felirat a képernyőolvasónak megmarad). */
@media (max-width: 480px) {
  .ui { gap: 8px; }
  .btn { padding: 9px 13px; }
  .btn-sound .label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ui { transition: none; transform: none; }
  .letters { transition: opacity 0.3s linear; }
  .letters.enter { transform: none; }
  .hint { animation: none; opacity: 0.8; }
}
