/* Shared styles for every toy page */
:root {
  --bg: #fff8f0;
  --ink: #2b2118;
  --muted: #7a6a5c;
  --lava: #ff5a1f;
  --lava-dark: #d63a00;
  --card: #ffffff;
  --radius: 24px;
  --shadow: 0 6px 0 rgba(43, 33, 24, 0.12), 0 12px 30px rgba(43, 33, 24, 0.08);
  font-family: "Baloo 2", "Nunito", ui-rounded, "Segoe UI Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
}

.brand {
  font-weight: 800;
  font-size: 1.25rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.back {
  text-decoration: none;
  font-weight: 700;
  background: var(--card);
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: var(--shadow);
}
.back:active { transform: translateY(2px); }

main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 20px 32px;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1.05;
  margin: 8px 0 6px;
  font-weight: 800;
}

.lead {
  color: var(--muted);
  font-size: 1.15rem;
  margin: 0 0 28px;
}

/* Home page toy grid */
.toys {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.toy {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 26px 18px 22px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 0.15s ease;
  height: 100%;
}
a.toy:hover { transform: translateY(-4px) rotate(-1deg); }
a.toy:active { transform: translateY(2px); }

.toy-name { font-size: 1.35rem; font-weight: 800; }
.toy-desc { color: var(--muted); }

.toy.soon { opacity: 0.55; }
.badge {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #efe4d8;
  border-radius: 999px;
  padding: 4px 10px;
}

.mini-wheel {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 5px solid var(--ink);
  background: conic-gradient(#22c55e 0 72deg, #3b82f6 0 144deg, #ef4444 0 216deg, #facc15 0 288deg, #9ca3af 0 360deg);
}

.toy-art { width: 96px; height: 96px; }

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 16px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Shared toy page parts ---------- */
body { transition: background-color 0.4s ease; }

.toy-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding-bottom: 24px;
}
.toy-page h1 { margin: 0; }

.result {
  font-size: clamp(1.3rem, 5vw, 2rem);
  font-weight: 800;
  min-height: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}
.result .swatch {
  display: inline-block;
  font-size: clamp(2rem, 8vw, 2.8rem);
  padding: 2px 28px;
  border-radius: 999px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,0.25);
  animation: pop 0.45s cubic-bezier(.2,1.6,.4,1);
}
.pop { animation: pop 0.45s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop {
  from { transform: scale(0.4); }
  to { transform: scale(1); }
}

.big-btn {
  font: inherit;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  background: var(--lava);
  border: none;
  border-radius: 999px;
  padding: 16px 56px;
  min-width: 220px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--lava-dark);
  touch-action: manipulation;
  transition: transform 0.08s ease, box-shadow 0.08s ease, opacity 0.2s;
}
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--lava-dark); }
.big-btn:disabled { opacity: 0.6; cursor: default; }
.big-btn:focus-visible { outline: 4px solid var(--ink); outline-offset: 4px; }

.sound-toggle {
  font: inherit;
  font-weight: 700;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 12px;
}

@media (prefers-reduced-motion: reduce) {
  .result .swatch, .pop { animation: none; }
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
