:root {
  --bg: #0e1116;
  --bg-2: #151a22;
  --fg: #eef2f7;
  --muted: #9aa7b6;
  --accent: #2d6cdf;
  --accent-2: #5a92ff;
  --line: rgba(255, 255, 255, 0.10);
  --radius: 16px;
  --ease: cubic-bezier(0.5, 0, 0, 0.75);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(45, 108, 223, 0.22), transparent 60%),
    var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", Meiryo, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

[hidden] { display: none !important; }

.btn {
  appearance: none;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.33s var(--ease), transform 0.15s var(--ease);
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* ---------- 合言葉ゲート ---------- */
.gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 100;
}
.gate__panel {
  width: min(420px, 100%);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 28px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.gate__title {
  margin: 0 0 8px;
  font-size: 1.9rem;
  letter-spacing: 0.02em;
}
.gate__lead { margin: 0 0 24px; color: var(--muted); }
.gate__form { display: grid; gap: 14px; }
.gate__inputwrap { position: relative; display: flex; }
.gate__input {
  flex: 1;
  font: inherit;
  padding: 12px 64px 12px 14px;
  background: #0b0e13;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 10px;
  -webkit-text-security: disc;
  text-security: disc;
}
.gate__input.is-visible { -webkit-text-security: none; text-security: none; }
.gate__input:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.gate__toggle {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 8px;
}
.gate__toggle:hover { color: var(--fg); }
.gate__submit { width: 100%; }
.gate__error {
  margin: 4px 0 0;
  color: #ff8a8a;
  font-size: 0.9rem;
  min-height: 1.2em;
}

/* ---------- 本文 ---------- */
.site { min-height: 100dvh; display: flex; flex-direction: column; }
.hero {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 32px 24px;
}
.hero__card {
  text-align: center;
  max-width: 640px;
}
.hero__eyebrow {
  margin: 0 0 14px;
  font-size: 0.78rem;
  letter-spacing: 0.42em;
  color: var(--accent-2);
  user-select: none;
}
.hero__title {
  margin: 0;
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.05;
  user-select: none;
  background: linear-gradient(180deg, #ffffff, #b9c6d8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__soon {
  margin: 18px 0 0;
  font-size: 1.1rem;
  letter-spacing: 0.28em;
  color: var(--accent-2);
  text-transform: uppercase;
}
.hero__desc {
  margin: 22px auto 0;
  color: var(--muted);
  max-width: 30em;
}
/* ---------- 準備中プレビュー：見た目から探す ---------- */
.gallery {
  padding: 8px 14px 24px;
  border-top: 1px solid var(--line);
}
.gallery__head {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 6px 14px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.gallery__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  color: var(--accent-2);
}
.gallery__title {
  margin: 0;
  font-size: 1.3rem;
  flex: 1;
}
.gallery__shuffle {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--fg);
  font: inherit;
  font-size: 0.82rem;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.gallery__shuffle:hover { border-color: var(--accent-2); }
.gallery__shuffle:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* マソンリー（画面を埋め尽くす・全幅・高密度） */
.wall {
  column-width: 160px;
  column-gap: 5px;
  padding: 5px;
  flex: 1;
}
@media (min-width: 700px) { .wall { column-width: 200px; column-gap: 6px; padding: 6px; } }
.tile {
  break-inside: avoid;
  margin: 0 0 5px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #0b0e13;
  display: block;
  cursor: pointer;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.tile img { width: 100%; display: block; }
/* マウスオーバーでタイルごとせり出して拡大（周りより手前に浮く） */
.tile:hover {
  transform: scale(3);
  z-index: 30;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.7);
}
.tile figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 16px 10px 8px;
  font-size: 0.75rem;
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}
.tile:hover figcaption { opacity: 1; }
.tile.is-broken { display: none; } /* 読めない画像は詰めて消す */

/* 似てる基準の切替（左上・控えめ） */
.axis {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(21, 26, 34, 0.85);
  backdrop-filter: blur(6px);
}
.axis__label {
  font-size: 0.68rem;
  color: var(--muted);
  padding: 0 6px 0 8px;
  user-select: none;
}
.axis__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.axis__btn:hover { color: var(--fg); }
.axis__btn.is-active { background: var(--accent); color: #fff; }
.axis__btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
@media (max-width: 520px) {
  .axis__label { display: none; }
  .axis__btn { padding: 5px 10px; }
}

/* 右下の操作ボタン（最初に戻る・シャッフル） */
.fab-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fab {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(21, 26, 34, 0.85);
  backdrop-filter: blur(6px);
  color: var(--fg);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.4s var(--ease), border-color 0.2s;
}
.fab:hover { border-color: var(--accent-2); }
.fab:active { transform: scale(0.92); }
.fab:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.footer {
  padding: 16px 20px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border-top: 1px solid var(--line);
}
.footer__brand {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  user-select: none;
  cursor: default;
}
.footer__copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  user-select: none;
  cursor: default;
}
/* フッターにまとめた出典（クレジット） */
.credits {
  max-width: 900px;
  margin: 16px auto 0;
  text-align: left;
  font-size: 0.78rem;
  color: var(--muted);
}
.credits__summary { cursor: pointer; color: var(--fg); text-align: center; }
.credits__note { margin: 10px 0; }
.credits__note a, .credits__item { color: var(--accent-2); }
.credits__list { columns: 2 240px; gap: 16px; line-height: 1.7; }
.credits__item {
  display: block;
  break-inside: avoid;
  text-decoration: none;
}
.credits__item:hover { text-decoration: underline; }

/* ---------- ダイアログ（管理パネル / ハッシュ） ---------- */
.admin {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--fg);
  width: min(560px, 92vw);
  max-height: 86vh;
  padding: 0;
}
.admin::backdrop { background: rgba(0, 0, 0, 0.6); }
.admin__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.admin__title { margin: 0; font-size: 1.15rem; }
.admin__close {
  background: transparent; border: 0; color: var(--muted);
  font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 4px 8px;
}
.admin__close:hover { color: var(--fg); }
.admin__body { padding: 20px; overflow: auto; }
.admin__mock { margin: 0; padding: 10px 20px; color: #ffcf7a; font-size: 0.85rem; background: rgba(255, 207, 122, 0.08); }
.admin__note { color: var(--muted); font-size: 0.9rem; margin-top: 0; }
.admin__hash {
  display: block;
  word-break: break-all;
  background: #0b0e13;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  margin-bottom: 14px;
}
.admin__copy { width: 100%; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat {
  background: #0b0e13;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}
.stat__label { color: var(--muted); font-size: 0.78rem; margin: 0 0 4px; }
.stat__value { font-size: 1.5rem; font-weight: 700; margin: 0; }
.section-title { font-size: 0.95rem; margin: 20px 0 10px; color: var(--muted); }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.bar-row__name { font-size: 0.85rem; }
.bar-row__track { grid-column: 1 / -1; height: 6px; background: #0b0e13; border-radius: 3px; overflow: hidden; }
.bar-row__fill { height: 100%; background: var(--accent); }
.day-bars { display: flex; align-items: flex-end; gap: 4px; height: 96px; }
.day-bar { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; cursor: pointer; opacity: 0.85; }
.day-bar:hover { opacity: 1; }
.day-bar.is-active { background: var(--accent-2); }
.day-hours { margin-top: 12px; }

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