/* メビウス号 船内（試作） */
:root {
  --sea-0: #071d35;
  --sea-1: #0b2a4a;
  --sea-2: #12406b;
  --sea-3: #1d5d93;
  --foam: #eaf4fb;
  --paper: #fffaf0;
  --paper-2: #f6ecd6;
  --ink: #1a2b40;
  --ink-2: #5a6b80;
  --sun: #ffcf5a;
  --gold: #e9a92a;
  --coral: #ff7a59;
  --green: #5fae3c;
  --radius: 18px;
  --pixel: "DotGothic16", "Hiragino Sans", sans-serif;
  --round: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(255, 207, 90, .18), transparent 70%),
    linear-gradient(180deg, var(--sea-1) 0%, var(--sea-2) 50%, var(--sea-3) 100%) fixed;
  color: var(--foam);
  font-family: var(--round);
  line-height: 1.8;
  min-height: 100vh;
  padding-bottom: 88px;
  overflow-x: clip;
}
a { color: var(--sun); }
img { max-width: 100%; }
.px { image-rendering: pixelated; }
.wrap { max-width: 880px; margin: 0 auto; padding: 8px 16px 32px; }
.center { text-align: center; }
.muted { color: rgba(234, 244, 251, .72); font-size: 14px; }
.card .muted { color: var(--ink-2); }

/* 上のバー */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: rgba(7, 29, 53, .85); backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--foam); text-decoration: none; font-weight: 800; letter-spacing: .08em; }
.brand img { width: 44px; }
.brand i { color: var(--sun); font-style: normal; }
.proto { font-family: var(--pixel); font-size: 12px; color: var(--sea-1); background: var(--sun); padding: 2px 10px; border-radius: 999px; }

/* 下のタブ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(7, 29, 53, .94); border-top: 1px solid rgba(255, 255, 255, .1);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar[hidden] { display: none; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: rgba(234, 244, 251, .7); font-size: 11px; padding: 4px 0; border-radius: 12px; }
.tabbar img { width: 30px; height: 30px; object-fit: contain; }
.tabbar a.on { color: var(--sun); background: rgba(255, 255, 255, .06); }

/* 共通の箱 */
.card {
  display: block; background: var(--paper); color: var(--ink);
  border-radius: var(--radius); padding: 18px 16px; margin: 16px 0;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .15);
  text-decoration: none;
}
.ttl { font-family: var(--pixel); font-weight: 400; font-size: 20px; text-align: center; margin: 0 0 12px; letter-spacing: .12em; color: var(--sea-1); }
.page-ttl { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: clamp(20px, 5vw, 28px); margin: 18px 0 4px; text-align: center; }
.page-ttl img { width: 48px; }
.crumb { font-size: 13px; margin: 12px 0 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two .card { margin: 0; }
@media (max-width: 560px) { .two { grid-template-columns: 1fr; } }

.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  font: 700 15px var(--round); color: var(--paper); background: var(--sea-2);
  padding: 10px 20px; border-radius: 999px; box-shadow: 0 4px 0 var(--sea-0);
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--sea-0); }
.btn.gold { background: var(--sun); color: var(--sea-0); box-shadow: 0 4px 0 var(--gold); }
.btn.sm { font-size: 13px; padding: 6px 14px; }
.btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.pill { display: inline-block; font-family: var(--pixel); font-size: 13px; padding: 2px 12px; border-radius: 999px; background: var(--sea-2); color: var(--paper); }
.pill.gold { background: var(--sun); color: var(--sea-0); }

/* 船長の吹き出し */
.talk-row { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0; }
.captain { flex: 0 0 64px; width: 64px; height: 64px; background: var(--paper); border-radius: 50%; border: 3px solid var(--sun); }
.talk { position: relative; flex: 1; background: var(--paper); color: var(--ink); border-radius: 16px; padding: 10px 16px; }
.talk::before { content: ""; position: absolute; left: -10px; top: 22px; border: 10px solid transparent; border-right-color: var(--paper); border-left: 0; }
.talk b { font-family: var(--pixel); font-weight: 400; font-size: 12px; color: var(--sea-3); }
.talk p { margin: 0; }
.card .talk { background: var(--paper-2); }
.card .talk::before { border-right-color: var(--paper-2); }

