/* Smocza Matematyka — Smocza Jaskinia: 'cave', 'hoard' (Skarbiec), 'stones' (Półka kamieni), 'journal' (Dziennik).
 * The only dark scene of the app: warm firelight, velvet and wood; the black dragon gets a light rim glow here.
 * All selectors are prefixed with .screen-<id> or .cv- (cave screens). Logical stage pixels (1280 x 800).
 */

/* ---------- shared: dragon rim light and body glow (open learner model, §4.2) ---------- */

.cv-rim .dragon {
  filter: drop-shadow(0 0 10px rgba(255, 196, 120, 0.42)) drop-shadow(0 0 2px rgba(255, 230, 190, 0.5));
}

/* fallback when the renderer has no setGlow(): body parts glow through the sticker rim (1 soft, 2 clear, 3 golden) */
.cv-glow-wings-1 .d-s-wing-l, .cv-glow-wings-1 .d-s-wing-r,
.cv-glow-tail-1 .d-s-tail,
.cv-glow-horns-1 .d-s-head,
.cv-glow-claws-1 .d-s-arm-l, .cv-glow-claws-1 .d-s-arm-r {
  fill: #fbe7b0;
  stroke: #fbe7b0;
}
.cv-glow-wings-2 .d-s-wing-l, .cv-glow-wings-2 .d-s-wing-r,
.cv-glow-tail-2 .d-s-tail,
.cv-glow-horns-2 .d-s-head,
.cv-glow-claws-2 .d-s-arm-l, .cv-glow-claws-2 .d-s-arm-r {
  fill: #ffd86b;
  stroke: #ffd86b;
}
.cv-glow-wings-3 .d-s-wing-l, .cv-glow-wings-3 .d-s-wing-r,
.cv-glow-tail-3 .d-s-tail,
.cv-glow-horns-3 .d-s-head,
.cv-glow-claws-3 .d-s-arm-l, .cv-glow-claws-3 .d-s-arm-r {
  fill: #ffc21f;
  stroke: #ffc21f;
  filter: drop-shadow(0 0 6px rgba(255, 200, 40, 0.9));
}
.cv-glow-eyes-1 .d-eye { filter: drop-shadow(0 0 2px rgba(255, 226, 120, 0.8)); }
.cv-glow-eyes-2 .d-eye { filter: drop-shadow(0 0 4px rgba(255, 214, 90, 0.95)); }
.cv-glow-eyes-3 .d-eye { filter: drop-shadow(0 0 7px rgba(255, 200, 40, 1)); }

/* speech bubble in the cave: warm parchment */
.cv-scene .guide-bubble,
.cv-sub .guide-bubble {
  background: #fff8e8;
  border-color: #3a2614;
  color: #2a1d12;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35), 0 0 24px rgba(255, 190, 110, 0.18);
}
.cv-scene .guide-repeat,
.cv-sub .guide-repeat {
  background: #f6e3bd;
}
/* no hyphenation in the dragon's words: she is just learning to read */
.cv-scene .guide-text,
.cv-sub .guide-text {
  hyphens: manual;
  -webkit-hyphens: manual;
}
.cv-lair-guide .guide-text {
  text-wrap: balance; /* two even lines instead of a lonely last word */
}

/* ---------- 'cave' hub ---------- */

.screen-cave {
  background: #160f1b;
}
.cv-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #160f1b;
  color: #fff3d6;
}
.cv-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cv-bg-svg {
  display: block;
}

