/* Equal Earth – interactive (browser version) */
:root {
  --bg: #ffffff;
  --fg: #222222;
  --muted: #555555;
  --panel: #f4f2ee;
  --line: #d8d3c8;
  --accent: #2c6e9e;
  --ocean: #a8cfe6;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Segoe UI", "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  font-size: 14px;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 16px;
}

.topbar {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0 6px;
}
.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.status {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stage {
  flex: 1 1 auto;
  min-height: 300px;
  position: relative;
}
#map {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--bg);
  cursor: grab;
  touch-action: none;           /* ピンチ・ドラッグを自前で扱う */
  outline: none;
  border-radius: 4px;
}
#map:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
#map.dragging { cursor: grabbing; }
#map.rolling  { cursor: crosshair; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 8px 0;
  align-items: center;
}
.group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0;
}
.toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
}
.toolbar input[type="number"] {
  width: 5.5em;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.toolbar select {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  background: #fff;
}
.toolbar button {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}
.toolbar button:hover { border-color: #b8b1a3; }
.toolbar button:active { transform: translateY(1px); }
.toolbar button.toggle.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.help {
  padding: 4px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* --- 免責事項ダイアログ ------------------------------------------------ */
.notice-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 20, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  animation: fade-in 180ms ease-out;
}
.notice-backdrop[hidden] { display: none; }
.notice {
  width: min(680px, 100%);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  padding: 16px 20px 18px;
}
.notice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.notice-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.notice-x {
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
}
.notice-x:hover { color: var(--fg); }
#notice-lang {
  font: inherit;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  max-width: 100%;
}
.notice-text {
  margin: 14px 0 18px;
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-line;          /* 原文の 4 行の改行を保つ */
  text-align: left;               /* 左詰め（既定） */
}
.notice-text[dir="rtl"] {
  text-align: right;              /* 右→左書きの言語は右詰め */
}
.notice-foot {
  display: flex;
  justify-content: flex-end;
}
.notice button.primary {
  min-width: 7em;
  padding: 7px 16px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.notice button.primary:hover { filter: brightness(1.08); }

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 600px) {
  .help { display: none; }
  .topbar { flex-direction: column; gap: 2px; }
}