/* 港（OPEN） */
/* アイキャッチは画面の横幅いっぱい（中身の幅に関係なく左右の端まで） */
.hero { position: relative; width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); min-height: 420px; display: grid; place-items: center; overflow: hidden; }
@media (min-width: 900px) { .hero { min-height: 560px; } }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(1.1) brightness(.85); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 29, 53, .1), rgba(7, 29, 53, .65)); }
.hero-in { position: relative; z-index: 1; text-align: center; padding: 24px 16px; }
.logo { width: min(560px, 92vw); filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
.hero-lead { font-weight: 700; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); margin: 8px 0 18px; }
.mebius svg { width: min(360px, 100%); display: block; margin: 0 auto; color: var(--sea-2); }
.mebius text { font: 700 18px var(--pixel); fill: var(--sea-1); }
.mebius text.filter { fill: var(--gold); }
.mebius p { margin: .6em 0; }
.gate { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .gate { grid-template-columns: 1fr; } }
.gate-box { background: var(--paper-2); border-radius: 14px; padding: 14px; text-align: center; }
.gate-box h3 { margin: 0 0 8px; font-size: 16px; }
.gate-box input { width: 100%; font: 16px var(--round); padding: 10px 12px; border-radius: 10px; border: 2px solid var(--sea-3); margin-bottom: 10px; }
.msg { min-height: 1.5em; color: var(--coral); font-size: 14px; margin: 8px 0 0; }

/* カウンター */
.counter { text-align: center; margin: 18px 0 0; font-family: var(--pixel); }
.counter b { display: block; font-weight: 400; font-size: 18px; }
.counter em { font-style: normal; font-size: 40px; color: var(--sun); padding: 0 4px; }
.counter span { font-size: 14px; opacity: .85; }

/* 航路の帯 */
.strip { display: flex; gap: 6px; overflow-x: auto; padding: 8px 4px 12px; scroll-snap-type: x proximity; }
.strip-isl { flex: 0 0 96px; display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--ink); scroll-snap-align: center; position: relative; }
.strip-isl + .strip-isl::before { content: ""; position: absolute; left: -10px; top: 44px; width: 14px; border-top: 3px dotted var(--gold); }
.strip-img { position: relative; width: 88px; height: 88px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 50% 60%, #cfe9f7, #a9d3ec); }
.strip-img img { width: 80px; height: 80px; object-fit: contain; }
.strip-img .flag { position: absolute; right: -6px; top: -8px; width: 40px; height: 40px; }
.strip-img .ship-mark { position: absolute; left: -12px; bottom: 2px; width: 48px; height: 48px; }
.strip { position: relative; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.card p a:not(.btn), .crumb a { color: var(--sea-3); font-weight: 700; }
.crumb a { color: var(--sun); }
.strip-name { font-size: 11px; text-align: center; line-height: 1.4; margin-top: 4px; font-weight: 700; }
.strip-isl.here .strip-img { box-shadow: 0 0 0 4px var(--sun); animation: bob 3s ease-in-out infinite; }
.strip-isl.ahead .strip-img, .strip-isl.fog .strip-img { filter: grayscale(.9) brightness(1.05); opacity: .6; }
.strip-isl.fog .strip-name { color: var(--ink-2); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .strip-isl.here .strip-img { animation: none; } }

/* 小さいカード */
.card.mini { display: flex; gap: 12px; align-items: center; }
.card.mini img { width: 72px; flex: 0 0 72px; }
.card.mini h3 { margin: 0; font-size: 16px; }
.card.mini p { margin: 2px 0; font-size: 14px; }

/* 船内設備 */
.facs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 560px) { .facs { grid-template-columns: repeat(2, 1fr); } }
.fac { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--ink); background: var(--paper-2); border-radius: 14px; padding: 10px 6px; transition: transform .15s; }
.fac:hover { transform: translateY(-3px); }
.fac img { width: 72px; height: 72px; object-fit: contain; }
.fac b { font-size: 14px; }
.fac span { font-size: 11px; color: var(--ink-2); }