.cv-mote {
  animation: cv-twinkle 5.5s ease-in-out infinite;
  opacity: 0.25;
}
.cv-mote.m1 { animation-delay: -1.4s; animation-duration: 6.5s; }
.cv-mote.m2 { animation-delay: -2.8s; animation-duration: 7.2s; }
.cv-mote.m3 { animation-delay: -4.1s; animation-duration: 5s; }
@keyframes cv-twinkle {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.85; }
}
.cv-crystal {
  animation: cv-crystal 6s ease-in-out infinite;
}
@keyframes cv-crystal {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

.cv-mapbtn {
  position: absolute;
  left: 24px;
  top: 18px;
  z-index: 10;
  min-height: 80px;
  background: #fff3d6;
  border-color: #c9a46a;
}
.cv-gold {
  position: absolute;
  right: 24px;
  top: 26px;
  z-index: 10;
}

/* name plate hanging above the lair */
.cv-plate {
  position: absolute;
  left: 470px;
  top: 0;
  width: 340px;
  height: 120px;
  padding: 0;
  border: 0;
  background: transparent;
  z-index: 12;
  transform-origin: 50% 0;
  animation: cv-sway 7s ease-in-out infinite;
}
.cv-plate:active {
  transform: translateY(3px);
}
.cv-plate-art {
  position: absolute;
  inset: 0;
  line-height: 0;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45));
}
.cv-plate-name {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 40px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 800;
  color: #fff6dc;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 0 #5a3418, 0 0 12px rgba(255, 210, 120, 0.35);
  white-space: nowrap;
}
@keyframes cv-sway {
  0%, 100% { transform: rotate(-0.8deg); }
  50% { transform: rotate(0.8deg); }
}

/* lair: the guide dragon in the middle with the nest around its feet */
.cv-nest {
  position: absolute;
  left: 420px;
  top: 468px;
  width: 440px;
  height: 150px;
  line-height: 0;
  pointer-events: none;
}
.cv-nest-back { z-index: 4; }
.cv-nest-front { z-index: 7; }

.cv-lair-guide.guide {
  position: absolute;
  left: 380px;
  top: 128px;
  width: 520px;
  height: 480px;
  display: block;
  z-index: 6;
  pointer-events: none;
}
.cv-lair-guide .guide-bubble {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 0;
  margin: 0;
  max-width: none;
  min-height: 0;
  overflow: visible; /* show the tail pointing at the dragon (the wide bubble never holds more than 2 lines) */
  padding: 16px 64px 16px 22px;
  font-size: 27px;
  text-align: center;
  pointer-events: auto;
}
.cv-lair-guide .guide-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -18px;
  margin-left: -16px;
  border: 16px solid transparent;
  border-top-color: #3a2614;
  border-bottom: 0;
}
.cv-lair-guide .guide-repeat {
  top: 50%;
  bottom: auto;
  margin-top: -20px;
  height: 40px;
}
.cv-lair-guide .guide-dragon {
  position: absolute;
  left: 50%;
  top: 152px;
  transform: translateX(-50%);
  pointer-events: auto;
}

/* doors and objects */
.cv-obj {
  position: absolute;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  z-index: 8;
  border-radius: 28px;
  transition: transform 0.12s ease;
}
.cv-obj:active {
  transform: translateY(4px) scale(0.98);
}
.cv-obj-art {
  position: relative;
  flex: none;
  display: block;
  line-height: 0;
}
.cv-obj-art > svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.cv-label {
  position: relative;
  z-index: 2;
  margin-top: -6px;
  padding: 5px 20px 7px;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff4d8, #f1dcae);
  color: #3a2614;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4), inset 0 -3px 0 rgba(160, 110, 40, 0.25);
}

/* golden material over the chest (absolute in the 340 x 250 art, scaled with it) */
.cv-vault-gold {
  position: absolute;
  left: 0;
  top: 0;
  width: 340px;
  height: 250px;
  pointer-events: none;
  transform-origin: 0 0;
  filter: drop-shadow(0 3px 2px rgba(60, 30, 0, 0.45));
}
.cv-vault-gold > .mat {
  position: absolute;
}
.cv-shelf-gems {
  position: absolute;
  left: 0;
  top: 0;
  width: 340px;
  height: 210px;
  pointer-events: none;
  transform-origin: 0 0;
}
.cv-shelf-gem {
  position: absolute;
  line-height: 0;
}
.cv-shelf-gem.on {
  filter: drop-shadow(0 0 8px rgba(255, 240, 200, 0.45));
}
.cv-candle {
  transform-origin: 55px 136px;
  animation: cv-flicker 2.6s ease-in-out infinite;
}

