:root {
  --bg-primary: #000000;   /* pure black = transparent on additive display, lets real world show through */
  --bg-secondary: #0a0a0f;
  --bg-tertiary: #12141a;
  --bg-card: #171a21;
  --text-primary: #ffffff;
  --text-secondary: #9fb0ad;
  --text-muted: #5c6b68;

  --accent-primary: #00e5c7;   /* cool cyan/teal identity color */
  --accent-dim: rgba(0, 229, 199, 0.4);
  --focus-ring: #00e5c7;
  --focus-glow: rgba(0, 229, 199, 0.4);

  --success: #3ddc84;
  --warning: #ffd166;
  --danger: #ff5c5c;

  --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); /* transparent on additive display — real world shows through */
  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;
  padding: 18px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid rgba(0, 229, 199, 0.14);
  gap: 12px;
  flex-shrink: 0;
}
.header h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex: 1;
}

/* --- Content Area --- */
.content {
  flex: 1;
  padding: 16px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

/* --- Focus States (critical for D-pad / EMG input) --- */
.focusable {
  transition:
    transform 475ms cubic-bezier(0.6, 0, 0.4, 1),
    box-shadow 300ms cubic-bezier(0.4, 0.04, 0.5, 1),
    background 300ms cubic-bezier(0.4, 0.04, 0.5, 1);
  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);
  transform: scale(0.99);
}

/* --- Navigation Bar --- */
.nav-bar {
  display: flex;
  gap: 8px;
  padding: 14px 24px;
  background: var(--bg-secondary);
  border-top: 1px solid rgba(0, 229, 199, 0.1);
  flex-shrink: 0;
}
.nav-item {
  flex: 1;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 16px;
  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: #04211d;
  font-weight: 700;
}
.nav-item.primary:focus { background: #33ecd4; }

/* --- Status Badges (reused for level status) --- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success { background: rgba(61, 220, 132, 0.16); color: var(--success); }
.badge-warning { background: rgba(255, 209, 102, 0.16); color: var(--warning); }
.badge-danger { background: rgba(255, 92, 92, 0.16); color: var(--danger); }

/* --- Utility --- */
.hidden { display: none !important; }
.text-center { text-align: center; }

/* ======================================================
   HOME SCREEN
   ====================================================== */
.home-content {
  text-align: center;
  gap: 22px;
}
.home-icon {
  font-size: 76px;
  line-height: 1;
  color: var(--accent-primary);
  text-shadow: 0 0 26px rgba(0, 229, 199, 0.45);
}
.home-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 420px;
}

/* ======================================================
   LEVEL SCREEN
   ====================================================== */
.demo-banner {
  flex-shrink: 0;
  background: rgba(255, 209, 102, 0.12);
  border-bottom: 1px solid rgba(255, 209, 102, 0.35);
  color: var(--warning);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  padding: 7px 12px;
}

.level-content {
  gap: 16px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.level-gauge-wrap {
  width: 300px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.level-gauge-canvas {
  width: 300px;
  height: 300px;
  display: block;
}

.level-readout {
  display: flex;
  gap: 32px;
  font-family: 'SF Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 21px;
  font-weight: 600;
  color: var(--accent-primary);
  font-variant-numeric: tabular-nums;
}

.level-status-badge {
  font-size: 14px;
  padding: 6px 18px;
  letter-spacing: 0.02em;
}
