/* ZELTREX Kids: the hub and the plain pages. Shared parts are in parts.css (load it first). */
html, body { margin: 0; height: 100%; }
.hub-page *, .hub-page *::before, .hub-page *::after, .doc * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body.hub-page, body.doc {
  font-family: var(--font); font-weight: 700; color: #fff; background: var(--night);
  -webkit-user-select: none; user-select: none; overscroll-behavior: none; touch-action: manipulation;
}
.hub-page h1, .hub-page h2 { margin: 0; font-weight: 900; line-height: 1.1; }
.hub-page h1 { font-size: clamp(2rem, 9vw, 3rem); }
.hub-page h2 { font-size: clamp(1.5rem, 6.5vw, 2rem); }
.hub-page p { margin: .6em 0; line-height: 1.35; }
.k-small { font-size: .9rem; font-weight: 600; opacity: .85; }
:where(.hub-page) a { color: inherit; }
:where(.hub-page) button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
.hub-page button:focus-visible, .hub-page a:focus-visible { outline: 4px solid var(--sun); outline-offset: 3px; }


/* ---- hub ---- */
.hub-page {
  background: radial-gradient(120% 80% at 50% 0%, var(--night-2), var(--night) 70%); min-height: 100%;
  display: flex; flex-direction: column; overflow-x: hidden;
}
.sky { position: fixed; inset: 0; pointer-events: none; }
.sky i { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: #fff; opacity: .5; animation: twinkle 3s ease-in-out infinite; }
.sky i:nth-child(1) { left: 8%; top: 12%; } .sky i:nth-child(2) { left: 82%; top: 9%; animation-delay: .6s; width: 6px; height: 6px; }
.sky i:nth-child(3) { left: 64%; top: 30%; animation-delay: 1.1s; background: var(--sun); } .sky i:nth-child(4) { left: 16%; top: 46%; animation-delay: 1.7s; width: 7px; height: 7px; }
.sky i:nth-child(5) { left: 90%; top: 55%; animation-delay: .3s; background: var(--mint); } .sky i:nth-child(6) { left: 6%; top: 78%; animation-delay: 2.2s; background: var(--pink); }
.sky i:nth-child(7) { left: 74%; top: 84%; animation-delay: 1.4s; width: 6px; height: 6px; } .sky i:nth-child(8) { left: 42%; top: 6%; animation-delay: .9s; width: 5px; height: 5px; }
.hub-head { display: flex; justify-content: space-between; align-items: center; padding: calc(12px + var(--safe-t)) 16px 0; position: relative; }
.brand { font-weight: 900; letter-spacing: .04em; opacity: .9; }
.brand b { color: var(--sun); }
.hub { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 16px; position: relative; }
.hello { display: flex; align-items: center; gap: 6px; }
.mascot { flex: none; filter: drop-shadow(0 10px 0 rgba(0, 0, 0, .25)); }
.bob { animation: bob 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
.bubble {
  background: var(--paper); color: var(--ink); border-radius: 24px; padding: 14px 18px; position: relative; font-size: 1.05rem; flex: 1;
  animation: popin .5s cubic-bezier(.3, 1.6, .5, 1) both .2s;
}
.bubble b { font-size: 1.6rem; font-weight: 900; }
.bubble::before { content: ""; position: absolute; left: -12px; top: 50%; border: 12px solid transparent; border-right-color: var(--paper); border-left: 0; margin-top: -12px; }
.games { display: grid; gap: 14px; }
.game {
  display: flex; align-items: center; gap: 14px; text-align: left; text-decoration: none; width: 100%; min-height: 128px; padding: 14px;
  border-radius: 28px; color: var(--ink); position: relative; overflow: hidden; transition: transform .12s;
  animation: popin .5s cubic-bezier(.3, 1.6, .5, 1) both;
}
.game:nth-child(2) { animation-delay: .12s; }
.game:active { transform: scale(.96) rotate(-1deg); }
.game-mirrors { background: linear-gradient(135deg, var(--sun), #ff9f43); box-shadow: 0 8px 0 #c97a12; }
.game-soon { background: repeating-linear-gradient(135deg, #7a5cff 0 22px, #6a4df0 22px 44px); color: #fff; box-shadow: 0 8px 0 #3f2ba8; }
.game-art { flex: none; width: 104px; height: 104px; border-radius: 22px; background: rgba(255, 255, 255, .35); display: flex; align-items: center; justify-content: center; }
.game-art img { width: 96px; height: 96px; animation: wobble 3s ease-in-out infinite; }
.mystery { font-size: 4.2rem; font-weight: 900; color: var(--sun); text-shadow: 0 5px 0 rgba(0, 0, 0, .25); animation: wobble 2.2s ease-in-out infinite; }
.game-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.game-text b { font-size: 1.5rem; font-weight: 900; line-height: 1.05; }
.game-text small { font-size: .95rem; font-weight: 700; opacity: .85; }
.game-go { flex: none; width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; box-shadow: 0 4px 0 rgba(0, 0, 0, .2); }
.idea {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 18px; border-radius: 28px; background: #d92d6a;
  box-shadow: 0 8px 0 #a81f50; transition: transform .12s; animation: popin .5s cubic-bezier(.3, 1.6, .5, 1) both .24s;
}
.idea:active { transform: translateY(5px); box-shadow: 0 3px 0 #a81f50; }
.idea-mic { flex: none; width: 64px; height: 64px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 2rem; animation: pulse 1.6s ease-in-out infinite; }
.idea-text { display: flex; flex-direction: column; }
.idea-text b { font-size: 1.25rem; font-weight: 900; line-height: 1.1; }
.idea-text small { font-weight: 700; opacity: .9; }
.hub-foot { text-align: center; padding: 8px 16px calc(16px + var(--safe-b)); position: relative; }
.hub-foot p { margin: 0 0 4px; }

/* ---- plain pages (grown-ups, team) ---- */
body.doc { background: var(--paper); color: var(--ink); font-weight: 500; -webkit-user-select: text; user-select: text; }
.doc main { max-width: 720px; margin: 0 auto; padding: 24px 18px 60px; }
.doc h1 { font-size: 1.8rem; margin: .4em 0; } .doc h2 { font-size: 1.25rem; margin: 1.4em 0 .3em; }
.doc a { color: #4a2bd6; }
.doc .lang-en { border-top: 2px solid #ddd; margin-top: 40px; padding-top: 10px; }
.doc table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.doc th, .doc td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #ddd; vertical-align: top; }
.doc .tag { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: .78rem; font-weight: 800; background: #e9e4ff; }
.doc .tag.warn { background: #ffd9d9; opacity: 1; color: #8a1c1c; }
.doc .cards { display: flex; gap: 10px; flex-wrap: wrap; }
.doc .card { background: #fff; border-radius: 12px; padding: 10px 14px; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); min-width: 110px; }
.doc .card b { display: block; font-size: 1.5rem; }
.doc .note { background: #fff3c4; border-radius: 10px; padding: 8px 12px; font-size: .9rem; }
.doc .said { color: #555; font-size: .85rem; }


/* ---- numbers, votes, stickers ---- */
.stats { display: flex; gap: 8px; justify-content: space-between; }
.stats span { flex: 1; background: var(--soft); border-radius: 18px; padding: 8px 6px; text-align: center; line-height: 1.1; }
.stats b { display: block; font-size: 1.5rem; font-weight: 900; color: var(--sun); }
.stats small { font-size: .8rem; font-weight: 700; opacity: .9; }
.game-wrap { position: relative; }
.votes { display: flex; gap: 8px; justify-content: flex-end; margin: -14px 14px 0 0; position: relative; }
.hub-page .vote { background: var(--paper); color: var(--ink); border-radius: 999px; min-height: 48px; min-width: 76px; padding: 0 14px; font-size: 1.15rem; font-weight: 900; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); transition: transform .12s; }
.hub-page .vote:active { transform: scale(.9); }
.hub-page .vote[aria-pressed="true"] { background: var(--mint); }
.hub-page #down[aria-pressed="true"] { background: var(--pink); color: #fff; }
.shelf-box { background: var(--soft); border-radius: 24px; padding: 12px 14px 14px; }
.hub-page .shelf-box h2 { font-size: 1.1rem; display: flex; justify-content: space-between; align-items: baseline; }
.shelf-box h2 small { font-size: .85rem; opacity: .8; }
.shelf { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }

.game-mirrors .game-go { animation: pulse 1.6s ease-in-out infinite; }
@media (max-width: 380px) {
  .game-art { width: 76px; height: 76px; } .game-art img { width: 70px; height: 70px; }
  .game-text b { font-size: 1.25rem; } .game-go { width: 48px; height: 48px; } .mystery { font-size: 3.2rem; }
}
