/* ---------------------------------------------------------------
   Lesní kniha — vzhled
   Barvy a rozměry jsou v proměnných níž, klidně si je přepiš.
--------------------------------------------------------------- */

:root {
  --paper:        #f3e8d2;
  --paper-edge:   #d3bf9c;
  --ink:          #33291d;
  --ink-soft:     #6b5c46;
  --accent:       #3f6141;
  --backdrop-1:   #1d2620;
  --backdrop-2:   #10150f;

  --book-w: min(1240px, 94vw);
  --book-ratio: 0.62;      /* výška / šířka celé dvojstrany */
  --flip-ms: 720ms;
  --radius: 6px;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: var(--serif);
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 50% 0%, var(--backdrop-1) 0%, var(--backdrop-2) 70%),
    var(--backdrop-2);
  overflow: hidden;
}

.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px clamp(10px, 2vw, 26px) 16px;
}

/* ---------------- horní lišta ---------------- */

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: #cdd7c6;
  flex: 0 0 auto;
}

.topbar__title {
  margin: 0;
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.72;
}

.topbar__verze {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: none;
  opacity: 0.55;
  margin-left: 8px;
}

.topbar__right { display: flex; align-items: center; gap: 14px; }

.topbar__counter {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.55;
}

.ghost-btn {
  font-family: var(--sans);
  font-size: 12px;
  color: #cdd7c6;
  background: none;
  border: 1px solid rgba(205, 215, 198, 0.28);
  border-radius: 100px;
  padding: 5px 12px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity .2s, border-color .2s;
}
.ghost-btn:hover { opacity: 1; border-color: rgba(205, 215, 198, 0.6); }

/* ---------------- pódium a listování ---------------- */

.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1.5vw, 20px);
}

.nav {
  flex: 0 0 auto;
  width: 46px;
  height: 92px;
  border: 0;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.05);
  color: #d7e0d2;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, transform .2s, opacity .2s;
}
.nav:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.nav:active:not(:disabled) { transform: scale(0.94); }
.nav:disabled { opacity: 0.15; cursor: default; }

/* ---------------- kniha ---------------- */

.book {
  position: relative;
  width: var(--book-w);
  height: min(calc(var(--book-w) * var(--book-ratio)), 100%);
  perspective: 2400px;
  filter: drop-shadow(0 26px 50px rgba(0, 0, 0, 0.55));
}

.book__spread {
  position: absolute;
  inset: 0;
  display: flex;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
}

.book__spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 46px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 6;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0) 0%,
    rgba(60, 40, 18, 0.16) 42%,
    rgba(60, 40, 18, 0.30) 50%,
    rgba(60, 40, 18, 0.16) 58%,
    rgba(0,0,0,0) 100%);
}

.page {
  position: relative;
  width: 50%;
  height: 100%;
  background: var(--paper);
  overflow: hidden;
}

.page--left  { box-shadow: inset -14px 0 22px -18px rgba(0,0,0,.5); }
.page--right { box-shadow: inset  14px 0 22px -18px rgba(0,0,0,.5); }

/* jemné ztmavení k okrajům, ať papír není placatý */
.page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background: radial-gradient(120% 100% at 50% 50%, rgba(255,255,255,0) 55%, rgba(90,66,32,.18) 100%);
}

/* ---------------- levá strana: scéna ---------------- */

.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #cbd3c0;
}

/* Rám dopočítaný JS tak, aby ilustrace stranu přesně pokryla.
   Hotspoty sedí uvnitř něj, takže drží na místě při každé velikosti okna. */
.scene__frame {
  position: absolute;
  transform-origin: center;
  transition: transform .35s cubic-bezier(.2,.7,.3,1);
  will-change: transform;
}

.scene__layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  filter: var(--tonovani, );
  user-select: none;
  -webkit-user-drag: none;
}

.scene__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 34px 22px 14px;
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #f2ead8;
  background: linear-gradient(to top, rgba(12,16,10,.72), rgba(12,16,10,0));
  pointer-events: none;
  z-index: 4;
}

/* ilustrace vlepená do papíru — deska jako v přírodopisné knize */
.scene.is-contain { background: transparent; }