/* fire */
.cv-flames {
  transform-origin: 100px 110px;
  animation: cv-flicker 1.8s ease-in-out infinite;
}
.cv-flames .f2 {
  transform-origin: 100px 110px;
  animation: cv-flicker 1.3s ease-in-out -0.4s infinite;
}
.cv-fire-glow {
  animation: cv-glowpulse 3s ease-in-out infinite;
}
.cv-embers {
  display: none;
}
.cv-obj-fire.is-out .cv-flames,
.cv-obj-fire.is-out .cv-fire-glow {
  display: none;
}
.cv-obj-fire.is-out .cv-embers {
  display: inline;
  animation: cv-glowpulse 4s ease-in-out infinite;
}
.cv-obj-fire.is-out .cv-label {
  opacity: 0.75;
}
@keyframes cv-flicker {
  0%, 100% { transform: scale(1, 1); }
  30% { transform: scale(0.96, 1.06); }
  60% { transform: scale(1.03, 0.95); }
}
@keyframes cv-glowpulse {
  0%, 100% { opacity: 0.22; }
  50% { opacity: 0.38; }
}

/* mini-games: round stone medallions */
.cv-game-medal {
  width: 116px;
  height: 116px;
  margin-bottom: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 38% 32%, #5a4a62, #2e2434 70%);
  box-shadow: inset 0 0 0 7px var(--mod-color), inset 0 0 0 10px rgba(0, 0, 0, 0.35), 0 6px 0 rgba(0, 0, 0, 0.45), 0 0 26px rgba(255, 190, 110, 0.18);
  font-size: 58px;
  line-height: 1;
}
.cv-game-medal svg {
  width: 70px;
  height: 70px;
}
.cv-obj-game .cv-label {
  font-size: 22px;
  padding: 4px 14px 6px;
}

