:root {
  --bg: #fff5f7;
  --card: #ffffff;
  --text: #2b1d24;
  --muted: #8a7480;
  --line: #f1dde4;
  --accent: #ff4f7b;
  --accent2: #ff8a5c;
  --grad: linear-gradient(135deg, var(--accent2), var(--accent));
  --soft: #ffe7ee;
  --ok: #1fa96b;
  --shadow: 0 6px 24px rgba(255, 79, 123, 0.12);
  --r: 20px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17111a;
    --card: #231a27;
    --text: #f6eaf0;
    --muted: #b49caa;
    --line: #3a2c3f;
    --soft: #3a2232;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  }
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }
body { min-height: 100dvh; padding-top: var(--safe-t); }
a { color: var(--accent); }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
p { margin: 6px 0; }
.muted { color: var(--muted); font-size: 14px; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }

header#top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -0.3px; }
#topstats { display: flex; gap: 8px; font-weight: 700; font-size: 14px; }
.pill { background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; white-space: nowrap; }

main { padding: 4px 16px calc(96px + var(--safe-b)); max-width: 640px; margin: 0 auto; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }

nav#tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 6; display: flex; justify-content: space-around; padding: 6px 4px calc(6px + var(--safe-b)); background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
nav#tabs a { flex: 1; text-align: center; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; padding: 4px 0; border-radius: 12px; }
nav#tabs a b { display: block; font-size: 22px; line-height: 1.2; filter: grayscale(0.6); }
nav#tabs a.on { color: var(--accent); }
nav#tabs a.on b { filter: none; transform: scale(1.08); }

.card { background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); border: 1px solid var(--line); margin-bottom: 14px; }
.card.grad { background: var(--grad); color: #fff; border: 0; }
.card.grad .muted { color: rgba(255, 255, 255, 0.85); }

button, .btn { appearance: none; border: 0; border-radius: 14px; padding: 12px 16px; font: inherit; font-weight: 700; cursor: pointer; background: var(--grad); color: #fff; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button.ghost, .btn.ghost { background: var(--soft); color: var(--accent); }
button.small { padding: 7px 11px; font-size: 14px; border-radius: 11px; }
button:disabled { opacity: 0.45; cursor: default; }
button.block { width: 100%; }
input, textarea, select { width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; outline: none; }
input:focus, textarea:focus { border-color: var(--accent); }
textarea { min-height: 90px; resize: vertical; }
label { font-weight: 600; font-size: 14px; display: block; margin-bottom: 4px; }

/* otázky */
.qcard { position: relative; overflow: hidden; }
.qlevel { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--accent); }
.qtext { font-size: 19px; font-weight: 700; margin: 6px 0 12px; min-height: 52px; }
.qbox { position: relative; border-radius: 16px; }
.qbox .qtext { margin: 6px 0 4px; padding: 10px 2px; min-height: 84px; display: flex; align-items: center; }
.scratch { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; border-radius: 16px; }
.answer { background: var(--soft); border-radius: 14px; padding: 10px 12px; margin-top: 8px; }
.answer .who { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.answer img { max-width: 100%; border-radius: 10px; display: block; }
.locked { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; background: var(--bg); border: 1.5px dashed var(--line); border-radius: 14px; padding: 10px 12px; margin-top: 8px; }
.types { display: flex; gap: 6px; margin-bottom: 8px; }
.types button { flex: 1; padding: 8px 4px; font-size: 13px; }

/* série */
.streak { display: flex; align-items: center; gap: 14px; }
.streak .big { font-size: 44px; font-weight: 900; line-height: 1; }
.milestones { display: flex; gap: 6px; margin-top: 10px; }
.milestones span { flex: 1; text-align: center; font-size: 12px; font-weight: 700; padding: 6px; border-radius: 10px; background: rgba(255, 255, 255, 0.2); }
.milestones span.on { background: #fff; color: var(--accent); }

/* mřížky */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.tile b { font-size: 30px; display: block; }
.tile span { font-weight: 700; }
.tile small { display: block; color: var(--muted); font-size: 12px; }
.sounds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sounds button { flex-direction: column; background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 12px 4px; font-size: 12px; font-weight: 600; min-height: 84px; }
.sounds button b { font-size: 30px; }
.sounds button:active { transform: scale(0.94); }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; display: block; }

/* widget s fotkou */
.widget { position: relative; border-radius: 26px; overflow: hidden; aspect-ratio: 3/4; background: var(--soft); box-shadow: var(--shadow); }
.widget img { width: 100%; height: 100%; object-fit: cover; display: block; }
.widget .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 12px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.6)); font-weight: 700; }
.widget .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; }