.scene.is-contain .scene__frame {
  box-shadow:
    0 0 0 1px rgba(90, 66, 32, .28),
    0 10px 26px -12px rgba(50, 34, 12, .55);
}

.scene.is-contain .scene__caption {
  padding: 0 22px 7.6%;
  text-align: center;
  color: var(--ink-soft);
  background: none;
}

/* hotspoty */

.hotspot {
  position: absolute;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  z-index: 5;
}

.hotspot__dot {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: rgba(255, 249, 233, 0.92);
  box-shadow: 0 1px 6px rgba(0,0,0,.45);
  transition: inset .18s, background .2s;
}

.hotspot__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 249, 233, 0.75);
  animation: pulse 2.6s ease-out infinite;
}

@keyframes pulse {
  0%   { transform: scale(.55); opacity: 0; }
  35%  { opacity: .85; }
  100% { transform: scale(1.25); opacity: 0; }
}

.hotspot:hover .hotspot__dot { inset: 7px; }

.hotspot__label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  white-space: nowrap;
  font-family: var(--sans);
  font-size: 12px;
  color: #2a2418;
  background: rgba(255, 249, 233, 0.95);
  padding: 4px 9px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  box-shadow: 0 3px 10px rgba(0,0,0,.3);
}
.hotspot:hover .hotspot__label,
.hotspot:focus-visible .hotspot__label { opacity: 1; transform: translateX(-50%) translateY(0); }

.hotspot.is-found .hotspot__ring { display: none; }
.hotspot.is-found .hotspot__dot {
  inset: 12px;
  background: rgba(255, 249, 233, 0.45);
  box-shadow: 0 0 0 1px rgba(255,249,233,.5);
}
.hotspot.is-flash .hotspot__ring { display: block; animation: pulse .9s ease-out 2; }

/* ---------------- pravá strana: zápisník ---------------- */

.notes {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 3.2vw, 40px) clamp(20px, 3.4vw, 44px) 14px clamp(24px, 4vw, 52px);
}

.notes__head { flex: 0 0 auto; }

.notes__name {
  margin: 0;
  font-size: clamp(24px, 3.1vw, 38px);
  font-weight: 500;
}

.notes__latin {
  margin: 2px 0 0;
  font-style: italic;
  color: var(--ink-soft);
  font-size: clamp(13px, 1.5vw, 16px);
}

.notes__intro {
  margin: 14px 0 0;
  font-size: clamp(13.5px, 1.55vw, 16px);
  line-height: 1.62;
  color: #4b3f2e;
}

.notes__rule {
  height: 1px;
  margin: 16px 0 4px;
  background: linear-gradient(to right, var(--paper-edge), rgba(211,191,156,0));
  flex: 0 0 auto;
}

.notes__progress {
  flex: 0 0 auto;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.notes__list {
  list-style: none;
  margin: 0;
  padding: 0 8px 8px 0;
  flex: 1 1 auto;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--paper-edge) transparent;
}
.notes__list::-webkit-scrollbar { width: 6px; }
.notes__list::-webkit-scrollbar-thumb { background: var(--paper-edge); border-radius: 3px; }

.note {
  border-bottom: 1px solid rgba(211, 191, 156, .55);
  padding: 11px 0;
}
.note:last-child { border-bottom: 0; }

.note__title {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  font-family: var(--serif);
  font-size: clamp(14px, 1.65vw, 17px);
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.note__num {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 1px solid var(--paper-edge);
  display: grid;
  place-items: center;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-soft);
}

.note__body {
  margin: 6px 0 0 30px;
  font-size: clamp(13px, 1.5vw, 15.5px);
  line-height: 1.6;
  color: #4b3f2e;
}

.note__more {
  margin-top: 7px;
  display: none;
  color: #574833;
  border-left: 2px solid var(--paper-edge);
  padding-left: 11px;
}
.note.is-open .note__more { display: block; }

