/* =========================================================
   灰咲リリ — 小さなウィンドウ1枚のサイト
   黒・灰色・チェック柄。つやのあるボタンでY2Kっぽく、色は落としてダウナーに。
   ウィンドウ内のサイズはすべて em 指定。.win の文字サイズを変えると全体が拡大縮小する。
   ========================================================= */
:root {
  --desk: #121214;
  --win: #1b1b1e;
  --inset: #121214;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.18);
  --text: #c6c6cc;
  --dim: #7d7d86;
  --faint: #56565e;
  --hi: #ededf0;
  --red: #a3222d;

  --font-mono: "Space Mono", "Zen Kaku Gothic New", monospace;
  --font-jp: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-gothic: "UnifrakturMaguntia", "Space Mono", serif;

  --plaid:
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(255, 255, 255, 0.05) 22px 26px, transparent 26px 34px, rgba(255, 255, 255, 0.035) 34px 46px, transparent 46px 64px),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(255, 255, 255, 0.05) 22px 26px, transparent 26px 34px, rgba(255, 255, 255, 0.035) 34px 46px, transparent 46px 64px),
    repeating-linear-gradient(0deg, transparent 0 10px, rgba(0, 0, 0, 0.28) 10px 12px, transparent 12px 64px),
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(0, 0, 0, 0.28) 10px 12px, transparent 12px 64px),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 3px);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  /* つやのあるグレーのボタン */
  --gloss: linear-gradient(180deg, #74747c 0%, #45454c 46%, #2a2a2f 54%, #36363c 100%);
  --gloss-hover: linear-gradient(180deg, #8a8a92 0%, #55555c 46%, #34343a 54%, #42424a 100%);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  background: var(--desk);
  color-scheme: dark;
}
body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-jp);
  background-color: var(--desk);
  background-image: var(--plaid);
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: var(--noise), radial-gradient(ellipse at 50% 45%, transparent 25%, rgba(0, 0, 0, 0.65) 100%);
  opacity: 0.6;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, dl, dd, figure { margin: 0; padding: 0; }
ul { list-style: none; }
button, select { font: inherit; color: inherit; }
::selection { background: #e6e6ea; color: #111; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 画面の真ん中にウィンドウを置く。縦にはみ出さない */
.desk {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 8px;
}
.credit {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--faint);
}

/* =========================================================
   ウィンドウ
   ========================================================= */
.win {
  --body-h: 35.5em;
  position: relative;
  font-size: clamp(11px, 3.1vw, 12.5px);
  width: min(38em, calc(100vw - 16px));
  font-family: var(--font-mono);
  line-height: 1.6;
  background: var(--win);
  border: 1px solid #000;
  border-radius: 0.9em;
  box-shadow:
    inset 0 0 0 1px var(--line-2),
    0 0.2em 0 #000,
    0 2.4em 5em rgba(0, 0, 0, 0.7);
  overflow: hidden;
  transition: font-size 0.25s ease;
}
/* 拡大ボタン：ウィンドウ全体を少し大きく */
.win.is-max { font-size: 15px; }
.win.is-min .bookmarks,
.win.is-min .body,
.win.is-min .pager,
.win.is-min .bar.bottom { display: none; }
.win.is-closed { display: none; }

