/* 基本の色。後からここを変えると調整しやすくなります。 */
:root {
  color-scheme: dark;
  --bg: #0b111b;
  --panel: #121d2b;
  --border: #253246;
  --text: #e5edf7;
  --muted: #91a3ba;
  --accent: #54d5bc;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui, -apple-system, "Segoe UI",
    "Noto Sans JP", "Microsoft JhengHei",
    "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

h1 {
  margin: 5px 0;
  font-size: 30px;
  letter-spacing: 1px;
}

h2 {
  margin: 0;
  font-size: 18px;
}

h3 {
  margin: 9px 0 4px;
  font-size: 14px;
}

p {
  margin: 8px 0;
}

/* 左側のメニュー */
aside {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: 238px;
  padding: 30px 20px;
  background: #101925;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 750;
}

.emblem {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  flex-shrink: 0;
  color: #85efd4;
  background: #24483f;
  border: 1px solid #427769;
  border-radius: 7px;
}

.eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
}

aside > .eyebrow {
  margin: 20px 0 30px;
  font-size: 8px;
}

nav {
  display: grid;
  gap: 8px;
}

nav a {
  display: flex;
  gap: 12px;
  padding: 12px;
  color: var(--muted);
  border-radius: 6px;
}

nav a:hover,
nav a.active {
  color: #82e5cd;
  background: #203830;
}

nav a span:first-child {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.aside-bottom {
  margin-top: auto;
  padding-top: 36px;
  color: var(--muted);
  font-size: 12px;
}

.aside-bottom small {
  display: block;
  margin-top: 10px;
  font-size: 9px;
  letter-spacing: 2px;
}

.status-dot,
.report-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  background: var(--accent);
  border-radius: 50%;
}

/* メインの配置 */
.workspace {
  margin-left: 238px;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  height: 76px;
  padding: 0 40px;
  background: #0e1622ef;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.breadcrumb {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1px;
}

.breadcrumb > span:first-child {
  margin: 0 15px;
  color: #46546a;
}

