:root {
  --bg-primary: #000000; /* 純黒 = 加算式ディスプレイで透明 */
  --bg-secondary: #0a0a0f;
  --bg-tertiary: #14141f;
  --bg-card: #1a1a2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent-primary: #4dd0ff;
  --focus-ring: #4dd0ff;
  --focus-glow: rgba(77, 208, 255, 0.4);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  width: 600px;
  height: 600px;
  overflow: hidden;
}

#app { width: 100%; height: 100%; position: relative; }

/* --- Screens --- */
.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  left: 0;
}
.screen.hidden { display: none; }

/* --- Header --- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-secondary);
  gap: 12px;
  flex-shrink: 0;
}
.header h1 { font-size: 22px; font-weight: 600; }
.header-meta { font-size: 14px; color: var(--text-secondary); }

/* --- Content Area --- */
.content {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* --- Focus States --- */
.focusable {
  transition: all 0.15s ease;
  border: 2px solid transparent;
  cursor: pointer;
  min-height: 44px;
}
.focusable:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}

/* --- Navigation Bar --- */
.nav-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.nav-item:focus { background: var(--bg-card); }
.nav-item.primary { background: var(--accent-primary); color: #0a0a0f; }
.nav-item.primary:focus { background: #8ae2ff; }

/* --- Intro (home) --- */
.intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0 8px;
  text-align: center;
}
.intro-icon { font-size: 56px; }
.intro-text { font-size: 16px; color: var(--text-secondary); line-height: 1.6; }

/* --- Mini cards --- */
.data-grid { display: flex; gap: 12px; }
.mini-card {
  flex: 1;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
}
.mini-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.mini-value { font-size: 22px; font-weight: 700; }
.mini-value-sm { font-size: 16px; font-weight: 600; line-height: 1.4; padding-top: 4px; }

/* --- Sky screen --- */
#sky:not(.hidden) { display: block; }
#sky-canvas { display: block; width: 600px; height: 600px; }

.sky-chip {
  position: absolute;
  background: rgba(10, 10, 15, 0.85);
  border: 1px solid rgba(77, 208, 255, 0.25);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
  color: var(--text-primary);
  pointer-events: none;
}
.sky-chip-dir { top: 16px; left: 16px; color: var(--accent-primary); font-weight: 600; }
.sky-chip-time { top: 16px; right: 16px; color: var(--text-secondary); }
.sky-chip-hint {
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text-muted);
  border-color: rgba(96, 96, 112, 0.3);
  white-space: nowrap;
}

/* --- Sky menu overlay --- */
.sky-menu {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 320px;
  background: rgba(10, 10, 15, 0.96);
  border: 1px solid rgba(77, 208, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}
.sky-menu.hidden { display: none; }
.menu-item {
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
}
.menu-item:focus { background: var(--bg-card); }

/* --- Help --- */
.help-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 4px;
}
.help-list li {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.help-list li b { color: var(--text-primary); }