/* ---- 上下のバー ---- */
.bar {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.55em 0.6em;
  background: linear-gradient(180deg, #2c2c31, #18181b);
}
.bar.top { border-bottom: 1px solid #000; }
.bar.bottom { border-top: 1px solid #000; }

.pill {
  display: flex;
  align-items: center;
  gap: 0.6em;
  height: 2.2em;
  padding: 0 0.9em 0 0.5em;
  border: 1px solid #000;
  border-radius: 999px;
  background: var(--inset);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
}
.url { flex: 1; min-width: 0; }
.url b { font-weight: 400; color: var(--hi); }
.swatch {
  flex: none;
  width: 1.3em;
  height: 1.3em;
  border-radius: 50%;
  background-color: #3a3a40;
  background-image: var(--plaid);
  background-size: 48px 48px;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.swatch.big {
  width: 2.2em;
  height: 2.2em;
  border-radius: 0.4em;
  border: 1px solid #000;
}

.win-btns { display: flex; gap: 0.35em; }
.sq {
  position: relative;
  width: 2.1em;
  height: 2.1em;
  border: 1px solid #000;
  border-radius: 0.45em;
  background: var(--gloss);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
.sq:hover { background: var(--gloss-hover); }
.sq.close:hover { background: linear-gradient(180deg, #c04650 0%, #8e1f29 50%, #6e1720 100%); }
.sq::before,
.sq::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: var(--hi);
}
.sq.min::before { width: 0.8em; height: 2px; transform: translate(-50%, -50%); }
.sq.min::after { display: none; }
.sq.max::before {
  width: 0.75em;
  height: 0.75em;
  background: none;
  border: 1.5px solid var(--hi);
  transform: translate(-50%, -50%);
}
.sq.max::after { display: none; }
.win.is-max .sq.max::before { width: 0.6em; height: 0.6em; transform: translate(-30%, -70%); }
.win.is-max .sq.max::after {
  display: block;
  width: 0.6em;
  height: 0.6em;
  background: #3c3c42;
  border: 1.5px solid var(--hi);
  transform: translate(-70%, -30%);
}
.sq.close::before,
.sq.close::after { width: 0.95em; height: 2px; }
.sq.close::before { transform: translate(-50%, -50%) rotate(45deg); }
.sq.close::after { transform: translate(-50%, -50%) rotate(-45deg); }

/* ---- つやボタン ---- */
.gloss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.2em;
  padding: 0 1.1em;
  border: 1px solid #000;
  border-radius: 999px;
  background: var(--gloss);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.6);
  font-family: var(--font-mono);
  font-size: 1em;
  color: var(--hi);
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}
.gloss:hover { background: var(--gloss-hover); }
.gloss:active { transform: translateY(1px); }
.gloss.block { display: flex; width: 100%; }

/* ブックマークバー（外部リンク） */
.bookmarks {
  display: flex;
  align-items: center;
  gap: 0.2em;
  padding: 0.35em 0.7em;
  background: #202024;
  border-bottom: 1px solid #000;
  overflow: hidden;
  white-space: nowrap;
}
.bm-label {
  margin-right: 0.4em;
  padding-right: 0.7em;
  border-right: 1px solid var(--line-2);
  color: var(--faint);
  font-size: 0.9em;
}
.bookmarks a {
  padding: 0.15em 0.6em;
  border-radius: 0.4em;
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}
.bookmarks a:hover { background: var(--line); color: var(--hi); }

/* =========================================================
   中身（高さ固定。収まらない分だけ中でスクロール）
   ========================================================= */
.body {
  position: relative;
  height: var(--body-h);
  background: var(--inset);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
}
.body::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--noise);
  opacity: 0.15;
}
.panel {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.8em;
  scrollbar-width: thin;
  scrollbar-color: #4a4a52 transparent;
  animation: panelIn 0.35s ease;
}
.panel[hidden] { display: none; }
@keyframes panelIn { from { opacity: 0; } to { opacity: 1; } }
.panel::-webkit-scrollbar { width: 6px; }
.panel::-webkit-scrollbar-thumb { background: #4a4a52; border-radius: 3px; }

.cols {
  display: grid;
  grid-template-columns: 12.5em minmax(0, 1fr);
  gap: 0.8em;
  min-height: 100%;
}
.side {
  display: flex;
  flex-direction: column;
  gap: 0.55em;
}
.main { min-width: 0; }

.frame {
  position: relative;
  border: 1px solid #000;
  border-radius: 0.5em;
  box-shadow: inset 0 0 0 1px var(--line-2);
  background-color: #2a2a2f;
  background-image: var(--plaid);
  background-size: 48px 48px;
  overflow: hidden;
}
.frame.face { aspect-ratio: 1 / 1; }
.frame.face img { width: 100%; height: 100%; object-fit: cover; }

.tiny {
  font-family: var(--font-jp);
  font-size: 0.92em;
  line-height: 1.6;
  color: var(--text);
}
.tiny.dim { font-family: var(--font-mono); color: var(--dim); }

.handle {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  padding: 0.1em 0.2em 0.35em;
  margin-bottom: 0.6em;
  border-bottom: 2px solid var(--text);
  font-family: var(--font-jp);
  font-size: 1.15em;
  font-weight: 500;
  color: var(--hi);
  letter-spacing: 0.08em;
}
.gothic {
  font-family: var(--font-gothic);
  font-weight: 400;
  letter-spacing: 0;
}
.handle .gothic { font-size: 1.6em; line-height: 1; }
.handle .sub {
  font-size: 0.75em;
  color: var(--dim);
  letter-spacing: 0.15em;
}
.text {
  font-family: var(--font-jp);
  font-size: 0.95em;
  line-height: 1.75;
}

/* 眠さメーター（参考サイトのスクロールバー風） */
.meter {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: 0.7em 0;
  font-size: 0.9em;
  color: var(--dim);
}
.meter .track {
  flex: 1;
  height: 0.9em;
  border: 1px solid #000;
  border-radius: 999px;
  background: #0b0b0d;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--gloss);
}

/* プルダウン（おすすめ動画） */
.drop { margin-bottom: 0.6em; }
.drop summary {
  list-style: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.2em;
  padding: 0 2.2em;
  border: 1px solid #000;
  border-radius: 999px;
  background: var(--gloss);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.6);
  color: var(--hi);
  cursor: pointer;
  user-select: none;
}
.drop summary::-webkit-details-marker { display: none; }
.drop summary:hover { background: var(--gloss-hover); }
.drop summary::after {
  content: "";
  position: absolute;
  right: 1em;
  top: 50%;
  width: 0.5em;
  height: 0.5em;
  border-right: 1.5px solid var(--hi);
  border-bottom: 1.5px solid var(--hi);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s;
}
.drop[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.videos {
  display: grid;
  gap: 0.5em;
  margin-top: 0.5em;
}
.yt {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid #000;
  border-radius: 0.4em;
  overflow: hidden;
  background: var(--win);
}
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.yt-thumb {
  position: absolute;
  inset: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.yt-thumb img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.3) brightness(0.85); }
.yt-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3.4em;
  height: 3.4em;
  margin: -1.7em 0 0 -1.7em;
  border-radius: 50%;
  border: 1px solid var(--hi);
  background: rgba(0, 0, 0, 0.55);
}
.yt-play::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -0.5em 0 0 -0.25em;
  border-style: solid;
  border-width: 0.5em 0 0.5em 0.8em;
  border-color: transparent transparent transparent var(--hi);
}
.yt-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  color: var(--faint);
  background-color: #222226;
  background-image: var(--plaid);
  background-size: 48px 48px;
}
.yt-empty b { font-weight: 400; color: var(--dim); }