.note__toggle {
  display: block;
  margin-top: 7px;
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.note__toggle:hover { text-decoration: underline; }

/* neobjevená poznámka */
.note.is-locked .note__title { color: #a2917a; cursor: default; }
.note.is-locked .note__num { border-style: dashed; }

.note__ghost {
  margin: 8px 0 2px 30px;
  display: grid;
  gap: 6px;
}
.note__ghost span {
  display: block;
  height: 7px;
  border-radius: 3px;
  background: rgba(150, 128, 96, .22);
}
.note__ghost span:nth-child(2) { width: 82%; }
.note__ghost span:nth-child(3) { width: 54%; }

.note.is-flash { animation: noteflash 1.1s ease-out; }
@keyframes noteflash {
  0%   { background: rgba(165, 100, 42, .22); }
  100% { background: rgba(165, 100, 42, 0); }
}

/* razítko po dokončení stránky */
.stamp {
  flex: 0 0 auto;
  margin-top: 10px;
  align-self: flex-end;
  transform: rotate(-6deg);
  border: 2px solid rgba(63, 97, 65, .5);
  color: rgba(63, 97, 65, .75);
  border-radius: 4px;
  padding: 6px 12px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity .5s;
}
.stamp.is-on { opacity: 1; }

.notes__footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 10px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .1em;
  color: #a2917a;
  text-align: right;
}

/* ---------------- obálka ---------------- */

.cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 4vw, 56px);
  gap: 14px;
}
.cover__title {
  margin: 0;
  font-size: clamp(32px, 5vw, 62px);
  line-height: 1.02;
  font-weight: 500;
}
.cover__sub {
  margin: 0;
  font-size: clamp(14px, 1.7vw, 18px);
  color: var(--ink-soft);
  font-style: italic;
}
.cover__hint {
  margin-top: 18px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .1em;
  color: #9c8b73;
  line-height: 1.9;
}

/* ---------------- obsah dole ---------------- */

.contents {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-family: var(--sans);
  font-size: 12px;
  color: #b9c4b2;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 100px;
  padding: 5px 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { background: rgba(255,255,255,.1); color: #f0f4ec; }
.chip.is-current { border-color: rgba(165,180,155,.55); color: #f0f4ec; }
.chip__count { font-size: 10.5px; opacity: .6; letter-spacing: .06em; }
.chip.is-done .chip__count { color: #9fc79b; opacity: .95; }

/* ---------------- animace otáčení listu ---------------- */

.flip {
  position: absolute;
  top: 0;
  height: 100%;
  width: 50%;
  transform-style: preserve-3d;
  transition: transform var(--flip-ms) cubic-bezier(.42, .04, .28, 1);
  pointer-events: none;
  z-index: 8;
  display: none;
}
.flip.is-active { display: block; }

.flip--right { left: 50%; transform-origin: left center; }
.flip--left  { left: 0;   transform-origin: right center; }

.flip__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  overflow: hidden;
  background: var(--paper);
}
.flip__front { transform: rotateY(0deg); }
.flip__back  { transform: rotateY(180deg); }

.flip__face > .page { width: 100%; }

/* stín, který po listu přejíždí */
.flip__face::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background: linear-gradient(to right, rgba(0,0,0,.28), rgba(0,0,0,0) 45%);
  opacity: 0;
  transition: opacity var(--flip-ms);
}
.flip.is-turning .flip__face::before { opacity: 1; }

/* ---------------- mobil / úzká okna ---------------- */

@media (max-width: 900px), (orientation: portrait) {
  .book {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    perspective: none;
    filter: none;
  }
  .book__spine { display: none; }
  .flip { display: none !important; }

  .book__spread {
    flex-direction: column;
    box-shadow: 0 14px 40px rgba(0,0,0,.5);
    transition: opacity .28s, transform .28s;
  }
  .book__spread.is-swapping { opacity: 0; transform: translateY(10px); }

  .page { width: 100%; box-shadow: none; }
  .page--left  { flex: 0 0 44%; }

  /* Pod obrázkem se roluje celý zápisník, ne jen seznam v něm —
     na úzké obrazovce se do pevné výšky stejně nevejde. */
  .page--right { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

  .notes {
    position: relative;
    inset: auto;
    min-height: 100%;
    padding: 18px 20px 16px;
  }
  .notes__list { flex: 0 0 auto; overflow: visible; padding-right: 0; }
  .notes__intro { margin-top: 10px; }

  .stage { gap: 4px; }
  .nav { width: 34px; height: 64px; font-size: 24px; }

  .cover { justify-content: flex-start; padding-top: 26px; }
}

/* ---------------- průhled dovnitř (detail hotspotu) ---------------- */

.detail {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 40px);
}
.detail[hidden] { display: none; }

.detail__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 11, 8, .72);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .28s;
}
.detail.is-open .detail__backdrop { opacity: 1; }

