:root {
  --bg1: #fff4e0; --bg2: #e3f0ff;
  --card: #ffffff; --text: #26304a; --muted: #7c869c; --line: #e6eaf2;
  --accent: #ff7a45; --primary: #4c7cf0;
  --good: #22b573; --bad: #ef4f5a; --gold: #ffc727;
  --slot: #f2f5fb; --slot-b: #c3cde0;
  --red: #e8434d; --blue: #2f8be0;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh; padding: 16px;
  background: linear-gradient(160deg, var(--bg1), var(--bg2)) fixed;
  color: var(--text); font-weight: 700;
  font-family: Nunito, "Trebuchet MS", system-ui, sans-serif;
}
button { font: inherit; color: inherit; }
h1, h2, h3 { font-weight: 900; }
.wrap { max-width: 920px; margin: 0 auto; }
.center { text-align: center; }
.small { font-size: .95rem; color: var(--muted); }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; align-items: center; }
.sec { margin: 26px 4px 12px; font-size: 1.3rem; }

/* tlačítka */
.btn, .nextbtn {
  display: inline-block; padding: 13px 26px; font-size: 1.2rem; font-weight: 900;
  border: none; border-radius: 18px; cursor: pointer; color: #fff;
  background: var(--accent); box-shadow: 0 5px 0 #d65a28; transition: transform .08s, box-shadow .08s;
}
.btn:active, .nextbtn:active { transform: translateY(3px); box-shadow: 0 2px 0 #d65a28; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.gold { background: var(--gold); color: #5a3d00; box-shadow: 0 5px 0 #d9a400; }
.btn.danger { background: var(--bad); box-shadow: 0 5px 0 #b8333c; }
.btn.small, .ghost.small { padding: 8px 16px; font-size: 1rem; }
.ghost { padding: 12px 22px; font-size: 1.1rem; font-weight: 900; border: none; border-radius: 16px; background: #eef1f7; cursor: pointer; }
.ghost:hover { background: #e3e8f2; }
.link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 1rem; text-decoration: underline; padding: 8px; }
.back { background: #eef1f7; border: none; border-radius: 14px; padding: 8px 14px; cursor: pointer; }
.nextbtn { display: block; margin: 14px auto 0; }

/* hlavička */
header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.7rem; font-weight: 900; cursor: pointer; user-select: none; background: none; border: none; padding: 0; }
.logo .house { font-size: 2.3rem; }
.logo b, h1 b { color: var(--accent); }
.hright { display: flex; align-items: center; gap: 8px; }
.pill { background: #fff; border-radius: 999px; padding: 7px 14px; box-shadow: 0 4px 14px rgba(40,60,110,.1); font-size: 1.05rem; white-space: nowrap; }
.pill.bolts { font-size: 1.2rem; }
.pill.bump { animation: bump .45s; }
@keyframes bump { 40% { transform: scale(1.18); } }
.iconbtn { background: #fff; border: none; border-radius: 50%; width: 42px; height: 42px; cursor: pointer; box-shadow: 0 4px 14px rgba(40,60,110,.1); font-size: 1.1rem; }
.user { display: flex; align-items: center; gap: 6px; background: #fff; border: none; border-radius: 999px; padding: 5px 14px 5px 6px; cursor: pointer; box-shadow: 0 4px 14px rgba(40,60,110,.1); }
.user span { font-size: 1.5rem; }

.card { background: var(--card); border-radius: 32px; box-shadow: 0 12px 40px rgba(40,60,110,.12); padding: 24px; }
.card.narrow { max-width: 520px; margin: 0 auto; }
.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.bar h2 { margin: 0; font-size: 1.3rem; flex: 1; }

/* přihlášení */
.hero { text-align: center; margin: 10px 0 22px; }
.hero-house { font-size: 4.5rem; animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-8px); } }
.hero h1, .ttl { font-size: 2.2rem; margin: 4px 0; }
.hero p { font-size: 1.3rem; color: var(--muted); margin: 4px 0; }
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 10px; border: none; border-radius: 26px; background: #fff; cursor: pointer; box-shadow: 0 8px 24px rgba(40,60,110,.1); transition: transform .15s; }
.pcard:hover { transform: translateY(-4px); }
.pcard .pav { font-size: 3.4rem; }
.pcard .pname { font-size: 1.25rem; font-weight: 900; }
.pcard .psub { color: var(--muted); }
.pcard.new { background: transparent; border: 3px dashed #c3cde0; box-shadow: none; }
.bigav { font-size: 4rem; }
.lbl2 { display: block; text-align: left; margin: 16px 0 6px; font-size: 1.1rem; }
.inp { width: 100%; font: inherit; font-size: 1.3rem; padding: 12px 16px; border-radius: 16px; border: 3px solid var(--slot-b); outline: none; }
.inp:focus { border-color: var(--primary); }
.avgrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin-bottom: 18px; }
.avbtn { font-size: 1.8rem; padding: 6px 0; border-radius: 14px; border: 3px solid transparent; background: #f4f6fb; cursor: pointer; }
.avbtn.on { border-color: var(--accent); background: #fff1e8; }
.hint2 { color: var(--muted); }
.ptitle { font-size: 1.15rem; margin: 10px 0; }
.pslots { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; }
.pslot { width: 64px; height: 64px; border-radius: 18px; border: 3px dashed var(--slot-b); display: grid; place-items: center; font-size: 2.2rem; background: var(--slot); }
.pslot.full { border-style: solid; border-color: var(--primary); background: #fff; }
.pgrid { display: grid; grid-template-columns: repeat(3, 84px); gap: 10px; justify-content: center; }
.pkey { font-size: 2.4rem; height: 76px; border: none; border-radius: 20px; background: #eef3ff; box-shadow: 0 4px 0 #cdd9f5; cursor: pointer; }
.pkey:active { transform: translateY(3px); box-shadow: 0 1px 0 #cdd9f5; }
.pinshow { font-size: 2.4rem; letter-spacing: 8px; }
.shake { animation: shake .45s; }

/* domů */
.hi { font-size: 1.5rem; margin: 0 4px 14px; }
.resume { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; margin-bottom: 14px; background: #fff8e1; }
.homegrid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }
.carcard, .daily { display: flex; flex-direction: column; gap: 6px; }
.chead { display: flex; justify-content: space-between; align-items: center; }
.chead h3, .daily h3 { margin: 0; font-size: 1.3rem; }
.carbox { background: linear-gradient(#eaf5ff, #eaf5ff 78%, #d9e7c8 78%); border-radius: 20px; padding: 6px 10px 0; }
.car { width: 100%; height: auto; display: block; }
.prog { height: 12px; background: #eef1f7; border-radius: 99px; overflow: hidden; }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 99px; transition: width .6s; }
.carcard .btn { align-self: flex-start; }
.daily { background: linear-gradient(160deg, #fff, #fff6e6); text-align: center; align-items: center; }
.daily p { margin: 2px 0; color: var(--muted); }
.dprog { display: flex; gap: 10px; margin: 10px 0; }
.dprog span { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #eef1f7; font-size: 1.2rem; color: var(--muted); }
.dprog span.on { background: var(--good); color: #fff; }
.chest-closed { font-size: 3rem; filter: grayscale(.8); opacity: .55; }
.okmsg { color: var(--good) !important; }
.streak { font-size: 1.1rem; color: var(--text) !important; margin-top: auto !important; }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.mode { background: #fff; border-radius: 24px; box-shadow: 0 8px 24px rgba(40,60,110,.1); border-top: 6px solid var(--c); display: flex; flex-direction: column; overflow: hidden; transition: transform .15s; }
.mode:hover { transform: translateY(-4px); }
.mode-main { text-align: left; background: none; border: none; padding: 16px 18px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.mode-main .ic { font-size: 1.8rem; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, white); }
.mode-main b { font-size: 1.25rem; font-weight: 900; }
.mode-main small { color: var(--muted); font-size: .92rem; line-height: 1.3; }
.mode-main .ex { margin-top: auto; font-weight: 900; color: var(--c); }
.lvl { border: none; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--c) 7%, white); padding: 9px 18px; text-align: left; cursor: pointer; font-size: .95rem; }
.lvl span { color: #f0a500; letter-spacing: 1px; margin-left: 4px; }
.homefoot { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.lvls { display: grid; gap: 8px; margin: 12px 0 16px; text-align: left; }
.lvlopt { display: grid; grid-template-columns: 96px 1fr; gap: 0 10px; align-items: center; padding: 10px 14px; border-radius: 16px; border: 3px solid var(--line); background: #fff; cursor: pointer; text-align: left; }
.lvlopt .ls { grid-row: span 2; color: #f0a500; font-size: 1.05rem; }
.lvlopt small { color: var(--muted); }
.lvlopt.cur { border-color: var(--primary); background: #f2f6ff; }

/* hra */
.dots { display: flex; gap: 6px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; background: #e3e8f2; }
.dots i.cur { box-shadow: 0 0 0 3px var(--primary); }
.dots i.good { background: var(--good); }
.dots i.ok { background: #f6b93b; }
.lchip { color: #f0a500; font-size: .95rem; margin-left: 6px; letter-spacing: 1px; }
.task { text-align: center; font-size: clamp(1.8rem, 6.4vw, 3.1rem); font-weight: 900; margin: 18px 0 6px; }
.expr { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35em; margin: .25em 0; }
.unit { font-size: .6em; color: var(--muted); margin-left: .1em; }
.slot {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.75em; height: 1.45em; padding: 0 .2em;
  border: 3px dashed var(--slot-b); border-radius: .32em; background: var(--slot);
  color: var(--primary); cursor: pointer; transition: background .2s, border-color .2s, box-shadow .2s;
}
.slot.wide { min-width: 3.3em; }
.slot.sym { min-width: 1.3em; }
.slot.red { border: 4px solid var(--red); }
.slot.blue { border: 4px solid var(--blue); }
.slot.active { border-style: solid; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 5px rgba(76,124,240,.22); }
.slot.good { background: var(--good); border: 3px solid var(--good); color: #fff; box-shadow: none; }
.slot.bad { background: #ffe3e5; border: 3px solid var(--bad); color: var(--bad); animation: shake .45s; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
.pink { display: inline-flex; align-items: center; gap: .35em; background: #ffd9e2; padding: .12em .3em; border-radius: .4em; }
.box { border: 3px solid var(--text); border-radius: .25em; padding: 0 .25em; background: #fff; }
.brace { display: block; width: min(300px, 70%); margin: -.1em auto -.15em; }
.feedback { position: relative; min-height: 2.4rem; text-align: center; font-size: 1.45rem; font-weight: 900; margin-top: 12px; }
.feedback small { display: block; font-size: 1rem; font-weight: 700; color: var(--muted); margin-top: 4px; }
.feedback.good { color: var(--good); }
.feedback.bad { color: var(--bad); }
.feedback.info { color: var(--primary); }
.gain { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); color: #c98a00; font-size: 1.4rem; animation: up 1.2s ease-out forwards; pointer-events: none; white-space: nowrap; }
@keyframes up { from { opacity: 1; transform: translate(-50%, 0) scale(1.2); } to { opacity: 0; transform: translate(-50%, -60px) scale(1); } }
.pad { display: grid; gap: 10px; max-width: 540px; margin: 16px auto 0; }
.pad.k12 { grid-template-columns: repeat(6, 1fr); }
.pad.k4 { grid-template-columns: repeat(4, 1fr); max-width: 380px; }
.pad.k5 { grid-template-columns: repeat(5, 1fr); max-width: 440px; }
.key { font-size: 1.9rem; font-weight: 900; padding: 12px 0; border: none; border-radius: 18px; cursor: pointer; background: #eef3ff; box-shadow: 0 4px 0 #cdd9f5; transition: transform .08s, box-shadow .08s; }
.key:active { transform: translateY(3px); box-shadow: 0 1px 0 #cdd9f5; }
.key.del { background: #fff1e8; box-shadow: 0 4px 0 #f7d3bd; }
.key.ok { background: var(--good); color: #fff; box-shadow: 0 4px 0 #17955d; }
.off { opacity: .35; pointer-events: none; }
.opts { position: relative; max-width: 560px; margin: 18px auto 0; }
.optgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.opt { font-size: 2rem; font-weight: 900; padding: 16px 0; border-radius: 18px; cursor: pointer; background: #eef3ff; border: 3px solid #b9cdf7; }
.opt.good { background: var(--good); border-color: var(--good); color: #fff; }
.opt.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.curtain { position: absolute; inset: -6px; z-index: 2; border: none; border-radius: 22px; cursor: pointer; font-size: 1.2rem; font-weight: 900; color: #fff; line-height: 1.3; background: repeating-linear-gradient(90deg, #d9434d 0 24px, #bf3640 24px 48px); box-shadow: inset 0 -6px 0 rgba(0,0,0,.15); }
.curtain.open { display: none; }

/* krychle */
.kwrap { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.shapes { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.sbox { background: #fff8e1; border-radius: 22px; padding: 8px; transition: background .4s, box-shadow .4s; }
.sbox.lit { background: radial-gradient(circle at 50% 35%, #fffbe0, #ffe58a); box-shadow: 0 0 30px rgba(255,200,40,.6); }
.shapes .plus { font-size: 2.4rem; }
.cubes { max-width: 100%; height: auto; overflow: visible; }
.cubes .cube { transform: translate(var(--x0), var(--y0)); transition: transform .9s cubic-bezier(.34,1.56,.64,1); cursor: pointer; }
.cubes.exploded .cube { transform: translate(var(--x1), var(--y1)); }
.cubes path { stroke: #1d2433; stroke-width: 1.3; stroke-linejoin: round; }
.cubes.red .t { fill: #ff9097; } .cubes.red .f { fill: #e8434d; } .cubes.red .r { fill: #c02f39; }
.cubes.blue .t { fill: #93cbff; } .cubes.blue .f { fill: #2f8be0; } .cubes.blue .r { fill: #1e6bb8; }
.cubes .cube.counted .t { fill: #fff3a8; }
.cubes.xray .cube path { fill-opacity: .22; stroke-opacity: .5; }
.cubes.xray .cube.hid path { fill-opacity: 1; stroke-opacity: 1; stroke: #ff9f00; stroke-width: 2.6; animation: glow 1s ease-in-out infinite alternate; }
@keyframes glow { to { stroke: #fff2a8; } }
.lbl circle { fill: #fff; stroke: #1d2433; stroke-width: 1.5; }
.lbl text { text-anchor: middle; font: 900 13px Nunito, sans-serif; fill: #1d2433; }
.torch { width: 190px; font-size: 1rem; font-weight: 700; text-align: center; line-height: 1.35; padding: 16px 14px; border-radius: 24px; color: #fff; background: linear-gradient(160deg, #2c3260, #5a49a8); box-shadow: 0 10px 24px rgba(44,50,96,.3); transition: background .4s; }
.torch b { font-size: 1.2rem; font-weight: 900; }
.torch p { margin: 6px 0 12px; font-size: .92rem; opacity: .9; }
.torch-ic { font-size: 2.2rem; width: 64px; height: 64px; margin: 0 auto 6px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); transition: box-shadow .4s, background .4s; }
.torch.on { background: linear-gradient(160deg, #3a3f78, #7a5ad0); }
.torch.on .torch-ic { background: #ffe066; box-shadow: 0 0 0 8px rgba(255,224,102,.3), 0 0 40px #ffe066; }
.torch-btn { border: none; border-radius: 14px; padding: 10px 18px; font-size: 1.05rem; font-weight: 900; cursor: pointer; background: #ffe066; color: #2c3260; box-shadow: 0 4px 0 #d9b93a; }

/* desítky */
.frames { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.frame { display: grid; grid-template-columns: repeat(5, 30px); gap: 5px; padding: 7px; background: #fff; border: 3px solid var(--text); border-radius: 12px; }
.frame i { width: 30px; height: 30px; border-radius: 50%; background: #eef1f6; animation: pop .35s both; }
.frame i.r { background: var(--red); } .frame i.b { background: var(--blue); }
@keyframes pop { from { transform: scale(0); } }
.vcap { font-size: 1rem; color: var(--muted); margin: 8px 0 0; }

/* konec kola */
.done { text-align: center; }
.done .big { font-size: 3.6rem; margin-top: 4px; }
.done h2 { font-size: 2rem; margin: 2px 0; }
.done > p { font-size: 1.25rem; color: var(--muted); margin: 6px 0 12px; }
.track { position: relative; overflow: hidden; height: 150px; border-radius: 20px; background: linear-gradient(#eaf5ff 0 70%, #8a93a6 70% 100%); }
.track::after { content: ''; position: absolute; left: 0; right: 0; bottom: 15%; height: 4px; background: repeating-linear-gradient(90deg, #fff 0 30px, transparent 30px 60px); }
.drive { position: absolute; left: 50%; bottom: 4px; width: 270px; margin-left: -135px; z-index: 1; animation: drivein var(--dur) cubic-bezier(.2,.7,.3,1) both; }
@keyframes drivein { from { transform: translateX(-70vw); } to { transform: none; } }
.earn { max-width: 380px; margin: 0 auto 14px; background: #fff8e1; border-radius: 18px; padding: 10px 16px; text-align: left; }
.earn div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.earn .sumline { border-top: 2px dashed #f0d38a; margin-top: 4px; padding-top: 8px; font-size: 1.2rem; }
.sug { max-width: 480px; margin: 0 auto 16px; padding: 14px; border-radius: 18px; background: #eef6ff; border: 3px solid #b9cdf7; display: grid; gap: 10px; }

/* auto */
.car .wheel { transform-box: fill-box; transform-origin: center; }
.car.driving .wheel { animation: spin .45s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.car .flame { animation: flick .25s ease-in-out infinite alternate; transform-origin: 30px 118px; }
@keyframes flick { to { transform: scaleX(1.3); } }
.car .blink { animation: blink .8s steps(2) infinite; }
@keyframes blink { 50% { fill: #ff4d5e; } }

/* dílna */
.stage { position: relative; overflow: hidden; border-radius: 24px; background: linear-gradient(#eaf5ff 0 76%, #d9e7c8 76%); padding: 10px 40px 0; margin: 6px 0 12px; }
.stage .car { max-width: 520px; margin: 0 auto; }
.stage.pop .car { animation: popc .5s; }
@keyframes popc { 40% { transform: scale(1.06) translateY(-6px); } }
.stage .car.go { animation: testdrive var(--dur) ease-in-out; }
@keyframes testdrive { 0% { transform: none; } 45% { transform: translateX(130%); } 46% { transform: translateX(-130%); } 100% { transform: none; } }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 8px; scrollbar-width: thin; }
.tab { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 78px; padding: 8px 10px; border-radius: 16px; border: 3px solid var(--line); background: #fff; cursor: pointer; font-size: .85rem; position: relative; }
.tab span { font-size: 1.6rem; }
.tab.on { border-color: var(--accent); background: #fff1e8; }
.tab.has::after { content: '✓'; position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--good); color: #fff; font-size: .75rem; display: grid; place-items: center; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 6px; }
.item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 10px; border-radius: 20px; border: 3px solid var(--line); text-align: center; }
.item.on { border-color: var(--good); background: #effbf4; }
.iic { font-size: 2.4rem; line-height: 1; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #1d2433; }
.ibtn { border: none; border-radius: 12px; padding: 8px 12px; font-weight: 900; cursor: pointer; background: #eef1f7; }
.ibtn.buy { background: var(--gold); color: #5a3d00; box-shadow: 0 3px 0 #d9a400; }
.state { font-size: .95rem; color: var(--muted); display: flex; flex-direction: column; }
.state.on { color: var(--good); }
.state.need small { font-size: .8rem; }
.garage { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.pcar { background: #fff; border-radius: 20px; padding: 10px; box-shadow: 0 6px 18px rgba(40,60,110,.1); }

/* odznaky */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px 10px; border-radius: 20px; background: #f4f6fb; }
.badge .bi { font-size: 2.6rem; filter: grayscale(1); opacity: .35; }
.badge small { color: var(--muted); font-size: .85rem; }
.badge.got { background: linear-gradient(160deg, #fff8e1, #ffe9b0); }
.badge.got .bi { filter: none; opacity: 1; }

/* rodiče */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.kpis div { background: #f4f6fb; border-radius: 16px; padding: 12px; text-align: center; }
.kpis b { display: block; font-size: 1.6rem; }
.kpis span { color: var(--muted); font-size: .9rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.tbl th, .tbl td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.tbl select { font: inherit; padding: 4px; border-radius: 8px; border: 2px solid var(--line); max-width: 260px; }
.settings { display: grid; gap: 12px; margin-top: 18px; }
.srow, .tgl { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #f4f6fb; }
.tgl { justify-content: flex-start; cursor: pointer; }
.tgl input { width: 22px; height: 22px; flex: none; }
.srow small, .tgl small { color: var(--muted); font-weight: 700; }
.srow.danger { background: #fff0f1; }

/* modální okno, toasty */
.modal { position: fixed; inset: 0; background: rgba(30,36,60,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.mbox { background: #fff; border-radius: 28px; padding: 24px; max-width: 520px; width: 100%; text-align: center; max-height: 90vh; overflow: auto; animation: pop .25s; }
.mbox h2 { margin: 4px 0 8px; }
.mhead { font-size: 3.4rem; }
.mbox .inp { text-align: center; margin: 8px 0 14px; }
.mbox .carbox { margin: 8px 0; }
.chest { font-size: 6rem; background: none; border: none; cursor: pointer; animation: wobble 1.2s ease-in-out infinite; }
.chest.open { animation: pop .4s; }
@keyframes wobble { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
.win { font-size: 2rem; color: #c98a00; }
#toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(420px, calc(100% - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; background: #26304a; color: #fff; padding: 12px 16px; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); animation: tin .3s, tout .4s 2.8s forwards; }
.tbig { font-size: 2rem; }
@keyframes tin { from { transform: translateY(-20px); opacity: 0; } }
@keyframes tout { to { transform: translateY(-20px); opacity: 0; } }

@media (max-width: 720px) {
  .homegrid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  body { padding: 12px; }
  .card { padding: 18px 14px; border-radius: 26px; }
  .logo { font-size: 1.35rem; } .logo .house { font-size: 1.9rem; }
  .user b { display: none; } .user { padding: 5px 8px; }
  .pad.k12 { grid-template-columns: repeat(4, 1fr); }
  .optgrid { grid-template-columns: repeat(3, 1fr); }
  .frame { grid-template-columns: repeat(5, 24px); } .frame i { width: 24px; height: 24px; }
  .avgrid { grid-template-columns: repeat(4, 1fr); }
  .torch { width: 100%; display: grid; grid-template-columns: auto 1fr; text-align: left; gap: 0 12px; align-items: center; }
  .torch-ic { grid-row: span 3; margin: 0; } .torch p { margin: 2px 0 8px; } .torch-btn { justify-self: start; }
  .stage { padding: 10px 10px 0; }
  .lvlopt { grid-template-columns: 80px 1fr; }
}
.row .nextbtn { margin: 0; }

/* ===== v2: 3D ikony a garáž ===== */
.ic { width: 1.6em; height: 1.6em; object-fit: contain; vertical-align: middle; user-select: none; -webkit-user-drag: none; }
.i-in { width: 1.25em; height: 1.25em; vertical-align: -.28em; }
.i-btn { width: 1.45em; height: 1.45em; margin: -.3em .15em -.3em 0; }
.i-title { width: 1.5em; height: 1.5em; margin-right: 4px; vertical-align: -.35em; }
.i-fb { width: 1.5em; height: 1.5em; margin-right: 6px; vertical-align: -.35em; }
.logo-ic { width: 46px; height: 46px; }
.hero-house { width: 110px; height: 110px; display: block; margin: 0 auto; }
.pcard .pav { width: 84px; height: 84px; }
.pplus { font-size: 3rem; line-height: 84px; color: #b6c0d4; }
.psub { display: flex; align-items: center; gap: 4px; }
.bigav { width: 96px; height: 96px; display: block; margin: 6px auto; }
.mhead { width: 84px; height: 84px; display: block; margin: 0 auto; }
.avbtn .ic { width: 44px; height: 44px; }
.avbtn { padding: 4px 0; }
.pkey .ic { width: 52px; height: 52px; }
.pslot .ic { width: 44px; height: 44px; }
.pinshow .ic { width: 56px; height: 56px; margin: 0 4px; }
.pill.bolts, .pill { display: inline-flex; align-items: center; gap: 4px; }
.pill .ic { width: 28px; height: 28px; }
.iconbtn .ic { width: 26px; height: 26px; }
.user .ic { width: 34px; height: 34px; }
.hi { display: flex; align-items: center; gap: 8px; }
.hi .ic { width: 44px; height: 44px; }
.resume { justify-content: flex-start; }
.resume > .ic { width: 40px; height: 40px; }
.resume .btn { margin-left: auto; }
.mic { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, white); }
.mic .ic { width: 46px; height: 46px; }
.dicon { width: 84px; height: 84px; }
.dicon.locked { filter: grayscale(.85); opacity: .45; }
.giftbtn { border: none; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 900; color: #c98a00; font-size: 1.1rem; }
.giftbtn .ic { width: 96px; height: 96px; animation: wobble 1.2s ease-in-out infinite; }
.streak { display: flex; align-items: center; gap: 6px; justify-content: center; }
.chest .ic { width: 150px; height: 150px; }
.win .ic { width: 1.2em; height: 1.2em; }
.big { width: 96px; height: 96px; display: block; margin: 8px auto 0; }
.done .big { font-size: inherit; }
.tbig { width: 44px; height: 44px; flex: none; }
.toast .i-in { width: 1.2em; height: 1.2em; }
.badge .bi { width: 64px; height: 64px; font-size: inherit; }
.tab .ic { width: 34px; height: 34px; }
.curtain { display: flex; align-items: center; justify-content: center; gap: 12px; }
.i-curtain { width: 54px; height: 54px; }
.torch-ic .ic { width: 44px; height: 44px; }
.gain { display: inline-flex; align-items: center; gap: 4px; }
.gain .i-in { width: 1.1em; height: 1.1em; }
.earn b { display: inline-flex; align-items: center; gap: 4px; }
.sug { grid-template-columns: auto 1fr; align-items: center; }
.sug .row { grid-column: 1 / -1; }
.small-inp { width: 180px; font-size: 1.1rem; padding: 8px 12px; }
.state { align-items: center; }

/* garážová scéna */
.scene {
  position: relative; border-radius: 22px; overflow: hidden;
  background:
    radial-gradient(ellipse 60% 70% at 50% -10%, rgba(255,255,255,.22), transparent 70%),
    linear-gradient(#232b40 0%, #151b2b 74%, #0e1320 74%, #1a2133 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.scene::after { content: ''; position: absolute; left: 0; right: 0; top: 74%; height: 1px; background: rgba(255,255,255,.12); }
.scene .car { position: relative; z-index: 1; }
.carcard .scene { padding: 8px 6px 2px; }
.stage.scene { padding: 16px 40px 4px; }
.carbox { background: none; padding: 0; }
.car .blinkR { animation: blinkR .7s steps(2) infinite; }
.car .blinkB { animation: blinkR .7s steps(2) infinite reverse; }
@keyframes blinkR { 50% { opacity: .25; } }
.car .flame { animation: flick .18s ease-in-out infinite alternate; }
.car.driving { animation: bounce .3s ease-in-out infinite alternate; }
@keyframes bounce { to { transform: translateY(-1.5px); } }
.track.scene { height: 170px; }
.track.scene::after { top: auto; bottom: 16%; height: 4px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.5) 0 30px, transparent 30px 60px); }
.drive { width: 300px; margin-left: -150px; bottom: 0; }
.iprev { width: 100%; border-radius: 14px; padding: 4px 2px 0; }
.iprev.icon { display: grid; place-items: center; height: 74px; background: #f4f6fb; }
.iprev.icon .ic { width: 56px; height: 56px; }
.items { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.pcar.scene { padding: 6px; }
