:root{
  --bg:#ffffff;
  --text:#111;
  --muted:#666;
  --line:#e6e6e6;
  --card:#fff;
  --shadow: 0 6px 18px rgba(0,0,0,.06);
  --radius:14px;
  --btn:#111;
  --btnText:#fff;

  --c-investigator:#bcdfff;
  --c-lor:#bdebd0;
  --c-kira:#ffbcbc;
  --c-third:#ffd8a8;
}

*{ box-sizing:border-box; }
html,body{ margin:0; padding:0; background:var(--bg); color:var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP",
               "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

.app-header{
  position:sticky;
  top:0;
  background:#fff;
  border-bottom:1px solid var(--line);
  padding:12px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  z-index:5;
}
.app-header h1{ margin:0; font-size:18px; }
.header-right{ display:flex; gap:10px; align-items:center; }
.version-label{ font-size:12px; color:var(--muted); }

.app-main{ max-width:1200px; margin:0 auto; padding:16px; }

.seo-box{
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--card);
  box-shadow:var(--shadow);
  margin-bottom:12px;
}
.seo-box-title{ cursor:pointer; padding:10px 12px; font-weight:700; }
.seo-box-body{ padding:0 12px 12px; color:var(--muted); font-size:14px; }

.label{ display:block; font-size:12px; color:var(--muted); margin:6px 0; }
.input{
  width:100%;
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px;
  font-size:14px;
  background:#fff;
}

.btn{
  background:var(--btn);
  color:var(--btnText);
  border:none;
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
  font-size:14px;
}
.btn-ghost{
  background:#f2f2f2;
  color:#111;
}
.btn-danger{
  background:#e33;
  color:#fff;
}

.row{ display:flex; gap:8px; margin-top:8px; }

.phase-bar{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
  margin:10px 0 14px;
}
.phase-label{ font-weight:800; }

.kw-layout{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap:16px;
}
@media (max-width: 980px){
  .kw-layout{ grid-template-columns: 1fr; }
}

.tabs{ display:flex; gap:6px; }
.tab{
  flex:1;
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  cursor:pointer;
}
.tab.active{
  font-weight:800;
  border-color:#111;
}

.tab-panel{ display:none; }
.tab-panel.active{ display:block; margin-top:10px; }

.panel{
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:10px;
  margin-top:10px;
  background:#fff;
}
.panel-title{ font-weight:800; margin-bottom:8px; font-size:13px; }

.hint{ font-size:12px; color:var(--muted); margin:6px 0 10px; line-height:1.4; }
.hint.small{ margin-top:10px; }

.player-list{ display:flex; flex-wrap:wrap; gap:6px; }

.player-chip{
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  cursor:grab;
  user-select:none;
  border:1px solid rgba(0,0,0,.08);
}
.player-chip.selected{
  outline:3px solid rgba(0,0,0,.35);
  outline-offset:2px;
}

.player-chip.investigator{ background:var(--c-investigator); }
.player-chip.lor{ background:var(--c-lor); }
.player-chip.kira{ background:var(--c-kira); }
.player-chip.third{ background:var(--c-third); }

.faction-zone{
  border:1px dashed rgba(0,0,0,.18);
  border-radius:var(--radius);
  padding:10px;
  margin-bottom:10px;
}
.faction-zone h3{
  margin:0 0 8px;
  font-size:13px;
}
.faction-zone .zone-body{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  min-height:34px;
}

.faction-zone.investigator{ background:#e8f4ff; }
.faction-zone.lor{ background:#e9f8ef; }
.faction-zone.kira{ background:#ffecec; }
.faction-zone.third{ background:#fff4e5; }

.memo-box{
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:10px;
  background:#fff;
  margin-top:10px;
}
.memo-head{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:10px;
}
.memo-head h3{ margin:0; font-size:14px; }
.memo-meta{ font-size:12px; color:var(--muted); }
#memoInput{ min-height:140px; margin-top:8px; }

.map-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.map-modes{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }

.mode-btn{
  border:1px solid var(--line);
  background:#fff;
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
  font-size:13px;
}
.mode-btn.active{
  border-color:#111;
  font-weight:800;
}
.mode-btn.danger{
  border-color:#e33;
  color:#e33;
}

.map-wrapper{
  position:relative;
  border-radius:var(--radius);
  overflow:hidden;
  border:1px solid var(--line);
  background:#fff;
  box-shadow:var(--shadow);
}
#mapImage{
  width:100%;
  height:auto;
  display:block;
}
#mapCanvas{
  position:absolute;
  left:0;
  top:0;
  width:100%;
  height:100%;
}

.app-footer{
  border-top:1px solid var(--line);
  margin-top:20px;
  padding:14px 16px;
  color:var(--muted);
  font-size:12px;
}
.footer-section{ margin:6px 0; }
.bottom-section{ color:#111; font-weight:800; }



/* =========================================================
   Snow Banner Hub (fixed bottom-right)
   ========================================================= */
.snow-bh--fixed{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;

  /* サイズ制御（sidebar想定） */
  width: 280px;
  max-width: calc(100vw - 32px);

  /* 見た目を少し整える */
  background: transparent;
}

/* モバイルでは少し小さく */
@media (max-width: 640px){
  .snow-bh--fixed{
    right: 12px;
    bottom: 12px;
    width: 240px;
  }
}