:root {
  --bg: #fbf3df;
  --ink: #4a3a33;
  --card: #ffffff;
  --shadow: 0 5px 0 rgba(91,70,60,.16);
  --accent: #4b6fa5;
  --matcha: #5aa371;
  --brown: #5b463c;
  --paper: #fffaf0;
  --line: rgba(91,70,60,.38);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: linear-gradient(180deg, #fff8e7 0%, #f6f1ff 100%) fixed;
  color: var(--ink);
  font-family: "Nunito", ui-rounded, "SF Pro Rounded", "Quicksand", system-ui, sans-serif;
  font-size: 20px;
  user-select: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
button:focus-visible { outline: 4px solid #3a86ff; outline-offset: 3px; }

.bar {
  position: sticky; top: 0; z-index: 5; pointer-events: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  max-width: 900px; margin: 0 auto; padding: 12px 16px 0;
}
.bar > * { pointer-events: auto; }
.bar h1 { display: none; margin: 0; font-size: clamp(18px, 4.5vw, 24px); font-weight: 800; flex: 1; text-align: center; letter-spacing: .2px; }
.bar .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon { width: 44px; height: 44px; border-radius: 50%; background: #fff; box-shadow: 0 3px 10px rgba(60,50,110,.14); font-size: 22px; transition: transform .12s, background .12s; }
.icon:hover { background: #e6e1f8; transform: scale(1.06); }
.icon[hidden] { display: block; visibility: hidden; }
.pill { background: #fff; box-shadow: 0 3px 10px rgba(60,50,110,.14); border-radius: 99px; padding: 8px 14px; font-weight: 800; font-size: 18px; }

main { max-width: 900px; margin: 0 auto; padding: 20px 16px 48px; }

.hello { text-align: center; font-size: clamp(22px, 5vw, 30px); margin: 4px 0 16px; }
.ages { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; }
.ages button {
  background: #fff; border-radius: 99px; padding: 10px 20px; box-shadow: var(--shadow); font-weight: bold;
}
.ages button.on { background: var(--matcha); color: #fff; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.tile {
  border-radius: 28px; padding: 22px 10px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 26px; font-weight: bold; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.2);
  transition: transform .12s;
}
.tile:hover, .tile:active { transform: scale(1.05) rotate(-1deg); }
.tile .big { font-size: 64px; line-height: 1; text-shadow: none; }
.tile small { font-size: 16px; opacity: .95; }

.progress { display: flex; justify-content: center; gap: 8px; margin-bottom: 16px; }
.dot { width: 18px; height: 18px; border-radius: 50%; background: #e0d8c0; }
.dot.done { background: var(--matcha); }
.dot.now { background: #ffd166; transform: scale(1.3); }

.prompt {
  background: var(--card); border-radius: 28px; padding: 20px; text-align: center;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.prompt p { margin: 0 0 10px; font-size: clamp(20px, 4.5vw, 28px); font-weight: bold; }
.stage { font-size: clamp(64px, 18vw, 120px); line-height: 1.1; min-height: 1.1em; word-break: break-word; }
.stage.emoji-row { font-size: clamp(36px, 9vw, 56px); letter-spacing: 4px; }
.stage svg { width: clamp(120px, 34vw, 190px); height: auto; }
.say { margin-top: 6px; background: #3a86ff; color: #fff; border-radius: 99px; padding: 8px 18px; box-shadow: var(--shadow); }

.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; }
.opt {
  background: #fff; border-radius: 24px; min-height: 100px; padding: 12px;
  box-shadow: var(--shadow); font-size: clamp(32px, 8vw, 52px); font-weight: bold;
  display: flex; align-items: center; justify-content: center; border: 5px solid transparent;
  transition: transform .1s;
}
.opt { min-width: 0; }
.opt.word { font-size: clamp(16px, 4vw, 26px); overflow-wrap: break-word; hyphens: manual; }
.opt:hover { transform: translateY(-3px); }
.opt.swatch { border: 5px solid rgba(0,0,0,.15); min-height: 110px; }
.opt.right { border-color: var(--matcha); background: #d8f9ee; animation: pop .4s; }
.opt.wrong { border-color: #ef476f; animation: shake .4s; }
.opt:disabled { cursor: default; }

.msg { text-align: center; min-height: 1.6em; margin-top: 18px; font-size: 24px; font-weight: bold; }

.end { text-align: center; background: #fff; border-radius: 32px; padding: 30px 16px; box-shadow: var(--shadow); }
.end .trophy { width: 150px; margin: 0 auto; animation: pop .6s; }
.end .earned { font-size: 56px; letter-spacing: 6px; margin: 8px 0 16px; }
.end .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn { background: var(--matcha); color: #fff; border-radius: 99px; padding: 14px 28px; font-weight: bold; box-shadow: var(--shadow); font-size: 22px; }
.btn.alt { background: #3a86ff; }

.memory { display: grid; gap: 10px; grid-template-columns: repeat(4, 1fr); max-width: 520px; margin: 0 auto; }
.card {
  aspect-ratio: 1; border-radius: 20px; background: #8338ec; color: #fff; font-size: clamp(30px, 9vw, 54px);
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center;
  transition: transform .2s;
}
.card.up { background: #fff; color: inherit; }
.card.matched { background: #d8f9ee; animation: pop .4s; }

@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }


.kikobox { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.kikobox .kslot { width: 110px; flex: none; }
.kiko { width: 100%; height: auto; overflow: visible; }
.kiko.cheer { animation: hop .5s 2; }
.kiko.hmm { animation: tilt .6s; transform-origin: 50% 90%; }
.kiko .tail { transform-origin: 85% 90%; animation: wag 2s ease-in-out infinite; }
.bubble { position: relative; background: #fff; border-radius: 20px; padding: 12px 16px; box-shadow: var(--shadow); font-weight: bold; font-size: 22px; max-width: 340px; }
.bubble:empty { visibility: hidden; }
.bubble::before { content: ""; position: absolute; left: -8px; top: 50%; margin-top: -8px; border: 8px solid transparent; border-right-color: #fff; border-left: 0; }
.hello-box { margin: 0 0 20px; }
.hello-box .bubble { font-size: clamp(20px, 4.5vw, 26px); }
@keyframes hop { 40% { transform: translateY(-14px); } }
@keyframes tilt { 30% { transform: rotate(-8deg); } 70% { transform: rotate(6deg); } }
@keyframes wag { 50% { transform: rotate(8deg); } }

.foot { text-align: center; margin-top: 36px; font-size: 14px; color: #6b6f8a; }
.foot a { color: inherit; text-decoration: underline; }

.langwrap { position: relative; }
.langmenu {
  position: absolute; right: 0; top: 52px; z-index: 10; min-width: 190px; padding: 8px;
  background: #fff; border-radius: 20px; box-shadow: 0 12px 30px rgba(60,50,110,.22), 0 0 0 1px rgba(60,50,110,.06);
  display: flex; flex-direction: column; gap: 2px;
}
.langmenu[hidden] { display: none; }
.langmenu button { text-align: left; padding: 10px 14px; border-radius: 14px; background: none; font-weight: 800; font-size: 18px; }
.langmenu button:hover { background: #f1eefb; }
.langmenu button.on { background: var(--matcha); color: #fff; }

.opt.event { flex-direction: column; gap: 4px; font-size: 16px; }
.opt.event .evi { font-size: 46px; line-height: 1.1; }
.opt.event .evt { font-size: 18px; font-weight: 800; text-align: center; line-height: 1.2; overflow-wrap: anywhere; }

/* landing + sections */
.sec { font-size: 22px; font-weight: 900; margin: 26px 4px 12px; }
.tile.soon { opacity: .88; position: relative; background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.12) 0 12px, transparent 12px 24px); }
.tile.soon small { background: rgba(255,255,255,.28); border-radius: 99px; padding: 2px 10px; }
.land { max-width: 820px; margin: 0 auto; }
.hero { text-align: center; padding: 18px 0 8px; }
.hero-kiko { width: 150px; margin: 0 auto 4px; }
.hero h1 { font-size: clamp(30px, 7vw, 46px); line-height: 1.1; margin: 8px 0 12px; font-weight: 900; }
.hero .lead { font-size: clamp(18px, 3.6vw, 22px); line-height: 1.5; max-width: 640px; margin: 0 auto 22px; color: #3d4060; }
.btn.start { font-size: 24px; padding: 16px 36px; }
.land .lcard { background: #fff; border-radius: 28px; box-shadow: var(--shadow); padding: 22px 22px 18px; margin: 26px 0 0; }
.land .lcard h2 { margin: 0 0 8px; font-size: 24px; font-weight: 900; }
.land .lcard p { margin: 0; font-size: 19px; line-height: 1.6; color: #3d4060; }
.pts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.pt { background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: 18px; }
.pt-i { font-size: 34px; }
.pt h3 { margin: 4px 0 4px; font-size: 20px; font-weight: 900; }
.pt p { margin: 0; font-size: 17px; line-height: 1.5; color: #3d4060; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.land .skills ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
.land .skills li { font-size: 17px; line-height: 1.45; color: #3d4060; }
.land .skills li b { font-size: 18px; color: var(--ink); }
.chip { font-size: 14px; font-weight: 800; background: #fff3cf; border-radius: 99px; padding: 3px 10px; vertical-align: middle; }
.center { text-align: center; margin: 30px 0 0; }

.mixrow .tile { flex-direction: row; justify-content: center; gap: 14px; padding: 16px 10px; grid-column: 1 / -1; }
.mixrow .tile .big { font-size: 48px; }
.mixrow .tile small { display: none; }

.linkbtn { background: none; color: var(--accent); font-weight: 800; font-size: 17px; text-decoration: underline; padding: 10px; margin-top: 14px; }

.tile { position: relative; }
.badge { align-self: center; margin-bottom: 2px; background: #fff; color: #7a4a00; font-size: 13px; font-weight: 900; border-radius: 99px; padding: 3px 10px; text-shadow: none; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.secsub { margin: -6px 4px 12px; font-size: 17px; color: #5b5f7a; }

/* life skills */
.lifebar { display: flex; align-items: center; gap: 8px; margin: 4px 0 4px; }
.lifebar .icon { flex: none; }
.lifetitle { margin: 0; font-size: 22px; font-weight: 900; }
.lmenu { display: grid; gap: 14px; margin-top: 14px; }
.lbtn { display: flex; align-items: center; gap: 16px; text-align: left; background: #fff; border-radius: 24px; padding: 18px; box-shadow: var(--shadow); font-size: 20px; }
.lbtn:hover { transform: translateY(-2px); }
.lbtn-e { font-size: 44px; line-height: 1; }
.lbtn small { font-size: 16px; color: #5b5f7a; font-weight: 600; }
.story { background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: 18px 20px; text-align: center; margin: 12px 0; }
.story-e { font-size: 56px; line-height: 1.1; }
.story h3 { margin: 4px 0; font-size: 22px; font-weight: 900; }
.story p { margin: 6px 0 0; font-size: 20px; line-height: 1.5; }
.q { font-size: 22px; font-weight: 900; text-align: center; margin: 16px 0 12px; }
.lopts { display: grid; gap: 12px; }
.lopt { text-align: left; background: #fff; border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow); font-size: 19px; font-weight: 700; line-height: 1.4; border: 4px solid transparent; }
.lopt:disabled { cursor: default; color: inherit; }
.lopt.great { border-color: var(--matcha); background: #e3faf2; }
.lopt.ok { border-color: #ffc933; background: #fff8e1; }
.lopt.less { border-color: #f08aa0; background: #fdecf0; }
.lopt.picked { box-shadow: 0 0 0 4px rgba(58,134,255,.45); }
.lopt .why { display: block; margin-top: 8px; font-size: 16px; font-weight: 600; color: #3d4060; }
.lnext { text-align: center; margin-top: 18px; }
.lnext .kikobox { margin-bottom: 14px; }
.acard { background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: 16px 20px; margin: 14px 0; font-size: 19px; line-height: 1.5; }
.acard h3 { margin: 0 0 6px; font-size: 22px; font-weight: 900; }
.acard p { margin: 6px 0; } .acard ol { margin: 6px 0 0; padding-left: 22px; }
.atip { background: #fff8e1; border-radius: 14px; padding: 8px 12px; }
.how { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 12px 18px; margin: 12px 0; font-size: 18px; }
.how summary { font-weight: 900; cursor: pointer; }
.row.center { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.note { text-align: center; font-size: 17px; color: #5b5f7a; margin: 16px 6px; line-height: 1.5; }
.twister { background: #fff; border-radius: 28px; box-shadow: var(--shadow); padding: 28px 20px; text-align: center; font-size: clamp(26px, 6vw, 38px); font-weight: 900; line-height: 1.3; margin: 16px 0; }
.topic { font-size: 22px; font-weight: 900; }
.chips { display: flex; gap: 10px; justify-content: center; margin-bottom: 8px; }
.chipbtn { background: #fff; border-radius: 99px; padding: 10px 20px; font-weight: 900; box-shadow: var(--shadow); }
.chipbtn.on { background: var(--matcha); color: #fff; }
.timer { text-align: center; font-size: 72px; font-weight: 900; margin: 8px 0; }
.statement { font-size: clamp(22px, 5vw, 30px); font-weight: 900; line-height: 1.35; padding: 6px 4px 2px; }
.plancard { background: #fff; border: 4px dashed var(--matcha); border-radius: 28px; padding: 18px 22px; margin-top: 14px; font-size: 20px; line-height: 1.5; }
.plancard h3 { margin: 0 0 6px; font-size: 24px; font-weight: 900; }
.plancard p { margin: 8px 0; }
.shake { animation: shake .4s; }
@media print { .bar, .lifebar, .row, .foot, .kikobox { display: none !important; } body { background: #fff; } }

.langmenu button.locked { opacity: .55; cursor: not-allowed; }
.langmenu button.locked:hover { background: none; }
.lockmsg { margin: 6px 4px 2px; padding: 8px 10px; background: #fff3cf; border-radius: 12px; font-size: 14px; font-weight: 800; }
.lockmsg[hidden] { display: none; }

.tile.locked { opacity: .6; filter: saturate(.55); cursor: not-allowed; }
.tile.locked:hover { transform: none; }
.tile.locked small { background: rgba(255,255,255,.3); border-radius: 99px; padding: 2px 10px; }

.land .lvls { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
.land .lvls li { font-size: 17px; line-height: 1.45; color: #3d4060; }
.land .lvls li b { font-size: 18px; color: var(--ink); }

/* ---------- in-house graphics on the colorful design ---------- */
.tile { background: var(--c, #fff); }
.tile .big {
  display: grid; place-items: center; width: 76px; height: 76px; margin: 2px 0 4px; border-radius: 50%;
  background: rgba(255, 255, 255, .94); font-size: 0; line-height: 1; box-shadow: 0 3px 0 rgba(0, 0, 0, .1);
}
.tile .big .ico { width: 48px; height: 48px; }
.mixrow .tile .big { width: 56px; height: 56px; margin: 0; }
.mixrow .tile .big .ico { width: 36px; height: 36px; }
.tile.locked .big { opacity: .85; }
.ico { width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.icon .ico { width: 22px; height: 22px; vertical-align: 0; }
.pill .ico { width: 20px; height: 20px; vertical-align: -4px; }
.ages button .ico { width: 18px; height: 16px; vertical-align: -2px; }
.ages button .ico:last-child { width: 14px; height: 14px; vertical-align: -2px; }
.badge .ico { width: 15px; height: 13px; vertical-align: -2px; }
.tile small .ico { width: 13px; height: 13px; vertical-align: -2px; }
.say .ico { width: 16px; height: 16px; vertical-align: -3px; }
.end .earned { display: flex; justify-content: center; gap: 6px; letter-spacing: 0; }
.end .earned .ico { width: 52px; height: 52px; vertical-align: 0; }
.lbtn-e .ico { width: 44px; height: 44px; vertical-align: 0; }
.pt-i .ico { width: 40px; height: 40px; vertical-align: 0; }
.land .lvls .ico { width: 19px; height: 17px; vertical-align: -3px; }
.mini { display: inline-block; vertical-align: -6px; }
.mini .ico { width: 28px; height: 28px; vertical-align: 0; }
.lifetitle .mini .ico { width: 32px; height: 32px; }
.langmenu .ico, .lockmsg .ico { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- sudoku ---------- */
.sudoku {
  --cell: min(calc((100vw - 48px) / var(--n)), var(--max, 54px));
  display: grid; grid-template-columns: repeat(var(--n), var(--cell)); width: max-content; margin: 14px auto 12px;
  background: #fff; border: 3px solid var(--ink); border-radius: 14px; overflow: hidden; box-shadow: 0 6px 0 rgba(0,0,0,.12);
}
.sudoku .cell {
  width: var(--cell); height: var(--cell); display: flex; align-items: center; justify-content: center; border: 0;
  border-right: 1px solid #d9d5e6; border-bottom: 1px solid #d9d5e6; background: #fff;
  font-size: calc(var(--cell) * .55); font-weight: 900; color: var(--accent); padding: 0;
}
.sudoku .cell .ico { width: 70%; height: 70%; }
.sudoku .cell.given { background: #eef0ff; color: var(--ink); }
.sudoku .cell.br { border-right: 3px solid var(--ink); }
.sudoku .cell.bb { border-bottom: 3px solid var(--ink); }
.sudoku .cell.same { background: #d7f5ea; }
.sudoku .cell.sel { background: #ffe9a8; }
.sudoku .cell.bad { background: #ffd9df; color: #d6453d; }
.spad { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 10px auto 14px; max-width: 460px; }
.sbtn {
  width: 52px; height: 52px; border-radius: 16px; background: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.12);
  font-size: 26px; font-weight: 900; color: var(--accent); display: grid; place-items: center;
}
.sbtn .ico { width: 34px; height: 34px; }
.sbtn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.12); }

/* sudoku notes and parents' tile */
.sudoku .cell .nts { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; height: 100%; }
.sudoku .cell .nts i { font-style: normal; font-size: calc(var(--cell) * .24); font-weight: 800; color: #7a7f99; display: grid; place-items: center; line-height: 1; }
#snotes.on { background: var(--ink); color: #fff; }
.tiles.one { grid-template-columns: minmax(150px, 230px); }

/* ---------- family games: tic-tac-toe and four in a row ---------- */
.ttt { --tc: min(28vw, 118px); display: grid; grid-template-columns: repeat(3, var(--tc)); gap: 10px; width: max-content; margin: 16px auto; }
.tcell { width: var(--tc); height: var(--tc); background: #fff; border-radius: 20px; box-shadow: 0 5px 0 rgba(0,0,0,.12); display: grid; place-items: center; padding: 0; transition: transform .1s; }
.tcell:not(:disabled):hover { transform: translateY(-3px); }
.tcell .ico { width: 72%; height: 72%; }
.tcell:disabled { cursor: default; }
.tcell.win { background: #d8f9ee; outline: 4px solid var(--matcha); }
.mk { display: inline-block; vertical-align: -7px; }
.mk .ico { width: 30px; height: 30px; vertical-align: 0; }
.mk .disc { display: inline-block; width: 26px; height: 26px; vertical-align: -5px; }
.bubble .ico { width: 22px; height: 22px; vertical-align: -4px; }
.c4 { --cs: min(calc((100vw - 56px) / 7), 62px); display: grid; grid-template-columns: repeat(7, var(--cs)); width: max-content; margin: 16px auto; background: var(--accent); padding: 8px; border-radius: 22px; box-shadow: 0 6px 0 rgba(0,0,0,.18); }
.c4c { width: var(--cs); height: var(--cs); display: grid; place-items: center; padding: 0; background: transparent; }
.c4c:disabled { cursor: default; }
.c4c .hole { position: relative; width: 84%; height: 84%; border-radius: 50%; background: #e9eeff; box-shadow: inset 0 3px 6px rgba(0,0,0,.28); display: grid; place-items: center; }
.disc { display: block; width: 100%; height: 100%; border-radius: 50%; }
.disc.p1 { background: #ef6f5e; box-shadow: inset 0 -4px 0 rgba(0,0,0,.16); }
.disc.p2 { background: #f5b83d; box-shadow: inset 0 -4px 0 rgba(0,0,0,.16); }
.disc.new { animation: dropin .45s cubic-bezier(.3, .2, .5, 1); }
.disc.win { outline: 4px solid #fff; animation: pop .5s; }
@keyframes dropin { from { transform: translateY(calc((var(--r) + 1) * -105%)); } }
.tiles.pair { grid-template-columns: repeat(2, minmax(150px, 230px)); }
@media (max-width: 420px) { .tiles.pair { grid-template-columns: repeat(2, 1fr); } }

/* ---------- sea battle ---------- */
.tiles.fam { grid-template-columns: repeat(auto-fill, minmax(150px, 230px)); }
.bscap { text-align: center; font-weight: 900; margin: 14px 0 6px; }
.bsb { display: grid; gap: 2px; width: max-content; margin: 0 auto; padding: 6px; background: #1f6fb0; border-radius: 14px; box-shadow: 0 5px 0 rgba(0,0,0,.14); }
.bsb.big { --bc: min(calc((100vw - 64px) / 8), 42px); grid-template-columns: repeat(8, var(--bc)); }
.bsb.small { --bc: min(calc((100vw - 64px) / 8), 24px); grid-template-columns: repeat(8, var(--bc)); }
.bc { width: var(--bc); height: var(--bc); border-radius: 6px; background: #7cc4f0; display: grid; place-items: center; padding: 0; position: relative; }
.bc.foe:not(.miss):not(.hit):hover { background: #a9dcf8; }
.bc.ship { background: #7d8691; }
.bc.reveal { background: #c9ced6; }
.bc.miss { background: #bfe3f7; }
.bc .dot { width: 28%; height: 28%; border-radius: 50%; background: #1f6fb0; opacity: .55; }
.bc.hit { background: #ef6f5e; }
.bc.sunk { background: #a3281f; }
.bc .ico { width: 70%; height: 70%; }
.fleet { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 4px 0 6px; }
.fship { display: inline-flex; gap: 2px; padding: 3px 5px; background: #fff; border-radius: 8px; box-shadow: 0 2px 0 rgba(0,0,0,.1); }
.fship i { width: 12px; height: 12px; border-radius: 3px; background: #7d8691; }
.fship.dead { opacity: .6; }
.fship.dead i { background: #ef6f5e; }

/* ---------- how to play ---------- */
.helpbtn { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; background: #fff; border-radius: 99px; padding: 6px 14px 6px 8px; font-weight: 900; font-size: 15px; box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.helpbtn .q { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 15px; font-weight: 900; }
.helpbtn[aria-expanded="true"] { background: #e9eeff; }
.helpbox { background: #fff; border-radius: 24px; box-shadow: 0 5px 0 rgba(0,0,0,.12); padding: 16px 20px 18px; margin: 12px 0 6px; font-size: 17px; line-height: 1.5; }
.helpbox[hidden] { display: none; }
.helpbox h3 { margin: 4px 0 4px; font-size: 19px; font-weight: 900; color: var(--accent); }
.helpbox p { margin: 0 0 10px; }
.helpbox ol { margin: 0 0 12px; padding-left: 22px; }
.helpbox li { margin: 5px 0; }
.helpbox .btn { font-size: 18px; padding: 10px 24px; }

/* ---------- Halloween ---------- */
body.halloween { background: linear-gradient(180deg, #fff0dc 0%, #efe6ff 100%) fixed; }
.kslot:has(.kiko.scene) { width: min(240px, 52vw); }
.hero-kiko:has(.kiko.scene) { width: min(330px, 84vw); }
.end .trophy:has(.kiko.scene) { width: min(300px, 80vw); }
.kiko.scene { overflow: visible; }
#theme-layer { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.hw-web { position: absolute; top: 0; width: min(120px, 26vw); opacity: .8; }
.hw-web.tl { left: 0; }
.hw-web.tr { right: 0; transform: scaleX(-1); }
.hw-spider { position: absolute; top: 0; right: min(64px, 14vw); width: 30px; transform-origin: 50% 0; animation: hwdangle 3.4s ease-in-out infinite; }
@keyframes hwdangle { 0%, 100% { transform: rotate(-4deg) translateY(0); } 50% { transform: rotate(4deg) translateY(10px); } }
.hw-bat { position: absolute; top: var(--top); left: 0; animation: hwfly var(--dur) linear infinite; animation-delay: var(--delay); opacity: .92; }
.hw-bat .wings { transform-origin: 24px 12px; animation: hwflap .45s ease-in-out infinite alternate; }
@keyframes hwfly { from { transform: translate(-90px, 0); } 50% { transform: translate(50vw, 22px); } to { transform: translate(calc(100vw + 90px), -8px); } }
@keyframes hwflap { from { transform: scaleY(1); } to { transform: scaleY(.55); } }
.hw-ghost { position: absolute; right: 12px; bottom: 16px; width: 52px; opacity: .85; animation: hwbob 3.6s ease-in-out infinite; }
@keyframes hwbob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.hw-patch { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 34px auto 0; flex-wrap: nowrap; }
.hw-patch .hw-pk { flex: none; }
.hw-patch .hw-ghost-s { width: 44px; flex: none; }
@media (max-width: 420px) { .hw-patch { gap: 4px; transform: scale(.82); transform-origin: bottom center; } }

/* ---------- Christmas ---------- */
body.christmas { background: linear-gradient(180deg, #e6f4ff 0%, #fff3f3 100%) fixed; }
.xm-garland { position: absolute; top: 0; left: 0; right: 0; height: 34px; display: flex; overflow: hidden; }
.xm-seg { position: relative; flex: none; width: 48px; height: 14px; border-bottom: 2.5px solid #2d6a4f; border-radius: 0 0 50% 50%; }
.xm-bulb { position: absolute; left: 50%; bottom: -12px; width: 9px; height: 13px; margin-left: -4.5px; border-radius: 50% 50% 55% 55%; animation: xmblink 1.6s ease-in-out infinite alternate; box-shadow: 0 0 8px rgba(255,255,255,.7); }
@keyframes xmblink { from { opacity: 1; } to { opacity: .45; } }
.xm-flake { position: absolute; top: -12px; border-radius: 50%; background: #fff; opacity: .9; box-shadow: 0 0 4px rgba(120,170,220,.6); animation: xmfall linear infinite; }
@keyframes xmfall { from { transform: translate(0, -4vh); } 50% { transform: translate(var(--drift), 52vh); } to { transform: translate(calc(var(--drift) * -1), 108vh); } }
.xm-snowman { position: absolute; right: 12px; bottom: 10px; width: 60px; animation: hwbob 4s ease-in-out infinite; }
.xm-snowman svg { width: 100%; height: auto; }
.xm-patch { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 34px auto 0; flex-wrap: nowrap; }
.xm-patch .xm-pk { flex: none; }
@media (max-width: 420px) { .xm-patch { gap: 4px; transform: scale(.8); transform-origin: bottom center; } }

/* Rudolph and Santa's sleigh fly across the page, right to left */
.xm-flyer { position: absolute; top: 14vh; right: 0; width: min(540px, 92vw); animation: xmfly 58s linear infinite; animation-delay: -8s; }
.xm-flyer-in { animation: xmflybob 3.2s ease-in-out infinite; transform-origin: 50% 50%; }
.xm-flyer svg { display: block; width: 100%; height: auto; }
@keyframes xmfly { from { transform: translateX(110%); } to { transform: translateX(calc(-100vw - 110%)); } }
@keyframes xmflybob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-14px) rotate(1.5deg); } }
.xm-glow { animation: xmglow 1.1s ease-in-out infinite alternate; }
@keyframes xmglow { from { opacity: .15; } to { opacity: .5; } }

/* ---------- Fall ---------- */
body.autumn { background: linear-gradient(180deg, #fff3d9 0%, #ffe6d1 100%) fixed; }
.au-leaf { position: absolute; top: -30px; display: block; animation: aufall linear infinite; opacity: .95; }
.au-leaf svg { display: block; animation: auspin 6s ease-in-out infinite alternate; }
@keyframes aufall { from { transform: translate(0, -5vh); } 50% { transform: translate(var(--drift), 52vh); } to { transform: translate(calc(var(--drift) * -1), 108vh); } }
@keyframes auspin { from { transform: rotate(-35deg); } to { transform: rotate(35deg); } }
.au-hedgehog { position: absolute; right: 10px; bottom: 8px; animation: hwbob 4.6s ease-in-out infinite; }
.au-hedgehog svg { display: block; }
.au-patch { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 34px auto 0; flex-wrap: nowrap; }
.au-patch .au-pk { flex: none; }
@media (max-width: 420px) { .au-patch { gap: 4px; transform: scale(.8); transform-origin: bottom center; } }

/* ---------- Rainy fall ---------- */
body.rainy { background: linear-gradient(180deg, #dfe8f2 0%, #e9edf3 55%, #f4eadb 100%) fixed; }
.rn-drop { position: absolute; top: -30px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, rgba(90,169,230,0), rgba(90,169,230,.85)); transform: rotate(12deg); animation: rnfall linear infinite; }
@keyframes rnfall { from { transform: translate(0, -4vh) rotate(12deg); } to { transform: translate(-22vh, 108vh) rotate(12deg); } }
.rn-cloud { position: absolute; top: 4px; opacity: .92; animation: rndrift 16s ease-in-out infinite alternate; }
.rn-cloud.c1 { left: -16px; }
.rn-cloud.c2 { right: 6px; top: 22px; animation-duration: 21s; animation-direction: alternate-reverse; }
.rn-cloud svg { display: block; }
@keyframes rndrift { from { transform: translateX(-12px); } to { transform: translateX(26px); } }
.rn-frog { position: absolute; right: 8px; bottom: 6px; animation: rnhop 3.4s ease-in-out infinite; }
.rn-frog svg { display: block; }
@keyframes rnhop { 0%, 78%, 100% { transform: translateY(0); } 86% { transform: translateY(-14px); } 94% { transform: translateY(0); } }
.rn-ring { transform-box: fill-box; transform-origin: center; animation: rnripple 2.4s ease-out infinite; }
.rn-ring.r2 { animation-delay: 1.2s; }
@keyframes rnripple { from { transform: scale(.3); opacity: .9; } to { transform: scale(2.6); opacity: 0; } }
.rn-patch { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 34px auto 0; flex-wrap: nowrap; }
.rn-patch .rn-pk { flex: none; }
@media (max-width: 420px) { .rn-patch { gap: 4px; transform: scale(.8); transform-origin: bottom center; } }

/* ---------- color wheel and mixing ---------- */
.stage svg.wheel { width: clamp(190px, 52vw, 270px); height: auto; }
.mixbowl { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 16px 0 6px; flex-wrap: nowrap; }
.mslot { width: 70px; height: 70px; border-radius: 50%; border: 4px dashed #c9c4de; background: #fff; transition: transform .2s; }
.mslot.filled { border: 4px solid #fff; box-shadow: 0 4px 0 rgba(0,0,0,.14); animation: pop .3s; }
.mop { font-size: 34px; font-weight: 900; color: var(--ink); }
.mres { width: 96px; height: 96px; border-radius: 50%; border: 4px dashed #c9c4de; background: #fff center/cover; box-shadow: none; }
.mres[style*="background"] { border: 4px solid #fff; box-shadow: 0 5px 0 rgba(0,0,0,.14); }
.mres.swirl { animation: mixspin .85s linear; }
.mres.pop { animation: pop .45s; }
@keyframes mixspin { to { transform: rotate(540deg) scale(1.08); } }
.mixname { min-height: 1.6em; text-align: center; font-size: 22px; font-weight: 900; margin: 4px 0 10px; }
.paints { display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: center; margin: 6px 0 14px; }
.paint { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 18px; background: transparent; }
.paint .blob { width: 58px; height: 58px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 4px 0 rgba(0,0,0,.16), inset 0 -6px 0 rgba(0,0,0,.12); transition: transform .12s; }
.paint small { font-size: 13px; font-weight: 800; color: #3d4060; }
.paint:hover .blob { transform: translateY(-3px); }
.paint.sel { background: #fff; box-shadow: 0 0 0 3px var(--accent); }
@media (max-width: 420px) { .mslot { width: 56px; height: 56px; } .mres { width: 78px; height: 78px; } .mop { font-size: 26px; } }

/* ---------- coloring books ---------- */
.cbgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 16px; }
.cbcard { display: flex; flex-direction: column; gap: 8px; background: #fff; border-radius: 22px; box-shadow: 0 5px 0 rgba(0,0,0,.12); padding: 10px 10px 14px; text-align: center; transition: transform .12s; }
.cbcard:hover { transform: translateY(-3px); }
.cbthumb { display: block; border-radius: 14px; overflow: hidden; border: 2px solid #e4e1ee; pointer-events: none; }
.cbthumb svg, .cbboard svg { display: block; width: 100%; height: auto; }
.cbname { font-weight: 900; font-size: 17px; line-height: 1.25; }
@media (min-width: 640px) { .cbgrid { grid-template-columns: repeat(3, 1fr); } }
.cbtools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0; }
.cbtool { background: #fff; border-radius: 99px; padding: 8px 16px; font-weight: 800; font-size: 15px; box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.cbtool:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.cbboard { background: #fff; border-radius: 22px; border: 3px solid var(--ink); overflow: hidden; box-shadow: 0 6px 0 rgba(0,0,0,.14); touch-action: manipulation; }
.cbboard .reg { cursor: pointer; }
.cbpal { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 14px 0 6px; }
.sw { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.2), inset 0 0 0 1px rgba(0,0,0,.12); transition: transform .12s; }
.sw:hover { transform: translateY(-2px); }
.sw.sel { transform: scale(1.18); box-shadow: 0 0 0 3px var(--ink), 0 3px 0 rgba(0,0,0,.2); }
@media print { .cbtools, .cbpal, .helpbtn, .helpbox { display: none !important; } .cbboard { box-shadow: none; } }

/* ---------- feedback ---------- */
.fbform { background: #fff; border-radius: 26px; box-shadow: 0 6px 0 rgba(0,0,0,.12); padding: 18px 20px 22px; margin-top: 16px; }
.fbform .q { margin-top: 4px; }
.fbstars { display: flex; justify-content: center; gap: 4px; }
.fbstar { width: 58px; height: 58px; padding: 4px; border-radius: 14px; transition: transform .12s; }
.fbstar:hover { transform: scale(1.12); }
.fbstar .ico { width: 100%; height: 100%; }
.fblabel { text-align: center; font-weight: 900; color: var(--accent); min-height: 1.6em; margin: 2px 0 6px; }
.fbq, .fbl { display: block; font-weight: 900; margin: 14px 0 6px; font-size: 18px; }
.fbform .chips { flex-wrap: wrap; justify-content: flex-start; }
.fbtext, .fbin { width: 100%; font: inherit; font-size: 18px; padding: 12px 14px; border: 3px solid #e4e1ee; border-radius: 16px; background: #fff; color: inherit; user-select: text; }
.fbtext:focus, .fbin:focus { outline: none; border-color: var(--accent); }
.fbnote { font-size: 15px; color: #5b5f7a; margin: 6px 0 0; }
.fbcheck { display: flex; gap: 10px; align-items: center; margin: 16px 0 4px; font-weight: 800; font-size: 18px; }
.fbcheck input { width: 24px; height: 24px; flex: none; }
.fberr { color: #d6453d; font-weight: 800; min-height: 1.4em; margin: 6px 0; text-align: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* feedback pop-in (after 3 finished games, when leaving a game) */
#fbModal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 16px; overflow-y: auto; background: rgba(43,45,66,.55); animation: fbfade .2s ease-out; }
.fbm-card { width: 100%; max-width: 560px; margin: auto; padding: 14px 16px 22px; border-radius: 28px; background: #f6f3ff; box-shadow: 0 12px 40px rgba(0,0,0,.3); animation: fbpop .35s cubic-bezier(.2,1.3,.4,1); }
.fbm-x { flex: none; margin-left: auto; font-size: 28px; line-height: 1; font-weight: 900; }
@keyframes fbfade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fbpop { from { transform: scale(.7) translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media print { #fbModal { display: none; } }
/* beta notice */
.beta { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; padding: 10px 14px; border-radius: 16px; background: #fff4d6; border: 2px dashed #f0b429; font-size: 15px; line-height: 1.35; font-weight: 700; color: #5b4a12; }
.beta-tag { flex: none; background: #f0b429; color: var(--ink); font-weight: 900; border-radius: 99px; padding: 3px 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
/* exit button in the header (every page except home and the landing page) */
#homeBtn { width: auto; padding: 0 16px 0 12px; display: flex; align-items: center; gap: 6px; border-radius: 99px; font-weight: 800; font-size: 17px; }
#homeBtn .ico { width: 22px; height: 22px; }

/* Activities / Games switch on the home screen */
.areas { display: flex; gap: 8px; justify-content: center; margin: 4px 0 14px; }
.areas button { flex: 1; max-width: 220px; padding: 12px 16px; border-radius: 99px; background: #fff; font-weight: 900; font-size: 18px; box-shadow: 0 3px 0 rgba(0,0,0,.12); }
.areas button.on { background: var(--accent); color: #fff; }
.ages .lk .ico { width: 14px; height: 14px; vertical-align: -2px; }

.filters { flex-wrap: wrap; justify-content: center; gap: 8px; margin: 4px 0 14px; }
.filters .chipbtn { padding: 8px 14px; font-size: 15px; }

.lvlhead { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; }
.lvlhead .lvl { width: 22px; height: 18px; }

.mixrow2 { margin-top: 18px; }
.lvlhead + .tiles, .themehead + .tiles, .mixrow2 { grid-template-columns: repeat(auto-fill, minmax(150px, 230px)); }
.themehead { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; font-size: 17px; font-weight: 900; color: #5b5f7a; }
.themehead .ico { width: 20px; height: 20px; }

/* level icon in the corner of every card */
.lvlmark { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 42px; height: 34px; border-radius: 99px; background: rgba(255,255,255,.95); color: var(--ink); box-shadow: 0 2px 5px rgba(0,0,0,.15); }
.lvlmark .ico { width: 26px; height: 20px; }
.lvlmark .ico rect[fill="#d9d5c8"] { fill: #cfcab8; }

/* views row, hearts */
.views { flex-wrap: wrap; }
.views button { flex: 1 1 auto; max-width: none; padding: 10px 14px; font-size: 16px; }
.views button .ico { width: 16px; height: 16px; vertical-align: -3px; }
.favbtn { position: absolute; top: 10px; left: 10px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.95); color: #8a8fa8; box-shadow: 0 2px 5px rgba(0,0,0,.15); cursor: pointer; z-index: 2; }
.favbtn .ico { width: 20px; height: 20px; }
.favbtn:hover { transform: scale(1.1); }
.favbtn:focus-visible { outline: 3px solid var(--accent); }

/* favorites button next to the stars */
.favpill { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.favpill .ico { width: 18px; height: 18px; }
.favpill:hover { background: #fde8f0; }

/* smaller screens: tighter filters and header pills that never wrap */
.pill { white-space: nowrap; }
@media (max-width: 480px) {
  .bar { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .bar .right { gap: 6px; }
  .pill { padding: 8px 11px; font-size: 16px; }
  .views button { padding: 8px 12px; font-size: 15px; }
  .ages { gap: 6px; }
  .ages button { padding: 7px 10px; font-size: 14px; }
  .filters { gap: 6px; margin: 2px 0 10px; }
  .filters .chipbtn { padding: 6px 11px; font-size: 14px; }
}

/* Kiko's guide */
.guide { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 8px 0 6px; }
.gbtn { flex: 1 1 160px; max-width: 260px; padding: 16px 20px; border-radius: 24px; background: var(--accent); color: #fff; font-weight: 900; font-size: 20px; box-shadow: 0 5px 0 rgba(0,0,0,.18); transition: transform .12s; }
.gbtn:hover { transform: translateY(-2px); }
.gbtn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.gbtn.alt { background: #fff; color: var(--ink); }
.gbtn.off { opacity: .45; }
.gbtn .ico { width: 24px; height: 18px; vertical-align: -3px; }
.guidechips { flex-wrap: wrap; justify-content: center; gap: 8px; margin: 4px 0 12px; }

/* Kiko's dialogue */
.guide-wrap { transition: opacity .4s ease, transform .4s ease; }
.guide-wrap.hidden { opacity: 0; transform: translateY(10px); pointer-events: none; }
.kslot.enter { animation: kikoin .9s cubic-bezier(.2, 1.4, .4, 1) both; }
.bubble.pop { animation: bubblepop .3s ease-out; }
.hello-box .bubble { cursor: default; min-height: 2.6em; }
@keyframes kikoin { 0% { transform: translateY(70px) scale(.4) rotate(-12deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes bubblepop { from { transform: scale(.92); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .kslot.enter, .bubble.pop { animation: none; } .guide-wrap { transition: none; } }

.nameform { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 8px 0 6px; }
.nameform input { flex: 1 1 200px; max-width: 320px; font: inherit; font-size: 22px; font-weight: 800; text-align: center; padding: 14px 16px; border: 3px solid #e4e1ee; border-radius: 22px; background: #fff; color: inherit; user-select: text; }
.nameform input:focus { outline: none; border-color: var(--accent); }
.nameform .gbtn { flex: 0 1 140px; }

/* graphics on the kind buttons, the theme chips and Kiko's guide */
.chipbtn[style*="--c"], .kindbtn { box-shadow: inset 0 0 0 2px var(--c), 0 2px 0 rgba(0,0,0,.1); }
.chipbtn[style*="--c"] .ico, .kindbtn .ico { width: 22px; height: 22px; vertical-align: -6px; margin-right: 2px; }
.chipbtn[style*="--c"].on, .chipbtn[data-on], .areas .kindbtn.on { background: var(--c); color: #fff; box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.chipbtn[style*="--c"].on .ico, .chipbtn[data-on] .ico, .kindbtn.on .ico { background: rgba(255,255,255,.92); border-radius: 50%; padding: 2px; width: 26px; height: 26px; vertical-align: -8px; }
.kindbtn { font-weight: 900; }
.guidechips .chipbtn.big { padding: 10px 16px; font-size: 17px; }
.gbtn.kind { background: var(--c, var(--accent)); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 20px 16px; }
.gbtn.kind .ico { width: 64px; height: 64px; background: rgba(255,255,255,.94); border-radius: 50%; padding: 10px; box-shadow: 0 3px 0 rgba(0,0,0,.12); }

/* start over: a pill like the other buttons, right under Kiko */
.restartrow { display: flex; justify-content: center; margin: 4px 0 12px; }
.restartbtn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 99px; background: #fff; color: var(--ink); font-weight: 800; font-size: 16px; box-shadow: inset 0 0 0 2px #cfd4f0, 0 2px 0 rgba(0,0,0,.1); }
.restartbtn .ico { width: 20px; height: 20px; }
.restartbtn:hover { background: #eef0fd; }

/* the conversation with Kiko */
.chat { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 12px; }
.msg { display: flex; align-items: flex-end; gap: 10px; }
.msg.you { justify-content: flex-end; }
.msg .av { width: 64px; flex: none; }
.msg .av.ghost { height: 0; }
.msg .bubble { font-size: clamp(18px, 4.4vw, 22px); max-width: min(420px, 100% - 80px); }
.msg .bubble:empty { visibility: visible; min-width: 56px; min-height: 1.6em; }
.msg.kiko .bubble::before { top: auto; bottom: 14px; margin-top: 0; }
.bubble.you { background: var(--accent); color: #fff; border-radius: 20px 20px 6px 20px; }
.bubble.you::before { display: none; }
@keyframes dots { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.chat .msg { transition: opacity .35s ease; }
.chat .msg:not(.current) { opacity: .55; }
.chat .msg.current .bubble:not(.you) { box-shadow: 0 4px 14px rgba(58,100,216,.25); }

/* Kiko at the front of the results */
.kikohero { display: flex; align-items: center; gap: 14px; margin: 16px 0 8px; }
.kikobtn { width: 120px; flex: none; background: none; border: 0; padding: 0; cursor: pointer; transition: transform .15s; }
.kikobtn:hover { transform: scale(1.05); }
.kikobtn.enter { animation: kikoin .9s cubic-bezier(.2, 1.4, .4, 1) both; }
.kikobtn.talk { animation: kikotalk .6s ease; }
@keyframes kikotalk { 0%, 100% { transform: none; } 25% { transform: rotate(-6deg) scale(1.06); } 60% { transform: rotate(5deg) scale(1.06); } }
.herobubble { position: relative; flex: 1; background: #fff; border-radius: 20px; padding: 12px 14px; box-shadow: var(--shadow); }
.herobubble::before { content: ""; position: absolute; left: -8px; top: 38px; border: 8px solid transparent; border-right-color: #fff; border-left: 0; }
.sumchips { display: flex; flex-wrap: wrap; gap: 6px; }
.sumchip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 99px; background: #fff; box-shadow: inset 0 0 0 2px var(--c); font-weight: 800; font-size: 14px; }
.sumchip .ico { width: 18px; height: 18px; }
.saybox { margin-top: 8px; font-weight: 800; font-size: 17px; min-height: 0; }
.saybox:empty { display: none; }
.restartrow { gap: 10px; flex-wrap: wrap; }
@media (max-width: 480px) { .kikobtn { width: 92px; } }
@media (prefers-reduced-motion: reduce) { .kikobtn.enter, .kikobtn.talk { animation: none; } }

#homeBtn[hidden] { display: none; }
/* the child's name as a profile bubble, like a message from "you" in the chat */
.profile { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 150px; padding: 4px 14px 4px 4px; border-radius: 99px 99px 99px 6px; background: var(--accent); color: #fff; font-weight: 900; font-size: 16px; box-shadow: 0 3px 10px rgba(58,100,216,.35); }
.profile[hidden] { display: none; }
.profile.ghost { background: #fff; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); cursor: pointer; }
.profile.ghost .pavatar { background: var(--accent); color: #fff; }
.profile.ghost:hover { background: #eef0fd; }
.profile:not(.ghost) { cursor: default; }
.pavatar { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--accent); font-size: 16px; font-weight: 900; }
.pname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .profile { max-width: 96px; gap: 6px; font-size: 14px; padding-right: 10px; } .pavatar { width: 26px; height: 26px; font-size: 14px; } }

.herobubble:has(.saybox:empty) { display: none; }

.helpbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gbtn.mini { flex: 0 1 auto; padding: 8px 16px; font-size: 16px; border-radius: 18px; box-shadow: 0 3px 0 rgba(0,0,0,.18); }

/* Kiko by your side in every game: tap to ask for help */
.lifebar .kikoask { margin-left: auto; position: relative; flex: none; }
.kikoask-btn { position: relative; display: block; width: 58px; padding: 0; background: none; border: 0; cursor: pointer; transition: transform .15s; }
.kikoask-btn:hover { transform: scale(1.06) rotate(-3deg); }
.kikoask-btn .q { position: absolute; top: -2px; right: -2px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 900; font-size: 14px; box-shadow: 0 2px 4px rgba(0,0,0,.25); }
.kikoask-bubble { position: absolute; z-index: 15; top: calc(100% + 6px); right: 0; width: min(270px, 78vw); padding: 12px 14px; border-radius: 18px 4px 18px 18px; background: #fff; box-shadow: 0 8px 22px rgba(30,40,100,.25); font-weight: 800; font-size: 17px; }
.kikoask-bubble[hidden] { display: none; }
.kikoask-bubble p { margin: 0; }

/* Kiko holding up a question mark (the two pictures sit side by side, no overlap) */
.kikoask-btn { display: flex; align-items: flex-end; gap: 2px; width: auto; }
.kikoask-btn .kheadwrap { width: 52px; flex: none; }
.kikoask-btn .qsign { width: 26px; flex: none; margin-bottom: 4px; transform-origin: 50% 100%; animation: qwave 2.6s ease-in-out infinite; }
.kikoask-btn .qsign svg { display: block; width: 100%; }
.kikoask-btn .q { display: none; }
@keyframes qwave { 0%, 60%, 100% { transform: rotate(0deg); } 70% { transform: rotate(-12deg); } 80% { transform: rotate(10deg); } 90% { transform: rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .kikoask-btn .qsign { animation: none; } }

.langguide { max-width: 520px; margin-left: auto; margin-right: auto; }
.langguide .gbtn { flex: 1 1 150px; font-size: 18px; padding: 14px 12px; }
.langguide .lk .ico { width: 16px; height: 16px; vertical-align: -2px; }

/* answer the hello with a flag */
.langguide { gap: 12px; }
.flagbtn { position: relative; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: #fff; font-size: 44px; line-height: 1; box-shadow: 0 5px 0 rgba(0,0,0,.14); transition: transform .12s; }
.flagbtn:hover { transform: translateY(-3px) scale(1.05); }
.flagbtn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.14); }
.flagbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.flaglock { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; }
.flaglock .ico { width: 14px; height: 14px; }
.bubble.you.flagmsg { font-size: clamp(30px, 7vw, 38px); padding: 8px 18px; }
/* version number in the footer */
.foot .verlink { color: inherit; opacity: .75; }

/* introduce yourself later */
#nameModal, #accModal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(43,45,66,.55); animation: fbfade .2s ease-out; }
.nm-card { width: 100%; max-width: 420px; padding: 18px 18px 20px; border-radius: 28px; background: #f6f3ff; box-shadow: 0 12px 40px rgba(0,0,0,.3); text-align: center; animation: fbpop .35s cubic-bezier(.2,1.3,.4,1); }
.nm-kiko { width: 110px; margin: 0 auto 6px; }
.nm-bubble { display: inline-block; margin-bottom: 12px; }
.nm-bubble::before { display: none; }
#nmIn { width: 100%; font: inherit; font-size: 22px; font-weight: 800; text-align: center; padding: 14px 16px; border: 3px solid #e4e1ee; border-radius: 22px; background: #fff; color: inherit; user-select: text; }
#nmIn:focus { outline: none; border-color: var(--accent); }
.nm-row { display: flex; gap: 10px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.nm-row .gbtn { flex: 0 1 150px; padding: 12px 16px; font-size: 18px; }

/* pictures drawn in-house (art.js): sized like a letter, with a slight hand-painted wobble */
.art { width: 1em; height: 1em; vertical-align: -0.14em; overflow: visible; }
.stage svg.art { width: 1em; height: 1em; }
.stage.emoji-row .art { margin: 0 2px; }
.card .art, .opt .art { display: inline-block; }
.stage.emoji-row { font-size: clamp(44px, 11vw, 66px); letter-spacing: 0; line-height: 1.15; }
.stage.emoji-row { background: #fff4dc; border-radius: 20px; padding: 10px 8px; margin: 6px 0 10px; }
.opt .art { width: 1.8em; height: 1.8em; vertical-align: middle; }
.opt.word .art { width: 1em; height: 1em; }
.card .art { width: 1.25em; height: 1.25em; vertical-align: middle; }


.acc-l { display:block; margin:8px 0 6px; font-size:.9rem; color:#5a5d78; }
#accIn { width:100%; box-sizing:border-box; padding:12px 14px; font-size:1rem; border-radius:16px; border:2px solid #cfc8ee; }
.acc-err { min-height:1.3em; margin:6px 0; color:#c0392b; font-size:.9rem; }
#accModal .bubble a { text-decoration:underline; font-weight:700; }
.menulabel { padding: 8px 14px 4px; font-weight: 800; font-size: 14px; color: #6b6f8a; }
#profMenu { min-width: 150px; }
.profile:not(.ghost) { cursor: pointer; }
.ages button.locked, .gbtn.locked { opacity: .6; filter: saturate(.55); cursor: not-allowed; }
.lvsbox { cursor: default; }
.lvsbox:hover { transform: none; }
.lvsbox .lbtn-e .kiko, .lvsbox .lbtn-e svg { width: 44px; height: 44px; }
.lvs-body { flex: 1; min-width: 0; display: block; }
.lvs-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.lvchip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; background: var(--matcha); color: #fff; font-weight: 800; font-size: 16px; white-space: nowrap; box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.lvchip:hover { transform: translateY(-2px); }
.lvchip .ico { width: 18px; height: 16px; flex: none; }
.pill[hidden], #favBtn[hidden], #stars[hidden] { display: none; }
/* locked languages: greyed-out flags */
.flagbtn.locked, .langmenu button.locked { filter: grayscale(1); opacity: .5; cursor: not-allowed; }
.flagbtn.locked:hover { transform: none; }

/* learning corner */
.learn-top { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin: 6px 0 10px; }
.learn-tap { text-align: center; color: #5b5f7a; font-weight: 700; margin: 4px 0 14px; }
.learn-h { text-align: center; margin: 22px 0 10px; }
.lcat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.lcat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 10px 14px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.lcat:hover { transform: translateY(-2px); }
.lcat-l { font-size: 44px; font-weight: 900; line-height: 1; color: var(--accent); }
.lcat-l small { font-size: 28px; margin-left: 6px; color: #8a8fb0; }
.lw { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.lw b { color: #2f9e44; }
.lw-pic .art, .lw-pic svg { width: 36px; height: 36px; vertical-align: middle; }
.ncat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.ncat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.ncat:hover { transform: translateY(-2px); }
.ncat-d { font-size: 40px; font-weight: 900; line-height: 1; color: var(--accent); }
.ncat-w { font-size: 18px; font-weight: 800; }
.ncat-p { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin-top: 4px; }
.ncat-p .art, .ncat-p svg { width: 22px; height: 22px; }
@media print {
  .bar, .betabar, #betaBar, .foot, .learn-top, .learn-tap, #accModal, #nameModal { display: none !important; }
  body { background: #fff !important; }
  .lcat, .ncat { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
}
.gbtn.kind small { display: block; font-size: 13px; font-weight: 700; opacity: .92; line-height: 1.25; }
.lcat-pic .art, .lcat-pic svg { width: 64px; height: 64px; }
.lcat .lw-word { font-size: 20px; font-weight: 800; }
.acc-hr { border: 0; border-top: 2px dashed #d9d3f0; margin: 14px 0 10px; }
#accModal .fbin { width: 100%; box-sizing: border-box; padding: 12px 14px; font-size: 1rem; border-radius: 16px; border: 2px solid #cfc8ee; }
#accModal .fbcheck { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: .9rem; margin: 8px 0; }
#accModal .hp { position: absolute; left: -9999px; }
#accModal .nm-card { max-height: 92vh; overflow-y: auto; }
#reqForm .nm-row .gbtn { flex: 0 1 auto; white-space: nowrap; padding: 12px 22px; }
#accModal .nm-card { position: relative; }
.acc-x { position: absolute; top: 10px; right: 12px; width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(60,45,40,.4); background: #fff; font-size: 24px; line-height: 1; font-weight: 800; color: #3d4060; cursor: pointer; display: grid; place-items: center; z-index: 2; }
.acc-x:hover { background: #f1eefb; }
.letters-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.letters-grid .lcat-l { font-size: 52px; }
.letterjump { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 4px 0 8px; }
.letterjump .chipbtn { min-width: 38px; padding: 6px 10px; font-weight: 900; }
.wletter { scroll-margin-top: 70px; font-size: 40px; color: var(--accent); }
.wletter small { font-size: 26px; color: #8a8fb0; margin-left: 6px; }
.wcard .lcat-pic .art, .wcard .lcat-pic svg { width: 64px; height: 64px; }
.lw-word b { color: #2f9e44; }
.tile .big .art { width: 52px; height: 52px; }
.learn-tiles { width: 100%; }
.fbintro { margin: 8px 0 0; text-align: center; font-size: 13px; font-weight: 600; color: #6b6f8a; }
.shapecard .lcat-pic svg { width: 68px; height: 68px; }
.calcard .lcat-pic svg { width: 72px; height: 72px; }
.colorcard .lcat-pic svg { width: 68px; height: 68px; }
.mixgrid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.mixcard .lcat-pic svg { width: 100%; max-width: 210px; height: auto; }
.mixcard .lw-word { font-size: 18px; text-align: center; }
.mixcard .lw-word b { color: #1f7a5a; }
.mixnote { max-width: 560px; margin: 0 auto 12px; text-align: center; font-weight: 700; color: #4a4d6a; line-height: 1.4; }
.wheelbox { display: flex; justify-content: center; margin: 4px 0 16px; }
.wheelbox svg { width: min(260px, 70vw); height: auto; }
.dinogrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.dinocard .lcat-pic svg { width: 96px; height: 96px; }
.dinocard .lw-word { font-size: 17px; }
.lw-kind { font-size: 13px; font-weight: 700; color: #6b6f8a; }

.flaggrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.flagcard .lcat-pic svg { width: 96px; height: 72px; }
.flagcard .lw-word { font-size: 16px; }
.flaghead { margin: 22px 0 8px; font-size: 22px; scroll-margin-top: 70px; }
.flaghead small { font-size: 14px; opacity: .6; }
.flagbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.flagjump { padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.07); text-decoration: none; color: inherit; font-weight: 700; font-size: 14px; }
.stage .capflag svg { width: clamp(140px, 40vw, 210px); height: auto; }
.lvllabel { display: block; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; opacity: .85; }
.tiles > .tile:only-child { max-width: 230px; width: 100%; justify-self: start; } /* one tile alone stays card-sized instead of stretching across the page */
.endcount { font-weight: 900; color: var(--ink); background: rgba(255,255,255,.85); padding: 4px 14px; border-radius: 99px; }
.modebar { display: flex; justify-content: center; margin: -6px 0 12px; }
.endtoggle { border: 2px solid rgba(0,0,0,.12); background: rgba(255,255,255,.9); color: var(--ink); font: inherit; font-size: 14px; font-weight: 800; border-radius: 99px; padding: 5px 14px; cursor: pointer; }
.endtoggle[aria-pressed="true"] { background: var(--matcha); color: #fff; border-color: transparent; }
.landgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.landgrid .lcat-pic svg { width: 96px; height: 96px; }
