/* Ospalek – barvy a písma podle brand manuálu (tokens.json). Den = světlé téma, Noc = tmavé (výchozí večer). */
:root {
  --surface: #F7F5FC;
  --surface-raised: #FFFFFF;
  --line: #E3DFF2;
  --ink: #2E3150;
  --ink-muted: #5E6180;
  --lavender: #C9C3EC;
  --lavender-ink: #5B4FB0;
  --lavender-soft: #ECE9FA;
  --on-lavender: #FFFFFF;
  --peach: #FFCFB3;
  --mint: #CDEBDD;
  --sky: #BFDDF2;
  --honey: #F6D98B;
  --on-pastel: #2E3150;
  --focus-ring: var(--lavender-ink);
  --err: #B3261E;
  --overlay: rgba(46, 49, 80, .45);
  --radius-sm: 12px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --radius-pill: 999px;
  --shadow-soft: 0 8px 24px rgba(46, 49, 80, .12);
  /* Plyš: vlákna fleecu, prošívání a polštářkový stín (brand/maskot-3d) */
  --felt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .18 0 0 0 0 .19 0 0 0 0 .31 .16 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --stitch: rgba(46, 49, 80, .2);
  --stitch-on-accent: rgba(255, 255, 255, .55);
  --shadow-plush: inset 0 2px 0 rgba(255, 255, 255, .7), inset 0 -6px 14px rgba(46, 49, 80, .06), 0 2px 3px rgba(46, 49, 80, .06), 0 10px 22px rgba(46, 49, 80, .1);
  --shadow-pillow: inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -5px 10px rgba(0, 0, 0, .14), 0 6px 14px rgba(46, 49, 80, .18);
  /* Fredoka nemá ě, č, ř, ů, ň, ť, ď – nadpisy proto v Nunitu, Fredoka jen ve slově „ospalek“ v logu */
  --display: "Nunito", ui-rounded, system-ui, sans-serif;
  --logo: "Fredoka", "Nunito", ui-rounded, system-ui, sans-serif;
  --body: "Nunito", ui-rounded, system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --surface: #1C1E33;
  --surface-raised: #262942;
  --line: #3A3D5C;
  --ink: #EEEBFA;
  --ink-muted: #B4B2CF;
  --lavender: #8F86D1;
  --lavender-ink: #C9C3EC;
  --lavender-soft: #2E2C52;
  --on-lavender: #1C1E33;
  --peach: #E8A486;
  --mint: #7FBFA3;
  --sky: #7BAED3;
  --honey: #E4C066;
  --on-pastel: #1C1E33;
  --err: #FFB4AB;
  --overlay: rgba(10, 11, 22, .7);
  --felt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .93 0 0 0 0 .92 0 0 0 0 .98 .1 0 0 0 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --stitch: rgba(238, 235, 250, .18);
  --stitch-on-accent: rgba(28, 30, 51, .35);
  --shadow-plush: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 -6px 14px rgba(0, 0, 0, .18), 0 10px 22px rgba(0, 0, 0, .3);
  --shadow-pillow: inset 0 2px 0 rgba(255, 255, 255, .3), inset 0 -5px 10px rgba(0, 0, 0, .18), 0 6px 14px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--body); -webkit-tap-highlight-color: transparent; }