/* name picker: plaques on both sides of the dragon */
.cv-names {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(14, 9, 18, 0.74);
  opacity: 0;
  transition: opacity 0.25s;
}
.cv-names.show {
  opacity: 1;
}
.cv-scene.names-open .cv-lair-guide,
.cv-scene.names-open .cv-nest-front {
  z-index: 24;
}
.cv-scene.names-open .cv-nest-back {
  z-index: 22;
}
.cv-scene.names-open .cv-plate {
  z-index: 26;
}
.cv-scene.names-open .cv-gold {
  visibility: hidden; /* the close button takes its corner */
}
.cv-names-board {
  position: absolute;
  inset: 0;
}
.cv-names-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.cv-name {
  position: absolute;
  width: 330px;
  height: 104px;
  pointer-events: auto;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(180deg, #c58a50, #9a6232);
  box-shadow: inset 0 0 0 4px #3a220f, inset 0 0 0 9px rgba(255, 220, 160, 0.25), 0 6px 0 rgba(0, 0, 0, 0.5);
  color: #fff6dc;
  font-size: 38px;
  font-weight: 800;
  text-shadow: 0 2px 0 #5a3418;
  transition: transform 0.12s ease, box-shadow 0.2s;
}
.cv-name:active {
  transform: translateY(4px);
}
.cv-name:nth-child(1) { left: 40px; top: 150px; }
.cv-name:nth-child(2) { left: 40px; top: 278px; }
.cv-name:nth-child(3) { left: 40px; top: 406px; }
.cv-name:nth-child(4) { left: 40px; top: 534px; }
.cv-name:nth-child(5) { left: 910px; top: 150px; }
.cv-name:nth-child(6) { left: 910px; top: 278px; }
.cv-name:nth-child(7) { left: 910px; top: 406px; }
.cv-name:nth-child(8) { left: 910px; top: 534px; }
.cv-name.is-current::after {
  content: '';
  position: absolute;
  right: 16px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  background: #ffd24a;
  box-shadow: 0 0 10px rgba(255, 210, 74, 0.9);
}
.cv-name.is-picked {
  background: linear-gradient(180deg, #ffe08a, #f2b705);
  color: #3a220f;
  text-shadow: none;
  box-shadow: inset 0 0 0 4px #3a220f, 0 0 0 6px rgba(255, 220, 120, 0.55), 0 0 30px rgba(255, 200, 80, 0.7), 0 6px 0 rgba(0, 0, 0, 0.5);
}
.cv-names-close {
  position: absolute;
  right: 24px;
  top: 18px;
  width: 80px;
  height: 80px;
  border: 0;
  border-radius: 50%;
  background: #fff3d6;
  color: #3a2614;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cv-names-ok {
  position: absolute;
  left: 50%;
  top: 650px;
  transform: translateX(-50%);
  min-width: 300px;
}
.cv-names-ok:active:not(:disabled) {
  transform: translateX(-50%) translateY(4px);
}
.cv-names-ok.is-hidden {
  visibility: hidden;
}

/* ---------- sub-screens frame (hoard, stones, journal) ---------- */

.cv-sub {
  position: absolute;
  inset: 0;
  overflow: hidden;
  color: #fff3d6;
  background: #1a1220;
}
.cv-sub-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 62% 58%, rgba(255, 170, 90, 0.16), rgba(255, 170, 90, 0) 70%),
    radial-gradient(ellipse at 60% 30%, #3d2b41 0%, #261b2c 55%, #150e19 100%);
}
.cv-topbar {
  position: absolute;
  left: 0;
  top: 0;
  width: 1280px;
  height: 96px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 20px;
  background: linear-gradient(180deg, #120c16, #1d1423);
  border-bottom: 5px solid #c98f2a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  z-index: 10;
}
.cv-back {
  min-height: 74px;
  background: #fff3d6;
  border-color: #c9a46a;
}
.cv-back .btn-label {
  font-size: 26px;
}
.cv-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 38px;
  font-weight: 800;
  color: #ffe9b0;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
.cv-guide-col {
  position: absolute;
  left: 0;
  top: 96px;
  width: 240px;
  height: 704px;
  padding: 16px 12px 10px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(43, 31, 50, 0.92), rgba(30, 21, 36, 0.95));
  border-right: 3px solid #3e2e48;
  z-index: 6;
}
.cv-guide-col .guide {
  flex: 1;
}
.cv-guide-col .guide-bubble {
  font-size: 23px;
}
.cv-guide-col .guide-column .guide-bubble::after {
  border-top-color: #3a2614;
}
.cv-content {
  position: absolute;
  left: 240px;
  top: 96px;
  width: 1040px;
  height: 704px;
  overflow: hidden;
}

/* round page arrows (stones, journal) */
.cv-arrow {
  position: absolute;
  top: 300px;
  width: 96px;
  height: 96px;
  border: 0;
  border-radius: 50%;
  background: #fff3d6;
  color: #3a2614;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.45), 0 0 20px rgba(255, 200, 120, 0.25);
  z-index: 5;
  transition: transform 0.1s ease;
}
.cv-arrow:active {
  transform: translateY(4px);
}
.cv-arrow-prev { left: 8px; }
.cv-arrow-next { right: 8px; }
.cv-arrow.is-hidden {
  visibility: hidden;
}

/* ---------- 'hoard' (Skarbiec) ---------- */

.cv-trays {
  position: absolute;
  left: 20px;
  top: 16px;
  width: 1000px;
  height: 344px;
  display: flex;
  gap: 24px;
}
.cv-tray-col {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  border-radius: 24px;
}
.cv-tray-col:active .cv-tray {
  transform: translateY(3px);
}
.cv-tray-col-3 { width: 264px; }
.cv-tray-col-2 { width: 234px; }
.cv-tray-col-1 { width: 234px; }
.cv-tray-col-0 { width: 196px; }
.cv-tray {
  position: relative;
  height: 272px;
  padding: 0;
  border: 0;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 60% at 45% 35%, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 70%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.025) 0 3px, rgba(0, 0, 0, 0.03) 3px 6px),
    linear-gradient(180deg, #7b2245, #4d1029);
  box-shadow:
    inset 0 0 0 6px #d8a943,
    inset 0 0 0 9px #8a5d12,
    inset 0 8px 18px rgba(0, 0, 0, 0.45),
    0 6px 0 rgba(0, 0, 0, 0.45),
    0 0 28px rgba(255, 190, 90, 0.12);
  transition: box-shadow 0.3s, transform 0.1s;
}
.cv-pile {
  position: relative;
}
.cv-cell {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.cv-cell > .mat {
  filter: drop-shadow(0 2px 1px rgba(40, 10, 0, 0.55));
}
.cv-cell.cv-ghost > .mat {
  opacity: 0.16;
  filter: grayscale(0.3) brightness(1.5);
}
.cv-cell.is-new {
  animation: cv-drop 0.55s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
@keyframes cv-drop {
  0% { transform: translateY(-120px) scale(0.6); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.cv-tray.is-full {
  box-shadow:
    inset 0 0 0 6px #ffd24a,
    inset 0 0 0 9px #b98010,
    inset 0 8px 18px rgba(0, 0, 0, 0.45),
    0 6px 0 rgba(0, 0, 0, 0.45),
    0 0 0 5px rgba(255, 214, 90, 0.65),
    0 0 36px rgba(255, 200, 60, 0.75);
  animation: cv-full 1.8s ease-in-out infinite;
}
@keyframes cv-full {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}
.cv-cell.in-ten > .mat {
  filter: drop-shadow(0 0 5px rgba(255, 230, 120, 0.95));
}
.cv-tray-label {
  position: relative;
  flex: none;
  height: 62px;
  padding: 0;
  border: 0;
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  border-radius: 16px;
  background: rgba(255, 244, 216, 0.94);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cv-tray-name {
  transition: opacity 0.25s;
}
.cv-tray-card {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  line-height: 0;
}
.cv-tray-label.has-card .cv-tray-name {
  opacity: 0;
}
.cv-tray-label.show-card .cv-tray-card {
  opacity: 1;
}

/* bottom row: growth window (left) | number cards (centre) | bank under the small trays (right) */
.cv-cards {
  position: absolute;
  left: 352px;
  top: 392px;
  width: 336px;
  height: 292px;
  padding: 0 0 70px;
  border: 0;
  border-radius: 28px;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.cv-cards-glow {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 30px;
  bottom: 40px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 60%, rgba(255, 200, 110, 0.22), rgba(255, 200, 110, 0) 70%);
  pointer-events: none;
}
.cv-cards-stand {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 44px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(180deg, #c48a52, #8f5a2e);
  box-shadow: inset 0 0 0 3px #4a2a12, inset 0 6px 0 rgba(255, 220, 170, 0.25), 0 10px 14px rgba(0, 0, 0, 0.5);
}
.cv-cards .mat-cardstack {
  position: relative;
  transition: opacity 0.3s;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.45));
}
.cv-cards.is-out .mat-cardstack {
  opacity: 0.28;
}
.cv-cards:active .mat-cardstack {
  transform: translateY(3px);
}

.cv-bank-zone {
  position: absolute;
  left: 712px;
  top: 384px;
  width: 308px;
  height: 312px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}
.cv-bank {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 24px;
  transition: opacity 0.35s, filter 0.35s;
}
/* resting bank: quiet and a little dim; it lights up when ten pieces wait */
.cv-bank-zone:not(.is-on) .cv-bank {
  opacity: 0.62;
  filter: saturate(0.7);
}
.cv-bank-zone.is-on .cv-bank-tray {
  box-shadow: 0 0 0 5px rgba(255, 214, 90, 0.55), 0 0 30px rgba(255, 200, 60, 0.55);
  border-radius: 24px;
}
.cv-showme {
  min-width: 220px;
  transition: opacity 0.35s, transform 0.35s;
}
.cv-bank-zone:not(.is-on) .cv-showme {
  visibility: hidden;
  opacity: 0;
  transform: translateY(16px);
}
.cv-bank-tray {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cv-bank-tray.is-merging {
  animation: cv-merge 0.5s ease-in-out;
}
@keyframes cv-merge {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.06); filter: brightness(1.6); }
  100% { transform: scale(1); filter: brightness(1); }
}
.cv-bank-pile {
  position: relative;
}
.cv-bank-label {
  margin-top: -4px;
  padding: 2px 18px 4px;
  border-radius: 14px;
  background: #fff3d6;
  color: #3a2614;
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
}
.cv-bank-count {
  position: absolute;
  right: -18px;
  top: -18px;
  min-width: 52px;
  height: 52px;
  padding: 0 8px;
  border-radius: 26px;
  background: radial-gradient(circle at 35% 30%, #fff6c4, #f2b705 60%, #c98f00);
  color: #3a2614;
  font-family: var(--font-num);
  font-size: 30px;
  font-weight: 800;
  line-height: 52px;
  text-align: center;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4);
}
.cv-bank-count:empty {
  display: none;
}
.cv-fly-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 12px rgba(255, 220, 90, 0.95));
}

/* growth window: a round hole in the cave roof with the night sky; current dragon -> golden steps -> next stage */
.cv-growth {
  position: absolute;
  left: 20px;
  top: 400px;
  width: 300px;
  height: 280px;
  padding: 0;
  border: 0;
  border-radius: 30px;
  background: transparent;
  box-shadow: 0 0 0 6px #3a2a40, 0 0 0 9px #5c4864, 0 10px 24px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.cv-growth:active {
  transform: translateY(3px);
}
.cv-growth-sky {
  position: absolute;
  inset: 0;
  line-height: 0;
}
.cv-growth-now,
.cv-growth-next {
  position: absolute;
  line-height: 0;
}
.cv-growth-now {
  left: 8px;
  bottom: 10px;
}
.cv-growth-next {
  right: 10px;
  top: 8px;
}
.cv-growth-now .dragon {
  filter: drop-shadow(0 0 8px rgba(255, 196, 120, 0.5));
}
.cv-growth-next .dragon {
  filter: brightness(0) drop-shadow(0 0 2px rgba(255, 214, 120, 0.95)) drop-shadow(0 0 12px rgba(255, 190, 80, 0.55));
  opacity: 0.95;
}
.cv-growth-q {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #ffe08a;
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 0 10px rgba(255, 200, 80, 0.9);
}
.cv-path {
  position: absolute;
  inset: 0;
}
.cv-step {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid rgba(255, 214, 120, 0.45);
  background: rgba(10, 8, 30, 0.45);
}
.cv-step.on {
  border-color: #b98010;
  background: radial-gradient(circle at 35% 30%, #fff6c4, #f2b705 60%, #c98f00);
  box-shadow: 0 0 9px rgba(255, 200, 60, 0.85);
}
.cv-growth.is-max .cv-step {
  border-color: #b98010;
  background: radial-gradient(circle at 35% 30%, #fff6c4, #f2b705 60%, #c98f00);
}
.cv-growth-crown {
  position: absolute;
  right: 40px;
  top: 40px;
  color: #ffd24a;
  line-height: 0;
  filter: drop-shadow(0 0 12px rgba(255, 200, 60, 0.95));
}

/* ---------- 'stones' (Półka kamieni) ---------- */

.cv-tabs {
  position: absolute;
  left: 0;
  top: 14px;
  width: 1040px;
  height: 100px;
  display: flex;
  justify-content: center;
  gap: 24px;
}
.cv-tab {
  position: relative;
  width: 96px;
  height: 96px;
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: rgba(255, 244, 216, 0.08);
  box-shadow: inset 0 0 0 3px rgba(255, 220, 160, 0.2), 0 5px 0 rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s, background 0.2s;
}
.cv-tab:not(.has-earned) .stone {
  opacity: 0.55;
  filter: saturate(0.6);
}
.cv-tab.is-on {
  background: rgba(255, 232, 170, 0.22);
  box-shadow: inset 0 0 0 4px #ffd24a, 0 0 22px rgba(255, 210, 90, 0.55), 0 5px 0 rgba(0, 0, 0, 0.35);
  transform: translateY(-4px);
}
.cv-tab:active {
  transform: translateY(2px);
}

.cv-shelfwall {
  position: absolute;
  left: 116px;
  top: 134px;
  width: 808px;
  height: 516px;
}
.cv-shelfwall.slide-l { animation: cv-slide-l 0.4s ease both; }
.cv-shelfwall.slide-r { animation: cv-slide-r 0.4s ease both; }
@keyframes cv-slide-l {
  from { transform: translateX(60px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes cv-slide-r {
  from { transform: translateX(-60px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.cv-plank {
  position: relative;
  height: 172px;
}
.cv-plank-row {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 166px;
  display: flex;
  justify-content: center;
  gap: 24px;
}
.cv-plank-wood {
  position: absolute;
  left: -14px;
  right: -14px;
  top: 112px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(180deg, #c48a52, #8f5a2e);
  box-shadow: inset 0 0 0 3px #4a2a12, 0 8px 10px rgba(0, 0, 0, 0.45);
}
.cv-plank.is-empty .cv-plank-wood {
  opacity: 0.6;
}
.cv-slot {
  position: relative;
  width: 176px;
  height: 168px;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff3d6;
  border-radius: 20px;
  z-index: 1;
}
.cv-gem {
  height: 116px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  line-height: 0;
  position: relative;
  z-index: 2;
}
.cv-slot.is-earned .cv-gem .stone {
  filter: drop-shadow(0 0 10px rgba(255, 240, 210, 0.45)) drop-shadow(0 4px 2px rgba(0, 0, 0, 0.5));
}
.cv-slot.is-newest .cv-gem::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 30px;
  width: 120px;
  height: 120px;
  margin-left: -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 240, 190, 0.5), rgba(255, 240, 190, 0) 65%);
  z-index: -1;
  animation: cv-glowpulse2 2.4s ease-in-out infinite;
}
@keyframes cv-glowpulse2 {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.cv-beadbar {
  position: absolute;
  top: 136px;
  display: flex;
  gap: 3px;
  z-index: 3;
}
.cv-bb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid rgba(255, 220, 150, 0.55);
  background: rgba(0, 0, 0, 0.35);
}
.cv-bb.on {
  border-color: #b98010;
  background: radial-gradient(circle at 35% 30%, #fff6c4, #f2b705 60%, #c98f00);
}
.cv-slot-name {
  position: absolute;
  top: 132px;
  left: 0;
  right: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  color: #fff0cf;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
}
.cv-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  display: flex;
  justify-content: center;
  gap: 14px;
}
.cv-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid rgba(255, 220, 150, 0.6);
}
.cv-dot.on {
  background: #ffd24a;
  border-color: #ffd24a;
}

/* ---------- 'journal' (Smoczy Dziennik) ---------- */

.cv-book {
  position: absolute;
  left: 112px;
  top: 14px;
  width: 816px;
  height: 676px;
  perspective: 1600px;
}
.cv-book-cover {
  position: absolute;
  inset: -12px -14px;
  border-radius: 26px;
  background: linear-gradient(180deg, #6b2a3a, #4a1626);
  box-shadow: inset 0 0 0 5px #2e0c16, inset 0 0 0 9px #b98a3a, 0 12px 30px rgba(0, 0, 0, 0.6);
}
.cv-page {
  position: absolute;
  top: 0;
  width: 408px;
  height: 676px;
  overflow: hidden;
  padding: 22px 26px 20px;
  background:
    radial-gradient(ellipse 80% 70% at 50% 40%, #fffaf0, #f6ead0 80%, #ead9b6 100%);
  color: #3a2614;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cv-page-left {
  left: 0;
  border-radius: 18px 4px 4px 18px;
  box-shadow: inset -18px 0 22px -14px rgba(90, 60, 20, 0.55);
}
.cv-page-right {
  left: 408px;
  border-radius: 4px 18px 18px 4px;
  box-shadow: inset 18px 0 22px -14px rgba(90, 60, 20, 0.55);
}
.cv-book-spine {
  position: absolute;
  left: 404px;
  top: 0;
  width: 8px;
  height: 676px;
  background: linear-gradient(90deg, rgba(90, 60, 20, 0.3), rgba(90, 60, 20, 0.05), rgba(90, 60, 20, 0.3));
}
.cv-book.turn-l .cv-page-right,
.cv-book.turn-r .cv-page-left {
  animation: cv-turn 0.45s ease both;
}
.cv-book.turn-l .cv-page-right { transform-origin: 0 50%; }
.cv-book.turn-r .cv-page-left { transform-origin: 100% 50%; }
@keyframes cv-turn {
  from { transform: rotateY(-70deg); filter: brightness(0.8); }
  to { transform: none; filter: none; }
}
.cv-book.turn-r .cv-page-left {
  animation-name: cv-turn-r;
}
@keyframes cv-turn-r {
  from { transform: rotateY(70deg); filter: brightness(0.8); }
  to { transform: none; filter: none; }
}

.cv-title-page {
  flex: 1;
  border: 0;
  padding: 10px 0 0;
  background: transparent;
  color: #3a2614;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.cv-tp-title {
  font-size: 42px;
  font-weight: 800;
  color: #6b2a3a;
}
.cv-tp-pic {
  line-height: 0;
  padding: 14px 18px 8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 210, 120, 0.4), rgba(255, 210, 120, 0) 70%);
}
.cv-tp-names {
  font-size: 30px;
  font-weight: 700;
  color: #5a3a1a;
  padding-top: 8px;
  border-top: 3px dashed #d9c39a;
}
.cv-blank {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.cv-day-head {
  flex: none;
  border: 0;
  padding: 6px 4px 12px;
  background: transparent;
  color: #3a2614;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border-bottom: 3px dashed #d9c39a;
  text-align: left;
  min-height: 72px;
}
.cv-day-rel {
  font-size: 34px;
  font-weight: 800;
  color: #6b2a3a;
  line-height: 1.1;
}
.cv-day-date {
  font-size: 24px;
  font-weight: 700;
  color: #7a5a3a;
}
.cv-day-list {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 10px;
}
.cv-day-row {
  min-height: 96px;
  max-height: 128px;
  border: 0;
  padding: 8px 14px 8px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 2px #e6d4b0;
  display: flex;
  align-items: center;
  gap: 24px;
  color: #3a2614;
  text-align: left;
}
.cv-day-row:active {
  transform: translateY(2px);
}
.cv-day-icon {
  position: relative;
  flex: none;
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--mod-color) 22%, #fff8e8);
  box-shadow: inset 0 0 0 4px var(--mod-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 46px;
  line-height: 1;
}
.cv-day-icon svg {
  width: 56px;
  height: 56px;
}
.cv-day-icon.small {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  font-size: 32px;
}
.cv-day-icon.small svg {
  width: 38px;
  height: 38px;
}
.cv-day-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cv-day-name {
  font-size: 22px;
  font-weight: 800;
  color: #6b4a2a;
}
.cv-day-sum {
  font-size: 22px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.cv-day-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cv-day-times {
  display: flex;
  gap: 5px;
  margin-top: 3px;
}
.cv-day-times i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6c4, #f2b705 60%, #c98f00);
}
.cv-day-mood {
  position: absolute;
  right: -14px;
  bottom: -12px;
  line-height: 0;
  border-radius: 50%;
  box-shadow: 0 2px 0 rgba(90, 60, 20, 0.25);
}
.cv-day-mood svg {
  width: 46px;
  height: 46px;
}
.cv-day-foot {
  flex: none;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}
.cv-day-rest {
  display: flex;
  gap: 10px;
  padding: 4px 6px;
}
.cv-day-gems {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border: 0;
  padding: 8px 12px;
  border-radius: 18px;
  background: rgba(107, 42, 58, 0.08);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 72px;
}

/* ---------- reduced motion ---------- */

.reduced-motion .cv-mote,
.reduced-motion .cv-crystal,
.reduced-motion .cv-plate,
.reduced-motion .cv-flames,
.reduced-motion .cv-flames .f2,
.reduced-motion .cv-fire-glow,
.reduced-motion .cv-candle,
.reduced-motion .cv-tray.is-full,
.reduced-motion .cv-slot.is-newest .cv-gem::after {
  animation: none;
}
.reduced-motion .cv-cell.is-new,
.reduced-motion .cv-shelfwall.slide-l,
.reduced-motion .cv-shelfwall.slide-r,
.reduced-motion .cv-book .cv-page {
  animation-name: cv-fade;
}
@keyframes cv-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .cv-mote,
  .cv-crystal,
  .cv-plate,
  .cv-flames,
  .cv-flames .f2,
  .cv-fire-glow,
  .cv-candle,
  .cv-tray.is-full,
  .cv-slot.is-newest .cv-gem::after {
    animation: none;
  }
  .cv-cell.is-new,
  .cv-shelfwall.slide-l,
  .cv-shelfwall.slide-r,
  .cv-book .cv-page {
    animation-name: cv-fade;
  }
}
