/* Shelf appearance reused from narumori/tools/bookshelf/public/app.css. */
/* 本棚 トップ（棚の画面） */

:root {
  --row: 124px;          /* 棚1段の高さ（板を含む） */
  --plank: 14px;         /* 棚板の厚み */
  --headroom: 14px;      /* 本の上のすき間 */
  --item-h: calc(var(--row) - var(--plank) - var(--headroom));
  --cover-w: 58px;       /* 表紙の最小幅（1段5冊ほど） */
  --spine-scale: 1;
  --pad: 8px;
  --topbar-h: 48px;
  --band-h: 32px;
  --tabbar-h: 54px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  --ink: #fff;
  --link: #3d9cf5;
  --wood: #8a4b1f;
  --cover-font: 10px;
  --spine-font: 9px;

  /* 背板の木目（縦目） */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.09 0.0035' numOctaves='4' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.22 0 0 0 0 0.09 0 0 0 0 0.02 1.7 0 0 0 -0.62'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  /* 棚板の木目（横目） */
  --grain-h: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='60'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.004 0.35' numOctaves='3' seed='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.25 0 0 0 0 0.1 0 0 0 0 0.02 1.6 0 0 0 -0.6'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

@media (min-width: 700px) {
  :root {
    --row: 176px;
    --plank: 18px;
    --headroom: 18px;
    --cover-w: 100px;
    --spine-scale: 1.4;
    --pad: 28px;
    --topbar-h: 52px;
    --band-h: 38px;
    --tabbar-h: 58px;
    --cover-font: 13px;
    --spine-font: 12px;
  }
}


body.bookshelf-page .band {
  position: sticky;
  top: calc(var(--topbar-h) + var(--safe-top));
  z-index: 10;
  display: flex;
  align-items: center;
  height: var(--band-h);
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
  background:
    linear-gradient(rgba(255, 220, 170, .35), rgba(255, 220, 170, 0) 30%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, .35)),
    var(--grain-h) 0 0 / 420px 100%,
    #b8662c;
  box-shadow: 0 3px 6px rgba(0, 0, 0, .55);
  font-size: 15px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
}

body.bookshelf-page .wall {
  min-height: calc(100dvh - var(--topbar-h) - var(--safe-top) - var(--band-h));
  padding: 0 var(--pad) calc(var(--tabbar-h) + var(--safe-bottom) + var(--row));
  background-color: var(--wood);
  background-image:
    /* 段ごと：上の棚板が落とす影／棚板の天面と前面 */
    linear-gradient(
      rgba(0, 0, 0, .55) 0,
      rgba(0, 0, 0, 0) 16px,
      rgba(0, 0, 0, 0) calc(var(--row) - var(--plank) - 6px),
      rgba(0, 0, 0, .28) calc(var(--row) - var(--plank)),
      rgba(222, 150, 88, .95) calc(var(--row) - var(--plank)),
      rgba(196, 117, 56, .9) calc(var(--row) - var(--plank) + 3px),
      rgba(150, 78, 30, .9) calc(var(--row) - 3px),
      rgba(70, 32, 10, .95) var(--row)
    ),
    /* 左右の側板の影 */
    linear-gradient(90deg, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0) 14px, rgba(0, 0, 0, 0) calc(100% - 14px), rgba(0, 0, 0, .45)),
    var(--grain);
  background-size: 100% var(--row), 100% 100%, 420px 420px;
  background-repeat: repeat-y, no-repeat, repeat;
}

body.bookshelf-page .wall__empty {
  margin: 0;
  height: var(--row);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fbe9d0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}

