:root {
  color-scheme: dark;
  --bg: #070b18;
  --bg-2: #0b1025;
  --panel: rgba(19, 27, 58, 0.92);
  --panel-2: rgba(28, 39, 79, 0.92);
  --line: rgba(143, 167, 255, 0.24);
  --text: #f6f8ff;
  --muted: #aeb8d9;
  --primary: #70a7ff;
  --primary-2: #9a7cff;
  --good: #64d6a2;
  --warn: #f4c56c;
  --danger: #ff7e91;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(80, 104, 255, .22), transparent 30%),
    radial-gradient(circle at 95% 12%, rgba(154, 124, 255, .18), transparent 25%),
    linear-gradient(180deg, #0b1025 0%, #070b18 55%, #050711 100%);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px calc(88px + env(safe-area-inset-bottom));
}
.app-shell.no-bottom-nav {
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.topbar h1 { font-size: 1.1rem; margin: 0; }
.topbar .sub { color: var(--muted); font-size: .82rem; }

.icon-button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--text);
  border-radius: 14px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 12px;
}

.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px;
  background:
    radial-gradient(circle at 75% 25%, rgba(121, 151, 255, .2), transparent 30%),
    linear-gradient(135deg, rgba(27, 39, 87, .97), rgba(14, 20, 48, .97));
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  right: -60px;
  top: -70px;
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: 0 0 50px rgba(125, 155, 255, .18);
}
.hero-copy { position: relative; z-index: 2; padding-right: 92px; }
.hero h2 { margin: 0 0 8px; font-size: 1.5rem; }
.hero p { margin: 0; color: var(--muted); line-height: 1.65; }

.mascot {
  position: absolute;
  right: 18px;
  bottom: 16px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: linear-gradient(145deg, #8fc2ff, #6e73ff);
  border: 3px solid rgba(255,255,255,.72);
  box-shadow: 0 10px 26px rgba(0,0,0,.3);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  font-size: 2.1rem;
  transform: rotate(-4deg);
}
.mascot::before, .mascot::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 30px;
  top: -11px;
  background: #7aa0ff;
  border: 3px solid rgba(255,255,255,.72);
  transform: rotate(45deg);
  border-radius: 7px 2px 10px 2px;
  z-index: -1;
}
.mascot::before { left: 9px; }
.mascot::after { right: 9px; transform: rotate(135deg); }
.mascot small {
  position: absolute;
  bottom: -20px;
  white-space: nowrap;
  font-size: .68rem;
  color: var(--muted);
  font-weight: 600;
}

.section { margin-top: 18px; }
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.section-title h2, .section-title h3 { margin: 0; font-size: 1rem; }
.section-title span { color: var(--muted); font-size: .82rem; }

.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .grid.three { grid-template-columns: 1fr; } }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(0,0,0,.16);
}
.card.compact { padding: 12px; }
.card h3 { margin: 0 0 6px; font-size: 1rem; }
.card p { margin: 0; color: var(--muted); line-height: 1.55; }

.mode-card {
  width: 100%;
  min-height: 126px;
  text-align: left;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 22px;
  padding: 18px;
  background: linear-gradient(145deg, rgba(34, 51, 103, .9), rgba(20, 28, 61, .96));
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
}
.mode-card strong { display: block; font-size: 1.1rem; margin: 8px 0 5px; }
.mode-card span { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.mode-icon { font-size: 1.6rem; }

.primary, .secondary, .danger, .ghost {
  border-radius: 14px;
  min-height: 46px;
  padding: 11px 15px;
  border: 1px solid transparent;
  color: var(--text);
  font-weight: 700;
}
.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #071022; }
.secondary { background: rgba(112,167,255,.12); border-color: rgba(112,167,255,.4); }
.danger { background: rgba(255,126,145,.12); border-color: rgba(255,126,145,.4); }
.ghost { background: transparent; border-color: var(--line); }
.full { width: 100%; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.button-row > * { flex: 1 1 140px; }

label { display: block; color: var(--muted); font-size: .86rem; margin-bottom: 6px; }
input[type="text"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(5,9,22,.7);
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}
textarea { resize: vertical; min-height: 88px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(112,167,255,.12); }
.form-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: .82rem;
}
.chip.good { border-color: rgba(100,214,162,.5); color: #a8f3cf; }
.chip.warn { border-color: rgba(244,197,108,.5); color: #ffe0a4; }
.chip.danger { border-color: rgba(255,126,145,.5); color: #ffc2cb; background: rgba(255,126,145,.08); }

.participant-list { display: grid; gap: 8px; }
.participant-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 10px;
  background: rgba(255,255,255,.035);
}
.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(112,167,255,.18);
  color: #d9e7ff;
  font-weight: 800;
}
.participant-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.counter-list { display: grid; gap: 8px; }
.counter-row {
  display: grid;
  grid-template-columns: 1fr 42px 56px 42px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
}
.counter-row button { min-height: 38px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255,255,255,.05); color: var(--text); }
.counter-value { text-align: center; font-weight: 800; }

.status-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.status-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px;
  text-align: center;
  background: rgba(255,255,255,.035);
}
.status-box b { display: block; font-size: 1.15rem; margin-top: 2px; }
.status-box span { color: var(--muted); font-size: .78rem; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 12px;
  background: rgba(255,255,255,.025);
}
.switch-row + .switch-row { margin-top: 9px; }
.switch-copy strong { display: block; margin-bottom: 3px; }
.switch-copy span { color: var(--muted); font-size: .8rem; }
.switch {
  position: relative;
  width: 52px;
  height: 30px;
  flex: 0 0 auto;
}
.switch input { position: absolute; opacity: 0; }
.switch-ui {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #303851;
  transition: .2s;
}
.switch-ui::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: white;
  transition: .2s;
}
.switch input:checked + .switch-ui { background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.switch input:checked + .switch-ui::after { transform: translateX(22px); }

.stepper {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 4px 0 16px;
}
.step-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.16); }
.step-dot.active { background: var(--primary); box-shadow: 0 0 0 5px rgba(112,167,255,.1); }

.notice {
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  background: rgba(112,167,255,.08);
  padding: 11px 12px;
  color: #dce8ff;
  line-height: 1.55;
  font-size: .88rem;
}
.notice.warn { border-left-color: var(--warn); background: rgba(244,197,108,.08); color: #ffe8b7; }
.notice.good { border-left-color: var(--good); background: rgba(100,214,162,.08); color: #c7f7df; }

.bottom-nav {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 760px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(7,11,24,.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.bottom-nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  min-height: 50px;
  border-radius: 13px;
  font-size: .75rem;
}
.bottom-nav button span { display: block; font-size: 1.18rem; margin-bottom: 2px; }
.bottom-nav button.active { background: rgba(112,167,255,.13); color: var(--text); }

.phase-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}
.phase-center { text-align: center; }
.phase-center strong { display: block; font-size: 1.1rem; }
.phase-center span { color: var(--muted); font-size: .8rem; }

.assignment-grid, .memo-grid { display: grid; gap: 10px; }
.assignment-card, .memo-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 17px;
  padding: 13px;
}
.assignment-card.dead, .memo-card.dead { opacity: .62; }
.assignment-head, .memo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.assignment-head strong, .memo-head strong { font-size: 1rem; }
.role-badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: rgba(154,124,255,.15); border: 1px solid rgba(154,124,255,.35); font-size: .78rem; }
.subrole-badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: rgba(244,197,108,.12); border: 1px solid rgba(244,197,108,.35); font-size: .75rem; color: #ffe1a3; }

