/* 色は portfolio のダークテーマ（3 色）に寄せた仮の値。Canvas は起動時に変数を読む */
:root {
  --color-background: #111318;
  --color-surface: #1b1e26;
  --color-surface-raised: #252a35;
  --color-border: #3a3f4b;
  --color-text: #e6e6e6;
  --color-muted: #9aa0ab;
  --color-accent: #f2c14e;
  --color-pitch: #22653f;
  --color-pitch-stripe: #1d5a37;
  --color-pitch-line: rgba(255, 255, 255, 0.8);
  --color-unknown-seat-type: #2a2e38;
  --color-unassigned: #3a3f4b;
  --color-row-line: rgba(0, 0, 0, 0.35);
  --color-label: #ffffff;
  --color-highlight: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--color-background);
  color: var(--color-text);
  font-family: system-ui, sans-serif;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.bar {
  flex: none;
  padding: 4px 12px;
  background: var(--color-surface);
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.title {
  flex: 1 1 auto;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.search {
  margin: 0;
}

/* 入力欄とボタンの共通の枠。差は padding と cursor だけ */
.field,
.button {
  min-height: 32px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface-raised);
  color: var(--color-text);
  font: inherit;
}

.field {
  padding: 4px 8px;
}

.field-number {
  width: 64px;
}

.button {
  padding: 4px 12px;
  cursor: pointer;
}

/* 黄の地に背景と同じ暗い色の文字 */
.button-primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-background);
  font-weight: 600;
}

.status {
  margin: 2px 0 0;
  min-height: 1.2em;
  font-size: 12px;
  color: var(--color-muted);
}

.stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
}

.map {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

.map:focus-visible {
  outline: 2px solid var(--color-highlight);
  outline-offset: -2px;
}

/* Canvas に重ねるシート（凡例・ポップアップ）。Canvas の高さは変えない */
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  padding: 10px 12px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.legend {
  top: 0;
  max-height: 70%;
  overflow: auto;
  border-top: none;
  border-bottom: 1px solid var(--color-border);
}

.legend-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 12px;
  font-size: 13px;
}

.legend-list li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.legend-season {
  display: block;
  margin-top: 8px;
  font-size: 13px;
}

.legend-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--color-muted);
}

.popup {
  bottom: 0;
}

.popup-title {
  margin: 0;
  font-weight: 600;
}

.popup-detail {
  margin: 4px 0 0;
}

.popup-notes {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--color-muted);
}

.popup-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.share-url {
  width: 100%;
  margin-top: 8px;
}
