
    * {
      box-sizing: border-box;
    }
    body {
      margin: 0;
      display: flex;
      height: 100dvh;
      perspective: 900px;
      font: 16px/1.4 sans-serif;
      overflow: hidden;
      background-color: #232425;
    }

    html {
      font-size: clamp(13px, 1.6vw, 16px);
    }

    html, body { touch-action: auto; -webkit-user-select: auto; -webkit-touch-callout: default; }


    .book {
      position: relative;
      display: flex;
      left: 50%;
      margin-top: auto;
      margin-bottom: auto;
      pointer-events: none;
      transform-style: preserve-3d;
      transition: transform 0.3s ease;
      rotate: 1 0 0 30deg;
      transform: scale(var(--s,1)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
      transform-origin: center center;
      max-width: clamp(220px, 85vw, 375px);
      width: 100%;
      aspect-ratio: 3 / 4;
    }



    .page {
      --thickness: 2px;
      flex: none;
      display: flex;
      width: 100%;
      height: 100%;
      pointer-events: all;
      user-select: none;
      transform-style: preserve-3d;
      border: 1px solid #0008;
      transform-origin: left center;
      transition: transform 1s,
        rotate 1s ease-in
          calc((min(var(--i), var(--c)) - max(var(--i), var(--c))) * 50ms);
      translate: calc(var(--i) * -100%) 0px 0px;
      transform: translateZ(calc(var(--i) * var(--thickness)))
        translateZ(calc((var(--c) - var(--i) - 0.5) * 5px));
      rotate: 0 1 0 calc(clamp(0, var(--c) - var(--i), 1) * -180deg);
      position: relative;
      background: linear-gradient(
        180deg,
        #fff7df 0%,
        #f1dfb3 60%,
        #e9d5a0 100%
      );
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
      padding: 0.6rem;
      overflow: visible;
    }

    .front,
    .back {
      flex: none;
      width: 100%;
      height: 100%;
      padding: 0.6rem;
      backface-visibility: hidden;
      background-color: #fff;
      translate: 0px;
      box-shadow: inset 0 0 3px #0002;
      overflow: hidden;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .back {
      background-image: linear-gradient(to right, #fff 80%, #eee 100%);
      translate: -100% 0;
      rotate: 0 1 0 180deg;
    }

    .page::before {
      content: "";
      position: absolute;
      top: 0;
      right: -1px;
      width: var(--thickness);
      height: 100%;
      background: linear-gradient(to right, #ccc, #999);
      transform: rotateY(90deg) translateX(calc(var(--thickness) / 2));
      transform-origin: left;
    }

    .page .page-content {
      height: 100%;
      display: grid;
      grid-template-columns: 1fr;
      grid-template-rows: repeat(4, 1fr);
      gap: 0.5rem;
      align-content: start;
      padding: 0;
    }

    .entry {
      display: flex;
      flex-direction: row;
      gap: 0.6rem;
      align-items: stretch;
      background: linear-gradient(
        180deg,
        rgba(255, 255, 245, 0.96),
        rgba(255, 250, 230, 0.96)
      );
      border-radius: 8px;
      padding: 0.45rem;
      box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
      min-height: 0;
      border: 1px solid #b9924a;
      position: relative;
      overflow: hidden;
    }

    .entry::after {
      content: "";
      position: absolute;
      inset: 6px;
      border-radius: 6px;
      pointer-events: none;
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
    }

      .entry-image {
        aspect-ratio: 3 / 2;
        width: 100%;
        max-width: 25%;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        background: linear-gradient(180deg,#fbf6eb,#f3ead1);
        border-radius: 6px;
        padding: 6px;
        box-sizing: border-box;
      }


      .entry-image img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center center;
        display: block;
        max-width: none;
        border-radius: 4px;
      }


      .no-img {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px dashed #c9bfae;
        background: linear-gradient(180deg, #fbf6eb, #f3ead1);
        font-family: "IM Fell English SC", "IM Fell English", Georgia, serif;
        color: #3a2f21;
        padding: 0.25rem;
        text-align: center;
        font-size: 0.6rem;
        border-radius: 4px;
        }


      /*@media (max-width: 420px) {
        .entry-image { aspect-ratio: 4 / 3; max-width: none; width: 100%; min-height: 110px; }
        .entry-image img { max-height: 160px; }
      }*/


    .entry-text {
      flex: 1 1 67%;
      min-width: 0;
      display: flex;
      flex-direction: column;
      justify-content: start;
      gap: 0.125rem;
      padding-left: 0.15rem;
    }

    .devil-title {
      font-family: "IM Fell English SC", "IM Fell English", Georgia,
        "Times New Roman", serif;
      font-size: 0.75rem;
      margin: 0;
      color: #21160d;
    }

    .devil-meta {
      font-family: "EB Garamond", Georgia, "Times New Roman", serif;
      font-size: 0.6rem;
      margin: 0;
      color: #3b2e25;
    }

    .devil-abilities {
      font-family: "EB Garamond", Georgia, "Times New Roman", serif;
      font-size: 0.6rem;
      color: #2e2a23;
      line-height: 1.2;
      white-space: pre-wrap;
    }

    .cover {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 0.25rem;
      text-align: center;
      background-color: #7A5A3A;
      padding: 2rem;
    }
    .cover h1 {
      margin: 0;
      font-family: "IM Fell English SC", "Cinzel", Georgia, serif;
      font-size: 100%;
      font-variant: small-caps;
      letter-spacing: 1.5px;
    }
    .cover h3 {
      margin: 0;
      font-family: Georgia, "Times New Roman", serif;
      font-size: 0.85rem;
      color: #4a3b2e;
    }

    .backcover .back {
      background-color: #7A5A3A;
      background-image: none;
      color: #F6E9D7;
    }

    /*@media (max-width: 420px) {
      .page .page-content {
        grid-template-rows: repeat(4, auto);
      }
      .entry {
        flex-direction: column;
        padding: 0.5rem;
      }
      .entry-image {
        flex: 0 0 auto;
        width: 100%;
        max-width: 25%;
        min-height: 100px;
      }
      .entry-image img {
        height: 100%;
        width: auto;
        max-height: 160px;
      }
      .entry-text {
        padding-left: 0;
      }
    }*/

    .page .tab {
      right: -33px;
      width: 34px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 2px;
      background: linear-gradient(180deg,#fff7df,#f1dfb3);
      font-size: 0.65rem;
      color: #23160d;
      cursor: pointer;
      z-index: 9999;
      box-sizing: border-box;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      transition: opacity 0.2s ease;
    }

    .book .tab {
      position: absolute;
      right: -33px;
      pointer-events: auto;
    }

    .page .tab._auto {
      pointer-events: auto;
    }
    .page .tab.disabled {
      opacity: 0.45;
      cursor: default;
      pointer-events: none;
    }
    .page .tab:hover:not(.disabled) {
      opacity: 0.8;
    }

    /*@media (max-width: 420px) {
      .page .tab { right: -28px; width: 26px; font-size: 0.6rem; }
      .book .tab { right: -28px; width: 26px; font-size: 0.6rem; }
    }*/
    