/* 画像グリッド */
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45em;
}
.grid li {
  aspect-ratio: 1 / 1;
  border: 1px solid #000;
  border-radius: 0.5em;
  box-shadow: inset 0 0 0 1px var(--line-2);
  overflow: hidden;
  background: linear-gradient(180deg, #34343a, #1c1c20);
}
.grid a { display: block; width: 100%; height: 100%; }
.grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 6%;
  filter: grayscale(0.25);
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: filter 0.3s;
}
.grid a:hover img { filter: none; }
.grid .plaid-tile {
  background-color: #2a2a2f;
  background-image: var(--plaid);
  background-size: 48px 48px;
}
.grid .plaid-tile a {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6em;
  color: var(--hi);
}

/* ---- profile ---- */
.slider { flex: 1; min-height: 14em; }
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.slide.is-active { opacity: 1; }
.slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
  padding-top: 0.6em;
}
.slide.bust img { object-fit: cover; object-position: 50% 0; padding: 0; }
.sl-btn {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 2em;
  height: 2em;
  margin-top: -1em;
  border: 1px solid #000;
  border-radius: 50%;
  background: var(--gloss);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
}
.sl-btn:hover { background: var(--gloss-hover); }
.sl-btn::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.5em;
  height: 0.5em;
  border-top: 1.5px solid var(--hi);
  border-right: 1.5px solid var(--hi);
}
.sl-btn.prev { left: 0.4em; }
.sl-btn.next { right: 0.4em; }
.sl-btn.prev::before { transform: translate(-30%, -50%) rotate(-135deg); }
.sl-btn.next::before { transform: translate(-70%, -50%) rotate(45deg); }
.sl-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9em;
  color: var(--dim);
}
.slider-dots { display: flex; gap: 0.3em; }
.slider-dots button {
  width: 1.2em;
  height: 0.3em;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: var(--faint);
  cursor: pointer;
}
.slider-dots button.is-active { background: var(--hi); }