/* 島 */
.isl-head { display: flex; align-items: center; gap: 12px; }
.isl-head img { width: 84px; height: 84px; object-fit: contain; }
.isl-head h2 { margin: 0; font-size: 18px; }
.isl-head p { margin: 0; }
.isl-head .pill { margin-left: auto; white-space: nowrap; }
.isl.locked .isl-head img { filter: grayscale(1); opacity: .6; }
.vols { list-style: none; padding: 0; margin: 12px 0 0; }
.vols li { border-top: 1px dashed #d9cdb3; }
.vols li a, .vols li.locked { display: flex; align-items: center; gap: 10px; padding: 10px 4px; color: var(--ink); text-decoration: none; }
.vols li.locked { color: var(--ink-2); }
.vols .no { font-family: var(--pixel); font-size: 12px; background: var(--sea-2); color: var(--paper); border-radius: 6px; padding: 0 6px; min-width: 52px; text-align: center; }
.vols li.locked .no { background: #b9c4cf; }
.grp { font-size: 15px; margin: 18px 0 0; color: var(--sea-2); }
.grp:first-child { margin-top: 0; }
.stamp { margin-left: auto; font-family: var(--pixel); font-size: 12px; color: var(--coral); border: 2px solid var(--coral); border-radius: 6px; padding: 0 6px; transform: rotate(-6deg); }
.stamp.big { display: inline-block; font-size: 22px; padding: 4px 16px; margin: 6px 0; }
.fog-card { background: #dfe7ee; }
.fog-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.fog-list li { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); }
.fog-list img { width: 40px; filter: grayscale(1); opacity: .6; }

/* ラジオ */
.player { display: flex; gap: 12px; align-items: center; background: var(--paper-2); border-radius: 14px; padding: 12px; }
.player img { width: 72px; }
.player p { margin: 0; }
.work, .answer { margin-top: 14px; }
.work h3, .answer h3 { font-size: 15px; margin: 0; }
.answer { background: repeating-linear-gradient(45deg, #efe4cc, #efe4cc 8px, #f6ecd6 8px, #f6ecd6 16px); border-radius: 12px; padding: 10px 12px; }
.answer.open { background: #e9f6df; }

/* 音声つきの回 */
.onair { background: var(--sea-0); color: var(--foam); border: 2px solid rgba(255, 207, 90, .5); }
.onair p { margin: 0 0 .7em; }
.onair-label { font-family: var(--pixel); color: var(--sun); letter-spacing: .15em; font-size: 13px; }
.onair-label::before { content: "●"; color: var(--coral); margin-right: 6px; animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .onair-label::before { animation: none; } }
.onair-mini { margin-left: auto; font-family: var(--pixel); font-size: 11px; color: var(--sea-0); background: var(--sun); border-radius: 6px; padding: 0 6px; }
.player-body { flex: 1; min-width: 0; }
.player audio { width: 100%; margin-top: 6px; }
.small { font-size: 13px; }

/* 画面で書ける穴埋めシート */
.sheet { background: #f4f2ef; border-radius: 12px; padding: 14px 10px; display: grid; gap: 6px; color: #2f3f8f; font-size: clamp(16px, 4.4vw, 22px); font-weight: 700; }
.sheet-row { display: flex; align-items: flex-start; justify-content: center; gap: 6px; flex-wrap: nowrap; }
.sheet-row > span { padding-top: 8px; white-space: nowrap; }
.sheet-row.right { justify-content: flex-end; padding-right: 22%; }
.sheet .arrow { font-size: 1.2em; line-height: 1; }
.blank { display: inline-flex; flex-direction: column; align-items: center; }
.blank input { width: min(9em, 30vw); font: 700 1em var(--round); color: var(--coral); text-align: center; background: #fff; border: 2px solid #3b4fa0; border-radius: 4px; padding: 6px 4px; }
.blank input:focus { outline: 3px solid var(--sun); outline-offset: 1px; }
.blank .ans { font-size: .7em; color: var(--green); margin-top: 2px; }
.answer-card.locked { background: repeating-linear-gradient(45deg, #efe4cc, #efe4cc 10px, #f6ecd6 10px, #f6ecd6 20px); }
.answer-img { display: block; width: 100%; border-radius: 10px; margin-top: 8px; }

/* にぎわい：乗船者の気配 */
.counter .pax { display: block; margin-top: 4px; font-size: 13px; color: var(--sun); }
.strip-count { font-family: var(--pixel); font-size: 10px; color: var(--sea-3); min-height: 1.4em; }
.others { position: absolute; right: -18px; bottom: -4px; display: flex; align-items: flex-end; }
.others img { width: 44px; height: 44px; margin-left: -22px; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25)); }
.others b { font-family: var(--pixel); font-weight: 400; font-size: 10px; color: var(--sea-1); background: var(--paper); border-radius: 6px; padding: 0 3px; margin-left: 2px; }
.vol-ttl { display: flex; flex-direction: column; min-width: 0; }
.heard-n { font-family: var(--pixel); font-size: 11px; color: var(--ink-2); }
.heard-big { font-family: var(--pixel); color: var(--sea-3); margin: 4px 0 0; }

/* みんなの反応 */
.reacts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.react { font: 700 14px var(--round); color: var(--ink); background: var(--paper-2); border: 2px solid #d9cdb3; border-radius: 999px; padding: 6px 14px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.react i { font-style: normal; font-family: var(--pixel); font-size: 12px; color: var(--ink-2); min-width: 1.2em; }
.react.on { border-color: var(--coral); background: #fff0ea; color: var(--coral); }
.react.on i { color: var(--coral); }
.react:focus-visible, .btn:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.hitokoto { margin-top: 16px; border-top: 1px dashed #d9cdb3; padding-top: 12px; }
.hitokoto-q { margin: 0 0 8px; font-weight: 700; text-align: center; }
.hitokoto-row { display: flex; gap: 6px; flex-wrap: wrap; }
.hitokoto input { font: 15px var(--round); padding: 8px 10px; border-radius: 10px; border: 2px solid #d9cdb3; min-width: 0; }
/* 紙色のカードの中の入力欄は、明るい色で固定（全体が夜の海の色なので、ふつうだと暗くなる） */
.card input, .gate-box input { background: #fff; color: var(--ink); color-scheme: light; }
.card input::placeholder, .gate-box input::placeholder { color: #9aa6b2; }
.hitokoto .nm { flex: 0 1 9em; }
.hitokoto .tx { flex: 1 1 12em; }
.hitokoto .btn { flex: 0 0 auto; }

/* リスナーからのお便り */
.note-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 4px 2px 10px; scrollbar-width: none; }
.note-track::-webkit-scrollbar { display: none; }
.note { position: relative; flex: 0 0 min(260px, 78%); scroll-snap-align: start; margin: 0; background: #fff; border: 2px solid #e8dcc0; border-radius: 14px; padding: 14px 14px 10px; box-shadow: 0 3px 0 #e8dcc0; }
.note blockquote { margin: 0 0 8px; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.note figcaption { font-size: 12px; color: var(--ink-2); }
.note.featured { border-color: var(--sun); box-shadow: 0 3px 0 var(--gold); }
.on-air-badge { position: absolute; top: -10px; right: 10px; font-family: var(--pixel); font-size: 11px; color: var(--sea-0); background: var(--sun); border-radius: 6px; padding: 0 8px; }

/* 手紙 */
.letter h2 { font-size: 18px; margin: 0 0 6px; }
.letter p { margin: 0 0 4px; }

/* 客室 */
.ticket { display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, #fff6dc, #f3e2b8); border: 2px dashed var(--gold); border-radius: 14px; padding: 12px; }
.ticket > img { width: 120px; }
.ticket dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; flex: 1; }
.ticket dt { font-family: var(--pixel); font-size: 12px; color: var(--ink-2); }
.ticket dd { margin: 0; }
.ticket input { font: 15px var(--round); padding: 4px 8px; border-radius: 8px; border: 1px solid #c9b78f; width: min(180px, 100%); }
@media (max-width: 560px) { .ticket { flex-direction: column; } }
.stamps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; margin: 12px 0; }
.stamps li { aspect-ratio: 1; border-radius: 50%; border: 2px dashed #c9b78f; display: grid; place-items: center; font-family: var(--pixel); font-size: 13px; color: #b9a982; }
.stamps li.on { border: 3px solid var(--coral); color: var(--coral); background: #fff0ea; transform: rotate(-8deg); }
.flags { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.flags li { position: relative; text-align: center; font-size: 10px; line-height: 1.3; color: var(--ink-2); }
.flags li img { width: 56px; height: 56px; object-fit: contain; filter: grayscale(1); opacity: .5; }
.flags li.on img { filter: none; opacity: 1; }
.flags li .flag { position: absolute; top: -6px; right: 4px; width: 28px; height: 28px; filter: none; opacity: 1; }
.aiko { font-family: var(--pixel); font-size: clamp(18px, 5vw, 26px); text-align: center; background: var(--sea-1); color: var(--sun); border-radius: 12px; padding: 14px; letter-spacing: .06em; word-break: keep-all; overflow-wrap: anywhere; }
.books { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 560px) { .books { grid-template-columns: 1fr 1fr; } }
.book { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; background: var(--paper-2); border-radius: 12px; padding: 10px; color: var(--ink); }
.books.card, section.books .card { margin: 0; }
.book img { width: 96px; }
.book b { font-size: 14px; }
.book span { font-size: 11px; color: var(--ink-2); }
.book.locked img { filter: grayscale(1); opacity: .5; }

/* テレビ */
.ev img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; }
.ev h3 { margin: 8px 0 0; }

/* 救急BOX */
details { border-top: 1px dashed #d9cdb3; padding: 8px 0; }
summary { cursor: pointer; font-weight: 700; }

/* 試作用の操作 */
.demo { margin: 24px 0; border: 2px dashed rgba(255, 207, 90, .6); border-radius: 14px; padding: 12px; font-size: 13px; }
.demo p { margin: 0 0 8px; }
.demo-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.demo .btn { background: rgba(255, 255, 255, .12); box-shadow: none; }
.demo .btn.ghost { color: var(--foam); }

.foot { text-align: center; font-size: 12px; opacity: .6; padding: 8px 0 24px; }