.language {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

select {
  padding: 8px 12px;
  color: var(--text);
  background: #172334;
  border: 1px solid var(--border);
  border-radius: 5px;
}

main {
  max-width: 1320px;
  margin: auto;
  padding: 34px 40px 20px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.demo {
  padding: 5px 10px;
  color: #acbdd0;
  border: 1px solid #46566e;
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: 1px;
  white-space: nowrap;
}

.notice {
  display: flex;
  gap: 10px;
  margin: 24px 0;
  padding: 10px 15px;
  color: #a8b9cf;
  background: #131f30;
  border: 1px solid #283c58;
  border-radius: 5px;
  font-size: 12px;
}

/* 共通のパネル */
.panel {
  margin-bottom: 22px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.section-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.badge {
  padding: 3px 9px;
  color: #7fe3be;
  background: #1c3e37;
  border: 1px solid #31574c;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
}

/* 現在の作戦 */
.operation {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #142b30, #132131 75%);
  border-color: #2a4b50;
}

.operation h2 {
  font-size: 27px;
}

.objective {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  padding: 17px;
  background: #0a172380;
  border-left: 2px solid var(--accent);
}

.target {
  color: var(--accent);
  font-size: 30px;
}

.objective small {
  display: block;
  color: var(--accent);
  font-size: 10px;
}

.objective strong {
  font-size: 16px;
  font-weight: 550;
}

.operation-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 11px;
}

/* 数字の概要 */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.stat {
  padding: 16px 22px;
  background: #101b29;
  border: 1px solid var(--border);
  border-radius: 7px;
}

.stat > span {
  color: var(--muted);
  font-size: 11px;
}

.stat strong {
  display: block;
  font-size: 28px;
  font-weight: 550;
}

.stat small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

/* お知らせと報告 */
.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.announcement time {
  float: right;
  color: var(--muted);
  font-size: 10px;
}

.amber {
  color: #efd18a;
  background: #40371f;
  border-color: #68552b;
}

.announcement h3 {
  margin-top: 16px;
}

.announcement small,
.report small {
  color: var(--muted);
  font-size: 10px;
}

.report {
  display: flex;
  gap: 12px;
  padding: 10px 0;
}

.report + .report {
  border-top: 1px solid var(--border);
}

.report-dot {
  flex: none;
  margin-top: 16px;
}

.report h3 {
  margin-top: 4px;
}

.report p {
  margin: 2px 0;
}

.amber-dot {
  background: #efc16e;
}

/* 部隊一覧 */
.unit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.unit-card {
  padding: 16px;
  background: #0f1927;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.unit-code {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 2px;
}

.unit-card h3 {
  margin: 8px 0;
}

.unit-card p {
  color: var(--muted);
  font-size: 12px;
}

.unit-card small {
  color: #b6c6d7;
  font-size: 10px;
}

/* 架空のマップ */
.map {
  position: relative;
  height: 300px;
  overflow: hidden;
  background-color: #14262a;
  background-image:
    linear-gradient(#29404766 1px, transparent 1px),
    linear-gradient(90deg, #29404766 1px, transparent 1px);
  background-size: 40px 40px;
  border: 1px solid #2b424b;
  border-radius: 6px;
}

.map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.river {
  fill: none;
  stroke: #285363;
  stroke-width: 36;
}

.road {
  fill: none;
  stroke: #8c916c;
  stroke-width: 2;
  stroke-dasharray: 8 7;
}

.terrain {
  fill: none;
  stroke: #3b5553;
  stroke-width: 24;
}

.map-marker {
  position: absolute;
  display: grid;
  justify-items: center;
  text-align: center;
  font-size: 22px;
  transform: translate(-50%, -50%);
}

.map-marker b {
  padding: 2px 8px;
  color: #e5edf7;
  background: #0b1625db;
  border: 1px solid #435563;
  border-radius: 3px;
  font-size: 10px;
  white-space: nowrap;
}

.friendly {
  color: #73ddbc;
}

.battle {
  color: #ffd079;
}

.enemy {
  color: #ec8b8b;
}

.map-caption {
  position: absolute;
  bottom: 12px;
  left: 14px;
  color: #c1d4d4;
  font-size: 10px;
}

.compass {
  position: absolute;
  top: 12px;
  right: 18px;
  color: #a0b9bd;
  font-size: 12px;
}

.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
}

.legend > span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend small {
  margin-left: auto;
}

.legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.green {
  background: #73ddbc;
}

.red {
  background: #ec8b8b;
}

.yellow {
  background: #ffd079;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 18px;
  color: #667a93;
  font-size: 9px;
  letter-spacing: 1px;
}

/* スマホ用メニュー */
.menu {
  display: none;
}

.shade {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: #0009;
}

.shade[hidden] {
  display: none;
}

/* 少し狭いPC・タブレット */
@media (max-width: 1100px) {
  aside {
    width: 205px;
    padding: 24px 14px;
  }

  .workspace {
    margin-left: 205px;
  }

  main {
    padding: 25px;
  }

  header {
    padding: 0 25px;
  }

  .unit-grid {
    gap: 8px;
  }

  .unit-card {
    padding: 12px;
  }
}

/* スマートフォン */
@media (max-width: 800px) {
  aside {
    width: 245px;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }

  aside.open {
    transform: translateX(0);
  }

  .workspace {
    margin-left: 0;
  }

  .menu {
    display: block;
    padding: 4px 10px;
    color: var(--text);
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 20px;
  }

  .breadcrumb {
    margin-right: auto;
  }

  .language > span {
    display: none;
  }

  header {
    height: 65px;
    padding: 0 16px;
  }

  main {
    padding: 24px 16px;
  }

  .columns {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .panel {
    padding: 20px;
  }

  .page-heading {
    align-items: flex-start;
  }

  h1 {
    font-size: 25px;
  }

  .demo {
    font-size: 8px;
  }

  .operation h2 {
    font-size: 23px;
  }

  .operation-footer {
    flex-direction: column;
    gap: 3px;
  }

  .stats {
    gap: 8px;
  }

  .stat {
    padding: 12px;
  }

  .stat strong {
    font-size: 25px;
  }

  .unit-grid {
    grid-template-columns: 1fr;
  }

  .unit-card {
    padding: 15px;
  }

  .unit-card h3,
  .unit-card p {
    margin: 3px 0;
  }

  .map {
    height: 240px;
  }

  .legend {
    gap: 15px;
  }

  .legend small {
    width: 100%;
    margin-left: 0;
  }

  footer {
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* 動きを減らす設定への対応 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  aside {
    transition: none;
  }
}