.detail__card {
  position: relative;
  display: flex;
  width: min(940px, 100%);
  max-height: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
  transform: scale(.9);
  opacity: 0;
  transform-origin: var(--ox, 50%) var(--oy, 50%);
  transition: transform .34s cubic-bezier(.2, .8, .3, 1), opacity .24s;
}
.detail.is-open .detail__card { transform: scale(1); opacity: 1; }

.detail__figure {
  flex: 0 0 46%;
  aspect-ratio: 1;            /* výchozí; JS ho přepíše podle obrázku */
  align-self: flex-start;     /* ať o výšce rozhoduje poměr stran, ne text vedle */
  margin: 0;
  position: relative;
  background: #cbd3c0;
}

.detail__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail__text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.6vw, 34px);
  overflow-y: auto;
}

.detail__kicker {
  margin: 0 0 10px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #a2917a;
}

.detail__title {
  margin: 0;
  font-size: clamp(21px, 2.4vw, 29px);
  font-weight: 500;
  line-height: 1.15;
}

.detail__short {
  margin: 12px 0 0;
  font-size: clamp(14px, 1.5vw, 16.5px);
  line-height: 1.6;
  color: #43382a;
}

.detail__more {
  margin: 12px 0 0;
  padding-left: 13px;
  border-left: 2px solid var(--paper-edge);
  font-size: clamp(13px, 1.42vw, 15.5px);
  line-height: 1.62;
  color: #5c4d38;
}

.detail__nav {
  margin-top: auto;
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail__step {
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
}
.detail__step:hover:not(:disabled) { text-decoration: underline; }
.detail__step:disabled { color: #bbac93; cursor: default; }

.detail__dots { display: flex; gap: 6px; }
.detail__dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(150, 128, 96, .3);
}
.detail__dots i.is-here { background: var(--accent); }

.detail__close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 249, 233, .8);
  color: #4b3f2e;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background .2s;
}
.detail__close:hover { background: #fff9e9; }

@media (max-width: 760px), (orientation: portrait) {
  .detail { padding: 0; }
  .detail__card {
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }
  .detail__figure { flex: 0 0 40%; aspect-ratio: auto; align-self: auto; }
  .detail__text { padding: 20px 20px 26px; }
}

/* ---------------- zvuk ---------------- */

.ghost-btn--icon {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

/* reproduktor s vlnkami; při vypnutém zvuku vlnky zhasnou a přeškrtne se */
.zvuk-ikona {
  position: relative;
  width: 13px;
  height: 12px;
  flex: 0 0 auto;
}
.zvuk-ikona::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 0;
  height: 0;
  border: 4px solid transparent;
  border-right-width: 7px;
  border-right-color: currentColor;
}
.zvuk-ikona::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 1px;
  width: 5px;
  height: 10px;
  border-right: 1.5px solid currentColor;
  border-radius: 0 50% 50% 0 / 0 50% 50% 0;
  opacity: .85;
}
.is-off .zvuk-ikona::after {
  border-right-color: transparent;
}
.is-off .zvuk-ikona::before {
  opacity: .5;
}
.is-off .zvuk-ikona {
  background: linear-gradient(to bottom right,
    transparent calc(50% - .7px), currentColor calc(50% - .7px),
    currentColor calc(50% + .7px), transparent calc(50% + .7px));
  opacity: .75;
}

/* tlačítko u jména zvířete — poslechnout, jak zní */
.hlas-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 28px;
  height: 28px;
  margin-left: 12px;
  padding: 0;
  color: var(--accent);
  background: none;
  border: 1px solid rgba(63, 97, 65, .35);
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
}
.hlas-btn:hover {
  background: rgba(63, 97, 65, .1);
  border-color: rgba(63, 97, 65, .6);
}
.hlas-btn:active { transform: scale(.92); }
.hlas-btn .zvuk-ikona { margin-left: -1px; }

