/* Sラボ。soluna-chart と同じネイビー×金の世界観で揃える。
   3つのアプリが同じ見た目であることが、サブスクを1本化した体験そのものになる。 */

:root {
  --bg: #0e1626;
  --bg-2: #131f33;
  --panel: #16233a;
  --line: #24354a;
  --line-soft: #1b283a;
  --text: #e6ebf2;
  --text-2: #9aa8bb;
  --text-3: #5d6b7e;
  --gold: #e8c766;
  --gold-dim: #b99b45;
  --up: #4ad991;
  --radius: 12px;
  --tile: 264px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }

/* ── ヘッダー ───────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px max(20px, env(safe-area-inset-left)) 12px max(20px, env(safe-area-inset-right));
  background: rgba(14, 22, 38, 0.86);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--line-soft);
}

.brand { display: flex; align-items: center; gap: 8px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--gold);
  border-radius: 8px;
  color: var(--gold);
  font-size: 15px;
  font-weight: 600;
  font-family: "Hiragino Mincho ProN", serif;
}

.brand-text { font-size: 15px; letter-spacing: 0.04em; }

.topnav { display: flex; gap: 20px; margin-right: auto; }

.topnav a {
  color: var(--text-2);
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 1.5px solid transparent;
  transition: color 0.15s;
}

.topnav a:hover { color: var(--text); }
.topnav a.active { color: var(--gold); border-bottom-color: var(--gold); }

.account { font-size: 13px; color: var(--text-2); }

.btn {
  appearance: none;
  border: 0.5px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover { background: var(--bg-2); border-color: var(--gold-dim); }

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #0e1626;
  font-weight: 600;
}

.btn-gold:hover { background: var(--gold); filter: brightness(1.06); }

/* ── レイアウト ─────────────────────────── */

main { padding: 28px 0 64px; min-height: 60vh; }

.wrap { padding: 0 max(20px, env(safe-area-inset-left)); }

.loading, .empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
}

/* ── 横スライドの行 ─────────────────────── */

.row { margin-bottom: 40px; }

.row-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 0 max(20px, env(safe-area-inset-left));
  margin-bottom: 14px;
}

.row-title { font-size: 17px; font-weight: 500; letter-spacing: 0.02em; }
.row-sub { font-size: 12.5px; color: var(--text-3); }

.rail-outer { position: relative; }

.rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  padding: 2px max(20px, env(safe-area-inset-left)) 6px;
  scrollbar-width: none;
}

.rail::-webkit-scrollbar { display: none; }

.rail-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0.5px solid var(--line);
  border-radius: 50%;
  background: rgba(19, 31, 51, 0.94);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.rail-btn:hover { background: var(--panel); border-color: var(--gold-dim); }
.rail-btn.prev { left: 8px; }
.rail-btn.next { right: 8px; }

@media (hover: hover) and (min-width: 760px) {
  .rail-outer:hover .rail-btn { display: grid; }
}

/* ── カード ─────────────────────────────── */

.tile {
  flex: 0 0 var(--tile);
  scroll-snap-align: start;
  cursor: pointer;
}

.tile-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-2);
  border: 0.5px solid var(--line-soft);
}

.tile-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tile:hover .tile-thumb { border-color: var(--gold-dim); }

/* サムネイル未設定のとき用。記事は文字、動画は再生記号を薄く敷く */
.thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-3);
  font-size: 30px;
  background:
    radial-gradient(120% 90% at 80% 10%, rgba(232, 199, 102, 0.09), transparent 60%),
    var(--bg-2);
}

