:root {
  --sky: #e8f7ff;
  --sky-2: #cdeefe;
  --aqua: #7fd3f0;
  --sea: #3bb0e0;
  --deep: #1d7fb5;
  --navy: #0f4c75;
  --foam: #ffffff;
  --sand: #fff3dc;
  --coral: #ff8f8f;
  --coral-bg: #ffe4e1;
  --ink: #17415c;
  --muted: #5f8aa3;
  --line: #bfe5f5;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(29, 127, 181, 0.15);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Zen Maru Gothic', 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Yu Gothic', sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky) 0%, #d7f1fd 55%, #bfe8f8 100%) fixed;
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---------- 泡 ---------- */
.bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bubbles span {
  position: absolute; bottom: -40px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.9), rgba(255,255,255,.25));
  border: 1px solid rgba(255,255,255,.7);
  animation: rise linear infinite;
}
.bubbles span:nth-child(1) { left: 8%;  width: 18px; height: 18px; animation-duration: 16s; }
.bubbles span:nth-child(2) { left: 22%; width: 10px; height: 10px; animation-duration: 12s; animation-delay: 3s; }
.bubbles span:nth-child(3) { left: 46%; width: 24px; height: 24px; animation-duration: 20s; animation-delay: 1s; }
.bubbles span:nth-child(4) { left: 63%; width: 12px; height: 12px; animation-duration: 14s; animation-delay: 6s; }
.bubbles span:nth-child(5) { left: 78%; width: 20px; height: 20px; animation-duration: 18s; animation-delay: 2s; }
.bubbles span:nth-child(6) { left: 92%; width: 9px;  height: 9px;  animation-duration: 11s; animation-delay: 5s; }
@keyframes rise {
  from { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: .9; }
  to { transform: translateY(-110vh) translateX(20px); opacity: 0; }
}