*{box-sizing:border-box}[hidden]{display:none!important}html,body{margin:0}
body.bookshelf-page{background:#1b0f07;color:#fff;font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic",sans-serif;-webkit-font-smoothing:antialiased;line-height:1.5}
body.bookshelf-page .topbar{position:sticky;top:0;z-index:20;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;height:calc(var(--topbar-h) + var(--safe-top));padding:var(--safe-top) 12px 0;gap:0;background:#000;color:#fff;border:0}
body.bookshelf-page .topbar__back{justify-self:start;color:var(--link);font-size:17px;text-decoration:none;white-space:nowrap;display:flex;align-items:center;min-height:44px}
body.bookshelf-page .topbar__title{font-size:15px;font-weight:700;line-height:1.5;margin:0;padding:5px 10px;border:1px solid #6b6b6b;border-radius:6px;background:linear-gradient(#2a2a2a,#0d0d0d);color:white;white-space:nowrap}
body.bookshelf-page .ga-global-actions{justify-self:end;display:flex;flex-wrap:nowrap;gap:4px}
body.bookshelf-page .ga-university button{font:inherit;font-size:13px;line-height:1.4;border:0;border-radius:0;padding:0 4px;min-height:44px;background:transparent;color:var(--link);white-space:nowrap;cursor:pointer}
body.bookshelf-page .ga-university #tbLogin{background:transparent;color:var(--link);border:0}
body.bookshelf-page .band{border:0;margin:0;width:100%;gap:8px;flex-wrap:nowrap;color:white;line-height:1.5}
.band__inner{min-width:0;margin:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#owner{font-size:17px}#bookCount{position:absolute;right:12px;font-size:12px;font-weight:400}.band__inner{max-width:calc(100% - 62px)}
body.bookshelf-page .wall{margin:0;max-width:none;width:100%;padding-bottom:var(--row)}
body.bookshelf-page .wall__empty{font-size:14px;text-align:center;padding:0 12px}
.notice{max-width:500px;margin:0 auto;padding:22px 16px;color:#fbe9d0;text-align:center;text-shadow:0 1px 2px #000}.notice h2{font-size:17px;margin:0 0 8px}.notice p{font-size:14px;margin:0}.notice button{font:inherit;font-size:15px;padding:10px 18px;min-height:44px;margin-top:12px;color:#fff;border:1px solid #b7834e;border-radius:6px;background:linear-gradient(#5a3318,#2a1408);cursor:pointer}
a:focus-visible,button:focus-visible{outline:3px solid #75b9ff;outline-offset:-3px}
@media(min-width:700px){body.bookshelf-page .band{font-size:17px}#owner{font-size:20px}body.bookshelf-page .wall__empty{font-size:16px}}

/* Original bookshelf cover layout. */
.covers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--cover-w), 1fr));
  grid-auto-rows: var(--row);
  column-gap: 6px;
}
.covers:empty { display: none; }

.slot {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: var(--plank);
}

.cover {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, calc(var(--item-h) * .7));
  aspect-ratio: 7 / 10;
  padding: 10% 9% 8%;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .3), rgba(255, 255, 255, .12) 4%, rgba(255, 255, 255, 0) 9%),
    linear-gradient(rgba(255, 255, 255, .14), rgba(0, 0, 0, .14)),
    var(--c);
  color: var(--fg);
  text-align: left;
  box-shadow: 2px 2px 3px rgba(0, 0, 0, .55), 6px 0 10px -6px rgba(0, 0, 0, .5);
  transition: transform .12s;
}
.cover:hover, .cover:focus-visible { transform: translateY(-3px); }
.cover::after {
  /* 帯の飾り */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24%;
  height: 3%;
  background: currentColor;
  opacity: .35;
}
.cover__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}
.cover--image { padding: 0; background: #e8e1d3; }
.cover--image .cover__image { opacity: 1; }
.cover--image .cover__title,
.cover--image .cover__author { visibility: hidden; }
.cover--image::after {
  /* 画像の表紙：帯の飾りの代わりに、左端に背の折り目の陰影を重ねる */
  inset: 0;
  height: auto;
  background: linear-gradient(90deg, rgba(0, 0, 0, .28), rgba(255, 255, 255, .18) 3%, rgba(255, 255, 255, 0) 7%);
  opacity: 1;
  z-index: 1;
}

.cover__title {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: var(--cover-font);
  font-weight: 800;
  line-height: 1.25;
  word-break: break-all;
}
.cover__author {
  margin-top: auto;
  font-size: calc(var(--cover-font) * .72);
  opacity: .85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