.role-list { display: grid; gap: 10px; }
.role-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px;
  background: rgba(255,255,255,.03);
}
.role-item summary { cursor: pointer; font-weight: 800; }
.role-item p { color: var(--muted); line-height: 1.6; margin: 9px 0 0; }
.faction { font-size: .75rem; border-radius: 999px; padding: 4px 8px; margin-left: 7px; border: 1px solid var(--line); color: var(--muted); }

.log-list { display: grid; gap: 8px; }
.log-item { border-left: 3px solid var(--primary); padding: 8px 10px; background: rgba(255,255,255,.03); border-radius: 0 12px 12px 0; }
.log-item time { color: var(--muted); font-size: .75rem; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0,0,0,.68);
  display: grid;
  place-items: end center;
  padding: 12px;
}
.modal {
  width: min(100%, 720px);
  max-height: 82vh;
  overflow: auto;
  border-radius: 24px 24px 16px 16px;
  border: 1px solid var(--line);
  background: #111936;
  padding: 16px;
  box-shadow: var(--shadow);
}

.small { font-size: .8rem; color: var(--muted); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.spacer { height: 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }


/* v0.2: CO判定・グレー集計・縄数 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.stat-card {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 10px 7px;
  background: rgba(255,255,255,.04);
  color: var(--text);
  text-align: center;
}
.stat-card span { display: block; color: var(--muted); font-size: .74rem; }
.stat-card strong { display: block; margin-top: 4px; font-size: 1.1rem; }
.stat-card.active { border-color: var(--primary); background: rgba(112,167,255,.13); }

.rope-panel .section-title { align-items: flex-start; }
.rope-panel .section-title span { max-width: 55%; text-align: right; }
.rope-scenarios {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 7px;
  margin-bottom: 10px;
}
.rope-scenarios > div {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 9px 5px;
  text-align: center;
  background: rgba(255,255,255,.035);
}
.rope-scenarios span { display: block; color: var(--muted); font-size: .72rem; }
.rope-scenarios strong { display: block; margin-top: 3px; }

.filter-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 1px 1px 10px;
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255,255,255,.04);
  color: var(--text);
}
.filter-chip span {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  font-size: .72rem;
}
.filter-chip.active { border-color: var(--primary); background: rgba(112,167,255,.15); }

.memo-card {
  position: relative;
  overflow: hidden;
  padding-left: 18px;
}
.memo-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: var(--role-color, #71809f);
}
.role-none { --role-color: #71809f; }
.role-villager { --role-color: #9aa5b7; }
.role-wolf { --role-color: #f05d6f; }
.role-seer { --role-color: #5f9cff; }
.role-medium { --role-color: #55bcd6; }
.role-knight { --role-color: #56b879; }
.role-madman { --role-color: #a37bff; }
.role-shared { --role-color: #e7c95c; }
.role-cat { --role-color: #ef83bc; }
.role-fox { --role-color: #efad50; }
.role-betrayer { --role-color: #7454be; }

.memo-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.judgment-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  font-size: .72rem;
  white-space: nowrap;
}
.judgment-gray { color: #cbd2df; background: rgba(154,165,183,.1); }
.judgment-white, .judgment-partial-white, .judgment-all-white { color: #eaf2ff; background: rgba(95,156,255,.12); border-color: rgba(95,156,255,.38); }
.judgment-black { color: #ffc6ce; background: rgba(240,93,111,.12); border-color: rgba(240,93,111,.4); }
.judgment-co { color: #d9e8ff; background: rgba(112,167,255,.1); }
.judgment-dead, .judgment-executed, .judgment-attacked, .judgment-cursed, .judgment-taken, .judgment-followed { color: #d1d4dc; background: rgba(120,128,145,.12); }

.status-select {
  width: auto;
  min-width: 90px;
  min-height: 38px;
  padding: 7px 9px;
  font-size: .78rem;
}

.result-summary { min-height: 46px; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.mini-result {
  display: inline-flex;
  gap: 4px;
  border-radius: 999px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  font-size: .75rem;
}
.mini-result.white { background: rgba(95,156,255,.1); color: #e4efff; }
.mini-result.black { background: rgba(240,93,111,.12); color: #ffc7cf; border-color: rgba(240,93,111,.4); }

.seer-result-area {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.seer-result-list { display: grid; gap: 7px; margin-bottom: 10px; }
.seer-result-row {
  display: grid;
  grid-template-columns: auto 1fr auto 34px;
  gap: 7px;
  align-items: center;
  border-radius: 11px;
  padding: 7px 8px;
  background: rgba(255,255,255,.035);
  font-size: .8rem;
}
.seer-result-row > span:first-child { color: var(--muted); }
.result-mark { white-space: nowrap; }
.result-mark.white { color: #e1edff; }
.result-mark.black { color: #ffb8c2; }
.mini-delete {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}

.result-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-choice {
  min-height: 84px;
  border-radius: 16px;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px;
}
.result-choice strong, .result-choice span { display: block; }
.result-choice span { margin-top: 5px; color: var(--muted); font-size: .78rem; }
.result-choice.white { background: rgba(95,156,255,.12); border-color: rgba(95,156,255,.38); }
.result-choice.black { background: rgba(240,93,111,.12); border-color: rgba(240,93,111,.42); }

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rope-scenarios { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seer-result-row { grid-template-columns: auto 1fr auto 30px; }
}


/* v0.5: compact list, clear day/night, timer, undo */
body[data-phase="day"] { --phase-a:#1c65a8; --phase-b:#163c74; }
body[data-phase="night"] { --phase-a:#44317e; --phase-b:#151b45; }
.phase-sticky { position:sticky; top:max(0px,env(safe-area-inset-top)); z-index:24; margin:-2px -2px 12px; border:1px solid rgba(255,255,255,.2); border-radius:18px; overflow:hidden; box-shadow:0 10px 24px rgba(0,0,0,.3); background:linear-gradient(135deg,var(--phase-a),var(--phase-b)); }
.phase-main { display:grid; grid-template-columns:1fr auto auto; gap:10px; align-items:center; padding:11px 12px; }
.phase-name { display:grid; grid-template-columns:auto 1fr; column-gap:8px; align-items:center; min-width:0; }
.phase-name>span { grid-row:1/3; font-size:1.65rem; }
.phase-name strong { font-size:1.05rem; }
.phase-name small { color:rgba(255,255,255,.76); }
.phase-next { min-height:42px; border:1px solid rgba(255,255,255,.35); border-radius:12px; padding:8px 11px; background:rgba(255,255,255,.16); color:white; font-weight:800; }
.timer-display { min-width:82px; font-variant-numeric:tabular-nums; font-size:1.45rem; font-weight:900; text-align:center; }
.timer-display.urgent { color:#ffe08a; animation:pulse 1s infinite; }
@keyframes pulse { 50%{opacity:.55} }
.phase-tools { display:flex; gap:7px; align-items:center; flex-wrap:wrap; padding:8px 10px; border-top:1px solid rgba(255,255,255,.18); background:rgba(0,0,0,.12); }
.tool-button { min-height:36px; border:1px solid rgba(255,255,255,.28); background:rgba(255,255,255,.1); color:white; border-radius:10px; padding:6px 10px; }
.inline-volume { display:flex; align-items:center; gap:7px; margin:0 0 0 auto; color:white; font-size:.78rem; }
.inline-volume input { width:105px; min-height:auto; padding:0; }
.rope-compact { text-align:center; }
.rope-compact small,.rope-compact strong { display:block; }
.compact-toolbar { display:flex; align-items:center; justify-content:space-between; gap:10px; border:1px solid var(--line); border-radius:15px; padding:9px 10px; background:rgba(255,255,255,.035); }
.compact-toolbar select { width:auto; min-width:110px; min-height:40px; }
.gm-person-grid,.memo-compact-grid { display:grid; grid-template-columns:1fr; gap:8px; }
.gm-person { position:relative; overflow:hidden; border:1px solid var(--line); border-radius:15px; padding:11px 11px 11px 16px; background:var(--panel); }
.gm-person:before,.memo-row-card:before { content:""; position:absolute; inset:0 auto 0 0; width:5px; background:var(--role-color,#71809f); }
.gm-person-head { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; margin-bottom:8px; }
.gm-person-name { display:flex; align-items:center; flex-wrap:wrap; gap:8px; min-width:0; }
.quick-execution {
  min-height:28px;
  padding:3px 10px;
  border:1px solid rgba(255,107,132,.62);
  border-radius:999px;
  background:rgba(255,78,113,.13);
  color:#ffd7df;
  font-size:.74rem;
  font-weight:800;
}
.quick-execution:hover { background:rgba(255,78,113,.23); }
.role-label { display:inline-flex; align-items:center; border:1px solid var(--role-color,var(--line)); background:color-mix(in srgb,var(--role-color,#71809f) 15%,transparent); border-radius:999px; padding:3px 7px; font-size:.72rem; white-space:nowrap; }
.memo-row-card { position:relative; overflow:hidden; border:1px solid var(--line); border-radius:15px; background:var(--panel); }
.memo-row-card>summary { list-style:none; cursor:pointer; padding:9px 10px 9px 15px; }
.memo-row-card>summary::-webkit-details-marker { display:none; }
.memo-line-main { display:grid; grid-template-columns:minmax(70px,1fr) auto auto 16px; gap:5px; align-items:center; }
.memo-line-main strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.memo-line-sub { display:flex; gap:6px; align-items:center; margin-top:5px; min-height:20px; overflow:hidden; }
.compact-results { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:.76rem; }
.death-label { flex:0 0 auto; border:1px solid rgba(255,126,145,.4); border-radius:999px; padding:2px 6px; color:#ffc2cb; font-size:.7rem; }
.chevron { transition:.2s; }
.memo-row-card[open] .chevron { transform:rotate(180deg); }
.memo-row-detail { border-top:1px solid var(--line); padding:10px 10px 12px 15px; }
.result-block { margin:10px 0; padding-top:10px; border-top:1px solid var(--line); }
.row-actions { display:flex; gap:7px; margin-top:8px; }
.row-actions button { min-height:36px; padding:6px 10px; }
.editable-result { width:100%; color:inherit; text-align:left; border:0; }
.mini-result.medium { border-color:rgba(85,188,214,.45); }
.dead-section { border:1px solid var(--line); border-radius:15px; padding:10px; background:rgba(255,255,255,.025); }
.dead-section>summary { display:flex; justify-content:space-between; cursor:pointer; margin-bottom:8px; }
.undo-toast { position:fixed; z-index:120; left:50%; bottom:calc(76px + env(safe-area-inset-bottom)); transform:translateX(-50%); width:min(calc(100% - 24px),560px); display:flex; align-items:center; justify-content:space-between; gap:10px; border:1px solid var(--line); border-radius:14px; padding:10px 12px; background:#18203e; box-shadow:var(--shadow); }
.undo-toast button { min-height:36px; border:0; border-radius:10px; padding:6px 10px; background:var(--primary); color:#071022; font-weight:800; }
.participant-row { grid-template-columns:38px 1fr auto; }
.participant-actions { display:flex; gap:4px; align-items:center; }
.mini-move { min-width:34px; min-height:34px; border:1px solid var(--line); border-radius:9px; background:rgba(255,255,255,.04); color:var(--text); }
@media(min-width:640px){ .gm-person-grid,.memo-compact-grid{grid-template-columns:repeat(2,minmax(0,1fr));} }
@media(max-width:480px){ .phase-main{grid-template-columns:1fr auto;} .phase-next{grid-column:1/3;width:100%;} .timer-display{font-size:1.25rem}.inline-volume{width:100%;margin-left:0}.inline-volume input{flex:1}.memo-line-main{grid-template-columns:minmax(60px,1fr) auto auto 14px}.role-label{max-width:86px;overflow:hidden;text-overflow:ellipsis}.participant-actions .mini-move{display:none} }


/* v0.6: participants first, diagnosis CO, removable GM logs */
.participant-first { padding-top: 4px; }
.memo-co-badges { display:flex; align-items:center; gap:4px; min-width:0; }
.memo-co-badges .role-label { min-width:0; }
.diagnosis-co-badge {
  display:inline-flex;
  align-items:center;
  padding:4px 7px;
  border-radius:999px;
  border:1px solid rgba(94, 214, 198, .55);
  background:rgba(94, 214, 198, .12);
  color:#aaf4e9;
  font-size:.7rem;
  white-space:nowrap;
}
.compact-switch-row { margin-top:10px; padding:9px 10px; border:1px solid var(--line); border-radius:12px; background:rgba(255,255,255,.025); }
.log-title-actions { display:flex; align-items:center; gap:8px; }
.compact-log-button { min-height:32px; padding:4px 9px; font-size:.75rem; }
.log-item-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.log-delete { min-width:32px; width:32px; height:32px; padding:0; flex:0 0 auto; }
@media(max-width:480px) {
  .memo-line-main { grid-template-columns:minmax(58px,1fr) minmax(92px,auto) auto 14px; }
  .memo-co-badges { flex-wrap:wrap; justify-content:flex-end; }
  .diagnosis-co-badge { font-size:.66rem; padding:3px 6px; }
}


/* v0.7: selectable GM log content and board inference */
#log-custom-wrap.hidden { display:none; }

.inference-panel { padding:0; overflow:hidden; }
.inference-panel details > summary {
  list-style:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px;
}
.inference-panel details > summary::-webkit-details-marker { display:none; }
.inference-panel summary div { display:flex; flex-direction:column; gap:3px; }
.inference-panel summary span { color:var(--muted); font-size:.78rem; }
.inference-panel details[open] > summary { border-bottom:1px solid var(--line); }
.inference-panel details[open] .chevron { transform:rotate(180deg); }
.inference-body { padding:16px; }
.inference-body small { display:block; color:var(--muted); margin-top:4px; }
.inference-slots-title { margin-top:16px; }
.inference-slot-grid {
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:8px;
}
.inference-slot-grid label { font-size:.75rem; color:var(--muted); }
.inference-slot-grid input { margin-top:5px; text-align:center; padding-left:4px; padding-right:4px; }
.inference-metrics {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin:14px 0 10px;
}
.inference-metrics div {
  display:flex;
  flex-direction:column;
  gap:3px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.025);
}
.inference-metrics span { color:var(--muted); font-size:.72rem; }
.inference-metrics strong { font-size:1.15rem; }

@media(max-width:520px) {
  .inference-slot-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}


/* v0.8: private player role, partners and diagnosis missing-role setup */
.private-setup-intro { border-color:rgba(124, 92, 255, .36); }
.private-role-preview {
  --role-color:var(--role-none);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:12px;
  padding:11px 13px;
  border-left:5px solid var(--role-color);
  border-radius:12px;
  background:rgba(255,255,255,.035);
}
.private-role-preview span { font-weight:800; }
.private-role-preview small { color:var(--muted); }

.private-partner-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-top:12px;
}
.private-partner-option {
  display:flex;
  align-items:center;
  gap:9px;
  min-height:46px;
  padding:9px 11px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.025);
}
.private-partner-option.selected {
  border-color:var(--accent);
  background:rgba(124,92,255,.13);
}
.private-partner-option input { width:18px; height:18px; }
.diagnosis-private-note { margin-top:10px; }

.private-info-panel { padding:0; overflow:hidden; }
.private-info-panel.empty {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:13px 15px;
}
.private-info-panel.empty > div { display:flex; flex-direction:column; gap:3px; }
.private-info-panel.empty span { color:var(--muted); font-size:.78rem; }
.private-info-panel details > summary {
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:13px 15px;
  cursor:pointer;
}
.private-info-panel details > summary::-webkit-details-marker { display:none; }
.private-info-panel details[open] > summary { border-bottom:1px solid var(--line); }
.private-info-panel details[open] .chevron { transform:rotate(180deg); }
.private-info-summary { display:flex; align-items:center; gap:10px; }
.private-info-summary > div { display:flex; flex-direction:column; gap:2px; }
.private-info-summary span:not(.private-lock) { color:var(--muted); font-size:.75rem; }
.private-lock { font-size:1.2rem; }
.private-info-body { padding:14px 15px 15px; }
.private-info-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-bottom:12px;
}
.private-info-grid > div {
  --role-color:var(--line);
  display:flex;
  flex-direction:column;
  gap:4px;
  min-height:65px;
  padding:10px;
  border:1px solid var(--line);
  border-left:4px solid var(--role-color);
  border-radius:11px;
  background:rgba(255,255,255,.025);
}
.private-info-grid span { color:var(--muted); font-size:.72rem; }
.private-info-grid strong { overflow-wrap:anywhere; }
.private-partner-value { grid-column:span 2; }
.private-diagnosis-value { grid-column:span 2; border-left-color:#5ed6c6 !important; }

@media(max-width:480px) {
  .private-partner-grid { grid-template-columns:1fr; }
  .private-info-grid { grid-template-columns:1fr; }
  .private-partner-value, .private-diagnosis-value { grid-column:auto; }
}


/* v0.9: diagnosis counterclaims and no-wolf/no-fox missing rules */
.diagnosis-claim-editor {
  margin-top:8px;
  padding:10px;
  border:1px solid rgba(94,214,198,.25);
  border-radius:12px;
  background:rgba(94,214,198,.055);
}
.diagnosis-claim-editor .small { margin-top:6px; }

.diagnosis-claims-panel { border-color:rgba(94,214,198,.28); }
.diagnosis-claim-list {
  display:flex;
  flex-direction:column;
  gap:7px;
  margin-bottom:10px;
}
.diagnosis-claim-row {
  display:grid;
  grid-template-columns:minmax(70px,1fr) minmax(100px,1.4fr) auto;
  align-items:center;
  gap:8px;
  min-height:42px;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:11px;
  background:rgba(255,255,255,.025);
}
.diagnosis-claim-row span { color:var(--muted); font-size:.82rem; }
.diagnosis-claim-row em {
  padding:3px 7px;
  border-radius:999px;
  border:1px solid rgba(255,126,126,.45);
  color:#ffb4b4;
  font-size:.7rem;
  font-style:normal;
}
.diagnosis-claim-row em.self {
  border-color:rgba(94,214,198,.5);
  color:#aaf4e9;
}
@media(max-width:440px) {
  .diagnosis-claim-row { grid-template-columns:minmax(62px,1fr) minmax(92px,1.3fr) auto; }
}


/* ================================================================
   v1.0 visual identity: Nikomaru, splash screen and PWA polish
   ================================================================ */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #06143d;
  opacity: 1;
  visibility: visible;
  transition: opacity .42s ease, visibility .42s ease;
}
.app-splash picture,
.app-splash img {
  display: block;
  width: 100%;
  height: 100%;
}
.app-splash img {
  object-fit: cover;
  object-position: center;
}
.app-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hero.hero-nicomaru {
  min-height: 250px;
  padding: 22px 190px 22px 22px;
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(7,16,53,.96) 0%, rgba(7,16,53,.91) 48%, rgba(7,16,53,.25) 72%, rgba(7,16,53,.08) 100%),
    radial-gradient(circle at 80% 15%, rgba(103,157,255,.35), transparent 38%),
    linear-gradient(145deg, #12265f, #080f2c);
  border-color: rgba(117,164,255,.42);
}
.hero.hero-nicomaru::before {
  content: "✦";
  position: absolute;
  left: 48%;
  top: 18px;
  color: rgba(255,236,173,.8);
  font-size: 1.35rem;
  text-shadow: 55px 32px 0 rgba(176,207,255,.55),
               -70px 70px 0 rgba(176,207,255,.38),
               25px 155px 0 rgba(255,236,173,.44);
  z-index: 1;
}
.hero.hero-nicomaru::after {
  width: 240px;
  height: 240px;
  right: -78px;
  top: -74px;
  background: radial-gradient(circle, rgba(180,213,255,.18), transparent 66%);
  border-color: rgba(223,236,255,.22);
}
.hero.hero-nicomaru .hero-copy {
  padding-right: 0;
}
.hero.hero-nicomaru h2 {
  max-width: 360px;
  margin-top: 12px;
  font-size: clamp(1.65rem, 5vw, 2.15rem);
  line-height: 1.25;
  letter-spacing: .02em;
  text-shadow: 0 3px 16px rgba(57,113,255,.35);
}
.hero.hero-nicomaru p {
  max-width: 380px;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.hero-tags span {
  padding: 5px 8px;
  border: 1px solid rgba(146,185,255,.3);
  border-radius: 999px;
  background: rgba(13,34,88,.68);
  color: #d8e7ff;
  font-size: .72rem;
}
.mascot-image-wrap {
  position: absolute;
  z-index: 2;
  right: -8px;
  bottom: -15px;
  width: 205px;
  height: 235px;
  overflow: hidden;
  pointer-events: none;
  filter: drop-shadow(0 16px 18px rgba(0,0,0,.42));
}
.mascot-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  border-radius: 46% 0 0 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}
.home-mode-grid .mode-card {
  min-height: 142px;
}
.gm-mode-card {
  background:
    radial-gradient(circle at 85% 15%, rgba(154,124,255,.2), transparent 30%),
    linear-gradient(145deg, rgba(42,43,109,.94), rgba(17,24,60,.98));
}
.memo-mode-card {
  background:
    radial-gradient(circle at 85% 15%, rgba(112,196,255,.2), transparent 30%),
    linear-gradient(145deg, rgba(25,61,116,.94), rgba(17,24,60,.98));
}
.resume-card {
  border-color: rgba(100,214,162,.45);
}
.home-link-card {
  width: 100%;
  text-align: left;
  color: inherit;
}

@media (max-width: 560px) {
  .hero.hero-nicomaru {
    min-height: 285px;
    padding: 19px 126px 19px 18px;
  }
  .mascot-image-wrap {
    width: 155px;
    height: 218px;
    right: -14px;
    bottom: -12px;
  }
  .hero.hero-nicomaru p {
    font-size: .83rem;
    line-height: 1.52;
  }
  .hero-tags {
    max-width: 190px;
  }
}
@media (max-width: 410px) {
  .hero.hero-nicomaru {
    padding-right: 112px;
  }
  .mascot-image-wrap {
    width: 140px;
  }
  .hero.hero-nicomaru h2 {
    font-size: 1.55rem;
  }
  .hero-tags span {
    font-size: .66rem;
  }
}
@media (min-width: 800px) {
  .app-splash img {
    object-fit: contain;
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-splash {
    transition: none;
  }
}


/* ================================================================
   v1.0.2: tablet landscape support
   ================================================================ */

/* 画面の回転を妨げず、横向きタブレットでは横幅を有効活用 */
@media (min-width: 700px) and (orientation: landscape) {
  :root {
    --content-max: 1180px;
  }

  body {
    min-height: 100dvh;
  }

  .app-shell,
  .shell,
  main {
    max-width: var(--content-max);
    margin-left: auto;
    margin-right: auto;
  }

  .hero.hero-nicomaru {
    min-height: 280px;
    padding: 28px 340px 28px 30px;
  }

  .mascot-image-wrap {
    width: 340px;
    height: 310px;
    right: 8px;
    bottom: -22px;
  }

  .hero.hero-nicomaru h2 {
    max-width: 520px;
    font-size: 2.35rem;
  }

  .hero.hero-nicomaru p {
    max-width: 560px;
    font-size: 1rem;
  }

  .home-mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-mode-grid .mode-card {
    min-height: 160px;
  }

  .memo-compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .private-partner-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .private-info-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .private-partner-value,
  .private-diagnosis-value {
    grid-column: span 2;
  }

  .inference-slot-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .phase-sticky {
    position: sticky;
    top: 0;
    z-index: 50;
  }
}

/* 縦向きタブレットでも2列を維持 */
@media (min-width: 700px) and (orientation: portrait) {
  .memo-compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .private-partner-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* v1.0.3: orientation-aware splash screen */
@media (orientation: landscape) {
  .app-splash img {
    object-fit: cover;
    object-position: center;
  }
}

@media (orientation: portrait) {
  .app-splash img {
    object-fit: cover;
    object-position: center;
  }
}

/* ================================================================
   v1.1.0: GM flow, role sorting, independent timer and result ledger
   ================================================================ */
.nowrap { white-space: nowrap; }

.global-timer-dock {
  position: sticky;
  top: max(0px, env(safe-area-inset-top));
  z-index: 45;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(58,48,126,.96), rgba(20,28,72,.96));
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
}
.global-timer-dock > div { display:flex; align-items:baseline; gap:10px; }
.global-timer-dock span { color:rgba(255,255,255,.72); font-size:.75rem; }
.global-timer-dock strong { font-size:1.35rem; font-variant-numeric:tabular-nums; }

.independent-timer-controls { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.timer-presets, .timer-actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.timer-presets .tool-button { background:rgba(112,167,255,.16); }

.role-faction-group { margin-top:14px; }
.role-faction-group:first-child { margin-top:0; }
.role-faction-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
  padding:7px 10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.035);
}
.role-faction-heading strong { font-size:.92rem; }
.role-faction-heading span { color:var(--muted); font-size:.75rem; }
.faction-wolf .role-faction-heading { border-color:rgba(240,93,111,.42); background:rgba(240,93,111,.08); }
.faction-third .role-faction-heading { border-color:rgba(239,173,80,.42); background:rgba(239,173,80,.07); }
.faction-village .role-faction-heading { border-color:rgba(95,156,255,.36); background:rgba(95,156,255,.06); }
.role-faction-grid { display:grid; grid-template-columns:1fr; gap:8px; }
.assignment-card { position:relative; border-left:5px solid var(--role-color,#71809f); }

.zero-day-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.zero-day-card { min-height:150px; }
.zero-day-icon {
  display:grid;
  place-items:center;
  width:42px;
  height:42px;
  margin-bottom:8px;
  border-radius:13px;
  background:rgba(154,124,255,.16);
  border:1px solid rgba(154,124,255,.36);
  font-weight:900;
}
.zero-day-value { display:block; margin:8px 0; font-size:1.15rem; }
.initial-seer-grid { display:grid; gap:8px; }
.initial-seer-card {
  display:grid;
  grid-template-columns:minmax(100px,.8fr) minmax(160px,1.3fr) auto;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.028);
}
.initial-seer-card span { color:var(--muted); font-size:.8rem; }
.initial-seer-card em { color:#ffe2a9; font-style:normal; font-size:.72rem; }
.details-title { display:flex; align-items:center; justify-content:space-between; gap:10px; cursor:pointer; list-style:none; }
.details-title::-webkit-details-marker { display:none; }
.details-title span { color:var(--muted); font-size:.76rem; }
.zero-day-assignments { margin-top:12px; }

.victory-panel { border-color:rgba(255,255,255,.2); }
.victory-panel.candidate { border-color:rgba(244,197,108,.55); box-shadow:0 0 0 2px rgba(244,197,108,.08); }
.victory-panel.confirmed { display:flex; align-items:center; justify-content:space-between; gap:12px; border-color:rgba(100,214,162,.58); background:rgba(100,214,162,.08); }
.victory-panel.confirmed > div { display:flex; flex-direction:column; gap:4px; }
.victory-panel.confirmed span { color:var(--muted); font-size:.76rem; }
.victory-panel.confirmed strong { color:#b7f6d7; font-size:1.25rem; }
.manual-victory { margin-top:10px; }
.manual-victory summary { cursor:pointer; color:var(--muted); font-size:.82rem; }
.victory-button-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:10px; }

.result-ledger { padding:0; overflow:hidden; }
.result-ledger > details > summary { padding:15px 16px; }
.result-ledger > details[open] > summary { border-bottom:1px solid var(--line); }
.result-ledger-body { padding:15px 16px 16px; }
.result-matrix-block + .result-matrix-block, .result-timeline { margin-top:18px; }
.result-matrix-scroll { overflow-x:auto; overscroll-behavior-inline:contain; padding-bottom:4px; }
.result-matrix { width:100%; min-width:560px; border-collapse:separate; border-spacing:0; font-size:.78rem; }
.result-matrix th, .result-matrix td { min-width:100px; padding:7px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); text-align:center; vertical-align:middle; background:rgba(8,13,30,.72); }
.result-matrix thead th { position:sticky; top:0; z-index:2; background:#182044; color:#dce6ff; }
.result-matrix th:first-child { position:sticky; left:0; z-index:3; min-width:120px; text-align:left; background:#151d3c; }
.result-matrix thead th:first-child { z-index:4; }
.result-matrix tr:first-child th { border-top:1px solid var(--line); }
.result-matrix th:first-child, .result-matrix td:first-child { border-left:1px solid var(--line); }
.matrix-result { width:100%; min-height:38px; display:flex; align-items:center; justify-content:center; gap:5px; border:1px solid var(--line); border-radius:9px; color:var(--text); background:rgba(255,255,255,.035); }
.matrix-result.white { border-color:rgba(95,156,255,.4); background:rgba(95,156,255,.1); }
.matrix-result.black { border-color:rgba(240,93,111,.5); background:rgba(240,93,111,.12); color:#ffd0d6; }
.matrix-result strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.matrix-add { min-width:38px; min-height:38px; border:1px solid rgba(112,167,255,.4); border-radius:9px; background:rgba(112,167,255,.12); color:var(--text); }
.matrix-empty { color:#68728f; }
.result-timeline { display:grid; gap:7px; }
.timeline-day { display:grid; grid-template-columns:72px 1fr; gap:10px; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:rgba(255,255,255,.025); }
.timeline-day span { color:var(--muted); }

.inference-enemy-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }

@media (min-width:640px) {
  .role-faction-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (min-width:900px) and (orientation:landscape) {
  .app-shell { width:min(100%, var(--content-max,1180px)); }
  .role-faction-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .zero-day-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}

@media (max-width:560px) {
  .hero.hero-nicomaru { min-height:300px; padding:18px 116px 18px 17px; }
  .hero.hero-nicomaru h2 { max-width:230px; font-size:1.48rem; line-height:1.3; }
  .hero.hero-nicomaru p { max-width:215px; font-size:.8rem; }
  .mascot-image-wrap { width:132px; height:205px; right:-8px; bottom:-8px; }
  .hero-tags { max-width:205px; }
  .zero-day-grid { grid-template-columns:1fr; }
  .initial-seer-card { grid-template-columns:1fr; }
  .victory-panel.confirmed { align-items:stretch; flex-direction:column; }
  .inference-enemy-grid { grid-template-columns:1fr; }
  .global-timer-dock { grid-template-columns:1fr auto; }
  .global-timer-dock > button:last-child { grid-column:1/3; }
  .independent-timer-controls { width:100%; }
  .timer-presets, .timer-actions { flex:1 1 100%; }
  .timer-presets .tool-button, .timer-actions .tool-button { flex:1; }
}


/* v1.1.1: splash skip, GM seer ledger, own seer memo */
.app-splash { cursor: pointer; }
.splash-skip {
  position: absolute;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 3;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 999px;
  background: rgba(4,12,42,.7);
  color: #fff;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  backdrop-filter: blur(8px);
}
.initial-seer-panel { overflow: hidden; }
.own-seer-memo {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(92,153,255,.38);
  border-radius: 18px;
  background: rgba(42,78,160,.13);
}
.gm-seer-result-list { display: grid; gap: 10px; }
.gm-seer-result-row {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(128,161,255,.25);
  border-radius: 14px;
  background: rgba(4,13,39,.42);
}
.gm-seer-result-row strong { min-width: 0; overflow-wrap: anywhere; }
.gm-seer-result-row em { font-style: normal; font-weight: 800; }
.gm-seer-result-row em.white { color: #bde4ff; }
.gm-seer-result-row em.black { color: #ff8e9c; }
.gm-seer-result-row em.curse { color: #d7a8ff; }
.death-detail { color: #ff9daa; }
@media (max-width: 560px) {
  .gm-seer-result-row { grid-template-columns: auto minmax(0,1fr) auto; }
  .gm-seer-result-row em { grid-column: 2; }
  .splash-skip { bottom: max(14px, env(safe-area-inset-bottom)); }
}


/* v1.1.3: GM night role console */
.night-role-console { border-color: rgba(126,105,255,.42); background: linear-gradient(180deg, rgba(57,39,122,.26), rgba(10,18,54,.92)); }
.night-role-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:16px; }
.night-role-card { display:grid; gap:12px; padding:16px; border:1px solid rgba(145,164,255,.26); border-radius:18px; background:rgba(3,10,37,.46); }
.night-role-heading { display:flex; gap:11px; align-items:flex-start; }
.night-role-heading > span { font-size:1.55rem; line-height:1; }
.night-role-heading div { display:grid; gap:3px; }
.night-role-heading strong { font-size:1.05rem; }
.night-role-heading small, .medium-audience { color:var(--muted); }
.role-message-item { display:grid; gap:10px; padding:12px; border-radius:14px; background:rgba(255,255,255,.035); }
.night-auto-result { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 14px; border-radius:13px; border:1px solid rgba(115,225,190,.4); background:rgba(40,170,135,.13); }
.night-auto-result span { font-weight:800; text-align:right; }
.night-auto-result.danger { border-color:rgba(255,96,126,.48); background:rgba(179,35,70,.15); }
.night-auto-result.curse { border-color:rgba(198,125,255,.52); background:rgba(129,58,190,.16); }
.night-resolution { display:grid; gap:5px; margin-top:16px; padding:15px; border-radius:16px; border:1px solid rgba(113,230,190,.45); background:rgba(36,154,124,.13); }
.night-resolution span { color:#8ff0cb; font-weight:800; }
.night-resolution strong { font-size:1.1rem; }
.night-resolution small { color:var(--muted); }
.night-resolution-actions { margin-top:16px; }
.night-resolution-actions > button { flex:1; }
@media (max-width:700px) {
  .night-role-grid { grid-template-columns:1fr; }
  .night-auto-result { align-items:flex-start; flex-direction:column; }
  .night-auto-result span { text-align:left; }
  .night-resolution-actions { flex-direction:column; }
  .night-resolution-actions > button { width:100%; }
}


/* v1.1.4: COメモ開始フロー・配役構成・カード開閉 */
.memo-composition-intro { border-color: rgba(104, 169, 255, .42); }
.composition-faction-list { display: grid; gap: 18px; }
.composition-faction-block {
  overflow: hidden;
  border: 1px solid rgba(133, 157, 234, .22);
  border-radius: 18px;
  background: rgba(5, 14, 43, .26);
}
.composition-faction-block .role-faction-heading { padding: 12px 14px; }
.composition-faction-block .counter-list { padding: 0 12px 12px; }
.memo-composition-summary { display: grid; gap: 12px; }
.composition-role-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.composition-role-chip {
  --role-color: #71809f;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--role-color) 52%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--role-color) 14%, rgba(4, 12, 38, .8));
}
.composition-role-chip span {
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  font-weight: 900;
}
.composition-summary-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.composition-summary-actions p { margin: 0; }
.composition-warning-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid rgba(255, 179, 79, .64);
  border-radius: 999px;
  color: #ffd18a;
  background: rgba(174, 101, 12, .18);
  font-size: .72rem;
  font-weight: 900;
}
.private-partner-option.disabled { opacity: .48; }
.memo-compact-grid { align-items: start; }
.memo-row-card { align-self: start; }
@media (min-width: 640px) {
  .memo-row-card[open] { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .composition-summary-actions { align-items: stretch; flex-direction: column; }
  .composition-summary-actions .ghost { width: 100%; }
}


/* v1.1.5: GM昼の公開発言と自動ログ */
.day-public-console { border-color: rgba(104, 170, 255, .45); }
.public-claim-grid { margin-top: 14px; }
.public-claim-list { display: grid; gap: 8px; margin-top: 14px; }
.public-claim-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid rgba(145, 174, 255, .28); border-radius: 14px; background: rgba(4, 13, 42, .42); }
.auto-badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; background: rgba(88, 179, 255, .18); border: 1px solid rgba(88, 179, 255, .5); font-size: .78rem; }
.public-co-chip { border-color: rgba(104, 207, 255, .62); color: #bdeeff; }
@media (min-width: 700px) and (orientation: landscape) {
  .public-claim-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}


/* v1.1.7: タイマー終了SE・全画面フラッシュ通知 */
.timer-display.time-up,
.global-timer-dock strong.time-up {
  color: #fff4b2;
  text-shadow: 0 0 9px rgba(255, 225, 89, .95), 0 0 24px rgba(255, 76, 118, .85);
}
.timer-end-alert {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at center, rgba(255, 246, 143, .94) 0 10%, rgba(255, 81, 119, .88) 34%, rgba(74, 27, 154, .94) 72%, rgba(4, 8, 32, .98) 100%);
  animation: timer-alert-flash .56s ease-in-out infinite alternate;
}
.timer-end-alert::before,
.timer-end-alert::after {
  content: '';
  position: absolute;
  inset: 8%;
  border: 5px solid rgba(255,255,255,.9);
  border-radius: 50%;
  box-shadow: 0 0 34px rgba(255,255,255,.95), inset 0 0 34px rgba(255,255,255,.65);
  animation: timer-alert-ring 1.15s ease-out infinite;
  pointer-events: none;
}
.timer-end-alert::after { animation-delay: .48s; }
.timer-end-alert-button {
  position: relative;
  z-index: 1;
  width: min(92vw, 620px);
  min-height: min(52vh, 390px);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 13px;
  padding: 32px;
  color: white;
  border: 4px solid rgba(255,255,255,.95);
  border-radius: 36px;
  background: rgba(16, 16, 67, .72);
  box-shadow: 0 0 28px rgba(255,255,255,.8), 0 0 90px rgba(255, 61, 111, .95), inset 0 0 36px rgba(255,255,255,.16);
  backdrop-filter: blur(8px);
  animation: timer-alert-card .56s ease-in-out infinite alternate;
}
.timer-end-alert-button strong {
  font-size: clamp(2rem, 7vw, 4.5rem);
  line-height: 1.05;
  white-space: nowrap;
  letter-spacing: .04em;
  text-shadow: 0 3px 0 rgba(90, 13, 74, .68), 0 0 28px rgba(255,255,255,.9);
}
.timer-end-kicker {
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  color: #d71959;
  font-size: clamp(1rem, 3.8vw, 1.55rem);
  font-weight: 1000;
  letter-spacing: .18em;
}
.timer-end-alert-button small {
  color: rgba(255,255,255,.86);
  font-size: clamp(.95rem, 3vw, 1.18rem);
  font-weight: 800;
}
body.timer-ended .app-shell {
  animation: timer-shell-glow .56s ease-in-out infinite alternate;
}
@keyframes timer-alert-flash {
  from { filter: brightness(.88) saturate(1); }
  to { filter: brightness(1.35) saturate(1.35); }
}
@keyframes timer-alert-ring {
  0% { transform: scale(.48); opacity: .95; }
  100% { transform: scale(1.18); opacity: 0; }
}
@keyframes timer-alert-card {
  from { transform: scale(.96); }
  to { transform: scale(1.035); }
}
@keyframes timer-shell-glow {
  from { box-shadow: inset 0 0 0 rgba(255,66,105,0); }
  to { box-shadow: inset 0 0 70px rgba(255,66,105,.9); }
}
@media (prefers-reduced-motion: reduce) {
  .timer-end-alert,
  .timer-end-alert::before,
  .timer-end-alert::after,
  .timer-end-alert-button,
  body.timer-ended .app-shell { animation: none; }
}


/* v1.1.8: GM昼の処刑導線・生存者優先・死亡者分離 */
.phase-next:disabled {
  opacity: .48;
  cursor: not-allowed;
  filter: grayscale(.35);
}
.execution-console {
  border-color: rgba(255, 125, 145, .52);
  background: linear-gradient(145deg, rgba(72, 18, 42, .38), rgba(20, 27, 58, .92));
}
.execution-console.has-target {
  box-shadow: 0 0 0 1px rgba(255, 126, 151, .18), 0 12px 30px rgba(100, 17, 48, .2);
}
.execution-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}
.execution-confirm {
  min-height: 48px;
  font-weight: 900;
}
.execution-flow-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: .78rem;
}
.quick-execution.selected,
.gm-person.execution-selected .quick-execution {
  border-color: rgba(255, 221, 115, .8);
  background: rgba(255, 196, 66, .2);
  color: #fff1b7;
  box-shadow: 0 0 14px rgba(255, 190, 67, .22);
}
.gm-person.execution-selected {
  border-color: rgba(255, 208, 96, .72);
  box-shadow: 0 0 0 1px rgba(255, 208, 96, .16);
}
.gm-alive-section {
  padding-top: 3px;
}
.compact-optional-panel {
  padding: 0;
  overflow: hidden;
}
.day-public-details > summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 13px 14px;
}
.day-public-details > summary::-webkit-details-marker { display: none; }
.day-public-details > summary span { display: grid; gap: 3px; }
.day-public-details > summary small { color: var(--muted); font-size: .75rem; font-weight: 500; }
.day-public-details > summary em {
  font-style: normal;
  padding: 3px 8px;
  border: 1px solid rgba(104, 170, 255, .38);
  border-radius: 999px;
  color: #cfe5ff;
  font-size: .75rem;
}
.day-public-details[open] > summary { border-bottom: 1px solid var(--line); }
.day-public-body { padding: 13px 14px 15px; }
.gm-dead-section {
  margin-top: 22px;
  padding: 17px 12px 13px;
  border-top: 1px solid rgba(172, 184, 215, .28);
  border-radius: 14px;
  background: rgba(170, 180, 205, .035);
}
.gm-dead-divider {
  display: grid;
  grid-template-columns: 1fr auto auto 1fr;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  color: #c7cddd;
}
.gm-dead-divider span { height: 1px; background: rgba(172, 184, 215, .3); }
.gm-dead-divider em { font-style: normal; color: var(--muted); font-size: .78rem; }
.gm-dead-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
}
.gm-dead-section .gm-person.dead {
  opacity: .76;
  border-color: rgba(172, 184, 215, .2);
  background: rgba(120, 130, 155, .07);
  filter: saturate(.72);
}
.gm-dead-section .gm-person.dead strong,
.gm-dead-section .gm-person.dead .role-label,
.gm-dead-section .gm-person.dead .death-detail {
  opacity: 1;
}
.gm-no-dead { text-align: center; padding: 8px; }
@media (min-width: 640px) {
  .execution-controls { grid-template-columns: minmax(0, 1fr) minmax(230px, .8fr); }
  .gm-dead-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.execution-sub-actions { display:flex; justify-content:flex-end; margin-top:8px; }
.execution-sub-actions .ghost { min-height:36px; padding:6px 10px; font-size:.78rem; }

/* v1.1.9: session home, quick SE, priority victory and CO quick actions */
.topbar-left { align-items: center; }
.session-home-button {
  display: inline-grid;
  grid-template-columns: 38px auto;
  align-items: center;
  gap: 7px;
  min-height: 46px;
  padding: 3px 10px 3px 4px;
  border: 1px solid rgba(112,167,255,.42);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(38,68,142,.88), rgba(39,29,91,.9));
  color: #fff;
  font-weight: 850;
  box-shadow: 0 8px 22px rgba(0,0,0,.25);
}
.session-home-button img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 22%;
  border: 2px solid rgba(255,255,255,.72);
  background: #17346d;
}
.session-home-button span { font-size: .76rem; }
.timer-se-quick { font-weight: 850; }
.timer-se-quick.is-on {
  border-color: rgba(116,230,186,.62);
  background: rgba(64,184,139,.2);
  color: #d9ffef;
}
.timer-se-quick.is-off {
  border-color: rgba(196,205,230,.3);
  background: rgba(110,120,150,.12);
  color: #c0c8de;
}
.victory-priority-wrap { margin: 4px 0 14px; }
.victory-priority-wrap .victory-panel {
  position: relative;
  overflow: hidden;
  border-width: 2px;
  background: linear-gradient(140deg, rgba(42,51,98,.98), rgba(18,25,55,.98));
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.victory-priority-wrap .victory-panel::before {
  content: "勝敗チェック";
  display: inline-flex;
  margin-bottom: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: #e7ecff;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .04em;
}
.victory-priority-wrap .victory-panel.candidate {
  border-color: rgba(255,201,86,.92);
  background: linear-gradient(140deg, rgba(103,66,15,.55), rgba(37,28,54,.98));
  box-shadow: 0 0 0 2px rgba(255,201,86,.13), 0 0 28px rgba(255,174,47,.2);
  animation: victoryAttention 1.45s ease-in-out infinite;
}
@keyframes victoryAttention {
  50% { box-shadow: 0 0 0 3px rgba(255,201,86,.2), 0 0 42px rgba(255,174,47,.3); }
}
.memo-progress-console {
  border-width: 2px;
  background: linear-gradient(145deg, rgba(26,44,91,.96), rgba(13,21,48,.96));
}
.memo-progress-day { border-color: rgba(255,119,145,.55); }
.memo-progress-night { border-color: rgba(125,118,255,.58); }
.memo-progress-console.has-target { box-shadow: 0 0 0 2px rgba(112,167,255,.09), 0 12px 28px rgba(0,0,0,.22); }
.memo-progress-controls {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(220px,.75fr);
  gap: 9px;
  align-items: end;
  margin-top: 11px;
}
.memo-death-controls { grid-template-columns: minmax(0,1fr) minmax(130px,.45fr) minmax(150px,.55fr); }
.memo-progress-controls button { min-height: 48px; font-weight: 900; }
.compact-progress-button { margin-top: 8px; min-height: 36px; padding: 6px 10px; font-size: .78rem; }
.memo-death-chips { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0; }
.memo-death-chips span {
  padding: 4px 8px;
  border: 1px solid rgba(255,126,145,.38);
  border-radius: 999px;
  background: rgba(255,126,145,.08);
  color: #ffd1d8;
  font-size: .76rem;
}
.own-role-console {
  --role-color: #71809f;
  position: relative;
  overflow: hidden;
  border-left: 6px solid var(--role-color);
  background: linear-gradient(145deg, color-mix(in srgb, var(--role-color) 12%, rgba(19,27,58,.96)), rgba(14,20,47,.98));
}
.own-role-console .section-title span { color: #d4dcf6; }
.own-role-controls { display:grid; gap:9px; margin:10px 0; }
.own-role-controls.inline { grid-template-columns: minmax(0,1fr) minmax(150px,.45fr); }
.own-role-controls.inline button { min-height: 46px; }
.compact-result-choices { margin-top: 0; }
.compact-result-choices .result-choice { min-height: 50px; padding: 8px; font-weight: 850; }
.own-auto-target, .own-partner-strip {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin:10px 0;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.035);
}
.own-auto-target span, .own-partner-strip span { color:var(--muted); font-size:.76rem; }
.own-partner-strip { align-items:flex-start; flex-direction:column; }
.own-partner-cards { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.own-partner-cards > div {
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:11px;
  background:rgba(255,255,255,.03);
}
.own-partner-cards span { color:var(--muted); font-size:.76rem; }
.private-action-history { display:grid; gap:6px; margin-top:10px; }
.private-action-history > div {
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:8px;
  padding:8px 9px;
  border:1px solid rgba(142,166,255,.2);
  border-radius:10px;
  background:rgba(7,12,30,.42);
}
.private-action-history span { color:var(--muted); font-size:.72rem; }
.private-action-history strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.private-action-history em { font-style:normal; color:#dce6ff; font-size:.74rem; }
.private-action-history em.black { color:#ffabb8; }
.private-action-history em.white { color:#b9dbff; }
@media (max-width: 620px) {
  .session-home-button { grid-template-columns: 36px; padding:3px; }
  .session-home-button span { display:none; }
  .session-home-button img { width:36px; height:36px; }
  .memo-progress-controls,
  .memo-death-controls,
  .own-role-controls.inline { grid-template-columns:1fr; }
  .own-partner-cards { grid-template-columns:1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .victory-priority-wrap .victory-panel.candidate { animation:none; }
}

/* v1.1.10: GM true-result ledgers */
.gm-seer-result-row > span:first-child {
  display: grid;
  gap: 4px;
  align-content: center;
  min-width: 76px;
  font-weight: 800;
}
.gm-result-source {
  width: fit-content;
  padding: 3px 7px;
  border: 1px solid rgba(116, 163, 255, .35);
  border-radius: 999px;
  background: rgba(36, 92, 190, .18);
  color: #bcd7ff;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1.15;
}
.gm-result-source.initial {
  border-color: rgba(255, 205, 93, .42);
  background: rgba(160, 104, 22, .2);
  color: #ffe29a;
}
.gm-result-source.medium {
  border-color: rgba(122, 232, 208, .36);
  background: rgba(25, 125, 117, .18);
  color: #aef2df;
}
.gm-medium-ledger {
  border-color: rgba(105, 218, 198, .34);
}
.gm-medium-result-row {
  border-color: rgba(105, 218, 198, .23);
}
.gm-result-day-note {
  margin-top: 12px;
}
