:root { color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100dvh; background: #050505; color: #fff; font-family: Arial, sans-serif; overflow: hidden; }
.reader { height: 100dvh; min-height: 100svh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #050505; overflow: hidden; }
.reader__header { position: relative; display: flex; align-items: center; justify-content: center; min-height: 62px; padding: 10px 64px max(10px, env(safe-area-inset-top)); background: linear-gradient(180deg, #252525 0%, #171717 100%); border-bottom: 1px solid #414141; box-shadow: 0 2px 10px rgba(0,0,0,.45); }
.book { position: relative; min-height: 0; display: grid; place-items: center; padding: 0; touch-action: pan-y; }
.page-frame { position: relative; width: min(100vw, calc((100dvh - 124px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * .531)); margin: 0; aspect-ratio: 0.531 / 1; overflow: hidden; border: 0; border-radius: 0; background: #060606; box-shadow: none; }
.page-frame img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; transform-origin: center; }
.under-page { z-index: 1; filter: brightness(.72); }
#menu-page { z-index: 2; background: #060606; }
.page-frame.is-next #menu-page { animation: turn-next .34s cubic-bezier(.2,.7,.2,1) forwards; }
.page-frame.is-previous #menu-page { animation: turn-previous .34s cubic-bezier(.2,.7,.2,1) forwards; }
.page-shine { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(112deg, transparent 0 42%, rgba(255,255,255,.10) 50%, transparent 58%); opacity: .34; }
.tap-zone { position: absolute; top: 0; bottom: 0; width: 30%; z-index: 2; border: 0; background: transparent; }
.tap-zone--previous { left: 0; cursor: w-resize; }
.tap-zone--next { right: 0; cursor: e-resize; }
.reader__footer { display: flex; align-items: center; justify-content: center; gap: 22px; min-height: 62px; padding: 10px 20px max(10px, env(safe-area-inset-bottom)); background: linear-gradient(0deg, #151515 0%, #242424 100%); border-top: 1px solid #414141; box-shadow: 0 -2px 10px rgba(0,0,0,.45); }
.control, .fullscreen-control { width: 42px; height: 38px; border: 1px solid rgba(255,217,0,.55); border-radius: 12px; background: linear-gradient(180deg, #292710 0%, #121108 100%); color: #ffdc00; font-size: 28px; line-height: 1; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 2px 5px rgba(0,0,0,.32); }
.control:active { transform: scale(.94); }
.home-link { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-width: 148px; color: #f6d800; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.home-link img { display: block; width: auto; height: 27px; max-width: 67px; object-fit: contain; }
.home-link:active { opacity: .72; }
.fullscreen-control { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 22px; }
.fullscreen-control:active { transform: translateY(-50%) scale(.94); }
.page-count { min-width: 64px; text-align: center; color: #f8da17; font-size: 12px; font-weight: 800; letter-spacing: .12em; }
@keyframes turn-next { from { transform: translateX(0) rotateY(0); opacity: 1; } to { transform: translateX(-108%) rotateY(-15deg); opacity: .1; } }
@keyframes turn-previous { from { transform: translateX(0) rotateY(0); opacity: 1; } to { transform: translateX(108%) rotateY(15deg); opacity: .1; } }
@media (max-width: 420px) { .reader__header { min-height: 58px; padding-top: 8px; } .page-frame { width: min(100vw, calc((100dvh - 116px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * .531)); } .reader__footer { gap: 14px; min-height: 58px; padding-top: 8px; } .home-link { min-width: 136px; font-size: 10px; } .home-link img { height: 24px; max-width: 58px; } .fullscreen-control { right: 10px; } }
@media (prefers-reduced-motion: reduce) { .page-frame img { animation: none !important; } }
