/* Round 49 anime-peek (flag 'anime-peek', assets/peek.js, docs/anime-peek.md): the preview of a mentioned anime.
   A hover card for a mouse and keyboard focus, a bottom sheet after a tap on a touch screen. Same ink and paper as
   the app and the public pages; nothing moves for a reader who asked for less motion. */
[data-anime-peek] { cursor: pointer; text-decoration: underline dotted rgba(242, 238, 223, .45); text-underline-offset: 3px; }
[data-anime-peek]:focus-visible { outline: 2px solid var(--red, #ef4b3f); outline-offset: 2px; border-radius: 2px; }

.pk-card {
    position: fixed; z-index: 2147483000; top: 0; left: 0; width: min(340px, calc(100vw - 16px));
    padding: 12px; border: 1px solid rgba(242, 238, 223, .22); border-radius: 12px;
    color: var(--paper, #f2eedf); background: #1f1f23; box-shadow: 0 18px 44px rgba(0, 0, 0, .5);
    font: 14px/1.45 Arial, sans-serif; text-align: left; pointer-events: auto;
    opacity: 0; transform: translateY(4px); transition: opacity .14s ease, transform .14s ease;
}
.pk-card[hidden] { display: none; }
.pk-card.pk-in { opacity: 1; transform: none; }
.pk-card.pk-above { transform: translateY(-4px); }
.pk-card.pk-above.pk-in { transform: none; }

.pk-body { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: start; }
.pk-cover { width: 72px; aspect-ratio: 230 / 326; overflow: hidden; border-radius: 6px; background: #2a2a30; }
.pk-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pk-cover i { display: grid; place-items: center; height: 100%; color: rgba(242, 238, 223, .35); font: 700 26px/1 serif; font-style: normal; }
.pk-text { min-width: 0; }
.pk-title { margin: 0; font-size: 16px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pk-native { margin: 2px 0 0; color: rgba(242, 238, 223, .6); font-size: 12px; overflow-wrap: anywhere; }
.pk-meta { margin: 6px 0 0; color: rgba(242, 238, 223, .75); font-size: 12px; }
.pk-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }
.pk-tags li { padding: 2px 8px; border: 1px solid rgba(242, 238, 223, .2); border-radius: 999px; font-size: 11px; line-height: 1.5; }
.pk-tags .pk-score { border-color: transparent; color: #121212; background: var(--paper, #f2eedf); font-weight: 700; }
.pk-synopsis { display: -webkit-box; margin: 10px 0 0; overflow: hidden; color: rgba(242, 238, 223, .85); font-size: 13px; line-height: 1.5;
    -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; }
.pk-status { margin: 0; color: rgba(242, 238, 223, .7); font-size: 13px; }
.pk-skeleton .pk-cover, .pk-skeleton .pk-line { background: linear-gradient(90deg, #2a2a30 0%, #34343b 50%, #2a2a30 100%); background-size: 200% 100%; animation: pk-shine 1.1s linear infinite; }
.pk-line { height: 12px; margin: 6px 0 0; border-radius: 4px; }
.pk-line.pk-wide { height: 16px; width: 80%; margin-top: 0; }
.pk-line.pk-short { width: 55%; }
@keyframes pk-shine { to { background-position: -200% 0; } }

/* Touch: the bottom sheet. */
.pk-sheet {
    position: fixed; inset: auto 0 0 0; width: 100%; max-width: 560px; max-height: min(78vh, 640px); margin: 0 auto; padding: 0;
    border: 0; border-radius: 18px 18px 0 0; color: var(--paper, #f2eedf); background: #1f1f23;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, .55); font: 15px/1.5 Arial, sans-serif; overflow: hidden;
}
.pk-sheet[open] { display: flex; flex-direction: column; animation: pk-rise .22s ease-out; }
.pk-sheet::backdrop { background: rgba(0, 0, 0, .55); }
@keyframes pk-rise { from { transform: translateY(100%); } to { transform: none; } }
.pk-sheet-top { display: flex; align-items: center; justify-content: center; position: relative; min-height: 34px; touch-action: none; }
.pk-handle { width: 40px; height: 5px; border-radius: 3px; background: rgba(242, 238, 223, .3); }
.pk-close { position: absolute; top: 4px; right: 6px; width: 44px; height: 44px; border: 0; border-radius: 50%; color: inherit; background: transparent; font: 400 26px/1 Arial, sans-serif; cursor: pointer; }
.pk-close:focus-visible, .pk-open:focus-visible { outline: 2px solid var(--red, #ef4b3f); outline-offset: 2px; }
.pk-sheet-main { padding: 0 18px 4px; overflow-y: auto; overscroll-behavior: contain; }
.pk-sheet .pk-body { grid-template-columns: 96px 1fr; gap: 14px; }
.pk-sheet .pk-cover { width: 96px; }
.pk-sheet .pk-title { font-size: 19px; }
.pk-sheet .pk-synopsis { -webkit-line-clamp: 8; line-clamp: 8; font-size: 14px; }
.pk-sheet-actions { padding: 12px 18px max(16px, env(safe-area-inset-bottom)); }
.pk-open { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; border: 0; border-radius: 12px;
    color: #121212; background: var(--paper, #f2eedf); font: 800 15px/1.2 Arial, sans-serif; text-decoration: none; cursor: pointer; }
html.pk-lock { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
    .pk-card, .pk-card.pk-above { transition: none; transform: none; }
    .pk-sheet[open] { animation: none; }
    .pk-skeleton .pk-cover, .pk-skeleton .pk-line { animation: none; }
}
@media (forced-colors: active) {
    .pk-card, .pk-sheet { border: 1px solid CanvasText; }
}