.data {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 0.8em;
  margin-top: 0.4em;
  font-family: var(--font-jp);
}
.data div {
  padding: 0.35em 0.1em;
  border-bottom: 1px dashed var(--line-2);
}
.data dt {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--faint);
}
.data dd { font-size: 0.95em; line-height: 1.5; }
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin-top: 0.8em;
  font-family: var(--font-jp);
}
.tags li {
  padding: 0.2em 0.7em;
  border: 1px solid #000;
  border-radius: 999px;
  background: #202024;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--hi);
  font-size: 0.92em;
}
.tags span {
  margin-right: 0.4em;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--faint);
}

/* ---- links / guideline / contact ---- */
.link-list { display: grid; gap: 0.45em; }
.link-list .row {
  display: grid;
  grid-template-columns: 8.5em minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6em;
  padding: 0.6em 0.9em;
  border: 1px solid #000;
  border-radius: 0.6em;
  background: #1d1d21;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background 0.2s;
}
.link-list .row:hover {
  background-color: #26262b;
  background-image: var(--plaid);
  background-size: 48px 48px;
}
.link-list b { font-weight: 400; color: var(--hi); }
.link-list span { font-family: var(--font-jp); color: var(--dim); font-size: 0.92em; }
.link-list em { font-style: normal; color: var(--faint); }
.link-list .row:hover em { color: var(--hi); }

.mini-head {
  margin: 1em 0 0.3em;
  font-size: 1em;
  font-weight: 400;
  color: var(--dim);
}
.mini-head::before { content: "// "; color: var(--faint); }
.news { font-family: var(--font-jp); font-size: 0.95em; }
.news li {
  display: flex;
  gap: 0.8em;
  padding: 0.35em 0.2em;
  border-bottom: 1px dashed var(--line-2);
}
.news time { flex: none; font-family: var(--font-mono); color: var(--dim); }

.note {
  margin-bottom: 0.6em;
  border: 1px solid #000;
  border-radius: 0.6em;
  overflow: hidden;
  background: #1d1d21;
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--font-jp);
}
.note-head {
  display: flex;
  justify-content: space-between;
  padding: 0.3em 0.8em;
  background: linear-gradient(180deg, #2c2c31, #202024);
  border-bottom: 1px solid #000;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--dim);
}
.note ul { padding: 0.6em 0.9em 0.7em; }
.note li {
  position: relative;
  padding-left: 1em;
  font-size: 0.95em;
  line-height: 1.7;
}
.note li::before {
  content: "-";
  position: absolute;
  left: 0;
  font-family: var(--font-mono);
  color: var(--faint);
}
.note.center { text-align: center; }
.note.center p { padding: 0.9em 0.9em 0; color: var(--dim); font-size: 0.95em; }
.mail {
  display: inline-block;
  margin: 0.4em 0 1em;
  font-family: var(--font-mono);
  font-size: 1.3em;
  color: var(--hi);
  border-bottom: 1px dashed var(--line-2);
  word-break: break-all;
}
.mail:hover { border-bottom-color: var(--hi); }

/* =========================================================
   前へ／次へ
   ========================================================= */
.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.6em;
  padding: 0.6em;
  background: #202024;
  border-top: 1px solid #000;
}
.pager .gloss:first-child { justify-self: end; }
.pager .gloss:last-child { justify-self: start; }
.page-select { position: relative; display: block; }
.page-select select {
  appearance: none;
  -webkit-appearance: none;
  height: 2.2em;
  min-width: 8.5em;
  padding: 0 2.2em 0 1em;
  border: 1px solid #000;
  border-radius: 999px;
  background: var(--inset);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.8);
  font-family: var(--font-mono);
  font-size: 1em;
  color: var(--hi);
  cursor: pointer;
}
.page-select::after {
  content: "";
  position: absolute;
  right: 0.95em;
  top: 50%;
  width: 0.45em;
  height: 0.45em;
  border-right: 1.5px solid var(--text);
  border-bottom: 1.5px solid var(--text);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* ---- お知らせのティッカー ---- */
.ticker { flex: 1; min-width: 0; padding: 0 0.9em; }
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 28s linear infinite;
}
.ticker-track span { padding-right: 0.4em; font-family: var(--font-jp); }
@keyframes ticker { to { transform: translateX(-50%); } }
.clock {
  flex: none;
  font-size: 0.9em;
  color: var(--dim);
}