.tile-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(14, 22, 38, 0.82);
  color: var(--text-2);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.tile-badge.live { background: #c8393c; color: #fff; }
.tile-badge.free { background: var(--up); color: #06301f; font-weight: 600; }

.tile-dur {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(14, 22, 38, 0.86);
  font-size: 11.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.tile-lock {
  position: absolute;
  right: 8px;
  top: 8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(14, 22, 38, 0.86);
  color: var(--gold);
  font-size: 12px;
}

.tile-body { padding: 9px 2px 0; }

.tile-title {
  font-size: 14px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-meta {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  gap: 8px;
  align-items: center;
}

.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

/* ── 記事ページ ─────────────────────────── */

.article { max-width: 720px; margin: 0 auto; padding: 8px 20px 0; }

.article-head { margin-bottom: 28px; }

.article h1 {
  font-size: 27px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.01em;
  margin: 0 0 12px;
}

.article-meta { font-size: 13px; color: var(--text-3); display: flex; gap: 10px; align-items: center; }

.tag {
  padding: 3px 9px;
  border: 0.5px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text-2);
}

.article-body { font-size: 16px; line-height: 1.95; }
.article-body h2 { font-size: 20px; font-weight: 500; margin: 40px 0 14px; }
.article-body h3 { font-size: 17px; font-weight: 500; margin: 30px 0 10px; color: var(--gold); }
.article-body p { margin: 0 0 22px; }
.article-body ul { padding-left: 22px; margin: 0 0 22px; }
.article-body li { margin-bottom: 8px; }
.article-body a { color: var(--gold); border-bottom: 0.5px solid var(--gold-dim); }
.article-body strong { font-weight: 600; color: #fff; }

/* 有料部分の境目。本文は届いていないので、ここから下には何も無い */
.paywall { position: relative; margin-top: 8px; }

.paywall-fade {
  height: 120px;
  margin-top: -120px;
  background: linear-gradient(to bottom, rgba(14, 22, 38, 0), var(--bg) 82%);
  pointer-events: none;
}

.paywall-card {
  border: 0.5px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 32px 28px;
  text-align: center;
}

.paywall-lock { font-size: 22px; color: var(--gold); }

.paywall-card h3 {
  font-size: 17px;
  font-weight: 500;
  margin: 10px 0 8px;
}

.paywall-card p { font-size: 13.5px; color: var(--text-2); margin: 0 0 20px; line-height: 1.8; }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.plan {
  border: 0.5px solid var(--line);
  border-radius: 10px;
  padding: 14px 12px;
  background: var(--bg-2);
}

.plan.best { border-color: var(--gold-dim); }
.plan-name { font-size: 12px; color: var(--text-3); }
.plan-price { font-size: 19px; font-weight: 500; margin-top: 4px; }
.plan-price span { font-size: 12px; color: var(--text-3); font-weight: 400; }
.plan-note { font-size: 11.5px; color: var(--gold); margin-top: 4px; }

.paywall-fine { font-size: 11.5px; color: var(--text-3); margin-top: 14px; }

/* ── 動画ページ ─────────────────────────── */

.player-wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  border: 0.5px solid var(--line-soft);
}

.player iframe { width: 100%; height: 100%; border: 0; }

.player-locked {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  background:
    radial-gradient(120% 90% at 80% 10%, rgba(232, 199, 102, 0.08), transparent 60%),
    var(--bg-2);
}

.video-info { max-width: 980px; margin: 20px auto 0; padding: 0 20px; }
.video-info h1 { font-size: 21px; font-weight: 500; margin: 0 0 8px; line-height: 1.5; }

/* ── ログインシート ─────────────────────── */

/* display 指定は [hidden] の display:none より詳細度が高いので、明示的に打ち消す */
.sheet[hidden] { display: none; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 11, 20, 0.7);
  backdrop-filter: blur(6px);
}

.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 380px;
  border: 0.5px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 30px 26px 26px;
}

.sheet-close {
  position: absolute;
  right: 12px;
  top: 8px;
  border: 0;
  background: none;
  color: var(--text-3);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.sheet h3 { font-size: 17px; font-weight: 500; margin: 0 0 8px; }
.sheet p { font-size: 13px; color: var(--text-2); margin: 0 0 18px; line-height: 1.75; }

.field {
  width: 100%;
  padding: 11px 13px;
  border: 0.5px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  margin-bottom: 12px;
}

.field:focus { outline: none; border-color: var(--gold-dim); }

.sheet .btn-gold { width: 100%; padding: 11px; font-size: 14px; }

.sheet-note { font-size: 11.5px; color: var(--text-3); margin-top: 14px; text-align: center; }

/* ── 管理画面 ───────────────────────────── */

.admin { max-width: 900px; margin: 0 auto; padding: 0 20px; }

.card {
  border: 0.5px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  padding: 24px 22px;
  margin-bottom: 20px;
}

.card h2 { font-size: 16px; font-weight: 500; margin: 0 0 16px; }
.count { font-size: 12.5px; color: var(--text-3); font-weight: 400; margin-left: 6px; }
.muted { color: var(--text-3); font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }

.notice {
  border: 0.5px solid var(--gold-dim);
  border-radius: 12px;
  background: rgba(232, 199, 102, 0.07);
  color: var(--text);
  font-size: 13px;
  padding: 14px 16px;
  margin-bottom: 20px;
  line-height: 1.7;
}

.notice-sub { color: var(--text-2); font-size: 12px; }

.notice.ok { border-color: var(--up); background: rgba(74, 217, 145, 0.06); }

.check-out {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-x: auto;
}

.drop {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 34px 20px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.drop.over { border-color: var(--gold); background: rgba(232, 199, 102, 0.05); }
.drop-main { margin: 0 0 8px; font-size: 14px; display: flex; gap: 10px; justify-content: center; align-items: center; }
.drop-sub { margin: 0; font-size: 12px; color: var(--text-3); }

.bar { height: 4px; border-radius: 999px; background: var(--bg); margin-top: 18px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--gold); transition: width 0.2s; }
.bar-label { font-size: 12.5px; color: var(--text-2); margin-top: 8px; }

.vrow {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px 0;
  border-top: 0.5px solid var(--line-soft);
}

.vthumb {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: var(--bg-2);
  border: 0.5px solid var(--line-soft);
  display: grid;
  place-items: center;
  color: var(--text-3);
  overflow: hidden;
}

.vthumb img { width: 100%; height: 100%; object-fit: cover; }

.field.sm { font-size: 13.5px; padding: 8px 10px; margin-bottom: 8px; }
textarea.field { resize: vertical; font-family: inherit; line-height: 1.6; }
.field.date { width: auto; }

.vopts { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.vopts label { display: flex; gap: 5px; align-items: center; cursor: pointer; }
.vmeta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }

.pill {
  padding: 2px 8px;
  border: 0.5px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-2);
}

.pill.free { border-color: var(--up); color: var(--up); }
.pill.live { border-color: #c8393c; color: #e07477; }
.pill.draft { border-color: var(--text-3); color: var(--text-3); }
.pill.warn { border-color: var(--gold-dim); color: var(--gold); }

.vactions { display: flex; flex-direction: column; gap: 8px; }
.btn.sm { font-size: 12.5px; padding: 6px 12px; white-space: nowrap; }
.btn.danger:hover { border-color: #c8393c; color: #e07477; }
.btn:disabled { opacity: 0.4; cursor: default; }

@media (max-width: 640px) {
  .vrow { grid-template-columns: 1fr; }
  .vthumb { max-width: 160px; }
  .vactions { flex-direction: row; flex-wrap: wrap; }
}

/* ── フッター ───────────────────────────── */

.footer {
  display: flex;
  justify-content: center;
  gap: 22px;
  padding: 26px 20px calc(30px + env(safe-area-inset-bottom));
  border-top: 0.5px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--text-3);
}

.footer a:hover { color: var(--text-2); }

@media (max-width: 560px) {
  :root { --tile: 216px; }
  .topnav { gap: 14px; }
  .article h1 { font-size: 23px; }
  .article-body { font-size: 15.5px; }
}