/* ---------------- roční doba a část dne ---------------- */

/* barevný přeliv přes základní ilustraci, když varianta nemá vlastní obrázek */
.scene__prekryv {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

/* přepínač dole v okraji papíru */
.doby {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 12px 10px;
  flex-wrap: wrap;
}

.doba {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #9c8b73;
  background: none;
  border: 1px solid transparent;
  border-radius: 100px;
  padding: 3px 8px;
  cursor: pointer;
  transition: color .18s, border-color .18s, background .18s;
}
.doba:hover { color: var(--ink); border-color: var(--paper-edge); }
.doba.is-tady {
  color: var(--ink);
  border-color: var(--paper-edge);
  background: rgba(211, 191, 156, .35);
}

.doby__del {
  width: 1px;
  height: 13px;
  margin: 0 6px;
  background: var(--paper-edge);
  opacity: .8;
}

/* prolnutí při přepnutí doby */
.book__spread { transition: opacity .22s; }
.book__spread.is-fading { opacity: 0; }

@media (max-width: 900px), (orientation: portrait) {
  .doby { padding: 0 8px 6px; gap: 2px; }
  .doba { font-size: 9.5px; padding: 3px 6px; letter-spacing: .06em; }
}

/* ---------------- zavřená kniha ---------------- */

.deska {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 4vh 4vw;
  perspective: 2200px;
}
.deska[hidden] { display: none; }

/* dokud je kniha zavřená, dvojstrana za ní jen tiše čeká */
body.je-zavrena .book { opacity: 0; pointer-events: none; }
body.je-zavrena .contents,
body.je-zavrena .nav,
body.je-zavrena .topbar__counter { opacity: 0; pointer-events: none; }
.book, .contents, .nav, .topbar__counter { transition: opacity .45s; }

.deska__kniha {
  position: relative;
  display: block;
  height: min(78vh, calc(var(--book-w) * var(--book-ratio)));
  aspect-ratio: 0.68;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transform-style: preserve-3d;
}

/* hřbet vlevo, kolem kterého se deska odklápí */
.deska__hrbet {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -14px;
  width: 20px;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(to right, #23301f, #35482d 55%, #2b3a25);
  box-shadow: -6px 12px 26px rgba(0, 0, 0, .5);
}

.deska__predni {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5%;
  padding: 9% 8%;
  border-radius: 3px 6px 6px 3px;
  transform-origin: left center;
  transition: transform var(--flip-ms) cubic-bezier(.42, .04, .28, 1), box-shadow var(--flip-ms);
  backface-visibility: hidden;
  background:
    radial-gradient(120% 90% at 30% 20%, rgba(255,255,255,.07), rgba(0,0,0,0) 60%),
    linear-gradient(150deg, #3f5d3a, #2c4229 60%, #334b2f);
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,.25),
    0 22px 50px rgba(0,0,0,.55);
}

/* jemné plátno na desce */
.deska__predni::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: .5;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, rgba(0,0,0,0) 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 1px, rgba(0,0,0,0) 1px 3px);
}

.deska__ram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9% 7%;
  border: 1px solid rgba(226, 208, 160, .38);
  border-radius: 2px;
  text-align: center;
}

.deska__obraz {
  width: 100%;
  max-height: 46vh;
  object-fit: contain;
  border-radius: 2px;
  margin-bottom: 4px;
}

.deska__titul {
  font-family: var(--serif);
  font-size: clamp(22px, 3.4vh, 40px);
  letter-spacing: .06em;
  color: #e9dcb4;
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
}

.deska__podtitul {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(12px, 1.7vh, 17px);
  color: rgba(233, 220, 180, .68);
}

.deska__pobidka {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5%;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(233, 220, 180, .5);
  transition: color .25s;
}
.deska__kniha:hover .deska__pobidka { color: rgba(233, 220, 180, .85); }

/* odklopení */
.deska.je-otevirana .deska__predni {
  transform: rotateY(-168deg);
  box-shadow: 0 22px 50px rgba(0,0,0,.2);
}
.deska.je-otevirana .deska__hrbet { opacity: 0; transition: opacity var(--flip-ms); }
.deska.je-otevirana { pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .deska__predni { transition: none; }
}