body { min-height: 100vh; }
#app { max-width: 480px; margin: 0 auto; padding: 16px 16px 48px; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-family: var(--display); font-weight: 800; }
h3 { font-weight: 700; }
p { line-height: 1.5; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font: inherit; color: var(--ink); background: var(--surface-raised); border: 2px solid var(--line); border-radius: var(--radius-md); padding: 14px; width: 100%; font-size: 17px; }
input:focus, select:focus { outline: none; border-color: var(--lavender-ink); }
label { display: block; font-weight: 600; margin: 14px 0 6px; color: var(--ink-muted); font-size: 15px; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 16px 20px; border-radius: var(--radius-pill); font-weight: 800; font-size: 18px; background: var(--lavender-ink); color: var(--on-lavender); transition: transform .1s; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--lavender-ink); box-shadow: inset 0 0 0 2px var(--lavender-ink); }
.btn.white { background: var(--surface-raised); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.small { width: auto; padding: 10px 16px; font-size: 15px; }
.link { color: var(--ink-muted); text-decoration: underline; font-size: 15px; padding: 8px; }

/* Login */
.login { min-height: 90vh; display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 14px; }
.logo { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 4px; }
.logo img { width: 112px; height: 112px; }
.wordmark { font-family: var(--logo); font-weight: 600; font-size: 44px; line-height: 1; text-transform: lowercase; color: var(--ink); }
.tag { color: var(--ink-muted); font-size: 19px; margin: 0 0 24px; }
.fine { color: var(--ink-muted); font-size: 13px; }

/* Onboarding */
.progress { height: 6px; background: var(--lavender-soft); border-radius: 9px; overflow: hidden; margin: 8px 0 24px; }
.progress div { height: 100%; background: var(--lavender-ink); transition: width .3s; }
.step-label { color: var(--ink-muted); font-size: 14px; font-weight: 600; }
.lead { color: var(--ink-muted); margin: 8px 0 20px; }
.onb-mascot { width: 84px; height: 84px; display: block; margin: 0 0 8px; }
.people { display: grid; gap: 10px; margin-bottom: 14px; }
.person { display: flex; align-items: center; gap: 12px; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px 14px; }
.av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; font-family: var(--display); font-weight: 800; font-size: 19px; background: var(--lavender); color: var(--on-pastel); }
.av.peach { background: var(--peach); } .av.mint { background: var(--mint); } .av.sky { background: var(--sky); } .av.honey { background: var(--honey); }
.av .ico { width: 22px; height: 22px; }
.person .nm { flex: 1; min-width: 0; }
.person .nm b { display: block; font-size: 18px; }
.person .nm span { color: var(--ink-muted); font-size: 14px; }
.add { width: 100%; padding: 16px; border: 2px dashed var(--line); border-radius: var(--radius-md); color: var(--lavender-ink); font-weight: 700; font-size: 17px; }
.footer-actions { display: grid; gap: 10px; margin-top: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: var(--radius-pill); background: var(--surface-raised); border: 2px solid var(--line); font-size: 15px; font-weight: 700; color: var(--ink); }
.chip.on { background: var(--lavender-soft); color: var(--lavender-ink); border-color: var(--lavender-ink); }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.seg { display: flex; background: var(--surface-raised); border-radius: var(--radius-pill); padding: 4px; border: 2px solid var(--line); }
.seg button { flex: 1; padding: 12px; border-radius: var(--radius-pill); font-weight: 700; font-size: 17px; }
.seg button.on { background: var(--lavender-ink); color: var(--on-lavender); }
details { margin-top: 14px; background: var(--lavender-soft); border-radius: var(--radius-md); padding: 4px 14px 14px; }
details summary { cursor: pointer; padding: 10px 0; color: var(--ink-muted); font-weight: 600; }
.cases { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.cases label { font-size: 13px; margin-top: 8px; }
.cases input { padding: 10px; font-size: 15px; }
.note { font-size: 14px; color: var(--ink-muted); }
.err { color: var(--err); font-size: 14px; }

/* Library */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 18px; }
.top h1 { font-size: 26px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-raised); border: 1px solid var(--line); color: var(--ink); display: grid; place-items: center; flex: 0 0 auto; }
.section-t { font-size: 12px; color: var(--ink-muted); font-weight: 800; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.hscroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll .chip { white-space: nowrap; }
.promo { margin: 18px 0 4px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--lavender); color: var(--on-pastel); display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; }
.promo img { width: 48px; height: 48px; }
.promo b { display: block; font-size: 17px; font-family: var(--display); font-weight: 800; }
.promo span { font-size: 14px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.card { text-align: left; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; padding: 0 0 12px; transition: box-shadow .15s; }
.card:hover { box-shadow: var(--shadow-soft); }
.cover { position: relative; aspect-ratio: 3/4; background: linear-gradient(160deg, var(--g1), var(--g2)); display: grid; place-items: center; font-size: 64px; overflow: hidden; }
.badge { position: absolute; z-index: 1; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 6px 9px; border-radius: var(--radius-pill); background: var(--surface-raised); color: var(--ink); display: inline-flex; align-items: center; gap: 4px; }
.badge .ico { width: 14px; height: 14px; stroke-width: 2.4; }
.badge.free { top: 10px; left: 10px; background: var(--honey); color: var(--on-pastel); }
.badge.lock { top: 10px; right: 10px; }
.card h3 { font-size: 17px; line-height: 22px; margin: 10px 12px 4px; }
.card .meta { font-size: 13px; color: var(--ink-muted); margin: 0 12px; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.empty { color: var(--ink-muted); text-align: center; padding: 24px 0; grid-column: 1 / -1; }
.empty img { width: 120px; margin: 0 auto 8px; display: block; }

/* Modal */
#modal:empty { display: none; }
.overlay { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.sheet { width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 22px 18px 28px; box-shadow: var(--shadow-soft); }
.sheet h2 { font-size: 24px; margin-bottom: 4px; }
.sheet-mascot { width: 96px; height: 96px; display: block; margin: 0 auto 8px; }
.plans { display: grid; gap: 10px; margin: 18px 0; }
.plan { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-radius: var(--radius-md); border: 2px solid var(--line); background: var(--surface-raised); text-align: left; }
.plan.on { border-color: var(--lavender-ink); background: var(--lavender-soft); }
.plan b { font-size: 18px; }
.plan small { display: block; color: var(--ink-muted); }
.plan .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; }
.plan.on .radio { border: 7px solid var(--lavender-ink); }
.save { background: var(--mint); color: var(--on-pastel); font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: var(--radius-pill); margin-left: 6px; }
.perks { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.perks li { padding-left: 26px; position: relative; }
.perks li::before { content: ''; position: absolute; left: 4px; top: 5px; width: 6px; height: 11px; border: solid var(--lavender-ink); border-width: 0 3px 3px 0; transform: rotate(45deg); }

/* Player */
.player { position: fixed; inset: 0; z-index: 40; background: linear-gradient(180deg, var(--c, var(--lavender)) -40%, var(--surface) 50%); display: flex; flex-direction: column; color: var(--ink); }
.player .inner { max-width: 480px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; height: 100%; padding: 14px 16px 20px; }
.player .bar { display: flex; justify-content: space-between; align-items: center; }
.pcover { font-size: 72px; text-align: center; margin: 4px 0; }
.player h2 { text-align: center; font-size: 22px; margin-top: 6px; }
.ptext { flex: 1; overflow-y: auto; margin: 14px 0; padding: 4px 4px 40%; mask-image: linear-gradient(transparent, #000 8%, #000 85%, transparent); }
.ptext p { font-size: 19px; color: var(--ink); opacity: .35; transition: opacity .4s; margin: 0 0 16px; }
.ptext p.now { opacity: 1; }
.ptext p.done { opacity: .6; }
.ptext.hide p:not(.now) { display: none; }
.waiting { text-align: center; color: var(--lavender-ink); font-weight: 800; min-height: 24px; }
.controls { display: flex; justify-content: center; align-items: center; gap: 28px; margin: 8px 0 14px; }
.controls .play { width: 80px; height: 80px; border-radius: 50%; background: var(--lavender-ink); color: var(--on-lavender); display: grid; place-items: center; box-shadow: var(--shadow-soft); }
.controls .play svg { width: 34px; height: 34px; fill: currentColor; }
.controls .skip { width: 52px; height: 52px; display: grid; place-items: center; color: var(--ink); }
.controls .skip svg { width: 28px; height: 28px; fill: currentColor; }
.mix { display: flex; align-items: center; gap: 10px; color: var(--ink-muted); font-size: 14px; font-weight: 600; }
.mix input[type=range] { flex: 1; padding: 0; accent-color: var(--lavender-ink); background: none; border: 0; }
.voicewarn { font-size: 12px; color: var(--ink-muted); text-align: center; margin-top: 10px; }
.the-end { text-align: center; padding: 32px 0; }
.the-end img { width: 180px; margin: 0 auto 8px; display: block; }
.voices { justify-content: center; margin-top: 10px; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover .badge { z-index: 2; }
.pcover img { width: 132px; aspect-ratio: 3/4; object-fit: cover; border-radius: var(--radius-md); box-shadow: var(--shadow-soft); display: block; margin: 0 auto; }
.section-t .hint { text-transform: none; letter-spacing: 0; font-weight: 600; opacity: .8; }

/* Plyš – látkový povrch, prošívání a polštářky místo plochých karet */
html, body { background: var(--felt), var(--surface); }
.card, .person, .plan, .promo, .icon-btn, details, .sheet, .seg, .chip { background-image: var(--felt); }
.card, .person, .plan, details { border-color: transparent; box-shadow: var(--shadow-plush); outline: 2px dashed var(--stitch); outline-offset: -7px; }
.card { padding-bottom: 16px; }
.card:hover { box-shadow: var(--shadow-plush), var(--shadow-soft); }
.cover { margin: 6px 6px 0; border-radius: calc(var(--radius-md) - 6px); }
.plan.on { outline-color: var(--lavender-ink); }
.promo { box-shadow: var(--shadow-plush); outline: 2px dashed var(--stitch-on-accent); outline-offset: -7px; }
.promo img, .logo img, .onb-mascot, .sheet-mascot, .empty img, .the-end img { object-fit: contain; filter: drop-shadow(0 8px 12px rgba(46, 49, 80, .18)); }
.logo img { width: 132px; height: 132px; }
.onb-mascot { width: 104px; height: 104px; }
.sheet-mascot { width: 112px; height: 112px; }
.promo img { width: 56px; height: 56px; }
.the-end img { width: 200px; height: auto; }
.btn, .seg button.on, .controls .play { box-shadow: var(--shadow-pillow); outline: 2px dashed var(--stitch-on-accent); outline-offset: -6px; }
.btn.ghost { box-shadow: inset 0 0 0 2px var(--lavender-ink); outline-color: var(--stitch); }
.btn.white { box-shadow: var(--shadow-plush); outline-color: var(--stitch); background-image: var(--felt); }
.btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.icon-btn, .chip, .seg { border-color: transparent; box-shadow: var(--shadow-plush); }
.chip.on { box-shadow: var(--shadow-plush), inset 0 0 0 2px var(--lavender-ink); }
.av { box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), inset 0 -4px 8px rgba(46, 49, 80, .12); }
input, select { box-shadow: inset 0 3px 8px rgba(46, 49, 80, .06); }
.progress { box-shadow: inset 0 2px 4px rgba(46, 49, 80, .1); }
.progress div { background-image: repeating-linear-gradient(90deg, transparent 0 6px, var(--stitch-on-accent) 6px 12px); background-size: 100% 2px; background-repeat: no-repeat; background-position: 0 50%; }
.sheet { box-shadow: var(--shadow-plush); }
.badge { box-shadow: 0 2px 6px rgba(46, 49, 80, .15); }

/* Plyš – vyšívané ikonky, filcové nášivky a plyšové ikonky kategorií místo plochých prvků */
.ico { stroke-width: 2.4; stroke-dasharray: 2.6 1.9; }
.badge .ico { stroke-dasharray: none; }
.av { background-image: var(--felt); outline: 1.5px dashed var(--stitch); outline-offset: -5px; }
.av .ico { stroke-dasharray: 2.4 1.8; }
.cat-ico { width: 26px; height: 26px; object-fit: contain; margin: -6px 0 -6px -4px; filter: drop-shadow(0 2px 2px rgba(46, 49, 80, .15)); }
.cat-ico.sm { width: 20px; height: 20px; margin: -4px 0 -4px -2px; }