/* kamera */
.cam { position: relative; background: #000; border-radius: 22px; overflow: hidden; aspect-ratio: 3/4; }
.cam video, .cam canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam .inset { position: absolute; top: 12px; left: 12px; width: 30%; border-radius: 14px; border: 3px solid #fff; }
.drawwrap { position: relative; }
.drawwrap canvas.pad { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }

/* plátno */
.board { position: relative; width: 100%; aspect-ratio: 1; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden; }
.board canvas { width: 100%; height: 100%; touch-action: none; display: block; }
.board .wait { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255, 255, 255, 0.55); font-weight: 700; color: #6b5160; pointer-events: none; text-align: center; padding: 20px; }
.palette { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line); padding: 0; }
.swatch.on { box-shadow: 0 0 0 3px var(--accent); }

/* vibe */
.slider { margin: 12px 0; }
.slider .top { display: flex; justify-content: space-between; font-weight: 700; }
input[type='range'] { padding: 0; border: 0; background: transparent; accent-color: var(--accent); height: 30px; }
.vibebars { display: grid; grid-template-columns: auto 1fr 1fr; gap: 6px 10px; align-items: center; font-size: 14px; }
.bar { height: 10px; border-radius: 6px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; }

/* drak */
.capy { text-align: center; padding: 10px 0; }
.capy .body { display: inline-block; width: min(260px, 80%); animation: bob 2.6s ease-in-out infinite; cursor: pointer; }
.capy-svg { width: 100%; height: auto; display: block; }
.capy.omdlela .body { filter: grayscale(0.7); animation: none; transform: rotate(-6deg) translateY(10px); }
.capy.smutná .body { filter: saturate(0.5); animation-duration: 5s; }
.capy .body.wiggle { animation: wiggle 0.5s; }
@keyframes wiggle { 25% { transform: rotate(-6deg) scale(1.05); } 75% { transform: rotate(6deg) scale(1.05); } }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-3deg); } }
.hearts { height: 14px; background: var(--soft); border-radius: 8px; overflow: hidden; margin: 10px 0 4px; }
.hearts i { display: block; height: 100%; background: var(--grad); transition: width 0.6s; }
.msg { background: var(--soft); border-radius: 14px; padding: 8px 12px; margin-top: 8px; }

/* odpočty */
.cd { display: flex; align-items: center; gap: 12px; }
.cd .num { font-size: 28px; font-weight: 900; min-width: 64px; text-align: center; color: var(--accent); }

/* mapa */
.map { height: 320px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); z-index: 0; }

/* toast + modal */
#toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); z-index: 20; background: #2b1d24; color: #fff; padding: 10px 16px; border-radius: 14px; font-weight: 600; max-width: 90vw; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
#modal { position: fixed; inset: 0; z-index: 15; background: rgba(20, 8, 14, 0.5); display: flex; align-items: flex-end; justify-content: center; }
#modal .sheet { background: var(--card); width: 100%; max-width: 640px; max-height: 92dvh; overflow: auto; border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + var(--safe-b)); }

.setup { min-height: 70dvh; display: flex; flex-direction: column; justify-content: center; }
.hero { font-size: 64px; text-align: center; }
.sep { text-align: center; color: var(--muted); margin: 16px 0; font-size: 14px; }
.backlink { display: inline-block; margin: 4px 0 10px; text-decoration: none; font-weight: 700; }
.code { font-size: 32px; font-weight: 900; letter-spacing: 6px; text-align: center; padding: 10px; background: var(--soft); border-radius: 14px; user-select: all; }

