/* =====================================================================
   Hry – spoločné prvky
   ===================================================================== */
.game-area { position: relative; min-width: 0; }
.sorter, .detective, .express, .quiet, .callno-game, .returns { grid-template-columns: minmax(0, 1fr); }
.cn-stage { min-width: 0; }
.game-hint { margin: 12px 4px 0; text-align: center; color: rgba(243, 234, 212, .82); font-size: 19px; }
.plank { height: 8px; background: var(--vlakna), var(--dub); box-shadow: inset 0 2px 0 var(--dub-svetly), 0 2px 0 #2a180b; }
.drag-ghost { position: fixed; z-index: 150; left: 0; top: 0; margin: 0 !important; pointer-events: none;
    transform: translate(-50%, -60%) rotate(-8deg) scale(1.25); filter: drop-shadow(0 10px 6px rgba(0, 0, 0, .45)); transition: none !important; animation: none !important; }
@keyframes wobble { 20%, 60% { translate: -3px 0; } 40%, 80% { translate: 3px 0; } }
@keyframes popIn { 0% { scale: .6; opacity: 0; } 70% { scale: 1.08; opacity: 1; } 100% { scale: 1; } }

/* =====================================================================
   Zoraďovač
   ===================================================================== */
.sorter { display: grid; gap: 12px; }
.cart { position: relative; padding: 8px 10px 0; background: var(--vlakna), var(--dub); border-radius: 4px 4px 0 0;
    box-shadow: inset 0 3px 0 var(--dub-svetly), inset 0 -2px 0 #4a2d18, 0 4px 8px rgba(0, 0, 0, .4); }
.cart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 4px 8px 3px; margin-bottom: 6px;
    background: var(--zrno), var(--karton); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transform: rotate(-.6deg); }
.cart-head .typed { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cart-head .pencil { font-size: 18px; }
.cart-shelf { --row: 50px; display: flex; flex-wrap: wrap; align-items: flex-end; align-content: flex-start; gap: 0 3px; min-height: calc(var(--row) * 2); padding: 0 4px;
    background: repeating-linear-gradient(transparent 0 calc(var(--row) - 8px), #4a2d18 calc(var(--row) - 8px) calc(var(--row) - 7px), var(--dub-svetly) calc(var(--row) - 7px) calc(var(--row) - 5px), var(--dub-tmavy) calc(var(--row) - 5px) var(--row)); }
.cart-wheels { display: block; width: 100%; height: 22px; margin-top: 2px; }

.bookcase { display: grid; padding: 6px 6px 0; background: var(--vlakna-v), var(--orech); box-shadow: 0 0 0 6px var(--dub-tmavy), 0 8px 14px rgba(0, 0, 0, .5); margin: 6px; }
.sort-shelf { --row: 50px; position: relative; display: grid; grid-template-columns: 70px minmax(0, 1fr); align-items: end; min-height: var(--row);
    border-bottom: 8px solid var(--dub); box-shadow: 0 2px 0 #2a180b; margin-bottom: 6px; padding-top: 2px; cursor: pointer; transition: background .2s; }
.shelf-plate { align-self: center; margin: 0 6px 0 0; padding: 3px; border-radius: 3px;
    background: linear-gradient(160deg, var(--mosadz-svetla), var(--mosadz) 45%, var(--mosadz-tmava)); box-shadow: 0 1px 0 rgba(0, 0, 0, .4); }
.plate-inner { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 5px; padding: 3px 5px 2px; background: var(--zrno), var(--karton);
    font: 700 10.5px/1.1 var(--f-stroj); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25); }
.plate-inner b { grid-column: 1 / -1; font-weight: 700; }
.plate-inner .swatch { width: 15px; height: 15px; }
.plate-inner small { font: 600 15px/1 var(--f-ruka); color: var(--grafit); justify-self: end; }
.sort-shelf.complete .plate-inner small { color: var(--zelen); }
.shelf-books { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 3px; min-height: var(--row); padding: 0 4px; }
.sort-book { margin-top: calc(42px - var(--h)); margin-bottom: 8px; border: 0; padding: 0; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
    transform-origin: 50% 100%; transition: transform .2s cubic-bezier(.3, 1.5, .5, 1), opacity .2s; }
.shelf-books .sort-book { margin-bottom: 0; }
.sort-book:hover { transform: translateY(-3px); }
.sort-book.selected { transform: translateY(-9px) rotate(-7deg); outline: 2.5px dashed var(--karton-svetly); outline-offset: 2px; z-index: 2; }
.sort-book.dragging { opacity: .25; }
.sort-book.landed { animation: landed .36s ease; }
.sort-book.lean { transform: rotate(9deg); }
@keyframes landed { 0% { translate: 0 -16px; } 60% { translate: 0 2px; scale: 1 .95; } 100% { translate: 0 0; scale: 1; } }
.sorter .drop-over { background: rgba(251, 246, 234, .16); }
.sorter.has-selection .sort-shelf { background: rgba(251, 246, 234, .06); }
.sorter.has-selection .sort-shelf:hover { background: rgba(251, 246, 234, .18); }

/* =====================================================================
   Detektív
   ===================================================================== */
.detective { display: grid; gap: 10px; }
.det-case { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 12px 5px; background: var(--zrno), var(--karton); transform: rotate(-.5deg); box-shadow: 0 2px 3px rgba(0, 0, 0, .35); }
.det-case .typed { font-size: 14px; }
.det-case .pencil { font-size: 19px; }
.det-shelves { --rowh: clamp(40px, calc((100svh - 380px) / var(--rows)), 96px); padding: 8px 8px 0; margin: 6px; background: var(--vlakna-v), var(--orech); box-shadow: 0 0 0 6px var(--dub-tmavy), 0 8px 14px rgba(0, 0, 0, .5); }
.det-row { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 0 clamp(2px, .8vw, 5px); align-items: end; height: calc(var(--rowh) + 7px); padding: 0 2px; border-bottom: 7px solid var(--dub); box-shadow: 0 2px 0 #2a180b; margin-bottom: 6px; }
.det-book { width: 100%; height: calc(var(--rowh) * var(--hf)); border: 0; padding: 0; cursor: pointer; transform-origin: 50% 100%; transition: transform .15s; }
.det-book:hover { transform: translateY(-3px); }
.det-book.wrong { filter: saturate(.3) brightness(.75); animation: wobble .35s ease; cursor: default; }
.det-book.right { animation: popIn .4s ease; z-index: 2; outline: 3px solid var(--karton-svetly); outline-offset: 1px; }
.det-in { animation: shelfIn .4s cubic-bezier(.25, 1.2, .45, 1); }
.det-shuffle { animation: shuffle .55s ease; }
@keyframes shelfIn { from { opacity: 0; translate: 40px 0; rotate: 1deg; } to { opacity: 1; translate: 0 0; rotate: 0deg; } }
@keyframes shuffle { 0% { scale: 1; } 30% { scale: .96 .9; opacity: .4; } 100% { scale: 1; opacity: 1; } }

/* =====================================================================
   Rýchlik
   ===================================================================== */
.express { --belt-dur: .6s; display: grid; gap: 14px; }
.exp-slip { padding: 10px 14px 12px; background: var(--zrno), var(--karton-svetly); box-shadow: 0 3px 6px rgba(0, 0, 0, .45); transform: rotate(-.8deg); }
.exp-slip.flip { animation: slipFlip .5s ease; }
@keyframes slipFlip { 0% { rotate: 0deg; } 35% { scale: 1 .1; } 70% { scale: 1 1.05; } 100% { scale: 1 1; } }
.exp-slip-top { display: flex; justify-content: space-between; font-weight: 700; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; border-bottom: 1.5px solid var(--linka-cervena); padding-bottom: 6px; margin-bottom: 10px; }
.exp-target { display: flex; gap: 14px; align-items: center; }
.exp-swatch { width: 56px; height: 56px; border-radius: 4px; }
.exp-swatch .sym { width: 18px; height: 18px; }
.exp-target-name { display: block; font: 650 30px/1 var(--f-nadpis); font-variation-settings: "opsz" 72, "WONK" 1; }
.exp-target .pencil { display: block; font-size: 18px; margin-top: 4px; }
.belt-wrap { position: relative; height: 176px; margin: 6px; background: var(--vlakna), var(--orech); overflow: hidden;
    box-shadow: inset 0 14px 22px rgba(0, 0, 0, .45), 0 0 0 6px var(--dub-tmavy); }
.belt-track { position: absolute; left: 0; right: 0; bottom: 44px; height: 90px; z-index: 2; }
.belt { position: absolute; left: 6px; right: 6px; bottom: 14px; height: 32px; border-radius: 16px; background: #2b2724; overflow: hidden; box-shadow: inset 0 3px 0 #4a443f, 0 3px 0 #120f0c; }
.belt-rubber { position: absolute; inset: 5px 0; background: repeating-linear-gradient(90deg, #3d3833 0 18px, #262220 18px 22px); animation: beltMove var(--belt-dur) linear infinite; }
@keyframes beltMove { to { background-position: -22px 0; } }
.roller { position: absolute; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #a29d96, #4a4540); }
.roller.rl { left: 4px; } .roller.rr { right: 4px; }
.belt-check { position: absolute; left: 0; top: 0; bottom: 0; width: 50px; z-index: 1; border-right: 3px dashed rgba(251, 246, 234, .65); background: rgba(179, 49, 42, .22); }
.belt-check span { position: absolute; top: 10px; left: 50%; writing-mode: vertical-rl; transform: translateX(-50%) rotate(180deg); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--karton); text-shadow: none; }
.belt-book { position: absolute; left: 0; bottom: 0; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; will-change: transform; }
.belt-book .spine-sym { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
.belt-book .spine-sym .sym { width: 11px; height: 11px; }
.belt-book.recolor { animation: recolor .22s ease; }
@keyframes recolor { 50% { scale: 1.14 1; } }
.belt-book.pass { animation: pass .55s ease forwards; }
.belt-book.fail { animation: fail .55s ease forwards; }
@keyframes pass { 30% { translate: 0 -10px; } 100% { translate: -20px 40px; opacity: 0; } }
@keyframes fail { 30% { rotate: -14deg; } 100% { rotate: -75deg; translate: -16px 70px; opacity: 0; } }
.exp-cycle { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; background: rgba(243, 234, 212, .92); font-size: 12px; box-shadow: 0 2px 4px rgba(0, 0, 0, .3); }
.exp-cycle .typed { font-weight: 700; margin-right: 4px; }
.exp-cycle-list { display: inline-flex; align-items: center; gap: 5px; }
.cyc-arrow { font-style: normal; font-weight: 700; color: var(--grafit); }

/* =====================================================================
   Ticho v čitárni
   ===================================================================== */
.quiet { display: grid; gap: 12px; }
.q-meter { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 12px 9px; background: var(--zrno), var(--karton-svetly);
    box-shadow: 0 3px 6px rgba(0, 0, 0, .45); transform: rotate(-.5deg); }
.q-librarian svg { display: block; width: 54px; height: 54px; }
.q-librarian .lib-warn, .q-librarian .lib-angry { display: none; }
.q-meter.lvl-1 .lib-calm, .q-meter.lvl-2 .lib-calm, .q-meter.lvl-3 .lib-calm, .q-meter.erupt .lib-calm { display: none; }
.q-meter.lvl-1 .lib-warn, .q-meter.lvl-2 .lib-warn { display: inline; }
.q-meter.lvl-3 .lib-angry, .q-meter.erupt .lib-angry { display: inline; }
.q-meter.lvl-3 .lib-warn, .q-meter.erupt .lib-warn { display: none; }
.q-meter.lvl-3 .q-librarian, .q-meter.erupt .q-librarian { animation: wobble .4s ease infinite; }
.q-meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.q-meter-top .typed { font-weight: 700; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.q-meter-note { font-size: 17px; }
.q-bar { position: relative; height: 22px; border: 1.5px solid var(--atrament); background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(38, 34, 29, .28) calc(10% - 1px) 10%); overflow: hidden; }
.q-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: repeating-linear-gradient(-45deg, var(--grafit) 0 2.5px, transparent 2.5px 6px); transition: width .15s linear; }
.q-meter.lvl-2 .q-fill { background: repeating-linear-gradient(-45deg, #c4652b 0 3px, transparent 3px 6px); }
.q-meter.lvl-3 .q-fill { background: repeating-linear-gradient(-45deg, var(--pecat) 0 3.5px, transparent 3.5px 6px); }

@media (min-width: 700px) { .game-quiet .q-room { width: 100%; max-width: min(100% - 12px, calc((100svh - 250px) * 1.12)); justify-self: center; } }
.q-room { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 10px 6px; padding: 14px 8px 10px; margin: 6px;
    background:
        linear-gradient(rgba(0, 0, 0, .25), rgba(0, 0, 0, 0) 30%),
        repeating-linear-gradient(90deg, rgba(0, 0, 0, .14) 0 2px, transparent 2px 64px),
        var(--vlakna-v), #23402f;
    box-shadow: 0 0 0 6px var(--dub-tmavy), 0 8px 14px rgba(0, 0, 0, .5); }
.q-seat { position: relative; aspect-ratio: 100 / 116; padding: 0; border: 0; background: none; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.q-seat svg { position: absolute; left: 4%; right: 4%; bottom: 17%; width: 92%; height: auto; overflow: visible; }
.q-table { position: absolute; left: -3px; right: -3px; bottom: 0; height: 19%; background: var(--vlakna), var(--dub);
    box-shadow: inset 0 3px 0 var(--dub-svetly), 0 3px 4px rgba(0, 0, 0, .4); border-radius: 2px; }
.q-lamp { position: absolute; right: -16%; bottom: 96%; width: 34%; height: 78%; pointer-events: none; z-index: 1; }
.q-lamp::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 42%; background: linear-gradient(#3f8a5c, #24563a 70%); border-radius: 46% 46% 6px 6px / 90% 90% 6px 6px; border: 1.5px solid #173a25;
    box-shadow: 0 10px 16px rgba(250, 226, 150, .45); }
.q-lamp::after { content: ""; position: absolute; left: 44%; width: 12%; top: 40%; bottom: 0; background: var(--mosadz); box-shadow: 0 0 0 0 transparent; border-radius: 1px;
    border-bottom: 5px solid var(--mosadz-tmava); }
.q-say { position: absolute; top: 0; left: 50%; z-index: 2; display: none; padding: 1px 7px 0; white-space: nowrap; border-radius: 3px;
    font: 600 clamp(15px, 4.4vw, 21px)/1.1 var(--f-ruka); color: var(--pecat); background: rgba(251, 246, 234, .94); box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    transform: translateX(-50%) rotate(-5deg); }

.q-seat .q-head { transform-box: fill-box; transform-origin: 50% 90%; transition: transform .25s; }
.q-seat .q-eyes-open, .q-seat .q-eyes-shut, .q-seat .q-brows-angry, .q-seat .q-mouth-open, .q-seat .q-mouth-flat, .q-seat .q-blush,
.q-seat .q-prop, .q-seat .q-waves, .q-seat .q-arms-up, .q-seat .q-finger { display: none; }
.q-seat .q-page { transform-box: fill-box; transform-origin: 0% 50%; }

/* hluční */
.q-seat.noisy .q-waves { display: inline; animation: waves .45s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.q-seat.noisy .q-say { display: block; animation: sayPop .3s cubic-bezier(.3, 1.6, .5, 1); }
.q-seat.noisy .q-eyes-read { display: none; }
.q-seat.noisy .q-eyes-open { display: inline; }
.q-seat.n-phone .q-phone { display: inline; animation: buzz .12s linear infinite; transform-box: fill-box; transform-origin: center; }
.q-seat.n-snack .q-book { display: none; }
.q-seat.n-snack .q-snack { display: inline; animation: buzz .2s linear infinite; transform-box: fill-box; transform-origin: center; }
.q-seat.n-chat .q-mouth-calm, .q-seat.n-sneeze .q-mouth-calm, .q-seat.n-loud .q-mouth-calm, .q-seat.n-hum .q-mouth-calm { display: none; }
.q-seat.n-chat .q-mouth-open, .q-seat.n-sneeze .q-mouth-open, .q-seat.n-loud .q-mouth-open, .q-seat.n-hum .q-mouth-open { display: inline; }
.q-seat.n-chat .q-head { animation: chat .5s ease-in-out infinite alternate; }
.q-seat.n-sneeze .q-head { animation: sneeze 1.3s ease-in-out infinite; }
.q-seat.n-loud .q-head, .q-seat.n-hum .q-head { animation: bob .45s ease-in-out infinite alternate; }
@keyframes waves { from { opacity: .45; transform: scale(.92); } to { opacity: 1; transform: scale(1.08); } }
@keyframes sayPop { from { transform: translateX(-50%) rotate(-5deg) scale(.4); opacity: 0; } }
@keyframes buzz { 25% { transform: translate(1px, -1px) rotate(4deg); } 75% { transform: translate(-1px, 1px) rotate(-4deg); } }
@keyframes chat { from { transform: rotate(-9deg) translateX(-2px); } to { transform: rotate(7deg) translateX(2px); } }
@keyframes sneeze { 0%, 45% { transform: rotate(0) translateY(0); } 60% { transform: rotate(-10deg) translateY(-3px); } 72% { transform: rotate(8deg) translateY(3px); } 100% { transform: rotate(0); } }
@keyframes bob { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-2px) rotate(3deg); } }

/* návnady – hýbu sa, ale sú ticho */
.q-seat.d-stretch .q-book { display: none; }
.q-seat.d-stretch .q-arms-up { display: inline; animation: stretch 1s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
.q-seat.d-stretch .q-eyes-read { display: none; }
.q-seat.d-stretch .q-eyes-shut { display: inline; }
.q-seat.d-tea .q-mug { display: inline; animation: sip 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.q-seat.d-page .q-page { animation: pageTurn .9s ease-in-out infinite; }
@keyframes stretch { from { transform: scaleY(.94); } to { transform: scaleY(1.04); } }
@keyframes sip { 0%, 100% { transform: translateY(0); } 50% { transform: translate(-6px, -10px) rotate(-14deg); } }
@keyframes pageTurn { 0%, 20% { transform: scaleX(1); } 55% { transform: scaleX(-.1); } 100% { transform: scaleX(-1); } }

/* utíšení a urazení */
.q-seat.shushed .q-eyes-read { display: none; }
.q-seat.shushed .q-eyes-shut, .q-seat.shushed .q-blush, .q-seat.shushed .q-finger { display: inline; }
.q-seat.shushed .q-mouth-calm { display: none; }
.q-seat.shushed .q-head { transform: translateY(3px) scale(.96); }
.q-seat.offended .q-eyes-read, .q-seat.offended .q-mouth-calm { display: none; }
.q-seat.offended .q-eyes-open, .q-seat.offended .q-brows-angry, .q-seat.offended .q-mouth-flat { display: inline; }
.q-seat.offended .q-head { transform: rotate(-6deg); }
.q-seat.offended svg { animation: wobble .3s ease; }
.q-seat.q-swap svg { animation: popIn .45s ease; }
.q-seat:focus-visible { outline-offset: 2px; }

/* =====================================================================
   Signatúra
   ===================================================================== */
.callno-game { display: grid; gap: 12px; }
.cn-slip { position: relative; padding: 14px 16px 12px; background: var(--zrno), #fff6d8; box-shadow: 0 3px 6px rgba(0, 0, 0, .45); transform: rotate(-1deg); }
.cn-slip::before { content: ""; position: absolute; left: 0; right: 0; top: -5px; height: 10px; background: radial-gradient(circle at 5px 5px, var(--orech-hlboky) 2.6px, transparent 3px) 0 0 / 12px 10px repeat-x; }
.cn-slip.flip { animation: slipFlip .5s ease; }
.cn-slip-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 6px; border-bottom: 1.5px dashed var(--linka-cervena); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cn-slip-top .pencil { font-size: 17px; text-transform: none; letter-spacing: 0; }
.cn-code { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 10px 0 2px; }
.cn-num { font: 700 clamp(28px, 9vw, 40px)/1 var(--f-stroj); letter-spacing: .01em; }
.cn-auth { padding: 3px 9px 2px; border: 2.5px solid var(--atrament); font: 700 clamp(22px, 7vw, 30px)/1 var(--f-stroj); }
.cn-title { margin: 8px 0 0; font-size: 13.5px; color: var(--grafit); }

.cn-aisles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; margin: 6px; }
@media (min-width: 640px) { .cn-aisles { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); } }
.cn-aisle { position: relative; display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; min-height: 138px; padding: 10px 8px 0; border: 0; cursor: pointer;
    background: var(--vlakna-v), var(--dub); border-radius: 3px 3px 0 0; box-shadow: inset 0 0 0 4px var(--dub-tmavy), inset 0 6px 0 4px var(--dub-svetly), 0 5px 8px rgba(0, 0, 0, .45); transition: transform .15s; }
.cn-aisle:hover { transform: translateY(-3px); }
.cn-sign { display: block; padding: 6px 4px 5px; text-align: center; background: var(--zrno), var(--karton); box-shadow: 0 0 0 3px var(--mosadz), 0 0 0 4px var(--mosadz-tmava), 0 3px 4px rgba(0, 0, 0, .45); }
.cn-sign b { display: block; font: 700 34px/1 var(--f-stroj); }
.cn-sign small { display: block; min-height: 2.5em; margin-top: 3px; font: 700 10.5px/1.2 var(--f-stroj); color: var(--grafit); }
.cn-aisle-books { display: flex; align-items: flex-end; gap: 2px; height: 34px; margin-top: 10px; padding: 0 2px; border-bottom: 5px solid var(--dub-tmavy); }
.cn-aisle-books i { flex: 1; height: 80%; background: var(--tkanina), #2f5d8c; border-radius: 1px; }
.cn-aisle-books i:nth-child(2) { height: 95%; background-color: #7a2e35; } .cn-aisle-books i:nth-child(3) { height: 70%; background-color: #3d7a50; }
.cn-aisle-books i:nth-child(4) { height: 88%; background-color: #c9982d; } .cn-aisle-books i:nth-child(5) { height: 76%; background-color: #4f5d63; } .cn-aisle-books i:nth-child(6) { height: 92%; background-color: #6b4f8e; }
.cn-aisle.cn-wrong { animation: wobble .35s ease; }
.cn-aisle.cn-open { animation: popIn .3s ease; box-shadow: inset 0 0 0 4px var(--dub-tmavy), 0 0 0 3px var(--karton-svetly), 0 5px 8px rgba(0, 0, 0, .45); }

.cn-shelf-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 6px; padding: 6px 10px 5px; background: var(--zrno), var(--karton); font-size: 12.5px; box-shadow: 0 2px 3px rgba(0, 0, 0, .35); }
.cn-shelf-head .pencil { font-size: 17px; white-space: nowrap; }
.cn-shelf-frame { margin: 10px 6px 0; background: var(--vlakna-v), var(--orech); box-shadow: 0 0 0 6px var(--dub-tmavy), 0 8px 14px rgba(0, 0, 0, .5); }
.cn-shelf { display: flex; align-items: flex-end; gap: 3px; height: 216px; padding: 20px 12px 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
    border-bottom: 9px solid var(--dub); box-shadow: 0 2px 0 #2a180b; cursor: grab; scrollbar-width: thin; scrollbar-color: var(--dub-svetly) transparent; -webkit-overflow-scrolling: touch; }
.cn-shelf.grabbing { cursor: grabbing; }
.cn-shelf.grabbing .cn-book { pointer-events: none; }
.cn-book { flex: none; border: 0; padding: 0; cursor: pointer; transform-origin: 50% 100%; transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.cn-book:hover { transform: translateY(-7px); }
.cn-book .spine-band-b { bottom: 4%; }
.cn-label { display: flex; flex-direction: column; left: 3px; right: 3px; bottom: 11%; padding: 4px 0 3px; font: 700 10px/1.15 var(--f-stroj); }
.cn-label .cn-main { font-size: 12.5px; }
.cn-label .cn-rest { font-size: 9.5px; overflow: hidden; white-space: nowrap; }
.cn-label .cn-a { margin: 3px 3px 0; padding-top: 2px; border-top: 1px solid rgba(38, 34, 29, .35); font-size: 11px; }
.cn-book.cn-pulled { animation: pulled .85s ease forwards; z-index: 2; }
.cn-book.cn-peek { animation: peek .55s ease; }
@keyframes pulled { 35% { translate: 0 -34px; rotate: -5deg; } 100% { translate: 0 -70px; rotate: -8deg; opacity: 0; } }
@keyframes peek { 35% { translate: 0 -24px; rotate: 3deg; } 100% { translate: 0 0; rotate: 0deg; } }
.cn-index { display: flex; gap: 6px; overflow-x: auto; margin: 16px 6px 0; padding-bottom: 2px; scrollbar-width: none; }
.cn-index::-webkit-scrollbar { display: none; }
.cn-jump { flex: none; display: grid; gap: 2px; min-width: 66px; min-height: 46px; padding: 5px 8px 4px; border: 0; cursor: pointer; text-align: left;
    font: 700 12px/1.1 var(--f-stroj); background: var(--zrno), var(--karton); box-shadow: 0 2px 3px rgba(0, 0, 0, .35); border-top: 3px solid var(--tab-buff); }
.cn-jump small { font-size: 10.5px; color: var(--grafit); }
.cn-walk { animation: shelfIn .4s cubic-bezier(.25, 1.2, .45, 1); }

/* =====================================================================
   Vrátené knihy
   ===================================================================== */
.returns { --u: 26px; display: grid; gap: 12px; }
.rt-top { display: grid; grid-template-columns: minmax(92px, 30%) minmax(0, 1fr); gap: 10px; align-items: stretch; margin: 0 6px; }
.rt-chute { position: relative; display: flex; flex-direction: column; padding: 8px 8px 6px; border-radius: 4px; background: var(--vlakna-v), var(--dub);
    box-shadow: inset 0 3px 0 var(--dub-svetly), inset 0 0 0 3px var(--dub-tmavy), 0 4px 6px rgba(0, 0, 0, .4); }
.rt-chute-head { display: grid; justify-items: center; gap: 7px; padding: 6px 4px 7px; text-align: center; background: var(--zrno), var(--karton); box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.rt-chute-head .typed { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1.2; }
.rt-slot { display: block; width: 82%; height: 10px; border-radius: 3px; background: #1a0f07; border: 2px solid var(--mosadz); box-shadow: inset 0 3px 4px rgba(0, 0, 0, .9), 0 1px 0 var(--mosadz-svetla); }
.rt-pile { flex: 1; display: flex; flex-direction: column-reverse; align-items: center; gap: 1px; min-height: 92px; padding: 8px 0 4px; }
.rt-mini { display: block; flex: none; height: 13px; width: var(--mw); border-radius: 2px; background: var(--tkanina), var(--c); transform: rotate(var(--mr));
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25), inset 3px 0 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .35); }
.rt-mini.fall { animation: miniFall .7s ease-in forwards; }
@keyframes miniFall { to { transform: translate(var(--fx), 280px) rotate(var(--fr)); opacity: 0; } }
.rt-count { text-align: center; font-size: 21px; color: var(--karton); }
.rt-chute.warn .rt-count { color: #ffb4a8; animation: pulse .8s ease-in-out infinite; }
.rt-chute.rt-drop { animation: chuteDrop .3s ease; }
@keyframes chuteDrop { 40% { translate: 0 3px; } }

.rt-hand { display: grid; gap: 8px; padding: 8px 8px 10px; background: var(--zrno), var(--karton-svetly); box-shadow: 0 3px 6px rgba(0, 0, 0, .45); transform: rotate(.5deg); }
.rt-stage { position: relative; display: flex; align-items: flex-end; justify-content: center; height: calc(var(--u) * 6 + 10px);
    border-bottom: 2px solid var(--atrament); background: repeating-linear-gradient(transparent 0 calc(var(--u) - 1px), rgba(179, 199, 217, .6) calc(var(--u) - 1px) var(--u)); background-position: 0 100%; }
.rt-ruler { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed var(--pecat); pointer-events: none; }
.rt-ruler span { position: absolute; right: 0; bottom: 2px; font-size: 16px; color: var(--pecat); white-space: nowrap; }
.rt-current { position: relative; z-index: 1; display: flex; align-items: flex-end; min-height: 20px; }
.rt-current .rt-spine { position: relative; }
.rt-empty { margin-bottom: 18px; font-size: 19px; }
.rt-tools { display: flex; justify-content: center; gap: 10px; }
.rt-tools .tag-btn { min-height: 42px; padding: 8px 12px 7px; }
.rt-tools .tag-btn:nth-child(2) { --r: 2deg; }

.rt-case { margin: 6px; padding: 10px 8px 0; background: var(--vlakna-v), var(--orech); box-shadow: 0 0 0 6px var(--dub-tmavy), 0 8px 14px rgba(0, 0, 0, .5); overflow: hidden; }
.rt-shelf { position: relative; margin: 0 auto; border-top: 8px solid #2a180b; border-bottom: 10px solid var(--dub); box-shadow: 0 2px 0 #2a180b; box-sizing: content-box;
    background: linear-gradient(rgba(0, 0, 0, .35), rgba(0, 0, 0, 0) 40%); }
.rt-shelf .rt-spine { position: absolute; bottom: 0; }
.rt-gap { position: absolute; top: 0; bottom: 0; padding: 0; border: 2px dashed rgba(251, 246, 234, .5); border-radius: 2px; background: rgba(251, 246, 234, .06); cursor: pointer; }
.rt-gap:hover, .rt-gap.over { background: rgba(251, 246, 234, .22); border-color: var(--karton-svetly); }
.rt-spine { transition: none; }
.rt-in-hand { cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.rt-in-hand.dragging { opacity: .3; }
.rt-ghost { transform: translate(-50%, -50%) rotate(-4deg) scale(1.04); }
.rt-fresh { animation: rtSlide .32s ease; }
.rt-turn { animation: rtTurn .26s ease; }
.rt-nope { animation: wobble .35s ease; }
.rt-out { animation: rtOut .5s ease-in forwards; }
.rt-in { animation: shelfIn .45s cubic-bezier(.25, 1.2, .45, 1); }
@keyframes rtSlide { from { translate: 0 -18px; opacity: .4; } }
@keyframes rtTurn { from { rotate: -90deg; } }
@keyframes rtOut { to { translate: 115% 0; opacity: .2; } }

/* ležiaca kniha – titul a zlaté linky vodorovne */
.spine.lying .spine-title { writing-mode: horizontal-tb; top: 50%; left: 50%; transform: translate(-50%, -50%); max-height: none; max-width: 74%; }
.spine.lying .spine-band { top: 3px; bottom: 3px; width: 1.5px; height: auto; }
.spine.lying .spine-band-t { left: 9%; right: auto; }
.spine.lying .spine-band-b { left: auto; right: 9%; }
.spine.lying .spine-band.b1, .spine.lying .spine-band.b1.spine-band-b { box-shadow: none; }
