* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1a2a; }
body { font-family: "Yu Gothic UI", "Meiryo", "Hiragino Sans", sans-serif; font-size: 14px; color: #3a2a17; }
.hidden { display: none !important; }
#sea { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; cursor: crosshair; image-rendering: pixelated; }

h1, h2, h3 { font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; margin: 0; }
small { display: block; color: #7a684c; font-size: 12px; margin-top: 2px; }
.dim { color: #8a7758; font-size: 12.5px; }
.good { color: #1f7a3a; font-weight: bold; }
.bad { color: #b83222; font-weight: bold; }
.warn { color: #a9620c; }

button {
  font: inherit; color: #3a2a17; background: #e6d3a3; border: 1px solid #8a6a38; border-radius: 4px;
  padding: 5px 11px; cursor: pointer; margin: 2px; white-space: nowrap;
}
button:hover:not(:disabled) { background: #f5e6bd; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: #2f6f94; color: #fff; border-color: #1c4a66; font-weight: bold; }
button.primary:hover:not(:disabled) { background: #3b86b1; }
button.on { background: #7a5a2e; color: #fff; }

/* ---- 画面 ---- */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8, 16, 28, .68); z-index: 10; padding: 8px; }
.screen.clear { background: rgba(8, 16, 28, .15); }
#mapview { z-index: 20; }
#book { z-index: 25; }
#modal { z-index: 30; }
.panel {
  background: #f2e6c8 linear-gradient(180deg, rgba(255,255,255,.35), rgba(160,120,60,.08));
  border: 3px solid #7a5a2e; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.6), inset 0 0 0 1px #d9c08a;
  width: min(980px, 100%); max-height: 100%; overflow: auto; padding: 16px 20px;
}
.panel header { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid #b79a62; padding-bottom: 8px; }
.panel header h2 { font-size: 26px; display: inline; margin-right: 10px; }
.sub { color: #7a684c; }
.status { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; }
.panel nav { margin: 10px 0 6px; }
.panel nav button { padding: 7px 18px; font-weight: bold; }
.panel section { min-height: 300px; }
.panel footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 2px solid #b79a62; margin-top: 10px; padding-top: 8px; }
.panel footer .msg { flex: 1; min-height: 20px; }
.panel h3 { margin: 14px 0 4px; font-size: 16px; border-left: 4px solid #7a5a2e; padding-left: 8px; }
.acts { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { font-size: 12px; color: #7a684c; font-weight: normal; border-bottom: 1px solid #b79a62; padding: 3px 6px; }
.tbl td { padding: 4px 6px; border-bottom: 1px solid rgba(183,154,98,.45); text-align: center; }
.tbl .l { text-align: left; }
.tbl td small { display: inline; margin-left: 6px; }
.tbl td.b { white-space: nowrap; }
.tbl td.b button { padding: 2px 8px; font-size: 13px; }
.tbl tr.cur { background: rgba(122,90,46,.14); }
.tag { font-size: 11px; border-radius: 3px; padding: 1px 5px; color: #fff; margin-left: 3px; }
.tag.sp { background: #2f6f94; } .tag.hi { background: #b5482f; } .tag.q { background: #2e8b4e; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 6px; border-bottom: 1px solid rgba(183,154,98,.45); }
.row.hl { background: rgba(232,195,58,.25); }
.row .b { white-space: nowrap; }

/* ---- タイトル ---- */
#title {
  display: block; padding: 0; overflow-x: hidden; overflow-y: auto; isolation: isolate;
  color: #f7ecd5; background: #102b46;
}
#title::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: url("img/title/title_bg.webp") center center / cover no-repeat;
  image-rendering: pixelated;
}
#title::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(5,17,35,.34), transparent 40%, rgba(3,14,29,.24) 70%, rgba(3,14,29,.8)),
    radial-gradient(ellipse at center, transparent 40%, rgba(3,14,29,.3));
}
#title .title-content {
  width: min(1700px, 100%); min-height: 100%; margin: auto;
  display: flex; flex-direction: column; padding: clamp(24px, 5vh, 62px) clamp(24px, 6vw, 100px) 18px;
}
#title .title-logo { text-align: center; flex: none; }
#title .title-ornament { display: flex; align-items: center; justify-content: center; gap: 18px; color: #edcc87; margin-bottom: 8px; }
#title .title-ornament::before, #title .title-ornament::after { content: ""; width: 100px; height: 1px; background: linear-gradient(90deg, transparent, #e8c689); }
#title .title-ornament::after { transform: rotate(180deg); }
#title .title-ornament span { font-size: 28px; line-height: 1; text-shadow: 0 2px 8px #091b30; }
#title h1 {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(42px, 4.8vw, 86px); font-weight: 700; line-height: 1.45; letter-spacing: .09em;
  color: #ffedbe; text-shadow: 0 2px 0 #6c4b27, 0 4px 6px #071b32, 0 0 22px rgba(3,14,29,.9);
  -webkit-text-stroke: .5px #e6bb70;
}
#title .title-subtitle {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(14px, 1.4vw, 22px); letter-spacing: .14em; margin: 5px 0 0; color: #ffe7b3;
  text-shadow: 0 2px 4px #071627, 0 0 12px #071627;
}
#title .title-tagline { font-size: 13px; letter-spacing: .2em; margin: 18px 0 24px; text-shadow: 0 2px 4px #061526; }
#title .title-menu {
  width: 430px; max-width: 100%; margin: auto 0 0 auto; padding: 23px 28px 19px;
  background: linear-gradient(135deg, rgba(16,39,57,.95), rgba(6,23,40,.94));
  border: 1px solid #b99b64; border-radius: 3px;
  box-shadow: 0 12px 36px #03122180, inset 0 0 0 5px #081d2c, inset 0 0 0 6px #b99b6438;
}
#title .title-menu h2 { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; color: #eed39c; text-align: center; font-size: 17px; font-weight: normal; letter-spacing: .22em; }
#title .title-menu h2::before, #title .title-menu h2::after { content: ""; height: 1px; flex: 1; background: #b99b6455; }
#title .title-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#title .title-fields label { min-width: 0; font-size: 12px; letter-spacing: .08em; color: #deccaa; }
#title input, #title select {
  display: block; width: 100%; min-width: 0; height: 41px; margin-top: 7px; padding: 7px 10px;
  font: inherit; font-size: 15px; color: #f9edd4; border: 1px solid #a98c5b88; border-radius: 2px; background: #091c2d;
  color-scheme: dark;
}
#title .title-actions { margin-top: 20px; }
#title button {
  margin: 0; min-height: 43px; border-radius: 2px; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  border: 1px solid #af925b; background: #132d42; color: #f3dfb6;
  transition: background .18s, box-shadow .18s;
}
#title #btn-new {
  display: block; width: 100%; min-height: 54px; font-size: 21px; letter-spacing: .15em;
  color: #2d251b; background: linear-gradient(#f2dfb1, #c8a569); border-color: #f0d29a;
  box-shadow: inset 0 0 0 3px #8b68333d, 0 3px 12px #0004;
}
#title #btn-new span { margin-left: 12px; }
#title #btn-new:hover { background: linear-gradient(#fff0c8, #e0bf84); box-shadow: 0 0 20px #e7c78c40; }
#title .title-secondary { display: flex; gap: 10px; margin-top: 10px; }
#title .title-secondary button { flex: 1; font-size: 15px; }
#title .title-secondary button:hover { background: #25475d; }
#title :is(button, input, select):focus-visible { outline: 2px solid #ffe0a1; outline-offset: 4px; }
#title .title-save { margin: 15px 0 0; font-size: 11px; line-height: 1.6; text-align: center; color: #c4c1b5; }
#title .title-note { margin-top: 22px; text-align: center; color: #dfd6c4; font-size: 12px; line-height: 1.7; letter-spacing: .05em; text-shadow: 0 1px 4px #000; }
@media (min-width: 1600px) and (min-height: 900px) {
  #title .title-menu { width: 470px; padding: 29px 34px 25px; margin-bottom: 30px; }
  #title .title-fields label { font-size: 13px; }
  #title .title-actions { margin-top: 24px; }
}
@media (max-width: 680px) {
  #title::before { background-position: 32% center; }
  #title::after { background: linear-gradient(#071b3055, #071b3010 40%, #03101de6); }
  #title .title-content { padding: 24px 18px 18px; min-height: 100%; }
  #title .title-ornament { margin-bottom: 12px; }
  #title .title-ornament::before, #title .title-ornament::after { width: 65px; }
  #title h1 { max-width: 390px; margin: auto; font-size: clamp(28px, 7vw, 45px); letter-spacing: .035em; }
  #title .title-subtitle { font-size: clamp(10px, 2.8vw, 15px); letter-spacing: 0; margin-top: 10px; }
  #title .title-tagline { font-size: 11px; letter-spacing: .07em; margin: 15px 0 30px; }
  #title .title-menu { margin: auto auto 0; padding: 21px 21px 18px; }
  #title .title-note { margin-top: 16px; font-size: 10px; letter-spacing: 0; }
}
@media (max-height: 650px) {
  #title .title-content { padding-top: 14px; }
  #title .title-ornament { display: none; }
  #title h1 { font-size: clamp(28px, 4vw, 52px); }
  #title .title-tagline { margin: 8px 0 18px; }
  #title .title-menu { margin-top: 12px; }
}

/* ---- 海図・モーダル ---- */
.panel.map { width: min(1400px, 100%); }
#worldmap { width: 100%; height: auto; max-height: calc(100vh - 170px); display: block; margin: 10px auto 0; border: 2px solid #7a5a2e; cursor: crosshair; image-rendering: pixelated; background: #131c26; touch-action: none; }
.panel.modal { width: min(560px, 100%); text-align: center; }
.panel.modal h2 { font-size: 24px; margin-bottom: 8px; color: #1c4a66; }
.panel.modal p { line-height: 1.7; }

/* ---- HUD ---- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; color: #f1f5f9; }
#hud button { pointer-events: auto; }
#topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; justify-content: center; padding: 7px 12px; background: linear-gradient(180deg, rgba(8,16,28,.92), rgba(8,16,28,.6)); border-bottom: 1px solid rgba(201,168,92,.5); font-size: 14px; }
#topbar .bad { color: #ff8a75; }
#log { position: absolute; left: 12px; bottom: 44px; width: min(460px, 60vw); font-size: 13.5px; line-height: 1.55; text-shadow: 0 1px 2px #000, 0 0 4px #000; }
#log div { background: rgba(8,16,28,.5); padding: 1px 8px; border-radius: 3px; margin-top: 2px; }
#log div:nth-last-child(n+5) { opacity: .55; }
#log .good { color: #9dffb0; } #log .bad { color: #ff8a75; } #log .warn { color: #ffd27a; }
#help { position: absolute; left: 12px; bottom: 10px; font-size: 12px; opacity: .8; text-shadow: 0 1px 2px #000; }
#controls { position: absolute; right: 12px; bottom: 172px; width: 276px; }
#hud.nomini #controls { bottom: 12px; }
#sailinfo { background: rgba(8,16,28,.78); border: 1px solid rgba(201,168,92,.6); border-radius: 4px; padding: 6px 8px; text-align: center; margin: 2px; }
#minimap { position: absolute; right: 14px; bottom: 12px; width: 240px; height: 150px; border: 2px solid #c9a85c; border-radius: 4px; image-rendering: pixelated; background: #131c26; }
#btn-enter { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); font-size: 17px; padding: 11px 24px; box-shadow: 0 4px 16px rgba(0,0,0,.5); }

@media (max-width: 720px) {
  #help { display: none; }
  #log { bottom: 12px; }
  .tbl.ships th:nth-child(7), .tbl.ships td:nth-child(7), .tbl.ships th:nth-child(2), .tbl.ships td:nth-child(2) { display: none; }
  .row { flex-wrap: wrap; }
  }

/* ---- 交易・探検・図鑑 ---- */
.pdesc { margin: 8px 2px 0; color: #5d4a2c; font-size: 13px; line-height: 1.6; }
small.in { display: inline; margin-left: 8px; }
.tbl td.l small { display: block; margin: 1px 0 0; }
.lv { margin: 5px 0 2px; }
.xp { display: inline-block; width: 150px; height: 9px; margin-left: 10px; background: #cdbb90; border: 1px solid #8a6a38; border-radius: 5px; overflow: hidden; vertical-align: middle; }
.xp i { display: block; height: 100%; background: #2f6f94; }
.row.stage { align-items: flex-start; }
.reqs { margin: 5px 0 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.req { font-size: 12px; border-radius: 3px; padding: 1px 7px; border: 1px solid; }
.req.ok { color: #1f6a35; border-color: #8fbf9a; background: rgba(46,139,78,.12); }
.req.ng { color: #a12a1c; border-color: #d9a59c; background: rgba(184,50,34,.1); font-weight: bold; }
.found { color: #7a5a12; font-weight: bold; }
.hint { color: #2f6f94; font-size: 12.5px; }
.stype { font-size: 12px; color: #7a684c; margin-left: 8px; font-weight: normal; }
.find { text-align: left; background: rgba(232,195,58,.2); border: 1px solid #c9a85c; border-radius: 6px; padding: 8px 12px; margin: 8px 0; }
.find p { margin: 4px 0 0; }
.panel section.scroll { max-height: calc(100vh - 210px); overflow: auto; }
.panel header > div:last-child button { padding: 4px 9px; }
#sailinfo small { display: inline; color: #b9c7d6; }
.tbl th { white-space: nowrap; }

/* ---- 発見物のイラスト ---- */
.art { display: block; width: 100%; max-width: 360px; margin: 0 auto 8px; border: 2px solid #7a5a2e; border-radius: 6px; background: #e9dcb8; }
.art.th { width: 150px; flex: none; margin: 0; }
.row.site { justify-content: flex-start; align-items: flex-start; }

/* ---- 航海中の依頼表示 ---- */
#quests { position: absolute; left: 12px; top: 48px; width: min(300px, 46vw); font-size: 13px; line-height: 1.5; }
#quests:empty { display: none; }
#quests h4 { margin: 0; padding: 3px 9px; background: rgba(8,16,28,.82); border-radius: 4px 4px 0 0; color: #e8c33a; font-size: 12.5px; }
#quests div { background: rgba(8,16,28,.62); padding: 3px 9px; border-top: 1px solid rgba(255,255,255,.12); }
#quests div:last-child { border-radius: 0 0 4px 4px; }
#quests small { color: #b9c7d6; margin: 0; }
#quests .good { color: #9dffb0; } #quests .bad { color: #ffb39a; }
@media (max-width: 720px) { #quests { top: 78px; } }

/* ---- ゲージ・航海画面の操作盤 ---- */
.g { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.bar { display: inline-block; width: 54px; height: 8px; background: rgba(120,120,120,.35); border: 1px solid rgba(0,0,0,.45); border-radius: 4px; overflow: hidden; }
.bar u { display: block; height: 100%; background: #4fae5e; }
.g.bad .bar u { background: #e0523c; }
#topbar .where b { color: #ffe9a6; }
#topbar .gold b { color: #ffd84a; }
.cgrid { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.cgrid button { padding: 5px 2px; font-size: 12px; margin: 1px; }
.sails { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 13px; }
.sails i { width: 16px; height: 13px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.45); border-radius: 2px 7px 7px 2px; }
.sails i.on { background: #fbf6e6; }
.sails b { font-size: 20px; margin-left: 8px; color: #fff; }
#banner { position: absolute; top: 15%; left: 50%; transform: translateX(-50%); text-align: center; opacity: 0; pointer-events: none; padding: 8px 46px;
  background: linear-gradient(90deg, rgba(8,16,28,0), rgba(8,16,28,.8) 22%, rgba(8,16,28,.8) 78%, rgba(8,16,28,0)); border-top: 1px solid rgba(201,168,92,.7); border-bottom: 1px solid rgba(201,168,92,.7); }
#banner b { display: block; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 28px; letter-spacing: .2em; color: #fff; }
#banner small { color: #e8c33a; }
#banner.show { animation: banner 3.2s ease-out; }
@keyframes banner { 0% { opacity: 0; } 12% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }

/* ---- 街の画面 (街の絵いっぱいに施設が並ぶ) ---- */
#port { padding: 0; background: #0d1a2a; }
.tw { position: absolute; inset: 0; overflow: hidden; color: #f1f5f9; }
.scene { position: absolute; inset: 0; background: #1d5aa6; }
.scene img.sc { width: 100%; height: 100%; display: block; object-fit: cover; image-rendering: pixelated; }
.scene.empty { background: linear-gradient(180deg, #7fbdea 0, #d8eefc 52%, #63b552 52%, #479a3e 100%); display: flex; align-items: center; justify-content: center; }
.scene img.tw-img { width: min(38%, 420px); image-rendering: pixelated; margin-top: 4%; }
.scene::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,16,28,.6) 0, rgba(8,16,28,0) 20%, rgba(8,16,28,0) 72%, rgba(8,16,28,.7) 100%); }
.tw-top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 14px; flex-wrap: wrap; }
.plate { background: linear-gradient(180deg, #f5e9c6, #e2cd9a); color: #3a2a17; border: 2px solid #7a5a2e; border-radius: 0 0 14px 14px; margin-top: -10px; padding: 12px 22px 8px; box-shadow: 0 4px 12px rgba(0,0,0,.45); }
.plate h2 { font-size: 26px; letter-spacing: .08em; }
.plate span { display: inline-block; margin-right: 12px; font-size: 12.5px; color: #7a684c; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; flex: 1; }
.chips .g { background: rgba(8,16,28,.78); border: 1px solid rgba(201,168,92,.65); border-radius: 999px; padding: 5px 12px; font-size: 13.5px; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.chips .g.bad { border-color: #ff8a75; color: #ffb39a; }
.chips .gold b { color: #ffd84a; }
.tw-spots { position: absolute; inset: 0; pointer-events: none; }
button.spot { position: absolute; pointer-events: auto; transform: translate(-50%, -50%); background: none; border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0; animation: spot 2.8s ease-in-out infinite; }
button.spot:hover:not(:disabled) { background: none; }
button.spot i { position: relative; font-style: normal; font-size: 34px; width: 76px; height: 76px; line-height: 70px; text-align: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff8dc, #e8cf8e 70%, #c9a85c); border: 3px solid #7a5a2e; box-shadow: 0 0 0 3px rgba(255,255,255,.55), 0 6px 14px rgba(0,0,0,.55); transition: transform .12s; }
button.spot b { margin-top: -8px; position: relative; background: linear-gradient(180deg, #2f6f94, #1c4a66); color: #fff; border: 2px solid #f2e6c8; border-radius: 999px; padding: 3px 16px; font-size: 15px; box-shadow: 0 3px 8px rgba(0,0,0,.5); }
button.spot:hover i { transform: scale(1.12); }
button.spot:active i { transform: scale(.95); }
@keyframes spot { 0%, 100% { margin-top: 0; } 50% { margin-top: -7px; } }
.badge { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; line-height: 20px; border-radius: 11px; background: #e0392a; color: #fff; border: 2px solid #fff; font: bold 13px/18px sans-serif; text-align: center; font-style: normal; animation: badge 1s ease-in-out infinite; }
@keyframes badge { 50% { transform: scale(1.18); } }
.tw-toast { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); max-width: 92%; background: rgba(8,16,28,.85); border: 1px solid rgba(201,168,92,.7); border-radius: 999px; padding: 7px 22px; font-size: 14px; animation: toast .25s ease-out; }
.tw-toast .good { color: #9dffb0; } .tw-toast .bad { color: #ff8a75; } .tw-toast .warn { color: #ffd27a; }
@keyframes toast { from { opacity: 0; bottom: 80px; } }
.tw-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; padding: 10px 14px; }
.tw-bottom .menu { display: flex; gap: 6px; background: rgba(8,16,28,.8); border: 1px solid rgba(201,168,92,.65); border-radius: 16px; padding: 6px 8px; }
.tw-bottom .menu button { display: flex; flex-direction: column; align-items: center; min-width: 74px; background: none; border: 0; color: #f1f5f9; font-size: 12px; padding: 4px 6px; border-radius: 10px; }
.tw-bottom .menu button i { font-style: normal; font-size: 24px; line-height: 1.2; }
.tw-bottom .menu button:hover { background: rgba(255,255,255,.14); }
button.sail { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 30px 10px 20px; border-radius: 999px; border: 3px solid #fff3c4; background: linear-gradient(180deg, #ffc94a, #e58a1c); color: #4a2a05; box-shadow: 0 6px 16px rgba(0,0,0,.55); }
button.sail:hover:not(:disabled) { background: linear-gradient(180deg, #ffd96e, #f09a2c); transform: scale(1.04); }
button.sail i { font-style: normal; font-size: 34px; }
button.sail b { font-size: 22px; letter-spacing: .2em; }
button.sail small { color: #6b3d08; margin: 0; }
.tinfo { font-size: 14px; line-height: 2; }
.tinfo b { display: inline-block; min-width: 9.5em; color: #7a5a2e; }
.npc { margin: 4px 0 8px; padding: 8px 12px; background: rgba(122,90,46,.12); border-left: 4px solid #7a5a2e; border-radius: 0 6px 6px 0; font-size: 13.5px; }
.npc b { display: inline-block; margin-right: 12px; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 16px; }
.stat2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.tbl.kv td { text-align: right; } .tbl.kv td.l { text-align: left; color: #7a684c; white-space: nowrap; }
.shipimg { float: right; width: 120px; image-rendering: pixelated; margin: -6px 0 0 8px; }
@media (max-width: 760px) { .stat2 { grid-template-columns: 1fr; } button.spot i { width: 58px; height: 58px; line-height: 52px; font-size: 26px; } button.spot b { font-size: 12.5px; padding: 2px 10px; } .tw-bottom .menu button { min-width: 54px; } button.sail { padding: 8px 18px 8px 12px; } #topbar { font-size: 12px; gap: 2px 10px; } .bar { width: 34px; } }

/* ---- 施設のウィンドウ ---- */
.fwin { position: fixed; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 14px 8px; background: rgba(8, 16, 28, .55); }
.panel.fac { position: relative; width: min(1020px, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: visible; border-radius: 16px; }
.panel.fac.in { animation: fwin .22s ease-out; }
@keyframes fwin { from { transform: translateY(40px) scale(.96); } }
.panel.fac header { align-items: center; padding-right: 30px; }
.panel.fac header .status { font-size: 13px; gap: 10px; }
.panel.fac nav { margin: 8px 0 2px; display: flex; flex-wrap: wrap; gap: 4px; }
.panel.fac nav button { position: relative; display: flex; align-items: center; gap: 6px; margin: 0; padding: 6px 14px; border-radius: 999px; }
.panel.fac nav button i { font-style: normal; font-size: 18px; }
.panel.fac nav .badge { top: -7px; right: -5px; }
.panel.fac section { flex: 1; min-height: 120px; overflow: auto; padding-right: 4px; }
button.xbtn { position: absolute; top: -14px; right: -10px; width: 40px; height: 40px; padding: 0; border-radius: 50%; background: #b83222; color: #fff; border: 3px solid #fff; font-size: 18px; font-weight: bold; box-shadow: 0 3px 8px rgba(0,0,0,.5); z-index: 1; }
button.xbtn:hover:not(:disabled) { background: #d9442f; }
small.perk { color: #1c5a7a; }
#topbar .vday { color: #ffe9a6; margin-left: 10px; }
.cgrid #btn-go { grid-column: 1 / -1; font-size: 15px; padding: 8px; font-weight: bold; }
.gi { width: 32px; height: 32px; image-rendering: pixelated; vertical-align: middle; margin-right: 6px; float: left; }
.row .gi { float: left; }
/* ---- 航海: 天候と帆 ---- */
#topbar .wx.bad { color: #ff8a75; font-weight: bold; }
#topbar small.in { color: #b9c7d6; }
.adv { margin: 3px 0 1px; padding: 2px 6px; border-radius: 3px; background: rgba(255,255,255,.1); font-size: 12.5px; }
.adv.good { color: #9dffb0; } .adv.warn { color: #ffd27a; } .adv.bad { color: #fff; background: #b83222; font-weight: bold; }
#sailinfo small { display: block; }

/* ---- スマホ (横画面専用) ---- */
html, body { overscroll-behavior: none; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
input, select { -webkit-user-select: text; user-select: text; }
#sea { touch-action: none; height: 100dvh; }
#rotate { display: none; position: fixed; inset: 0; z-index: 99; background: #0d1a2a; color: #f1f5f9; align-items: center; justify-content: center; text-align: center; padding: 20px; }
#rotate i { display: block; font-style: normal; font-size: 64px; animation: rotate-hint 2.6s ease-in-out infinite; }
#rotate b { display: block; font-size: 20px; margin-top: 14px; }
#rotate small { color: #b9c7d6; font-size: 14px; margin-top: 6px; }
@keyframes rotate-hint { 0%, 20% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (orientation: portrait) and (pointer: coarse) { #rotate { display: flex; } }
/* 切り欠きのある端末で、端の表示が隠れないように */
#topbar { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
#controls { right: max(12px, env(safe-area-inset-right)); }
#minimap { right: max(14px, env(safe-area-inset-right)); }
#log, #help, #quests { left: max(12px, env(safe-area-inset-left)); }
.tw-top, .tw-bottom { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
.screen { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
#port { padding: 0; }

/* 高さの小さい横画面 (スマホを横に持ったとき) */
@media (max-height: 540px) {
  body { font-size: 13px; }
  #topbar { font-size: 11.5px; padding-top: 3px; padding-bottom: 3px; gap: 1px 10px; }
  #topbar .bar { width: 26px; height: 6px; }
  #topbar > span:nth-last-child(2) { display: none; }
  #quests { top: 30px; width: 210px; font-size: 11.5px; line-height: 1.35; }
  #quests h4 { font-size: 11px; padding: 1px 8px; }
  #quests small { font-size: 10.5px; }
  #log { bottom: 6px; width: 44vw; font-size: 11.5px; line-height: 1.4; }
  #log div:nth-last-child(n+4) { display: none; }
  #help { display: none !important; }
  #minimap { width: 132px; height: 82px; bottom: 6px; }
  #controls { bottom: 94px; width: 216px; }
  #hud.nomini #controls { bottom: 6px; }
  #sailinfo { padding: 3px 6px; }
  #sailinfo small { font-size: 10.5px; }
  .sails b { font-size: 16px; }
  .adv { font-size: 11px; margin: 1px 0; }
  .cgrid button { font-size: 11px; padding: 7px 1px; }
  .cgrid #btn-go { font-size: 13px; padding: 7px; }
  #btn-enter { top: 58%; font-size: 14px; padding: 9px 18px; }
  #banner { top: 12%; padding: 4px 34px; }
  #banner b { font-size: 19px; }
  /* 街 */
  .plate { padding: 12px 14px 4px; }
  .plate h2 { font-size: 18px; }
  .plate span { font-size: 10.5px; margin-right: 8px; }
  .tw-top { padding-top: 6px; }
  .chips { gap: 4px; }
  .chips .g { font-size: 11px; padding: 3px 8px; }
  .chips .bar { width: 26px; height: 6px; }
  button.spot i { width: 54px; height: 54px; line-height: 48px; font-size: 24px; }
  button.spot b { font-size: 12px; padding: 2px 10px; margin-top: -6px; }
  .tw-bottom { padding-top: 6px; padding-bottom: 6px; }
  .tw-bottom .menu { padding: 3px 5px; border-radius: 12px; }
  .tw-bottom .menu button { min-width: 58px; font-size: 10.5px; padding: 3px 4px; }
  .tw-bottom .menu button i { font-size: 18px; }
  button.sail { padding: 6px 18px 6px 12px; }
  button.sail i { font-size: 24px; }
  button.sail b { font-size: 17px; }
  button.sail small { display: none; }
  .tw-toast { bottom: 62px; font-size: 12px; padding: 4px 14px; }
  /* 施設のウィンドウと日誌は画面いっぱいに */
  .fwin { padding: 0; }
  .panel { padding: 8px 12px; }
  .panel.fac, #book .panel { width: 100%; height: 100%; max-height: 100%; border-radius: 0; border-width: 0; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  #book { padding: 0; }
  #book .panel { display: flex; flex-direction: column; overflow: hidden; }
  button.xbtn { top: 5px; right: max(6px, env(safe-area-inset-right)); width: 34px; height: 34px; font-size: 15px; }
  .panel header { padding-bottom: 4px; gap: 6px; }
  .panel header h2 { font-size: 18px; }
  .panel.fac header { padding-right: 44px; }
  .panel.fac header .status { font-size: 11px; gap: 8px; }
  .panel.fac header .bar { width: 26px; }
  .panel nav, .panel.fac nav { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 4px; margin: 5px 0 2px; padding: 2px 0 3px; flex: none; }
  .panel nav button, .panel.fac nav button { padding: 5px 11px; font-size: 12px; margin: 0; flex: none; }
  .npc { display: none; }
  .panel section { min-height: 0; }
  .panel section.scroll { max-height: none; flex: 1; }
  .panel footer { margin-top: 4px; padding-top: 4px; }
  .panel footer .msg { font-size: 12px; }
  .panel h3 { margin: 9px 0 3px; font-size: 14px; }
  .row { padding: 5px 4px; gap: 8px; }
  .tbl td { padding: 3px 4px; }
  .row .b button, .tbl td.b button { padding: 6px 10px; font-size: 12.5px; }
  small { font-size: 11px; }
  .art.th { width: 110px; }
  .art { max-width: 250px; }
  /* 海図・メッセージ */
  .panel.map { padding: 6px 10px; }
  .panel.map header button { padding: 5px 8px; font-size: 12px; }
  #worldmap { max-height: calc(100dvh - 92px); margin-top: 5px; }
  #map-hint { margin: 3px 0 0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .panel.modal h2 { font-size: 19px; margin-bottom: 4px; }
  .panel.modal p { line-height: 1.5; margin: 6px 0; }
}
@media (max-height: 540px) {
  /* タイトル */
  #title .title-content { padding-top: 6px; padding-bottom: 6px; }
  #title .title-ornament, #title .title-tagline, #title .title-note, #title .title-menu h2 { display: none; }
  #title h1 { font-size: clamp(22px, 7.5vh, 34px); }
  #title .title-subtitle { font-size: 11px; margin-top: 2px; }
  #title .title-menu { margin-top: 8px; margin-bottom: 0; padding: 10px 16px 8px; }
  #title .title-fields { gap: 10px; }
  #title input, #title select { padding-top: 5px; padding-bottom: 5px; min-height: 0; height: 32px; font-size: 14px; }
  #title .title-actions { margin-top: 8px; display: flex; gap: 8px; align-items: stretch; }
  #title #btn-new { flex: 1.3; min-height: 0; height: 40px; padding: 0 10px; font-size: 16px; margin: 0; }
  #title .title-secondary { flex: 1; margin-top: 0; gap: 6px; }
  #title .title-secondary button { min-height: 0; height: 40px; padding: 0 6px; font-size: 12.5px; margin: 0; }
  #title .title-save { margin-top: 5px; font-size: 10px; }
  /* 航海: 操作盤は小さな海図の左に置き、羅針盤を隠さない */
  #controls { right: calc(max(14px, env(safe-area-inset-right)) + 140px); bottom: 6px; width: 250px; }
  #hud.nomini #controls { right: max(12px, env(safe-area-inset-right)); }
  .cgrid { grid-template-columns: repeat(4, 1fr); }
  #sailinfo small:first-of-type { display: none; }
  #btn-enter { top: 22%; }
  #log { width: 36vw; }
}

/* ---- 交易所: 買う (青) と売る (橙) を色で分ける ---- */
.mkseg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 2px 0 0; }
button.seg { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 7px 8px; border-radius: 10px 10px 0 0; border-width: 2px 2px 0; text-align: left; opacity: .62; white-space: normal; }
button.seg i { font-style: normal; font-size: 24px; }
button.seg b { font-size: 17px; display: block; }
button.seg small { margin: 0; color: inherit; opacity: .85; }
button.seg.on { opacity: 1; color: #fff; }
button.seg.buy.on { background: #2f6f94; border-color: #1c4a66; }
button.seg.sell.on { background: #c9661c; border-color: #8a4310; }
button.seg.sup.on { background: #4c7a3a; border-color: #2f5223; }
.mk { border: 3px solid; border-radius: 0 0 10px 10px; padding: 4px 8px 8px; }
.mk.buy { border-color: #2f6f94; background: rgba(47,111,148,.09); }
.mk.sell { border-color: #c9661c; background: rgba(201,102,28,.1); }
.mk.sup { border-color: #4c7a3a; background: rgba(76,122,58,.09); }
.mkhead { font-size: 17px; padding: 6px 4px 4px; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; }
.mkhead small { display: inline; margin-left: 12px; font-family: "Yu Gothic UI", "Meiryo", sans-serif; }
.mk.buy .mkhead b { color: #1c5a7a; } .mk.sell .mkhead b { color: #b0500c; }
.mk.buy td.b button { background: #2f6f94; color: #fff; border-color: #1c4a66; }
.mk.buy td.b button:hover:not(:disabled) { background: #3b86b1; }
.mk.sell td.b button { background: #c9661c; color: #fff; border-color: #8a4310; }
.mk.sell td.b button:hover:not(:disabled) { background: #de7a2c; }
/* ---- 航海の操作盤 ---- */
.cgrid button i, #btn-go i, #btn-speed i { font-style: normal; }
#btn-more { display: none; }
#minimap { pointer-events: auto; cursor: pointer; }
#title .title-fields { grid-template-columns: 1fr; }
@media (max-height: 540px) {
  /* スマホ: 海を広く見せるため、操作盤は丸いボタン4つだけにする (残りは ☰ で開く) */
  #controls { right: calc(max(14px, env(safe-area-inset-right)) + 140px); bottom: 6px; width: auto; display: flex; flex-direction: column; align-items: flex-end; pointer-events: none; }
  #hud.nomini #controls { right: max(12px, env(safe-area-inset-right)); }
  #sailinfo { padding: 2px 10px; border-radius: 999px; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
  #sailinfo small { display: none !important; }
  #sailinfo .sails i { display: none; }
  #sailinfo .sails b { font-size: 14px; margin: 0; }
  #sailinfo .adv { background: none; margin: 0; padding: 0; font-size: 11px; }
  .cgrid { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 250px; }
  .cgrid button, .cgrid #btn-go { width: 44px; height: 44px; padding: 0; margin: 0; border-radius: 50%; font-size: 11px; line-height: 1.1; box-shadow: 0 2px 6px rgba(0,0,0,.5); grid-column: auto; }
  .cgrid button i { display: block; font-size: 18px; }
  .cgrid button span { display: none; }
  #btn-speed { font-size: 10px; }
  #btn-speed i { font-size: 14px; }
  #btn-more { display: inline-block; }
  .cgrid .ex { display: none; }
  #controls.more .cgrid .ex { display: inline-block; }
  #controls.more #btn-more { background: #7a5a2e; color: #fff; }
  .mkseg { gap: 4px; }
  button.seg { padding: 4px 6px; }
  button.seg i { font-size: 18px; }
  button.seg b { font-size: 14px; }
  button.seg small { font-size: 10px; }
  .mkhead { font-size: 14px; padding: 3px 4px 2px; }
  .mk .row.hl small { display: none; }
}
/* ---- 船の一覧: 説明は船名の下の行に ---- */
.tbl.ships tr.main td, .tbl.ships tr:has(+ tr.sdesc) td { border-bottom: 0; padding-bottom: 0; }
.tbl.ships tr.sdesc td { padding-top: 0; font-size: 12px; color: #7a684c; line-height: 1.5; }
.tbl.ships td.l b { white-space: nowrap; }
.row.shipbox { justify-content: flex-start; align-items: center; gap: 12px; }
.row.shipbox .shipimg { float: none; width: 96px; margin: 0; flex: none; }
@media (max-height: 540px) {
  .tbl.ships th, .tbl.ships td { font-size: 11.5px; padding-left: 3px; padding-right: 3px; }
  .tbl.ships tr.sdesc td { font-size: 10.5px; }
  .row.shipbox .shipimg { width: 72px; }
}

/* ---- 交易所: 値段の動きと合計額 ---- */
.mknote { margin: 4px 4px 2px; font-size: 12.5px; color: #5d4a2c; }
small.pn { display: block; margin: 0; font-size: 11px; font-weight: bold; }
small.pn.up { color: #b83222; } small.pn.down { color: #2f6f94; }
.mk td.b button { padding: 3px 9px; line-height: 1.25; vertical-align: middle; }
.mk td.b button small { display: block; margin: 0; color: inherit; font-size: 11px; opacity: .92; }
.tbl td small.pn { display: block; margin: 0; }
/* ---- 行き先の案内・遊び方 ---- */
#seahint { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); max-width: min(560px, 90vw); text-align: center; pointer-events: none; padding: 9px 22px; font-size: 14px; line-height: 1.6;
  background: rgba(8,16,28,.84); border: 1px solid rgba(201,168,92,.8); border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.5); animation: seahint 2.2s ease-in-out infinite; }
#seahint b { display: block; color: #ffe9a6; font-size: 17px; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; letter-spacing: .1em; }
#seahint small { color: #b9c7d6; margin: 0; }
@keyframes seahint { 50% { border-color: rgba(255,233,166,1); box-shadow: 0 4px 22px rgba(255,220,120,.35); } }
.howto { text-align: left; }
.howto p { margin: 7px 0; }
@media (max-height: 540px) {
  #seahint { top: 34%; padding: 5px 14px; font-size: 11.5px; line-height: 1.45; }
  #seahint b { font-size: 13.5px; }
  .mknote { font-size: 11px; margin: 2px 4px; }
  .mk td.b button { padding: 4px 7px; }
  .howto p { margin: 4px 0; font-size: 12px; }
  #title .title-secondary button { font-size: 11.5px; padding: 0 3px; }
}

/* ---- タイトル: 最初は PUSH START だけを出す ---- */
#title .title-start { display: none; }
#title.wait { cursor: pointer; }
#title.wait .title-menu, #title.wait .title-note { display: none; }
#title.wait .title-start { display: block; margin: auto 0 9vh; text-align: center; animation: pushstart 1.6s ease-in-out infinite; }
#title .title-start b { display: block; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(22px, 3.4vw, 40px); letter-spacing: .32em; color: #fff3cf; text-shadow: 0 0 14px #e7c78c, 0 2px 6px #061526; }
#title .title-start small { margin-top: 8px; font-size: 13px; letter-spacing: .15em; color: #e9e2d0; text-shadow: 0 1px 4px #000; }
@keyframes pushstart { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (max-height: 540px) { #title.wait .title-start { margin-bottom: 7vh; } #title .title-start small { font-size: 11px; } }

/* ---- 季節・嵐 ---- */
#topbar .season { color: #ffe9a6; margin-left: 6px; font-weight: normal; }
#topbar .season small, .plate small { display: inline; margin: 0; font-size: 10.5px; color: inherit; opacity: .8; }
small.storm { color: #a12a1c; }

/* ---- 手引き ---- */
#tut { z-index: 32; }
.panel.tutp { width: min(680px, 100%); display: flex; flex-direction: column; max-height: 100%; }
.panel.tutp header { align-items: center; }
.panel.tutp header .ic { font-size: 30px; margin-right: 8px; vertical-align: middle; }
.panel.tutp header h2 { font-size: 24px; vertical-align: middle; }
.tutb { line-height: 1.75; overflow: auto; padding: 4px 2px; }
.tutb p { margin: 8px 0; }
.tutb ul, .tutb ol { margin: 6px 0; padding-left: 1.4em; }
.tutb li { margin: 3px 0; }
.tutb .tbl td.tl { text-align: left; font-size: 13px; line-height: 1.55; }
.tutb .perk { color: #1c5a7a; }
.panel.tutp footer .dots { display: flex; gap: 6px; flex: 1; }
.panel.tutp footer .dots i { width: 9px; height: 9px; border-radius: 50%; background: #cdbb90; }
.panel.tutp footer .dots i.on { background: #2f6f94; }
button.lnk { background: none; border: 0; color: #7a684c; text-decoration: underline; padding: 2px 0; font-size: 12px; }
.askb { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.askb button { margin: 0; padding: 12px; font-size: 17px; font-weight: bold; white-space: normal; }
.askb button small { display: block; margin-top: 4px; font-weight: normal; font-size: 12px; color: inherit; opacity: .85; }
@media (max-height: 540px) {
  #tut { padding: 0; }
  .panel.tutp { width: 100%; height: 100%; border-radius: 0; border-width: 0; padding: 8px max(14px, env(safe-area-inset-left)); }
  .panel.tutp header h2 { font-size: 18px; } .panel.tutp header .ic { font-size: 22px; }
  .tutb { flex: 1; line-height: 1.55; font-size: 13px; }
  .tutb p { margin: 5px 0; }
  .askb button { padding: 8px; font-size: 15px; }
}

/* ---- ドット絵のアイコン (絵文字のかわり) ---- */
img.ico { width: 1.3em; height: 1.3em; vertical-align: -0.3em; image-rendering: pixelated; display: inline-block; }
button.spot i img.ico { width: 48px; height: 48px; vertical-align: middle; margin-top: -4px; }
button.fac i img.ico, button.sail i img.ico, .tw-bottom .menu button i img.ico { width: 32px; height: 32px; vertical-align: middle; }
.panel.tutp header .ic img.ico { width: 32px; height: 32px; }
#rotate i img.ico { width: 96px; height: 96px; }
.cgrid button i img.ico { width: 24px; height: 24px; vertical-align: middle; }
button.seg i img.ico { width: 32px; height: 32px; vertical-align: middle; }
#topbar img.ico, .chips img.ico { width: 16px; height: 16px; vertical-align: -3px; }
#topbar { gap: 4px 13px; }
#topbar .g { gap: 4px; }
@media (max-height: 540px) {
  button.spot i img.ico { width: 32px; height: 32px; }
  button.fac i img.ico, button.sail i img.ico, .tw-bottom .menu button i img.ico, button.seg i img.ico { width: 24px; height: 24px; }
  .cgrid button i img.ico { width: 22px; height: 22px; }
}

/* ---- 変更11: 不具合の修正と学習の仕掛け ---- */
#btn-enter { z-index: 6; }
@media (max-width: 900px) { #btn-enter { top: 40%; } }
#map-hint { min-height: 1.5em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 6px 0 0; }
.tbl.ships th { white-space: normal; }
#book .panel section.scroll { overflow-x: auto; }
.tbl.ships { min-width: 600px; }
small.era { display: inline !important; margin-left: 6px; color: #7a5a2e; font-size: 11px; }
.tag.rd { background: #7b4fa0; }
.panel.modal .acts { flex-direction: column; align-items: stretch; }
.panel.modal .acts button.mbtn { white-space: normal; text-align: left; padding: 9px 14px; line-height: 1.5; }
.panel.modal .acts button.mbtn small { display: block; margin-top: 2px; color: inherit; opacity: .8; }
@media (max-height: 540px) { .panel.modal .acts button.mbtn { padding: 6px 10px; font-size: 13px; } }

/* ---- 学習の仕掛け: 謎かけ・急ぎの依頼 ---- */
.tag.dl { background: #b5482f; }
p.clue { background: rgba(122,90,46,.12); border-left: 4px solid #7a5a2e; padding: 8px 12px; text-align: left; border-radius: 0 6px 6px 0; }
#quests div b.bad { color: #ffb39a; }

/* ---- もっと知る ---- */
details.more { margin-top: 4px; }
details.more summary { cursor: pointer; color: #2f6f94; font-size: 12.5px; font-weight: bold; list-style: none; }
details.more summary::before { content: '▸ '; }
details.more[open] summary::before { content: '▾ '; }
details.more p { margin: 4px 0 2px; font-size: 13px; line-height: 1.7; color: #3a2a17; background: rgba(47,111,148,.07); border-left: 3px solid #2f6f94; padding: 6px 10px; border-radius: 0 6px 6px 0; text-align: left; }

/* ---- 体験版・完全版への導線 ---- */
#title .title-edition { margin: 8px 0 0; font-size: 12px; text-align: center; color: #f2e6c8; }
#title .title-edition:empty { display: none; }
#title .title-edition b { color: #ffd84a; margin-right: 4px; }
a.lnkbtn { display: inline-block; margin: 4px; padding: 6px 14px; border-radius: 6px; background: #2f6f94; color: #fff; text-decoration: none; font-weight: bold; font-size: 13px; }
a.lnkbtn:hover { background: #3b86b1; }
p.links { text-align: center; }

/* ---- 遊びながら覚える手引き ---- */
#coach { position: fixed; inset: 0; z-index: 29; pointer-events: none; }
#coach .spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(8,16,28,.45); border: 3px solid #ffd84a; animation: coachpulse 1.2s ease-in-out infinite; }
@keyframes coachpulse { 50% { border-color: #fff3b0; box-shadow: 0 0 0 9999px rgba(8,16,28,.45), 0 0 18px 4px rgba(255,216,74,.8); } }
#coach .bubble { position: fixed; pointer-events: auto; background: #fffaf0; color: #3a2a17; border: 3px solid #7a5a2e; border-radius: 14px; padding: 10px 14px 8px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
#coach .who { font-weight: bold; color: #2f6f94; font-size: 13px; margin-bottom: 2px; }
#coach .bubble p { margin: 0 0 6px; line-height: 1.6; font-size: 14.5px; }
#coach .cb { display: flex; justify-content: space-between; align-items: center; flex-direction: row-reverse; gap: 8px; }
#coach .cb:empty { display: none; }
#coach .cb button.primary { margin: 0; }
p.askread { text-align: center; margin: 10px 0 0; }
p.askread button.lnk { font-size: 13px; }
@media (max-height: 540px) { #coach .bubble { padding: 6px 10px 4px; } #coach .bubble p { font-size: 12.5px; line-height: 1.45; margin-bottom: 3px; } }
body.coaching #seahint { display: none !important; }

/* ---- セーブの枠 ---- */
#slots { z-index: 26; }
.panel.slotp { width: min(640px, 100%); }
.slotname { display: block; margin: 10px 0 4px; font-size: 13px; color: #7a684c; }
.slotname input { display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 16px; padding: 7px 10px; border: 1px solid #8a6a38; border-radius: 6px; background: #fffaf0; }
.slots { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.slot { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid #b79a62; border-radius: 10px; background: rgba(255,255,255,.4); }
.slot .sn { font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 17px; font-weight: bold; color: #7a5a2e; white-space: nowrap; }
.slot .si { flex: 1; min-width: 0; }
.slot .si b { font-size: 16px; }
.slot .sb { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
@media (max-height: 540px) { #slots { padding: 0; } .panel.slotp { width: 100%; height: 100%; border-radius: 0; border-width: 0; overflow: auto; } .slot { padding: 6px 10px; } .slotname input { padding: 4px 8px; font-size: 14px; } }

/* 手引き: 光っている場所以外を押したとき、吹き出しを揺らして知らせる */
#coach .bubble.nudge { animation: coachNudge .35s; }
@keyframes coachNudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
/* 交渉の行: 説明が長くても右のボタン・表示がつぶれない */
.mk .row.hl > div:first-child { flex: 1; min-width: 0; }
.mk .row.hl > .b { flex: none; }
.mk .row.hl .negoend { display: inline-block; padding: 6px 10px; border: 1px dashed rgba(122,90,46,.6); border-radius: 8px; color: #6b5a3e; font-size: 12.5px; text-align: center; line-height: 1.35; }

/* 手引き中のクイズ: 正解を光らせ、ほかは押せなくする */
#modal .mbtn.coach-ok { box-shadow: 0 0 0 3px #f0c94a, 0 0 16px 4px rgba(240,201,74,.75); animation: coachGlow 1.2s ease-in-out infinite; }
#modal .mbtn.coach-ng { opacity: .4; cursor: not-allowed; }
@keyframes coachGlow { 50% { box-shadow: 0 0 0 3px #f0c94a, 0 0 6px 1px rgba(240,201,74,.4); } }
#modal .coachnote { margin-top: 8px; padding: 6px 10px; background: #fffaf0; border: 2px solid #7a5a2e; border-radius: 10px; color: #3a2a17; font-size: 13px; }

/* 手引き: 海図の目的地を光らせるための目印 (押せるのは下の海図) */
#coach-mapdot { position: fixed; width: 44px; height: 44px; border-radius: 50%; pointer-events: none; z-index: 1; display: none; }

/* ===== 物語の場面 ===== */
#story { position: fixed; inset: 0; z-index: 40; background: #050b14; display: none; overflow: hidden; cursor: pointer; user-select: none; }
#story.on { display: block; }
#story .sbg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
#story.fade .sbg { animation: storyFade .6s ease-out; }
@keyframes storyFade { from { opacity: 0; } to { opacity: 1; } }
#story .sp { position: absolute; bottom: 0; height: 88%; max-height: 760px; image-rendering: pixelated; transition: filter .2s, opacity .2s; }
#story .sp.l { left: 4%; }
#story .sp.r { right: 4%; }
#story .sp.dim { filter: brightness(.55); }
#story .sp.voice { opacity: .92; }
#story .sbox { position: absolute; left: 50%; bottom: 3%; transform: translateX(-50%); width: min(920px, 92%); min-height: 120px; padding: 14px 22px 18px; background: rgba(12,22,38,.88); border: 2px solid #c9a95c; border-radius: 12px; color: #f5ecd7; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
#story .sbox .who { display: inline-block; margin: -30px 0 6px -8px; padding: 3px 14px; background: #7a5a2e; color: #fff6e0; border: 2px solid #c9a95c; border-radius: 8px; font-weight: bold; font-size: 15px; }
#story .sbox .txt { font-size: 18px; line-height: 1.75; }
#story .sbox.kn .txt { color: #d9cdb3; font-style: italic; }
#story .sbox.kv { border-color: #e9d48a; box-shadow: 0 0 24px rgba(233,212,138,.25), 0 8px 30px rgba(0,0,0,.5); }
#story .sbox.kv .who { background: #1b2c4a; }
#story .sbox.kl { background: #f3e7c9; color: #3a2a17; border-color: #7a5a2e; }
#story .sbox.kl .txt { font-size: 16.5px; font-family: serif; }
#story .sbox .more { position: absolute; right: 16px; bottom: 6px; color: #c9a95c; font-size: 13px; animation: storyBlink 1.2s infinite; }
@keyframes storyBlink { 50% { opacity: .2; } }
#story .peek { margin-top: 8px; padding: 8px 12px; background: #f3e7c9; color: #3a2a17; border-radius: 6px; font-size: 13.5px; font-style: normal; animation: storyFade 1.2s; }
#story .peek div { margin: 2px 0; } #story .peek b { margin-left: 8px; }
#story .sch { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); display: flex; flex-direction: column; gap: 12px; }
#story .sch button { min-width: 260px; padding: 12px 24px; font-size: 18px; }
#story .sskip { position: absolute; top: 12px; right: 14px; padding: 6px 14px; font-size: 13px; opacity: .8; }
@media (max-height: 540px) {
  #story .sbox { min-height: 84px; padding: 8px 14px 12px; bottom: 2%; }
  #story .sbox .txt { font-size: 14.5px; line-height: 1.6; }
  #story .sbox .who { font-size: 13px; margin-top: -24px; }
  #story .sp { height: 92%; }
}
/* 新しい航海の画面: 主人公と序章 */
.slotsex { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 4px 0 8px; font-size: 14px; }
.slotsex > span { font-weight: bold; }
.slotsex label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.slotsex .pro { margin-left: auto; color: #6b5a3e; }
.tbl.qlog small { display: block; color: #6b5a3e; }
/* この世界の決まり (船足) */
.rule { margin: 10px 0; padding: 8px 12px; border: 2px solid #c9a95c; border-radius: 10px; background: rgba(233,212,138,.18); }
.rule p { margin: 4px 0 0; font-size: 13.5px; }

/* ===== 達成の演出 ===== */
#cele { position: fixed; top: 6%; left: 50%; transform: translate(-50%, -20px) scale(.9); z-index: 28; pointer-events: none; opacity: 0; min-width: 300px; max-width: min(560px, 92vw);
  text-align: center; padding: 12px 34px 14px; color: #fff6dc; background: linear-gradient(180deg, rgba(14,30,52,.94), rgba(10,22,40,.94)); border: 2px solid #e8c33a; border-radius: 14px;
  box-shadow: 0 0 0 4px rgba(232,195,58,.18), 0 10px 30px rgba(0,0,0,.45); transition: opacity .35s, transform .35s; }
#cele.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
#cele .ci { font-size: 30px; line-height: 1; margin-bottom: 4px; }
#cele .ci img { width: 34px; height: 34px; }
#cele small { display: block; color: #e8c33a; letter-spacing: .12em; font-size: 13px; }
#cele b { display: block; font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 26px; letter-spacing: .12em; margin: 2px 0; }
#cele p { margin: 4px 0 0; font-size: 13.5px; color: #e6dcc4; }
#cele.k-ocean { border-width: 3px; padding: 16px 44px 18px; background: radial-gradient(ellipse at top, rgba(60,90,140,.96), rgba(10,22,40,.96)); box-shadow: 0 0 30px 6px rgba(232,195,58,.45), 0 12px 34px rgba(0,0,0,.5); }
#cele.k-ocean b { font-size: 34px; color: #ffe9a8; text-shadow: 0 0 12px rgba(232,195,58,.7); }
#cele.k-ocean.show::after, #cele.k-rare.show::after { content: ""; position: absolute; inset: -2px; border-radius: 14px; pointer-events: none; background: linear-gradient(110deg, transparent 30%, rgba(255,240,190,.45) 50%, transparent 70%); background-size: 250% 100%; animation: celeShine 1.6s ease-out .2s 2; }
@keyframes celeShine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
#cele.k-rare { border-color: #f0d27a; background: linear-gradient(180deg, rgba(60,40,10,.95), rgba(30,20,8,.95)); }
#cele.k-rare b { color: #ffe9a8; }
#cele.k-port { border-color: #9fb6d1; }
#cele.k-trade b { color: #ffd76a; font-family: inherit; font-size: 30px; }
#cele.k-far { border-color: #7fc4b3; }
@media (max-height: 540px) { #cele { top: 4%; padding: 6px 20px 8px; } #cele b { font-size: 20px; } #cele.k-ocean b { font-size: 24px; } #cele .ci { font-size: 22px; } }

/* 大発見・伝説の発見 */
.find .ftier { font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: 20px; letter-spacing: .25em; color: #8a5a00; text-align: center; margin: 2px 0 6px; }
.find.tier2 { border: 2px solid #d4a72c; background: linear-gradient(180deg, rgba(255,226,140,.45), rgba(232,195,58,.15)); }
.find.tier3 { border: 3px solid #c48a10; background: linear-gradient(180deg, rgba(255,214,110,.6), rgba(232,195,58,.2)); box-shadow: 0 0 18px rgba(232,170,40,.55); }
.find.tier3 .ftier { color: #7a3d00; font-size: 23px; }
.stars { color: #c98a0a; letter-spacing: 1px; font-size: 12px; white-space: nowrap; }
.stars img { width: 12px; height: 12px; } .stars .s0 { opacity: .25; }
#modal.grand .box, #modal.grand > div { box-shadow: 0 0 0 3px #e8c33a, 0 0 40px 8px rgba(232,195,58,.55); animation: grandIn .6s ease-out; }
@keyframes grandIn { from { transform: scale(.92); } to { transform: scale(1); } }

/* 図鑑: 発見物の札 */
.sprog { display: flex; align-items: center; gap: 10px; margin: 2px 0 8px; }
.sprog .sbar { flex: 1; height: 10px; background: rgba(122,90,46,.2); border-radius: 6px; overflow: hidden; }
.sprog .sbar i { display: block; height: 100%; background: linear-gradient(90deg, #c98a0a, #e8c33a); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { padding: 4px 10px; font-size: 12.5px; border-radius: 14px; }
.chip small { margin-left: 4px; opacity: .75; }
.chip.on { background: #7a5a2e; color: #fff6e0; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.scard { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px; text-align: center; background: #fbf3df; border: 2px solid #c9a95c; border-radius: 10px; cursor: pointer; font: inherit; color: inherit; }
.scard:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.scard img.art.th { width: 100%; height: 86px; object-fit: cover; border-radius: 6px; margin: 0 0 4px; }
.scard b { font-size: 13.5px; line-height: 1.3; }
.scard small { font-size: 11.5px; color: #6b5a3e; }
.scard.tier2 { border-color: #d4a72c; background: linear-gradient(180deg, #fff5d6, #fbf3df); }
.scard.tier3 { border-color: #c48a10; background: linear-gradient(180deg, #ffe9b0, #fbf3df); box-shadow: 0 0 10px rgba(232,170,40,.45); }
.scard.unk { cursor: default; background: rgba(122,90,46,.08); border-style: dashed; color: #8a7a5e; }
.scard.unk:hover { transform: none; box-shadow: none; }
.scard .sq { width: 100%; height: 86px; display: flex; align-items: center; justify-content: center; font-size: 40px; color: rgba(122,90,46,.45); border-radius: 6px; background: rgba(122,90,46,.08); margin-bottom: 4px; }
.scard .hint { color: #2f6f62; }
.scardbig img.art { width: 100%; max-height: 300px; object-fit: cover; border-radius: 8px; }
.scardbig .sline { margin: 6px 0 0; font-size: 13.5px; }
.scardbig p { margin: 8px 0 0; text-align: left; }
.scardbig.tier2 img.art { box-shadow: 0 0 0 3px #d4a72c; }
.scardbig.tier3 img.art { box-shadow: 0 0 0 3px #c48a10, 0 0 16px rgba(232,170,40,.6); }
@media (max-height: 540px) { .sgrid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); } .scard img.art.th, .scard .sq { height: 64px; } }
.chip.on small { color: #fff6e0; opacity: .85; }

/* 物語の演出: 暗くなる・暗闇から・目覚め */
#story .sdark { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; }
#story.wake .sbg { animation: storyWake 4.5s ease-out; }
#story.wake .sp { animation: storyWakeSp 4.5s ease-out; }
@keyframes storyWake { 0% { filter: blur(10px) brightness(.6); transform: scale(1.04); } 60% { filter: blur(3px) brightness(.9); } 100% { filter: none; transform: scale(1); } }
@keyframes storyWakeSp { 0% { filter: blur(8px); opacity: 0; } 50% { opacity: .6; } 100% { filter: none; opacity: 1; } }

/* ===== デバッグ版の道具箱 ===== */
#dbg-btn { position: fixed; left: 6px; bottom: 6px; z-index: 60; padding: 3px 8px; font: bold 11px monospace; background: #6b1d1d; color: #ffe; border: 1px solid #f99; border-radius: 4px; opacity: .8; }
#dbg-btn.bad { background: #c00; animation: storyBlink 1s infinite; }
#dbg { position: fixed; left: 6px; bottom: 34px; z-index: 61; width: min(560px, 96vw); max-height: 80vh; overflow: auto; padding: 8px 12px; background: rgba(20,20,24,.96); color: #eee; border: 2px solid #c44; border-radius: 8px; font-size: 12.5px; }
#dbg header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; } #dbg header b { color: #f88; } #dbg header button { margin-left: auto; }
#dbg h4 { margin: 8px 0 3px; color: #fc8; font-size: 12px; }
#dbg .drow { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 3px; }
#dbg button { padding: 3px 7px; font-size: 12px; background: #333; color: #eee; border: 1px solid #666; border-radius: 4px; }
#dbg button:hover { background: #555; }
#dbg select { max-width: 230px; font-size: 12px; background: #222; color: #eee; border: 1px solid #666; }
#dbg .dinfo { padding: 4px 6px; background: #000; color: #8f8; font: 11.5px monospace; border-radius: 4px; }
#dbg .derr { max-height: 120px; overflow: auto; margin: 0; padding: 4px 6px; background: #000; color: #f99; font: 11px monospace; white-space: pre-wrap; }
#dbg .dim { color: #999; font-size: 11px; }