/* nové prvky */
.us .mood { font-size: 22px; font-weight: 800; margin-top: 2px; }
.us .mood span { font-size: 16px; font-weight: 600; }
.think:active { transform: scale(0.96); }
.challenge { border: 2px solid var(--accent2); }
.challenge.spicy { border-color: #e0245e; background: linear-gradient(135deg, color-mix(in srgb, var(--card) 85%, #ff2d6f), var(--card)); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--soft); border-radius: 99px; padding: 6px 12px; font-weight: 600; font-size: 14px; margin: 0; cursor: pointer; }
.chip input { width: auto; margin: 0; accent-color: var(--accent); }
.chip.adult { background: color-mix(in srgb, var(--soft) 60%, #ff2d6f 25%); }
.emojis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.emojis button { font-size: 26px; padding: 8px; }
.emojis button.on { background: var(--grad); }
.fly { position: fixed; z-index: 30; pointer-events: none; font-size: 26px; transform: translate(-50%, -50%); animation: fly 1.4s ease-out forwards; }
@keyframes fly { to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.4); opacity: 0; } }
.facts { display: grid; grid-template-columns: 1fr; gap: 6px; }
.facts div { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--soft); border-radius: 12px; }
.facts b { font-size: 22px; }
.facts span { flex: 1; font-size: 14px; }
.facts strong { white-space: nowrap; }
.touchpad { position: relative; width: min(300px, 80vw); aspect-ratio: 1; margin: 20px auto; border-radius: 50%; background: var(--soft); display: grid; place-items: center; touch-action: none; user-select: none; -webkit-user-select: none; transition: box-shadow 0.3s; }
.touchpad .ring { position: absolute; inset: 14%; border-radius: 50%; border: 4px dashed var(--accent); opacity: 0.4; }
.touchpad .lbl { font-weight: 800; color: var(--accent); text-align: center; padding: 20px; }
.touchpad.me { background: color-mix(in srgb, var(--accent) 22%, var(--soft)); }
.touchpad.me .ring { animation: spin 6s linear infinite; opacity: 0.9; }
.touchpad.partner { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent2) 45%, transparent), 0 0 60px var(--accent2); }
@keyframes spin { to { transform: rotate(360deg); } }
.wheel #idea { font-size: 24px; font-weight: 900; min-height: 90px; display: grid; place-items: center; }
.task { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; margin-bottom: 8px; }
.task .check { width: 32px; height: 32px; padding: 0; border-radius: 50%; background: var(--soft); color: #fff; flex: none; border: 2px solid var(--accent); }
.task.done .check { background: var(--grad); border-color: transparent; }
.task.done .tt { text-decoration: line-through; color: var(--muted); }
.tile span { display: block; }

/* 18+ laboratoř */
.tile.spicy { background: linear-gradient(135deg, #3a0d1f, #8e1440); color: #fff; border: 0; }
.tile.spicy small { color: rgba(255, 255, 255, 0.8); }
.dice { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 10px 0 14px; }
.dice div { background: var(--soft); border-radius: 14px; padding: 12px; font-weight: 800; font-size: 18px; }
.todcard { min-height: 110px; display: grid; place-items: center; align-content: center; gap: 6px; background: linear-gradient(135deg, #3a0d1f, #b0174f); color: #fff; border-radius: 18px; padding: 16px; margin: 8px 0 12px; font-weight: 800; font-size: 18px; }
.todcard small { opacity: 0.75; font-size: 12px; letter-spacing: 0.6px; }
.todcard.flip { animation: flip 0.45s; }
@keyframes flip { 0% { transform: rotateY(90deg); } 100% { transform: rotateY(0); } }
.yn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.yn span { flex: 1 1 160px; font-weight: 600; }
.ynb { display: flex; gap: 4px; }
.ynb .on-y { background: #1fa96b; }
.ynb .on-m { background: #f0a92e; }
.ynb .on-n { background: #8a7480; }
.match { background: rgba(255, 255, 255, 0.2); border-radius: 12px; padding: 8px 12px; margin-top: 6px; font-weight: 700; }