/* ---------- ヘッダー ---------- */
.hero {
  position: relative; z-index: 1;
  background: linear-gradient(180deg, var(--sea) 0%, var(--aqua) 100%);
  color: #fff;
  padding: 22px 16px 70px;
  text-align: center;
}
.hero h1 { margin: 0; font-size: clamp(22px, 5vw, 34px); letter-spacing: .06em; text-shadow: 0 2px 6px rgba(15,76,117,.25); }
.hero p { margin: 4px 0 0; opacity: .95; font-size: 14px; }
.hero a { color: #fff; text-decoration: none; }
.waves { position: absolute; left: 0; bottom: -1px; width: 100%; height: 56px; display: block; }
.waves .w1 { animation: sway 9s ease-in-out infinite alternate; }
.waves .w2 { animation: sway 13s ease-in-out infinite alternate-reverse; }
@keyframes sway { from { transform: translateX(-3%); } to { transform: translateX(3%); } }

main { position: relative; z-index: 1; max-width: 1040px; margin: -26px auto 40px; padding: 0 12px; }

.card {
  background: var(--foam);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 16px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 10px; font-size: 18px; color: var(--navy); }

/* ---------- フォーム部品 ---------- */
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #f8fdff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 3px rgba(59,176,224,.2); }
textarea { resize: vertical; min-height: 70px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.check { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; color: var(--ink); font-size: 14px; }
.check input { width: auto; }

.btn {
  font: inherit; cursor: pointer; border: none; border-radius: 999px;
  padding: 10px 18px; background: var(--sea); color: #fff; font-weight: 700;
  box-shadow: 0 3px 0 var(--deep); transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--deep); }
.btn.ghost { background: #fff; color: var(--deep); border: 1.5px solid var(--sea); box-shadow: none; }
.btn.danger { background: var(--coral); box-shadow: 0 3px 0 #d96b6b; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.msg { min-height: 1.4em; font-size: 13px; color: #c0392b; margin: 8px 0 0; }
.msg.ok { color: var(--deep); }

/* ---------- トップ ---------- */
.grid2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.streamer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.streamer-list a {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  padding: 10px 14px; border-radius: 14px; background: var(--sky); border: 1px solid var(--line);
}
.streamer-list a:hover { background: var(--sky-2); }
.streamer-list .slug { color: var(--muted); font-size: 12px; margin-left: auto; }
.tabs2 { display: flex; gap: 6px; margin-bottom: 8px; }

/* ---------- カレンダー操作 ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.seg { display: inline-flex; background: var(--sky); border-radius: 999px; padding: 3px; border: 1px solid var(--line); }
.seg button { font: inherit; border: none; background: transparent; padding: 6px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 700; }
.seg button.on { background: var(--sea); color: #fff; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav .title { font-weight: 700; font-size: 18px; min-width: 9.5em; text-align: center; color: var(--navy); }
.iconbtn { font: inherit; width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; cursor: pointer; color: var(--deep); font-weight: 700; }
.owner-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; background: var(--sand); border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; font-size: 14px; }

/* ---------- 月表示 ---------- */
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.dow.sun, .cell.sun .num { color: #e0626a; }
.dow.sat, .cell.sat .num { color: var(--deep); }
.cell {
  min-height: 92px; background: #f6fcff; border: 1px solid var(--line); border-radius: 12px;
  padding: 4px; cursor: pointer; overflow: hidden; position: relative; text-align: left; font: inherit; color: inherit;
}
.cell:hover { background: var(--sky-2); }
.cell.other { opacity: .45; }
.cell .num { font-size: 13px; font-weight: 700; display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; }
.cell.today { border-color: var(--sea); box-shadow: 0 0 0 2px rgba(59,176,224,.35); }
.cell.today .num { background: var(--sea); color: #fff; }
.chip {
  display: block; font-size: 11px; line-height: 1.35; padding: 1px 5px; margin-top: 2px; border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip.stream { background: #d4f0fc; color: var(--navy); border-left: 3px solid var(--sea); }
.chip.event { background: var(--coral-bg); color: #8a3a3a; border-left: 3px solid var(--coral); }
.chip.off { background: #eef1f3; color: #6a7a85; border-left: 3px solid #b6c2ca; }
.more { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- 週・直近リスト ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.daycol { background: #f6fcff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 160px; }
.daycol.today { border-color: var(--sea); box-shadow: 0 0 0 2px rgba(59,176,224,.35); }
.daycol h3 { margin: 0 0 6px; font-size: 13px; color: var(--navy); }
.daycol .empty { color: #9fbfd0; font-size: 12px; }
.item {
  display: block; width: 100%; text-align: left; font: inherit; cursor: pointer; border: none;
  border-radius: 10px; padding: 6px 8px; margin-bottom: 6px; color: var(--ink);
}
.item.stream { background: #d4f0fc; border-left: 4px solid var(--sea); }
.item.event { background: var(--coral-bg); border-left: 4px solid var(--coral); }
.item.off { background: #eef1f3; border-left: 4px solid #b6c2ca; }
.item .t { font-weight: 700; font-size: 13px; }
.item .s { font-size: 12px; color: var(--muted); }
.item .tt { font-size: 14px; }

.agenda-day { margin-bottom: 14px; }
.agenda-day h3 { margin: 0 0 6px; font-size: 15px; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.agenda-day .tag { font-size: 11px; background: var(--sea); color: #fff; border-radius: 999px; padding: 0 8px; }
.agenda-empty { text-align: center; color: var(--muted); padding: 30px 0; }

@media (max-width: 720px) {
  .week { grid-template-columns: 1fr; }
  .daycol { min-height: 0; }
  .cell { min-height: 64px; }
  .chip { font-size: 10px; padding: 0 3px; }
  .chip .ct { display: none; }
  .nav .title { min-width: 7.5em; font-size: 16px; }
}

/* ---------- モーダル ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15,76,117,.45); z-index: 20; display: none; align-items: center; justify-content: center; padding: 12px; }
.overlay.open { display: flex; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 460px; max-height: 92vh; overflow: auto; padding: 18px; box-shadow: 0 12px 40px rgba(15,76,117,.35); }
.modal h2 { margin: 0 0 6px; color: var(--navy); font-size: 18px; }
.modal .actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.modal .actions .spacer { flex: 1; }
.plat { display: inline-block; font-size: 11px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; color: var(--deep); }
.note { white-space: pre-wrap; font-size: 13px; color: var(--ink); margin-top: 4px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 0 30px; position: relative; z-index: 1; }
.footer a { color: var(--deep); }

@media (prefers-reduced-motion: reduce) {
  .bubbles span, .waves .w1, .waves .w2 { animation: none; }
}

[hidden] { display: none !important; }

/* ---------- 期間(数日間)の帯 ---------- */
.chip.range { border-radius: 0; margin-left: -4px; margin-right: -4px; padding-left: 8px; min-height: 1.35em; border-left-width: 0; }
.chip.range-start { border-left-width: 3px; border-radius: 6px 0 0 6px; margin-left: 0; padding-left: 5px; }
.chip.range-end { border-radius: 0 6px 6px 0; margin-right: 0; }
.chip.range-start.range-end { border-radius: 6px; }

/* ---------- フッター・注意事項 ---------- */
.linkbtn { font: inherit; font-size: 13px; background: none; border: none; color: var(--deep); text-decoration: underline; cursor: pointer; padding: 4px 8px; }
.copyright { margin-top: 2px; }
.notice-h { margin: 14px 0 4px; font-size: 14px; color: var(--deep); }
.notice-list { margin: 0; padding-left: 1.3em; font-size: 14px; }
.notice-list li { margin: 3px 0; }
