/* Playful learning-app look: white, bright colours, chunky buttons with a solid lower edge. */
:root {
  --bg: #fff; --card: #fff; --ink: #3c3c3c; --muted: #6b6b6b; --line: #e5e5e5; --soft: #f7f7f7;
  --brand: #46a302; --brand-edge: #357d02; --bright: #58cc02; --on-brand: #fff;
  --blue: #1cb0f6; --blue-ink: #0b76a8; --blue-soft: #ddf4ff; --yellow: #ffc800; --yellow-soft: #fff4cc;
  --danger: #d63031; --danger-edge: #a81f20; --danger-soft: #ffdfe0;
  --round: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 500 17px/1.5 var(--round); }
.wrap { max-width: 28rem; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.5rem; color: var(--brand); text-decoration: none; }
.logo img { width: 40px; height: 40px; }
.lang { background: #fff; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; color: var(--blue-ink); padding: 6px 14px; font: 800 .85rem var(--round); cursor: pointer; }
h1 { font-weight: 800; font-size: 1.8rem; line-height: 1.2; margin: 0 0 8px; text-align: center; }
h2 { font-weight: 800; font-size: 1.25rem; text-align: center; margin: 0 0 12px; }
p { margin: 0 0 16px; }
.sub { color: var(--muted); text-align: center; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 20px; margin-bottom: 16px; }
label, legend { display: block; font-size: .85rem; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=password] {
  width: 100%; font: inherit; color: inherit; background: var(--soft); border: 2px solid var(--line);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 16px;
}
input[type=text]:focus, input[type=password]:focus { border-color: var(--blue); outline: none; background: #fff; }
input.pin { text-align: center; font: 800 2rem var(--round); letter-spacing: .35em; padding-left: calc(16px + .35em); }
input[type=range] { width: 100%; accent-color: var(--bright); }

.btn {
  display: block; width: 100%; border: 2px solid transparent; border-radius: 16px; padding: 14px 16px;
  font: 800 1.05rem var(--round); letter-spacing: .02em; text-align: center;
  background: var(--brand); color: var(--on-brand); box-shadow: 0 4px 0 var(--brand-edge); margin-bottom: 4px; cursor: pointer;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 transparent; }
.btn + .btn { margin-top: 10px; }
.btn.ghost { background: #fff; color: var(--blue-ink); border-color: var(--line); box-shadow: 0 4px 0 var(--line); }
.btn.danger { background: var(--danger); box-shadow: 0 4px 0 var(--danger-edge); }
.btn:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.error { color: var(--danger); font-weight: 700; text-align: center; min-height: 1.5em; margin: 12px 0 0; }
.note { font-size: .85rem; color: var(--muted); text-align: center; }
/* Install steps: one line each, read top to bottom. */
#install-help { white-space: pre-line; text-align: left; max-width: 32rem; }

.orb { width: 140px; height: 140px; margin: 8px auto 24px; border-radius: 50%; display: grid; place-items: center; position: relative; background: var(--blue-soft); }
.orb::before, .orb::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 4px solid var(--bright); opacity: 0; }
.on .orb::before, .on .orb::after { animation: ripple 2.4s ease-out infinite; }
.on .orb::after { animation-delay: 1.2s; }
.orb > img { width: 104px; height: 104px; }
.orb .avatar { width: 140px; height: 140px; }
@keyframes ripple { from { transform: scale(1); opacity: .9; } to { transform: scale(1.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .on .orb::before, .on .orb::after { animation: none; opacity: .6; transform: scale(1.1); } }

.status { text-align: center; font-weight: 800; font-size: 1.35rem; }
.big-pin { text-align: center; font-weight: 800; font-size: 3rem; line-height: 1.2; letter-spacing: .15em; margin: 0; font-variant-numeric: tabular-nums; }
.count { display: flex; justify-content: space-between; align-items: baseline; font-weight: 800; }
.count strong { font-size: 2rem; color: var(--blue-ink); }
#voice-alert .btn { width: 100%; }
.of { color: var(--muted); font-size: 1.1rem; }
.meter { height: 14px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 0 0 20px; }
.meter i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--bright); transition: width .1s; }
.qr { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 12px; max-width: 240px; margin: 0 auto 16px; }
.qr svg { display: block; width: 100%; height: auto; }
#install-help { margin: -8px auto 16px; }

.avatar { display: inline-block; flex: none; width: 44px; height: 44px; }
.avatar svg { display: block; width: 100%; height: 100%; }
.picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.picker .avatar { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.pick { display: block; margin: 0; padding: 5px; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 16px; background: #fff; cursor: pointer; }
.pick .avatar { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.pick[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); }
.pick:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.avatar-preview { display: flex; justify-content: center; margin: 4px 0 14px; }
.avatar-preview .avatar { width: 128px; height: 128px; }
.extra-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.extra-row .pick { padding: 3px; border-radius: 12px; }
.extras-title { font-size: .85rem; font-weight: 700; color: var(--muted); margin: 14px 0 6px; text-align: left; }
.avatar.photo { border-radius: 50%; overflow: hidden; }
.avatar.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.me-row { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.me-row .avatar { width: 56px; height: 56px; }
.me-row .btn { flex: 1; margin: 0; }
#face-dialog > .btn, #face-dialog > label.btn { width: 100%; margin-bottom: 10px; }
.guide-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.guide-row .avatar { width: 36px; height: 36px; }
.guide-row .sub { margin: 0; }

.btn.hand { margin-bottom: 8px; padding: 20px; font-size: 1.2rem; }
.btn.hand.waiting, .btn.hand.asking { background: var(--yellow); color: var(--ink); box-shadow: 0 4px 0 #d9a900; }
.btn.hand.speaking { background: var(--danger); box-shadow: 0 4px 0 var(--danger-edge); }
#talk-box { margin: 16px 0; }
#talk-box .note { margin: 10px 0; }
.reactions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.reactions button { font-size: 1.6rem; line-height: 1; padding: 10px 0; border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 16px; background: #fff; cursor: pointer; touch-action: manipulation; }
.reactions button:active { transform: translateY(2px); border-bottom-width: 2px; }
.float { position: fixed; bottom: 10%; z-index: 10; font-size: 2.6rem; pointer-events: none; opacity: 0; animation: float 2.2s ease-out forwards; }
@keyframes float { 0% { opacity: 1; transform: translateY(0) scale(.6); } 20% { transform: translateY(-8vh) scale(1.2); } 100% { opacity: 0; transform: translateY(-55vh) scale(1); } }
@media (prefers-reduced-motion: reduce) { .float { animation-name: fade; } @keyframes fade { from { opacity: 1; } to { opacity: 0; } } }

.check { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); font-size: .95rem; font-weight: 600; margin-bottom: 12px; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--bright); }
.people { list-style: none; padding: 0; margin: 12px 0 0; }
.people li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 16px; margin-bottom: 8px; }
.people li.hand { border-color: var(--yellow); background: var(--yellow-soft); }
.people li.speaking { border-color: var(--danger); background: var(--danger-soft); }
.who { flex: 1; min-width: 6rem; overflow-wrap: anywhere; line-height: 1.3; }
.who small { display: block; color: var(--muted); font-size: .8rem; }
.btn.small { width: auto; padding: 7px 12px; font-size: .85rem; margin: 0; border-radius: 12px; }
.btn.small + .btn.small { margin: 0; }
.kick { border: 0; background: none; color: var(--muted); font: 800 1.1rem var(--round); padding: 6px 8px; cursor: pointer; }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.tile { border: 2px solid var(--line); border-radius: 18px; padding: 12px; text-align: center; margin: 0; }
.tile strong { display: block; font-size: 1.7rem; color: var(--blue-ink); }
.tile span { font-size: .8rem; font-weight: 800; color: var(--muted); }
.tally { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tally li { background: var(--soft); border-radius: 14px; padding: 6px 12px; font-weight: 800; font-size: 1.1rem; }
.stars { display: flex; justify-content: center; gap: 4px; margin-bottom: 8px; }
.stars button { border: 0; background: none; padding: 4px; font-size: 2.4rem; line-height: 1; color: var(--line); cursor: pointer; }
.stars button.on { color: var(--yellow); }

.choice { display: block; text-align: center; text-decoration: none; color: inherit; padding: 28px 24px; border-bottom-width: 6px; }
.choice strong { display: block; font-weight: 800; font-size: 1.5rem; color: var(--brand); }
.choice + .choice strong { color: var(--blue-ink); }
.choice span { color: var(--muted); }
.choice:hover { border-color: var(--bright); }
.choice:active { transform: translateY(4px); border-bottom-width: 2px; }
dialog { width: min(24rem, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; border: 2px solid var(--line); border-radius: 24px; padding: 20px; background: #fff; color: var(--ink); text-align: center; }
dialog::backdrop { background: rgb(0 0 0 / .6); }
dialog h2 { margin-bottom: 16px; }
dialog .qr { max-width: 220px; margin-bottom: 12px; }
dialog p { margin-bottom: 8px; }
dialog .big-pin { font-size: 2.4rem; margin-bottom: 12px; }
dialog .btn { padding: 12px; }
#test-dialog .btn, #tips-headphones .btn { width: 100%; margin-bottom: 12px; }
#test-dialog .check, #tips-headphones .check { text-align: left; }
.phones { font-size: .95rem; font-weight: 700; margin-bottom: 16px; }
.phones.found { color: var(--bright); }
.short-link a { color: var(--blue-ink); font-weight: 800; font-size: 1.1rem; overflow-wrap: anywhere; }
#show-qr { margin-bottom: 12px; }
#mute-all { margin-bottom: 8px; }
#announcements .btn, #talk-warning .btn, #people-dialog > .btn, #music > .btn, #effects > .btn { width: 100%; margin-bottom: 12px; }
#effects h3 { font-size: .9rem; text-align: left; margin: 14px 0 4px; color: var(--muted); }
#effects ul { list-style: none; padding: 0; margin: 0; }
#effects li { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 2px solid var(--line); }
#effects li span { flex: 1; min-width: 0; text-align: left; overflow-wrap: anywhere; }
#effects .fav { border: 0; background: none; font-size: 1.4rem; line-height: 1; color: #ffc800; cursor: pointer; padding: 2px 4px; }
#people-dialog > .btn:last-child, #music > .btn:last-child { margin: 12px 0 0; }
#people-dialog .people { text-align: left; }
#announcements .check { text-align: left; }
#announcements li .btn { width: auto; margin: 0; }
#announce-list, #music-list { list-style: none; padding: 0; margin: 0 0 12px; }
#announce-list li, #music-list li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 2px solid var(--line); }
#announce-list span, #music-list span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
label.btn { font-size: 1.05rem; color: var(--blue-ink); margin: 0 0 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#announce-file:focus-visible + .btn { outline: 3px solid var(--blue); }

.requests { position: fixed; left: 0; right: 0; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20; display: grid; gap: 10px; width: min(26rem, calc(100% - 24px)); max-height: 70dvh; overflow: auto; margin: 0 auto; }
.request { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; background: #fff; border: 3px solid var(--yellow); border-radius: 20px; padding: 12px; box-shadow: 0 12px 32px rgb(0 0 0 / .28); animation: pop .25s ease-out; }
.request p { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.request .btn { grid-column: 1 / -1; width: 100%; padding: 12px; font-size: 1.05rem; margin: 0; }
.request .btn.ghost { margin-bottom: 4px; }
@keyframes pop { from { transform: translateY(30px) scale(.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .request { animation: none; } }
.tips .art { width: 100%; max-width: 220px; height: auto; }
.cuts { list-style: none; padding: 0; margin: 0 0 12px; text-align: left; }
.cuts li { display: flex; align-items: center; gap: 12px; padding: 7px 0; font-weight: 700; }
.cuts svg { width: 44px; height: 44px; flex: none; }

.feature img { display: block; margin: 0 auto 12px; }
.feature { padding: 22px 20px; }
.banner { display: block; position: relative; overflow: hidden; border-radius: 18px; background: var(--line); }
.banner img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; }
.banner-title { position: absolute; inset: auto 0 0; margin: 0; padding: 34px 16px 12px; color: #fff; font-weight: 800; font-size: 1.3rem; line-height: 1.25; text-align: left; background: linear-gradient(transparent, rgb(0 0 0 / .78)); text-shadow: 0 1px 3px rgb(0 0 0 / .6); }
.banner-title strong { display: block; font-size: 1.6rem; }
.banner-title small { display: block; font-size: .9rem; }
a.banner { margin-bottom: 16px; box-shadow: 0 6px 0 var(--line); }
a.banner:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--line); }
.back { display: inline-block; margin-bottom: 8px; color: var(--blue-ink); font-weight: 800; text-decoration: none; }
.card.tour { padding: 0; overflow: hidden; }
.tour .banner { border-radius: 0; }
.tour-body { padding: 16px; text-align: center; }
.tour .note { margin-bottom: 12px; }
.tour .note:empty { display: none; }
.remove-tour { font-size: .9rem; text-decoration: underline; }

.banner[hidden] { display: none; }
dialog.transcript[open] { display: flex; flex-direction: column; gap: 12px; width: min(28rem, calc(100% - 24px)); height: calc(100dvh - 32px); overflow: hidden; padding: 16px; }
.transcript h2 { margin: 0; }
.transcript-text { position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain; text-align: left; font-size: 1.2rem; line-height: 1.65; color: var(--muted); padding: 4px 2px 40vh; }
.transcript-text { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.transcript-text .line { border-radius: 6px; padding: 1px 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.transcript-text .line.now { background: var(--yellow-soft); color: var(--ink); font-weight: 800; }
.transcript-bar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; }
.transcript-bar .btn { margin: 0 0 4px; }
.show-transcript { margin-bottom: 12px; }
.transcript .hint { margin: 0; }
.transcript-text .w.picked { background: var(--blue-soft); color: var(--blue-ink); border-radius: 6px; }
.meaning { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; border: 3px solid var(--blue); border-radius: 18px; padding: 10px 14px; text-align: left; }
.meaning strong { grid-column: 1; font-size: 1.25rem; }
.meaning span { grid-column: 1; }
.meaning button { grid-column: 2; grid-row: 1 / 3; }
.badge { position: absolute; top: 10px; right: 10px; background: var(--yellow); color: var(--ink); border-radius: 99px; padding: 4px 12px; font-weight: 800; font-size: .8rem; }
.soon-heading { margin-top: 8px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lang.install { color: var(--brand); line-height: 1.15; padding: 6px 10px; font-size: .8rem; }
.player { margin-bottom: 18px; }
.buttons { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 10px; }
.round { flex: none; width: 64px; height: 64px; border: 0; border-radius: 50%; background: var(--brand); color: #fff; box-shadow: 0 5px 0 var(--brand-edge); position: relative; cursor: pointer; padding: 0; font: 800 .95rem var(--round); touch-action: manipulation; }
.round:active { transform: translateY(5px); box-shadow: 0 0 0 transparent; }
.round:not(.small)::before { content: ""; position: absolute; left: 25px; top: 19px; border-style: solid; border-width: 13px 0 13px 20px; border-color: transparent transparent transparent #fff; }
.round.playing::before { left: 21px; top: 20px; width: 8px; height: 24px; border-width: 0 8px; border-color: #fff; }
.round.small { width: 48px; height: 48px; background: #fff; color: var(--blue-ink); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.round.small:active { transform: translateY(4px); box-shadow: none; }
input.seek { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 28px; margin: 0; background: transparent; cursor: pointer; }
input.seek::-webkit-slider-runnable-track { height: 16px; border-radius: 99px; background: linear-gradient(var(--bright), var(--bright)) 0 / var(--done, 0%) 100% no-repeat var(--line); }
input.seek::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -5px; border: 4px solid var(--bright); border-radius: 50%; background: #fff; box-shadow: 0 2px 0 rgb(0 0 0 / .2); }
input.seek::-moz-range-track { height: 16px; border-radius: 99px; background: var(--line); }
input.seek::-moz-range-progress { height: 16px; border-radius: 99px; background: var(--bright); }
input.seek::-moz-range-thumb { width: 18px; height: 18px; border: 4px solid var(--bright); border-radius: 50%; background: #fff; }
.times { display: flex; justify-content: space-between; font-weight: 800; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.transcript-bar .speed { width: 64px; padding-inline: 0; }
.soon .tour-body .note { margin: 0; }
.transcript-bar .btn { white-space: nowrap; padding-inline: 8px; }
.brand .logo { flex: none; }
.lang.install { min-width: 0; }
@media (max-width: 370px) { .logo { font-size: 1.15rem; gap: 6px; } .logo img { width: 30px; height: 30px; } .brand { gap: 6px; } header { gap: 6px; } header .lang { padding-inline: 8px; font-size: .75rem; } }

/* Opening: the logo rises out of the dark, a light passes over the gold, the star sparkles. */
.splash { display: none; position: fixed; inset: 0; z-index: 100; align-items: center; justify-content: center; background: #070707; cursor: pointer; transition: opacity .6s ease; }
.intro .splash { display: flex; }
.intro body { overflow: hidden; }
.splash.leaving { opacity: 0; }
.splash-logo { position: relative; width: min(82vw, 30rem); opacity: 0; isolation: isolate; overflow: hidden; }
.splash-logo img { display: block; width: 100%; height: auto; }
.splash.play .splash-logo { animation: logo-in 1.6s cubic-bezier(.2, .7, .2, 1) forwards; }
.shine { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 38%, rgb(255 248 220 / .95) 50%, transparent 62%); transform: translateX(-100%); mix-blend-mode: overlay; }
.splash.play .shine { animation: shine 1.3s ease-in-out 1.1s forwards; }
.star { position: absolute; left: 82.1%; top: 15.8%; width: 12%; aspect-ratio: 1; translate: -50% -50%; opacity: 0; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgb(255 236 170 / .95), rgb(224 186 87 / .35) 35%, transparent 70%), linear-gradient(transparent 49%, rgb(255 240 190 / .9) 50%, transparent 51%), linear-gradient(90deg, transparent 49%, rgb(255 240 190 / .9) 50%, transparent 51%); }
.splash.play .star { animation: twinkle 1s ease-in-out 1.7s forwards; }
@keyframes logo-in { from { opacity: 0; transform: scale(1.06); filter: blur(6px); } to { opacity: 1; transform: scale(1); filter: blur(0); } }
@keyframes shine { to { transform: translateX(100%); } }
@keyframes twinkle { 0% { opacity: 0; scale: .2; rotate: 0deg; } 45% { opacity: 1; scale: 1.15; rotate: 20deg; } 100% { opacity: 0; scale: .5; rotate: 40deg; } }
@media (prefers-reduced-motion: reduce) { .splash.play .splash-logo { animation: none; opacity: 1; } .splash .shine, .splash .star { display: none; } }

/* The install button sits in the middle of the space between the logo and the language button */
header { gap: 10px; }
header .brand { flex: 1; }
header .brand .lang.install { margin-inline: auto; }
.banner.plain { display: block; aspect-ratio: 2 / 1; background: linear-gradient(135deg, var(--bright), var(--brand-edge)); }
.crumbs-title { margin-top: 4px; }

/* Explore */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 12px; }
.filters .btn.small + .btn.small { margin: 0; }
#refresh { margin-bottom: 16px; }
.place { text-align: center; }
.place h2 { margin-bottom: 4px; }
.place .kind { margin-bottom: 4px; font-weight: 800; }
.place .distance { color: var(--blue-ink); font-weight: 800; margin-bottom: 8px; }
a.btn { display: block; text-align: center; text-decoration: none; }
#nav-options .btn { margin: 0 0 12px; }
#search { margin-top: 16px; }
#search-results .btn { margin: 0 0 10px; font-size: .9rem; }
