/* CY_BORG — кибердека: лист персонажа за столом. Выезжает снизу, раскрывается крышкой, «загружает» данные и занимает весь стол. */
.deck { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(2, 3, 8, .88); }
.deck[hidden] { display: none; }
.deck-body { position: relative; display: flex; flex-direction: column; width: min(1180px, 98vw); height: min(98dvh, 960px); perspective: 1500px; transform-origin: 50% 100%;
  border: 3px solid #000; border-radius: 14px 14px 8px 8px; background: linear-gradient(180deg, #171722, #08080e);
  box-shadow: 0 0 0 3px var(--p), 0 0 70px rgba(255, 61, 180, .45), 10px 10px 0 #000; }
.deck-body::before, .deck-body::after { content: ''; position: absolute; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: #2c2c3a; box-shadow: inset 0 0 0 2px #555; z-index: 3; pointer-events: none; }
.deck-body::before { left: 8px; } .deck-body::after { right: 8px; }

.deck-top { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 28px; background: #000; border-bottom: 4px solid var(--y); border-radius: 11px 11px 0 0; flex: 0 0 auto; }
.deck-top b { font-family: var(--f-head); font-size: 22px; text-transform: uppercase; letter-spacing: .04em; color: var(--y); margin-right: auto; overflow-wrap: anywhere; }
.deck-top small { font-family: var(--f-pix); font-size: 11px; letter-spacing: .14em; color: var(--c); }
.deck-leds { display: inline-flex; gap: 5px; }
.deck-leds i { width: 9px; height: 9px; border-radius: 50%; background: #31ff7a; box-shadow: 0 0 8px #31ff7a; }
.deck-leds i:nth-child(2) { background: var(--y); box-shadow: 0 0 8px var(--y); }
.deck-leds i:nth-child(3) { background: var(--p); box-shadow: 0 0 8px var(--p); }

.deck-lid { position: relative; flex: 1 1 auto; min-height: 0; display: flex; padding: 10px; transform-origin: 50% 100%; backface-visibility: hidden; }
.deck-lid::after { content: ''; position: absolute; inset: 10px; pointer-events: none; z-index: 4; mix-blend-mode: multiply;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, .55) 100%); }
.deck-screen { flex: 1 1 auto; min-width: 0; overflow: auto; overscroll-behavior: contain; padding: 14px; color: #fff; border: 3px solid #000;
  background: radial-gradient(ellipse at 50% 0, #0c1c2a, #05080f 70%); box-shadow: inset 0 0 50px rgba(24, 230, 255, .2), 0 0 0 2px var(--c);
  scrollbar-width: thin; scrollbar-color: var(--p) #0b0b12; }
.deck-screen:focus-visible { outline: 2px solid var(--y); outline-offset: -6px; }
.deck-screen .sheet { max-width: 100%; margin-top: 4px; }
.deck-screen .lv { max-width: 980px; margin: 0 auto 12px; }

.deck-boot { position: absolute; inset: 10px; z-index: 3; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 0 8%; background: #03060b; pointer-events: none; opacity: 0; visibility: hidden;
  font-family: var(--f-pix); font-size: clamp(14px, 2.4vw, 22px); letter-spacing: .12em; color: #31ff7a; text-shadow: 0 0 10px rgba(49, 255, 122, .7); }
.deck-boot span { opacity: 0; }
.deck-off { position: absolute; inset: 10px; z-index: 5; display: flex; align-items: center; justify-content: center; background: #03060b; pointer-events: none; visibility: hidden; transform-origin: 50% 50%;
  font-family: var(--f-pix); font-size: clamp(14px, 2.4vw, 22px); letter-spacing: .12em; color: #31ff7a; text-shadow: 0 0 10px rgba(49, 255, 122, .7); }

.deck-base { flex: 0 0 auto; display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 20px; background: #05050a; border-top: 3px solid #000; border-radius: 0 0 6px 6px;
  font-family: var(--f-pix); font-size: 11px; letter-spacing: .2em; color: rgba(255, 255, 255, .45); }
.deck-base i { flex: 1; height: 16px; background: repeating-linear-gradient(90deg, #1e1e2c 0 26px, transparent 26px 30px); border: 2px solid #000; opacity: .9; }
@media (max-width: 720px), (max-height: 620px) { .deck-base { display: none; } .deck-body { width: 100vw; height: 100dvh; border-radius: 0; box-shadow: none; } .deck-body::before, .deck-body::after { display: none; } .deck-top { padding-left: 14px; border-radius: 0; } .deck-top small { display: none; } .deck-top b { font-size: 19px; } .deck-lid { padding: 6px; } .deck-lid::after { inset: 6px; } .deck-boot, .deck-off { inset: 6px; } .deck-screen { padding: 10px; } }

@media (prefers-reduced-motion: no-preference) {
  .deck.open { animation: deck-fade .3s ease-out both; }
  .deck.open .deck-body { animation: deck-pull .62s cubic-bezier(.16, .9, .24, 1) both; }
  .deck.open .deck-lid { animation: deck-lid-open .55s cubic-bezier(.2, .9, .2, 1) .36s both; }
  .deck.open .deck-leds i { animation: deck-led 1.3s steps(2) infinite; }
  .deck.open .deck-leds i:nth-child(2) { animation-delay: -.4s; } .deck.open .deck-leds i:nth-child(3) { animation-delay: -.8s; }
  /* загрузка: бегущие строки, потом экран «включается» вертикальной развёрткой */
  .deck.open .deck-boot { visibility: visible; animation: deck-boot-out .28s ease-in 1.3s both; }
  .deck.open .deck-boot span { animation: deck-type .3s steps(2) both; }
  .deck.open .deck-boot span:nth-child(1) { animation-delay: .62s; } .deck.open .deck-boot span:nth-child(2) { animation-delay: .8s; } .deck.open .deck-boot span:nth-child(3) { animation-delay: .98s; }
  .deck.booting .deck-screen { animation: deck-scan .5s ease-out 1.28s both; }
  .deck.booting .deck-screen .lv-row, .deck.booting .deck-screen .lv-cond { animation: deck-line .35s cubic-bezier(.2, .8, .2, 1) both; }
  .deck.booting .deck-screen .lv-row:nth-child(1) { animation-delay: 1.4s; } .deck.booting .deck-screen .lv-row:nth-child(2) { animation-delay: 1.48s; }
  .deck.booting .deck-screen .lv-row:nth-child(3) { animation-delay: 1.56s; } .deck.booting .deck-screen .lv-cond { animation-delay: 1.64s; }
  .deck.booting .deck-screen .sheet { animation: deck-line .5s cubic-bezier(.2, .8, .2, 1) 1.7s both; }
  /* убрать: экран гаснет как старый ЭЛТ (линия → точка), светодиоды тухнут, крышка складывается, дека уезжает вниз (всё быстрее, чем выезд) */
  .deck.closing { pointer-events: none; animation: deck-fade .34s ease-in .46s reverse both; }
  .deck.closing .deck-leds i { animation: none; opacity: .15; box-shadow: none; }
  .deck.closing .deck-off { visibility: visible; animation: deck-off-in .1s ease-out both, deck-crt-off .24s cubic-bezier(.6, 0, .9, .4) .1s both; }
  .deck.closing .deck-screen { animation: deck-hide .01s linear .12s both; }
  .deck.closing .deck-lid { animation: deck-lid-close .2s ease-in .32s both; }
  .deck.closing .deck-body { animation: deck-away .34s cubic-bezier(.5, 0, .9, .4) .46s both; }
}
@keyframes deck-fade { from { opacity: 0; } }
@keyframes deck-pull { 0% { opacity: 0; transform: translateY(104%) rotateX(38deg) scale(.9); } 55% { opacity: 1; } 100% { transform: none; } }
@keyframes deck-away { to { opacity: 0; transform: translateY(104%) rotateX(30deg) scale(.92); } }
@keyframes deck-lid-open { from { transform: rotateX(-88deg); filter: brightness(.25); } to { transform: none; filter: none; } }
@keyframes deck-lid-close { to { transform: rotateX(-88deg); filter: brightness(.25); } }
@keyframes deck-off-in { from { opacity: 0; } }
@keyframes deck-crt-off { 0% { transform: scale(1, 1); opacity: 1; filter: brightness(1); } 70% { transform: scale(1, .02); opacity: 1; filter: brightness(3); } 100% { transform: scale(0, .02); opacity: 0; } }
@keyframes deck-hide { to { opacity: 0; } }
@keyframes deck-led { 50% { opacity: .25; } }
@keyframes deck-type { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; } }
@keyframes deck-boot-out { 0% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@keyframes deck-scan { from { clip-path: inset(0 0 100% 0); filter: brightness(2.2); } to { clip-path: inset(0); filter: none; } }
@keyframes deck-line { from { opacity: 0; transform: translateX(-14px); } }
@media print { .deck { display: none !important; } }

/* прокачка: экран деки вспыхивает */
@media (prefers-reduced-motion: no-preference) {
  .deck.levelup .deck-screen { animation: deck-levelup 1.2s ease-out; }
  .deck.levelup .deck-leds i { animation: deck-led .25s steps(2) 4; }
}
@keyframes deck-levelup { 0% { filter: brightness(2.6) saturate(1.6); box-shadow: inset 0 0 90px rgba(255, 61, 180, .8), 0 0 0 2px var(--p), 0 0 40px var(--p); } 100% { filter: none; } }