/* 閉じたあと */
.reopen {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1em;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
}
.win.is-closed ~ .reopen { display: flex; }

/* 狭い画面：左の列を少し細く */
@media (max-width: 380px) {
  .cols { grid-template-columns: 10.5em minmax(0, 1fr); }
  .link-list .row { grid-template-columns: 7em minmax(0, 1fr) auto; }
}
/* スマホ：横幅が狭く文字が折り返す分、中身の高さを少し伸ばす */
@media (max-width: 420px) {
  .win { --body-h: 42em; }
}
/* 背の低い画面：中身の高さを縮めて画面内に収める */
@media (max-height: 680px) {
  .win { --body-h: clamp(9em, calc(100svh - 19em), 35.5em); }
}
@media (max-height: 680px) and (max-width: 420px) {
  .win { --body-h: clamp(9em, calc(100svh - 19em), 42em); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =========================================================
   Top：プリ帳風の写真＋チャット風の自己紹介
   ========================================================= */
/* トップはパネル全体ではなく、右のチャットだけをスクロールさせる */
#top.panel { overflow: hidden; padding: 0; }
.top-wrap {
  display: grid;
  grid-template-columns: 11.5em minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 1.1em;
  height: 100%;
  padding-left: 0.8em;
}

/* 写真の帯（テープで留めた感じ） */
.strip {
  position: relative;
  /* テープを含めた見た目の上下の余白が同じになるよう中央に置く。
     margin-top をテープのはみ出し分にすると、テープ上端〜帯の下端がちょうど中央に来る */
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: calc((var(--body-h) - 2.4em) / 2.25 - 0.6em);
  margin-top: var(--tape-over, 0.75em);
  display: grid;
  gap: 0.45em;
  padding: 0.55em 0.55em 0.4em;
  background: #2b2b30;
  border: 1px solid #000;
  box-shadow: 0 0.5em 1.2em rgba(0, 0, 0, 0.55), inset 0 0 0 1px var(--line);
}
.strip a {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid #000;
  background-color: #222226;
  background-image: var(--plaid);
  background-size: 40px 40px;
}
.strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 8%;
  filter: grayscale(0.35) contrast(1.05);
  transform: translateZ(0);
  backface-visibility: hidden;
  transition: filter 0.3s;
}
.strip a:hover img { filter: none; }
.strip figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 0.1em;
  font-size: 0.85em;
  color: var(--dim);
}
.strip figcaption .gothic { font-size: 1.7em; line-height: 1; color: var(--hi); }
.tape {
  position: absolute;
  top: -0.6em;
  width: 3.4em;
  height: 1.3em;
  background: rgba(214, 214, 220, 0.28);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(1px);
}
.tape.l { left: 0.5em; transform: rotate(-8deg); }
.tape.r { right: 0.5em; transform: rotate(7deg); }

