:root {
  --bg: #f4f1e8;
  --ink: #4a3a2a;
  --sub: #7a705f;
  --line: #e2dccb;
  --paper: #fff8e8;
  --paper2: #f3ead6;
  --wood: #8a5d33;
  --accent: #3f8f5a;
  --hp: #e0503a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", system-ui, sans-serif; }
button { font: inherit; color: inherit; }
.page { max-width: 1100px; margin: 0 auto; padding: 12px 16px 40px; }
.page-head h1 { font-size: 1.4rem; margin: 4px 0; }
.page-head small { font-size: .75rem; color: var(--sub); font-weight: normal; }
.page-head .subtitle { font-size: .85rem; font-weight: bold; color: var(--wood, #8a5d33); }
@media (max-width: 520px) { .page-head .subtitle { display: block; font-size: .75rem; } }
.page-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.guide-link { font-size: .8rem; font-weight: bold; color: var(--wood, #8a5d33); text-decoration: none; border: 1.5px solid currentColor; border-radius: 999px; padding: 2px 10px; }
.guide-link:hover { background: rgba(138,93,51,.08); }

.ad-slot { border: 2px dashed #c9c1ab; color: #a69d86; font-size: .8rem;
  display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.ad-top, .ad-bottom { height: 90px; margin: 10px 0; }
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
.ad-side { min-height: 600px; align-self: start; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .ad-side { display: none; }
  .ad-top, .ad-bottom { height: 60px; }
}
.about { margin-top: 14px; font-size: .92rem; line-height: 1.8; }
.about h2 { font-size: 1.1rem; margin: 0 0 4px; }

/* ===== ゲーム画面 ===== */
.game { position: relative; width: 100%; height: min(72vh, 600px); min-height: 360px;
  background: #69b6e0; border-radius: 14px; overflow: hidden; touch-action: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; font-size: 13px; }
.game:fullscreen, .game.pseudo-fs { height: 100vh; height: 100dvh; border-radius: 0; }
.game.pseudo-fs { position: fixed; inset: 0; z-index: 1000; }
#view { display: block; width: 100%; height: 100%; }
.ui { position: absolute; }
.frame { background: var(--paper); border: 3px solid var(--wood); border-radius: 10px; box-shadow: 0 3px 0 rgba(60,40,20,.35); }

.hud-st { left: 10px; top: 10px; padding: 5px 10px 6px; min-width: 170px; pointer-events: none; }
.hud-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-st { max-width: calc(100% - 200px); }
.hud-name span { color: var(--sub); font-size: 11px; margin-left: 4px; }
.hud-row { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 11px; }
.hud-row .lbl { font-weight: bold; }
.bar { flex: 1; height: 9px; background: #e6dccb; border-radius: 99px; overflow: hidden; border: 1px solid rgba(74,58,42,.25); min-width: 70px; }
.bar i { display: block; height: 100%; width: 100%; background: var(--hp); transition: width .2s; }
.bar.sta i { background: #f0b840; }
/* 経験値バー（HP・元気より細め） */
.hud-xp .bar { height: 6px; }
.bar.xp i { background: #5a9ee0; }
.hud-xp b { font-size: 10px; min-width: 3.2em; text-align: right; }
.bar.sta.low i { background: #e8743b; animation: low 1s infinite alternate; }
@keyframes low { to { opacity: .45; } }

.hud-tr { right: 10px; top: 10px; display: flex; gap: 6px; align-items: flex-start; }
.hud-pills { display: grid; gap: 5px; justify-items: end; }
.coin { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: #f2c640; border: 2px solid #b8862a; vertical-align: -1px; margin-right: 4px; }
.pill { padding: 3px 10px; font-weight: bold; font-size: 11px; border-radius: 999px; white-space: nowrap; }
.minimap { width: 92px; height: 92px; padding: 0; image-rendering: pixelated; background: #69b6e0; }

.menu { right: 10px; top: 112px; display: grid; grid-template-columns: repeat(3, 46px); gap: 5px; }
.ib { width: 46px; min-height: 42px; padding: 3px 0; display: grid; place-items: center; font-size: 11px; font-weight: bold;
  line-height: 1.15; cursor: pointer; }
.ib small { display: block; font-size: 9px; color: var(--sub); font-weight: normal; }
.ib:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(60,40,20,.35); }
.menu-sp { display: none; right: 10px; top: 112px; width: 58px; }
/* 右のメニューをたたむボタン（たたむと、このボタンだけ残る） */
.menu-toggle { grid-column: 1 / -1; padding: 3px 0; font-size: 11px; font-weight: bold; cursor: pointer; }
.menu.closed > :not(.menu-toggle) { display: none !important; }

.log { left: 10px; bottom: 10px; width: 250px; padding: 5px 9px; font-size: 11px; line-height: 1.55;
  background: rgba(40,34,26,.6); color: #fff; border-radius: 8px; pointer-events: none; }
.log:empty { display: none; }
.log p { margin: 0; }
.log .lv { color: #ffd34d; font-weight: bold; }

.toasts { left: 50%; top: 58px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center;
  gap: 4px; pointer-events: none; width: 90%; }
.toast { background: rgba(40,34,26,.86); color: #fff; padding: 5px 12px; border-radius: 999px;
  font-size: 12px; animation: toast 2.2s forwards; white-space: nowrap; }
.toast.lv { background: #d9822b; font-weight: bold; }
@keyframes toast { 0% { opacity: 0; transform: translateY(6px); } 10%, 75% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.stick { display: none; left: 18px; bottom: 18px; width: 116px; height: 116px; border-radius: 50%;
  background: rgba(255,248,232,.5); border: 3px solid rgba(138,93,51,.55); touch-action: none; }
.stick i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%;
  background: rgba(255,248,232,.96); border: 3px solid var(--wood); pointer-events: none; }
.act { right: 16px; bottom: 18px; width: 76px; height: 76px; border-radius: 50%; background: var(--accent); color: #fff;
  font-weight: bold; font-size: 14px; white-space: nowrap; letter-spacing: -.03em; border: 3px solid var(--paper); box-shadow: 0 3px 0 rgba(0,0,0,.3); cursor: pointer; touch-action: none; }
.act:active { transform: translateY(2px); }

.sub-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.bb-cat.small { padding: 3px 8px; font-size: 10px; }
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.dex-card { background: var(--paper2); border-radius: 8px; padding: 6px; text-align: center; font-size: 11px; display: grid; justify-items: center; gap: 2px; }
.dex-card canvas { width: 56px; height: 56px; }
.dex-card small { color: var(--sub); font-size: 10px; line-height: 1.4; }
.dex-card.unknown b { color: #a69d86; }
.dex-q { font-weight: bold; color: #b3a993; font-size: 14px; }
.av-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.av-row > b { width: 4em; flex: none; }
/* 売上の統計 */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; margin-bottom: 8px; }
.tile { background: var(--paper2); border-radius: 8px; padding: 6px 9px; display: grid; }
.tile small { color: var(--sub); font-size: 10px; }
.tile b { font-size: 17px; }
.tiles.small .tile b { font-size: 13px; }
.sub-tabs.inline { display: inline-flex; margin: 0 0 0 8px; vertical-align: middle; }
.chart { display: flex; gap: 4px; height: 120px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 9px; color: var(--sub); text-align: right; min-width: 42px; }
.chart-plot { flex: 1; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid #c9c1ab;
  background: repeating-linear-gradient(to top, transparent 0, transparent calc(50% - 1px), rgba(122,112,95,.15) calc(50% - 1px), rgba(122,112,95,.15) 50%); }
.bar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; outline: none; }
.bar-v { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
.bar-col:hover .bar-v, .bar-col:focus .bar-v { background: #2f7a48; }
.bar-col .tip { display: none; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: rgba(40,34,26,.92); color: #fff;
  font-size: 10px; padding: 3px 7px; border-radius: 6px; white-space: nowrap; z-index: 2; pointer-events: none; text-align: center; }
.bar-col:hover .tip, .bar-col:focus .tip { display: block; }
.chart-x { display: flex; gap: 2px; margin-left: 46px; font-size: 9px; color: var(--sub); height: 14px; }
.chart-x span { flex: 1; text-align: center; white-space: nowrap; overflow: visible; }
.hbars { display: grid; gap: 4px; margin-bottom: 8px; }
.hbar { display: grid; grid-template-columns: 7.5em 1fr auto; gap: 6px; align-items: center; font-size: 11px; }
.hbar .hn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .hb { height: 10px; background: #ece4d2; border-radius: 0 4px 4px 0; overflow: hidden; }
.hbar .hb i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.hbar .hv { color: var(--sub); font-size: 10px; white-space: nowrap; }
.stat-table { font-size: 11px; margin: 6px 0; }
.stat-table table { border-collapse: collapse; width: 100%; margin-top: 4px; }
.stat-table th, .stat-table td { border-bottom: 1px solid var(--line); padding: 3px 6px; text-align: left; }
/* レイド */
.raid-banner { left: 50%; top: 70px; transform: translateX(-50%); background: rgba(160,40,30,.88); color: #fff; font-size: 11px; font-weight: bold;
  padding: 4px 12px; border-radius: 999px; white-space: nowrap; pointer-events: none; border: 2px solid #ffd34d; z-index: 2; }
.raid-hp { position: relative; height: 16px; background: #5a4a3a; border-radius: 8px; overflow: hidden; margin: 4px 0; }
.raid-hp i { display: block; height: 100%; background: linear-gradient(90deg, #e0503a, #f2b840); }
.raid-hp span { position: absolute; inset: 0; text-align: center; font-size: 10px; line-height: 16px; color: #fff; font-weight: bold; }
.hud-time { font-size: 10px; color: var(--sub); margin-top: 1px; }
.ride-btn { right: 18px; bottom: 150px; width: 58px; background: #e6f0ff; z-index: 3; }
.av-name input { font: inherit; width: 8em; padding: 3px 6px; border: 2px solid #c9a874; border-radius: 6px; }
/* 釣りのミニゲーム */
.fish-game { left: 50%; top: 42%; transform: translate(-50%, -50%); width: min(320px, calc(100% - 40px)); padding: 10px 12px; text-align: center; z-index: 4; display: grid; gap: 6px; }
.fish-game[hidden] { display: none; }
.fish-game b { font-size: 13px; }
.fish-game small { font-size: 10px; color: var(--sub); }
.fg-bar { position: relative; height: 22px; background: #c8dff0; border: 2px solid #4a6a8a; border-radius: 999px; overflow: hidden; cursor: pointer; }
.fg-zone { position: absolute; top: 0; bottom: 0; background: #6fc25e; }
.fg-mark { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; background: #c0303a; border-radius: 2px; box-shadow: 0 0 0 1px #fff; }
.hud-craft { margin-top: 3px; font-size: 10px; color: #7a5230; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-craft[hidden] { display: none; }
.craft-now { display: grid; grid-template-columns: 36px 1fr; gap: 4px 8px; align-items: center; background: var(--paper2); border-radius: 8px; padding: 6px 8px; margin-bottom: 8px; font-size: 12px; }
.craft-now img { width: 32px; height: 32px; grid-row: span 2; }
.craft-now .raid-hp { height: 8px; margin: 0; }
.hud-buff { margin-top: 3px; font-size: 10px; color: #8a4fc0; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swatches { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ink); cursor: pointer; padding: 0; }
.sw.on { outline: 3px solid #e8743b; outline-offset: 1px; }
.sw:disabled { opacity: .4; cursor: default; }

/* 建築 */
.build-btn { right: 18px; bottom: 104px; width: 58px; background: #ffe9c9; z-index: 3; }
.build-bar { left: 10px; right: 10px; bottom: 10px; padding: 6px 8px; z-index: 4; }
.bb-top { display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; font-size: 12px; margin-bottom: 5px; }
.bb-name input { font: inherit; width: 9em; padding: 3px 6px; border: 2px solid #c9a874; border-radius: 6px; }
.bb-btns { margin-left: auto; display: flex; gap: 6px; }
.bb-btns .btn { padding: 4px 12px; }
.bb-cats { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 5px; scrollbar-width: none; touch-action: pan-x; }
.bb-cats::-webkit-scrollbar { display: none; }
.bb-cat { flex: none; padding: 4px 10px; border-radius: 999px; border: 2px solid #c9a874; background: #fff; font-size: 11px; font-weight: bold; cursor: pointer; white-space: nowrap; }
.bb-cat.on { background: var(--wood); color: #fff; border-color: var(--wood); }
.bb-desc { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--sub); margin-top: 4px; min-height: 24px; }
.bb-desc span { flex: 1; }
.bb-desc .btn { padding: 3px 10px; font-size: 11px; color: var(--ink); }
.bb-list { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 3px; touch-action: pan-x; }
.bb-item { flex: none; width: 76px; display: grid; justify-items: center; gap: 1px; padding: 4px 3px; background: var(--paper2);
  border: 2px solid transparent; border-radius: 8px; cursor: pointer; font-size: 10px; line-height: 1.25; }
.bb-item.on { border-color: #e8743b; background: #ffe9c9; }
.bb-item img { width: 36px; height: 36px; }
.bb-item small { font-size: 9px; }
.bb-item .ok { color: var(--accent); } .bb-item .ng { color: #c0503a; }
.bb-x { width: 36px; height: 36px; display: grid; place-items: center; font-size: 18px; color: #c0503a; font-weight: bold; }
.game.building .act, .game.building .log, .game.building .build-btn, .game.building .menu, .game.building .quick { display: none !important; }
/* クイックスロット（画面の下のまんなか） */
.quick { right: 96px; bottom: 12px; display: flex; gap: 5px; z-index: 3; }   /* 左下の記録とかさならないように、行動ボタンの左 */
.qs { position: relative; width: 42px; height: 42px; padding: 0; display: grid; place-items: center; cursor: pointer; }
.qs img { width: 34px; height: 34px; }
.qs.empty { background: rgba(255,248,232,.55); border-style: dashed; }
.qs.out img { opacity: .35; }
.qs .n { position: absolute; right: 2px; bottom: 0; font-size: 10px; font-weight: bold; text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.qs .k { position: absolute; left: 3px; top: 0; font-size: 9px; color: var(--sub); font-weight: bold; }
.qs:active { transform: translateY(2px); }
.qs-set { display: inline-flex; gap: 3px; align-items: center; font-size: 11px; color: var(--sub); margin-left: 6px; }
.qs-set .btn { padding: 2px 8px; font-size: 11px; }
@media (pointer: coarse), (max-width: 520px) { .quick { right: auto; left: 50%; transform: translateX(-50%); bottom: 140px; } .qs { width: 38px; height: 38px; } .qs img { width: 30px; height: 30px; } }
.game.building .stick { bottom: calc(var(--bb-h, 192px) + 16px); }   /* 建築バーの高さに合わせて自動で上げる（v1.26） */

/* スマホ（指で操作する端末） */
@media (pointer: coarse) {
  .stick { display: block; }
  .log { display: none; }
  .menu { display: none; }
  .menu-sp { display: grid; }
}
@media (pointer: fine) {
  .act { width: 66px; height: 66px; font-size: 12px; }
  .toasts .toast:not(.lv) { display: none; }   /* PCは左下の記録に出す */
}
@media (max-width: 520px) {
  .minimap { width: 70px; height: 70px; }
  .hud-st { min-width: 0; width: calc(100% - 206px); max-width: 200px; }   /* 右上の地図とお金に重ならない幅 */
  .hud-tr { flex-direction: row-reverse; }
  .hud-pills { justify-items: start; }
  .menu-sp { top: 90px; }
}

/* ===== ウィンドウ ===== */
/* 大きさは中身に関係なくいつも同じ（タブを切りかえてもタブの位置が動かない）。中身が多いときは中でスクロール */
.win { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100% - 24px));
  height: min(560px, calc(100% - 24px)); display: flex; flex-direction: column; padding: 0; z-index: 5; }
.win[hidden] { display: none; }
.win-tabs { display: flex; gap: 2px; padding: 6px 6px 0; background: #e9d7b0; border-radius: 7px 7px 0 0; flex: none; align-items: flex-end; }
.tabs-scroll { display: flex; gap: 2px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; touch-action: pan-x; }
.tabs-scroll[hidden] { display: none; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.win-title { flex: 1; padding: 5px 6px 8px; font-size: 14px; }
.win-tabs button { padding: 6px 9px; white-space: nowrap; flex: none; border: none; border-radius: 7px 7px 0 0; background: #d9c497; font-weight: bold;
  font-size: 12px; cursor: pointer; }
.win-tabs button.on { background: var(--paper); }
.win-tabs .x { margin-left: auto; background: #c0503a; color: #fff; padding: 4px 11px; font-size: 14px; margin-bottom: 3px; border-radius: 7px; }
.win-body { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px 12px; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.win-body section[hidden] { display: none; }
.win-body h3 { font-size: 13px; margin: 4px 0; }
.note { color: var(--sub); font-size: 11px; }
/* レア度：ノーマル・コモン・レア・エピック・レジェンド・ゴッド */
.rar { display: inline-block; padding: 0 6px; border-radius: 999px; font-size: 10px; font-weight: bold; color: #fff; line-height: 16px; vertical-align: 1px; white-space: nowrap; }
.rar0 { background: #8f887a; } .rar1 { background: #3f9a4a; } .rar2 { background: #2f74d0; }
.rar3 { background: #9a46d0; } .rar4 { background: #e0861a; }
.rar5 { background: linear-gradient(90deg, #e0405a, #f2a020, #3ab06a, #4a86e0, #9a46d0); }
.rn1 { color: #2f8a3c; } .rn2 { color: #2468c0; } .rn3 { color: #8a36c0; } .rn4 { color: #c8700a; }
.rn5 { background: linear-gradient(90deg, #e0405a, #e08a10, #2f9a50, #3a76d0, #9a46d0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rar-legend { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px; }
.help { margin: 0 0 6px; padding-left: 1.2em; font-size: 12px; line-height: 1.7; }
.btn { padding: 7px 14px; border-radius: 8px; border: 2px solid var(--wood); background: #fff; font-weight: bold; cursor: pointer; }
.btn.danger { border-color: #c0503a; color: #a2493a; background: #fff4f1; }
.btn.go { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn:disabled { border-color: #cfc7b3; background: #f1ece0; color: #b3a993; cursor: default; }

.eq-area { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.look { width: 96px; height: 96px; background: #dcefc9; border-radius: 10px; border: 2px solid #c9a874; flex: none; }
.eq-side { flex: 1; min-width: 0; }
.eq-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.eq-slot { display: flex; align-items: center; gap: 6px; padding: 3px 6px; background: var(--paper2); border-radius: 7px;
  border: 2px solid transparent; cursor: pointer; text-align: left; min-height: 38px; font-size: 11px; }
.eq-slot img { width: 28px; height: 28px; flex: none; }
.eq-slot .s { color: var(--sub); font-size: 10px; display: block; }
.eq-slot .empty { color: #b3a993; }
.stats { margin: 6px 0 0; font-size: 12px; font-weight: bold; }

.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 5px; }
.slot { position: relative; aspect-ratio: 1; background: #efe3c8; border: 2px solid #c9a874; border-radius: 7px; padding: 0;
  cursor: pointer; display: grid; place-items: center; }
.slot img { width: 80%; height: 80%; }
.slot .n { position: absolute; right: 3px; bottom: 0; font-size: 10px; font-weight: bold; text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.slot.sel { border-color: #e8743b; background: #ffe9c9; }
.slot.eqmark::after { content: "E"; position: absolute; left: 3px; top: 1px; font-size: 9px; color: var(--accent); font-weight: bold; }
.slot.blank { cursor: default; opacity: .55; }
.detail { margin-top: 8px; padding: 7px 9px; background: var(--paper2); border-radius: 8px; font-size: 12px; min-height: 40px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail img { width: 30px; height: 30px; }
.detail .d { flex: 1; min-width: 140px; }
.detail .d small { display: block; color: var(--sub); }

.craft { display: grid; gap: 6px; }
.recipe { display: flex; gap: 8px; align-items: center; padding: 6px 8px; background: var(--paper2); border-radius: 8px; font-size: 12px; }
.recipe img { width: 32px; height: 32px; flex: none; }
.recipe .d { flex: 1; min-width: 0; }
.recipe .d small { color: var(--sub); }
.recipe .need { display: block; font-size: 11px; }
.recipe .ok { color: var(--accent); } .recipe .ng { color: #c0503a; }
.recipe .btn { padding: 4px 12px; font-size: 12px; }

.skills { display: grid; gap: 8px; }
.skill { display: grid; grid-template-columns: 5.5em 3.6em 1fr; align-items: center; gap: 8px; font-size: 12px; }
.skill .bar i { background: var(--accent); }

.inv-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; margin: 2px 0 5px; }
.inv-head .full { color: #c0503a; font-weight: bold; }

/* ステータス */
.pts { font-size: 12px; margin: 0 0 8px; }
.pts b { color: #e8743b; font-size: 15px; }
.stat-row { display: grid; grid-template-columns: 4.2em 2.6em 1fr auto; gap: 8px; align-items: center; padding: 5px 8px;
  background: var(--paper2); border-radius: 8px; margin-bottom: 5px; font-size: 12px; }
.stat-row small { color: var(--sub); }
.stat-row .btn { padding: 2px 10px; }
.derived { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; margin-top: 8px; font-size: 12px; }
.derived div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 2px 0; }

/* お店 */
.shop-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 12px; }
.shop-head .sub { color: var(--sub); }
.rows { display: grid; gap: 5px; }
.row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: var(--paper2); border-radius: 8px; font-size: 12px; }
.row img { width: 30px; height: 30px; flex: none; }
.row .d { flex: 1; min-width: 0; }
.row .d small { display: block; color: var(--sub); }
.row .price { font-weight: bold; white-space: nowrap; }
.row .btn { padding: 4px 10px; font-size: 12px; white-space: nowrap; }
.form { display: grid; gap: 6px; padding: 8px; background: #fbf3df; border: 2px dashed #d9c497; border-radius: 8px; margin: 8px 0; font-size: 12px; }
.form label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.form select, .form input { font: inherit; padding: 4px 6px; border: 2px solid #c9a874; border-radius: 6px; background: #fff; min-width: 0; }
.form input[type=number] { width: 7em; }
.sales { margin: 6px 0 0; padding-left: 1.2em; font-size: 11px; color: var(--sub); }
.empty-msg { color: var(--sub); font-size: 12px; padding: 6px 2px; }

/* 地図 */
.world-map { width: 100%; max-width: 440px; aspect-ratio: 1 / 1; display: block; margin: 0 auto 8px; border-radius: 10px; border: 3px solid var(--wood);
  touch-action: none; cursor: grab; box-shadow: 0 3px 0 rgba(60,40,20,.25); }
.world-map:active { cursor: grabbing; }
.map-tools { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-bottom: 6px; }
.map-tools .btn { padding: 3px 10px; font-size: 11px; }
.map-card { background: var(--paper2); border-radius: 8px; padding: 7px 10px; font-size: 12px; margin-bottom: 6px; display: grid; gap: 4px; }
.map-card small { color: var(--sub); }
.map-card .ok { color: var(--accent); } .map-card .ng { color: #c0503a; }
.map-meta { display: grid; gap: 2px; font-size: 11px; color: var(--sub); }
.map-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 10px; color: var(--sub); margin-bottom: 6px; }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 3px; vertical-align: -1px; border: 1px solid var(--ink); }
.map-legend i.pin { background: #e0403a; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }

.rank { margin: 0; padding-left: 1.6em; font-size: 12px; }
.rank li { padding: 3px 0; }
.rank .me { font-weight: bold; color: var(--accent); }
.rank .sc { float: right; }

/* GMモード（確認用） */
.gm-badge{background:#3a5ab0;color:#fff;border-radius:4px;padding:0 5px;font-size:11px}
.gm-btn{background:#dfe6fb}
.gm-grid{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}


/* 広告枠：広告が入るときだけ出す。右の枠がないときはゲームを広く */
.ad-slot[data-ad] { border: none; min-height: 0; }
.ad-top[data-ad], .ad-bottom[data-ad] { height: auto; min-height: 90px; }
.layout:not(:has(.ad-side:not([hidden]))) { grid-template-columns: 1fr; }
@media (max-width: 860px) { .ad-top[data-ad], .ad-bottom[data-ad] { min-height: 60px; } }

/* ログイン画面（ゲーム画面の中にかぶせる） */
.login { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto;
  padding: 16px 18px; z-index: 30; }
.login h2 { margin: 0 0 8px; font-size: 1.15rem; text-align: center; }
.login .sub-tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-bottom: 8px; }
.login-form label { display: block; margin: 8px 0; font-size: .85rem; }
.login-form input { display: block; width: 100%; box-sizing: border-box; margin-top: 3px; padding: 8px; font-size: 16px; border: 2px solid #c9b48a; border-radius: 8px; background: #fffdf6; }
.login-btns { text-align: center; margin: 12px 0 4px; }
.login-btns .btn { font-size: 1rem; padding: 8px 22px; }
.login-msg { min-height: 1.2em; color: #b0402a; font-size: .85rem; text-align: center; margin: 6px 0 0; }
.recovery-code { font: bold 1.3rem/1.6 ui-monospace, Consolas, monospace; text-align: center; letter-spacing: .08em; background: #fff8e0;
  border: 2px dashed #e0b040; border-radius: 10px; padding: 10px; user-select: all; }
.net-banner { left: 50%; bottom: 76px; transform: translateX(-50%); background: rgba(60,60,80,.92); color: #fff; font-size: 12px; padding: 6px 12px;
  border-radius: 10px; z-index: 25; max-width: calc(100% - 24px); text-align: center; }

/* 広告の中身は枠いっぱいの幅にする（幅0だと広告が出ない） */
.ad-slot[data-ad] { display: block; }
.ad-slot[data-ad] ins.adsbygoogle { width: 100%; }

/* ===== v1.10 画面の見やすさ ===== */
/* レイド・お祭り・ボスのHPは左上のパネルの中（ほかのUIと重ならない） */
.hud-raid { margin-top: 5px; background: rgba(170,45,30,.92); color: #fff; font-size: 10.5px; font-weight: bold; line-height: 1.35;
  padding: 3px 7px; border-radius: 6px; border: 1.5px solid #ffd34d; white-space: normal; }
.hud-boss { margin-top: 5px; }
.hud-boss .hb-top { display: flex; justify-content: space-between; gap: 6px; font-size: 10.5px; }
.hud-boss .hb-top b { color: #b0402a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-boss .hb-top small { color: var(--sub); white-space: nowrap; }
.bar.boss i { background: #e0503a; }
/* お知らせ（トースト）：パネルの下に出して、長い文は折り返す */
.toasts { top: 112px; width: auto; max-width: min(440px, calc(100% - 150px)); }
.toast { white-space: normal; text-align: center; line-height: 1.4; }
@media (max-width: 520px) { .toasts { top: 150px; max-width: calc(100% - 24px); } }
/* 左下の記録（PC）：小さめ・古いものはうすく */
.log { width: 230px; font-size: 10.5px; background: rgba(40,34,26,.5); }
.log p:not(:last-child) { opacity: .72; }
/* 熟練度のくわしい数字 */
.skill-card { border-bottom: 1px dashed rgba(74,58,42,.2); padding: 6px 0 8px; }
.skill-num { font-size: 11.5px; margin: 2px 0 2px; }
.skill-det { display: grid; gap: 1px; font-size: 11px; color: var(--sub); }
.skill-det .next { color: #3f8f5a; font-weight: bold; }
/* ログイン画面のうしろはうすく暗くする */
.login { box-shadow: 0 0 0 100vmax rgba(40,30,20,.38), 0 4px 0 rgba(0,0,0,.2); }
.hud-boss .bar { display: block; width: 100%; margin-top: 2px; }
.hud-boss .hb-top { flex-wrap: wrap; }
.hud-boss .hb-top b { white-space: normal; }
.hud-row .lbl { white-space: nowrap; }
@media (max-width: 520px) { .hud-st .bar { min-width: 40px; } .hud-row b { font-size: 10px; } }

/* ===== v1.25 デザイン見直し（デザイン担当のレビューから） ===== */
/* あそびかた：折りたたみの章 */
details.help-sec { border-bottom: 1px dashed var(--line); }
details.help-sec summary { padding: 10px 4px; min-height: 40px; font-weight: bold; font-size: 13px; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
details.help-sec summary::-webkit-details-marker { display: none; }
details.help-sec summary::before { content: '▶'; font-size: 10px; color: var(--sub); transition: transform .15s; }
details.help-sec[open] summary::before { transform: rotate(90deg); }
.help { font-size: 13px; }
/* はじめの3つ */
.intro { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(340px, calc(100% - 32px)); padding: 12px 14px; z-index: 6; font-size: 13px; line-height: 1.6; }
.intro ol { margin: 6px 0; padding-left: 1.3em; }
.intro .btn { width: 100%; min-height: 40px; margin-top: 4px; }
/* 釣り：バーを太く・大きな「ひく！」ボタン */
.fg-bar { height: 34px; }
.fish-game small { font-size: 12px; }
.fg-btn { width: 100%; min-height: 44px; font-size: 15px; }
/* 小さな文字の下限・色 */
.qs .k, .ib small { font-size: 10px; }
.rar { font-size: 11px; line-height: 17px; }
.rar0 { background: #7a7366; }
/* お金の表示があふれないように */
.pill { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
/* 持ち物：選んだアイテムの説明とボタンを、いつも下に見せる */
.detail { position: sticky; bottom: 0; z-index: 1; box-shadow: 0 -4px 6px -4px rgba(0,0,0,.2); }
/* スマホ：押しやすい大きさに */
@media (pointer: coarse) {
  .win-tabs button { padding: 10px 12px; font-size: 13px; }
  .win-tabs .x { padding: 8px 14px; }
  .btn { min-height: 38px; }
  .sw { width: 34px; height: 34px; }
  .bb-cat { padding: 8px 12px; }
  .qs-set .btn { min-width: 38px; min-height: 38px; }
  .note { font-size: 12px; }
  .win-body { font-size: 13px; }
  .menu-sp { min-height: 46px; }
  .ride-btn { bottom: 176px; width: 64px; }
  .build-btn { bottom: 104px; width: 64px; }
}
@media (pointer: coarse), (max-width: 520px) { .quick { bottom: 148px; gap: 6px; } .qs { width: 44px; height: 44px; } .qs img { width: 34px; height: 34px; } }
/* 横持ちのスマホ（高さが低い）：クイックスロットは右下へ */
@media (pointer: coarse) and (max-height: 500px) { .quick { bottom: 12px; left: auto; right: 100px; transform: none; } }

/* ===== v1.26 左上の表示の作りかえ ===== */
/* 1行目：レベル・場所（左）と時刻（右） */
.hud-name { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.hud-name .hn-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-name .hud-time { flex: none; margin: 0; font-size: 10px; }
/* 料理の効果・制作中：小さな札にして並べる */
.hud-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.hud-chips:empty, .hud-chips:not(:has(> :not([hidden]))) { display: none; }
.hud-chips .hud-buff, .hud-chips .hud-craft { margin-top: 4px; max-width: 100%; padding: 1px 7px; border-radius: 99px; font-size: 10px; line-height: 1.5; }
.hud-chips .hud-buff { background: #efe4f8; }
.hud-chips .hud-craft { background: #f6e7d2; }
/* レイド・ボス：別の場所（位置は game.js の layoutHud が決める） */
.hud-alerts { left: 10px; right: 10px; top: 120px; margin: 0 auto; max-width: 380px; display: grid; gap: 5px; pointer-events: none; z-index: 2; }
.hud-alerts .hud-raid { margin: 0; font-size: 11px; text-align: center; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.hud-alerts .hud-boss { margin: 0; padding: 4px 10px 6px; }
.hud-alerts .hud-boss .hb-top { font-size: 11px; }
.hud-alerts .hud-boss .bar.boss { height: 10px; }
/* お知らせは、レイド・ボスの帯の下に出す */
.toasts { top: max(112px, var(--alert-b, 0px)); }
@media (max-width: 520px) {
  .toasts { top: max(150px, var(--alert-b, 0px)); }
  .hud-st { padding: 4px 8px 5px; }
  .hud-name { flex-wrap: wrap; row-gap: 0; }   /* 場所の名前が隠れないように、せまいときは時刻を2行目へ */
  .hud-row { margin-top: 2px; }
  .hud-st .bar { height: 7px; }
  .hud-xp .bar { height: 4px; }
  .hud-xp .lbl { font-size: 10px; }
  /* 建築バーの説明文はせまい画面では隠す（バーが高くならないように） */
  .bb-top > .note:not(#bbInfo), .bb-name small.note { display: none; }
}
/* ===== v1.26 ギルド受付のタブ ===== */
.guild-tabs { position: sticky; top: -2px; z-index: 1; background: var(--paper); padding: 2px 0 6px; margin-bottom: 4px; }
.guild-tabs .bb-cat { flex: 1 1 auto; text-align: center; }
.guild-tabs .bb-cat .warn { color: #c0392b; }

/* ===== v1.27 目標・毎日・みんなの様子・留守の売上 ===== */
.hud-goal { margin-top: 4px; font-size: 10.5px; font-weight: bold; color: #2f6b3a; background: #e3f2df; border-radius: 6px; padding: 2px 6px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hud-goal[hidden] { display: none; }
.streak { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.streak .sk { background: var(--paper2); border-radius: 8px; padding: 4px 2px; display: grid; justify-items: center; gap: 2px; font-size: 11px; min-height: 52px; align-content: center; }
.streak .sk small { color: var(--sub); font-size: 10px; }
.streak .sk img { width: 24px; height: 24px; }
.streak .sk.done { opacity: .5; }
.streak .sk.now { outline: 2px solid #e8743b; background: #fff3e6; }
.bar.daily { display: block; width: 100%; min-width: 0; margin-top: 3px; height: 7px; }
.bar.daily i { background: #3ab06a; }
.daily-all { margin-top: 6px; background: #fff7e0; border-radius: 8px; padding: 6px 8px; }
.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12px; }
.news li { background: var(--paper2); border-radius: 6px; padding: 4px 8px; line-height: 1.4; }
.news li small { color: var(--sub); margin-left: 6px; font-size: 10.5px; }
.ad-tag { display: inline-block; background: #e8743b; color: #fff; font-size: 10px; border-radius: 4px; padding: 0 4px; vertical-align: 1px; }
.away-sum { font-size: 14px; margin: 6px 0; }
.away-sum small { color: var(--sub); font-size: 11px; margin-left: 4px; }
.away-list { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 3px; font-size: 12px; }
.away-list img { width: 20px; height: 20px; vertical-align: -5px; margin-right: 4px; }

/* ===== v1.30 スマホの押しやすさ（チェックで見つかった所） ===== */
@media (pointer: coarse) {
  .win-tabs button { min-height: 40px; }
  .win-tabs .x { min-width: 44px; min-height: 40px; }
  .bb-cat, .bb-cat.small { min-height: 34px; padding: 6px 10px; font-size: 12px; }
  /* 入力欄は16px以上（iPhoneで、入力するたびに画面が勝手に拡大されないように） */
  .win-body input, .win-body select, .win-body textarea, .login input { min-height: 38px; font-size: 16px; }
  .fg-btn { min-height: 46px; }
}
@media (max-width: 520px) {
  .hud-st { width: calc(100% - 186px); max-width: 220px; }   /* 場所の名前が切れにくいように少し広く */
}
/* せまい画面：クイックスロットを左に寄せる（右の「のる」「建築」ボタンと重ならないように） */
@media (pointer: coarse) and (max-width: 520px), (max-width: 520px) {
  .quick { left: 12px; right: auto; transform: none; }
}

/* ===== v1.32 音の設定 ===== */
.snd-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.snd-row label { min-width: 6em; display: flex; align-items: center; gap: 6px; }
.snd-row input[type=range] { flex: 1; max-width: 240px; }
@media (pointer: coarse) { .snd-row input[type=checkbox] { width: 22px; height: 22px; } .snd-row input[type=range] { min-height: 32px; } }
.snd-row input[type=checkbox] { min-height: 0; }

/* ===== v1.33 感想・管理の数字・共有 ===== */
.fb-form textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 8px; border-radius: 8px; border: 2px solid var(--line, #d8c8a8); background: #fffdf6; resize: vertical; }
.fb-kinds { gap: 6px; }
.fb-kind { display: inline-flex; align-items: center; gap: 4px; background: var(--paper2); border-radius: 99px; padding: 4px 10px; font-size: 12px; }
.note.ok { color: #2f7a3e; font-weight: bold; }
.share-btn { background: #1d9bf0; color: #fff; border-color: #1580c8; }
.adm-days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; align-items: end; margin-bottom: 8px; }
.adm-day { display: grid; justify-items: center; font-size: 10px; gap: 1px; }
.adm-day small { color: var(--sub); font-size: 9.5px; }
.adm-bars { height: 70px; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; background: var(--paper2); border-radius: 4px; }
.adm-bars i { display: block; width: 40%; border-radius: 3px 3px 0 0; min-height: 1px; }
.adm-bars i.a { background: #3ab06a; }
.adm-bars i.j { background: #e8903a; }
.adm-step .bar { display: block; width: 100%; margin-top: 3px; }
.adm-step .bar i { background: #e8903a; }

/* ===== v1.35 お知らせのアイテム名をレア度の色に ===== */
.li { display: inline-block; padding: 0 5px; margin: 0 1px; border-radius: 4px; font-weight: bold; line-height: 1.35; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.li.r0 { background: rgba(255,255,255,.16); color: inherit; text-shadow: none; }
.li.r1 { background: #3f9a4a; }
.li.r2 { background: #2f74d0; }
.li.r3 { background: #9a46d0; box-shadow: 0 0 6px rgba(190,120,255,.8); }
.li.r4 { background: #e0861a; box-shadow: 0 0 7px rgba(255,190,80,.9); }
.li.r5 { background: linear-gradient(90deg, #e0405a, #f2a020, #3ab06a, #4a86e0, #9a46d0); background-size: 200% 100%; box-shadow: 0 0 8px rgba(255,255,255,.9); animation: liGod 2.4s linear infinite; }
@keyframes liGod { to { background-position: 200% 0; } }
.toast.lv .li.r4 { box-shadow: 0 0 0 1.5px #fff, 0 0 7px rgba(255,220,120,.9); }   /* オレンジの帯の上でも見分けやすく */
.toast .li.r0 { background: rgba(255,255,255,.2); }
.toast.rare-get { animation: rareGet .9s ease-out; }
@keyframes rareGet { 0% { transform: scale(.85); filter: brightness(1.6); } 60% { transform: scale(1.06); } 100% { transform: scale(1); filter: none; } }
.log p.rare-get { opacity: 1 !important; }

/* ===== v1.36 チェストの材料・まとめて入れる ===== */
.from-chest { color: #8a5a2a; font-size: 10.5px; margin-left: 2px; }
.note.chest-on { color: #6a4520; background: #f6ead6; border-radius: 6px; padding: 4px 8px; }
.chest-bulk { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }

/* ===== v1.37 まとめて作る ===== */
.craft-qty { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: -2px 0 8px; font-size: 12px; }
.craft-qty > span { color: var(--sub); margin-right: 4px; }
.craft-now small { color: var(--sub); }
.craft-now #craftStop { margin-left: 4px; padding: 2px 8px; font-size: 11px; }

/* ===== v1.44 はじめて建てる家具の印 ===== */
.new-build { color: #c07a10; font-weight: bold; }

/* ===== v1.43 左上の枠の幅を固定・ウィンドウのタブ（デザイン部長の案） ===== */
/* 場所の名前は2行目。長いときは「…」で切る（全文は title）。PCは幅220px固定で、エリアを移っても枠の幅が変わらない */
.hud-name { flex-wrap: nowrap; }
.hud-name .hn-main { white-space: normal; min-width: 0; }
.hud-name .hud-time { flex-shrink: 0; }
#hudPlace { display: block; margin-left: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 521px) { .hud-st { width: 220px; min-width: 0; max-width: calc(100% - 200px); } }
/* タブ：PC（広い画面）は2段に折り返して全部見せる。せまい画面は横スクロールのまま、右に続きの影 */
.win-tabs { align-items: flex-start; }
.tabs-scroll { position: relative; }
@media (min-width: 521px) {
  .tabs-scroll { flex-wrap: wrap; overflow: visible; row-gap: 3px; }
  .win-tabs button:not(.x) { padding: 6px 10px; font-size: 13px; }
}
@media (max-width: 520px) {
  .tabs-scroll.more { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent); }
}

/* ===== v1.40 ゲームの中の確認ウィンドウ（gameAsk） ===== */
.ask-wrap { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(40,34,26,.45); padding: 16px; }
.ask-box { position: static; width: min(360px, 100%); padding: 16px 16px 14px; font-size: 14px; line-height: 1.7; }
.ask-box p { margin: 0 0 12px; }
.ask-btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.ask-btns .btn { min-width: 96px; min-height: 40px; font-size: 14px; }

/* ===== v1.38 最初の画面をすっきり（デザイン部の会議） ===== */
.log { font-size: 11.5px; background: rgba(40,34,26,.66); color: #fff; }
.log p:not(:last-child) { opacity: .8; }
@media (max-width: 520px) {
  .hud-name { flex-wrap: wrap; row-gap: 0; }
  .hud-name .hn-main { white-space: normal; }
  #hudPlace { display: block; margin-left: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