/* チャット */
.chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.8em 0.8em 0.8em 0;
  scrollbar-width: thin;
  scrollbar-color: #4a4a52 transparent;
}
.chat::-webkit-scrollbar { width: 6px; }
.chat::-webkit-scrollbar-thumb { background: #4a4a52; border-radius: 3px; }
.chat-head {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding-bottom: 0.6em;
  margin-bottom: 0.7em;
  border-bottom: 1px solid var(--line-2);
}
.ava {
  flex: none;
  width: 2.8em;
  height: 2.8em;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid #000;
  box-shadow: 0 0 0 1px var(--line-2);
}
.ava img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.chat-name {
  font-family: var(--font-jp);
  font-size: 1.1em;
  font-weight: 500;
  line-height: 1.3;
  color: var(--hi);
  letter-spacing: 0.06em;
}
.chat-name span {
  margin-left: 0.3em;
  font-family: var(--font-mono);
  font-size: 0.75em;
  font-weight: 400;
  color: var(--faint);
  letter-spacing: 0;
}
.chat-status {
  display: flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.85em;
  color: var(--dim);
}
.chat-status i {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: #8b8b93;
  box-shadow: 0 0 0 2px rgba(139, 139, 147, 0.2);
}

.log {
  display: flex;
  flex-direction: column;
  gap: 0.45em;
  list-style: none;
  font-family: var(--font-jp);
}
.msg {
  align-self: flex-start;
  max-width: 92%;
  padding: 0.5em 0.85em;
  border: 1px solid #000;
  border-radius: 0.2em 1em 1em 1em;
  background: #26262b;
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 0.95em;
  line-height: 1.6;
  color: var(--text);
}
.msg b { font-family: var(--font-mono); font-weight: 400; color: var(--hi); }
/* 見ている人側の吹き出し */
.msg.me {
  align-self: flex-end;
  border-radius: 1em 0.2em 1em 1em;
  background: #3a3a40;
  color: var(--hi);
}
.msg.card { width: 92%; }
.sleepy {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 0.2em;
  font-size: 0.85em;
  color: var(--dim);
}
.sleepy .track {
  flex: 1;
  height: 0.7em;
  border: 1px solid #000;
  border-radius: 999px;
  background: #0b0b0d;
  overflow: hidden;
}
.sleepy i { display: block; height: 100%; background: var(--gloss); }
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin-top: 0.4em;
}
.chips a {
  padding: 0.1em 0.9em;
  border: 1px solid #000;
  border-radius: 999px;
  background: var(--gloss);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  font-family: var(--font-mono);
  font-size: 0.95em;
  color: var(--hi);
}
.chips a:hover { background: var(--gloss-hover); }
.msg .drop { margin: 0; }
.msg .drop summary {
  height: auto;
  padding: 0 1.6em 0 0;
  border: 0;
  background: none;
  box-shadow: none;
  justify-content: flex-start;
  color: var(--text);
}
.msg .drop summary:hover { background: none; color: var(--hi); }
.msg .drop summary::after { right: 0.2em; border-color: var(--dim); }

/* 入力中… */
.typing {
  align-self: flex-start;
  display: flex;
  gap: 0.3em;
  padding: 0.6em 0.85em;
  border: 1px solid #000;
  border-radius: 0.2em 1em 1em 1em;
  background: #26262b;
}
.typing span {
  width: 0.4em;
  height: 0.4em;
  border-radius: 50%;
  background: var(--dim);
  animation: typing 1.4s ease-in-out infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-0.2em); }
}

@media (max-width: 420px) {
  .top-wrap { grid-template-columns: 8.5em minmax(0, 1fr); gap: 0.8em; }
  .strip figcaption { justify-content: center; }
  .strip figcaption span:not(.gothic) { display: none; }
  .msg, .msg.card { max-width: 100%; }
  .msg.card { width: 100%; }
}
/* 横向きのスマホなど、とても背の低い画面では写真の帯を出さずチャットだけにする */
@media (max-height: 420px) {
  .strip { display: none; }
  .top-wrap { grid-template-columns: minmax(0, 1fr); }
  .chat { padding-left: 0; }
}
