:root {
  --bg: #1a1a1a;
  --surface: #242424;
  --card: #2a2a2a;

  --text: #eeeeee;
  --text-secondary: #cccccc;
  --text-muted: #888888;

  --blue: #4389fd;
  --blue-light: #8ab6fe;
  --red: #fd4445;
  --red-light: #fd8a8b;
  --purple: #8047f9;
  --purple-light: #b08dfb;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  /* Standard Board Base Colors to prevent blackening */
  --board-light: #f0d9b5;
  --board-dark: #b58863;
}

/* Base */
body {
  margin: 0; padding: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  overflow-x: hidden;
}

.app {
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom) 16px;
  max-width: 480px;
  margin: auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Top Bar */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; }
.topbar-left { display: flex; gap: 12px; align-items: center; }
.logo-img { width: 32px; height: 32px; border-radius: 6px; }
.title { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.subtitle { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); margin-top: -2px; }

/* Session Card */
.session-card {
  display: flex;
  justify-content: space-between;
  background: var(--surface);
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
}

.session-item { display: flex; flex-direction: column; gap: 2px; }
.label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.value, .minimal-select { font-size: 14px; font-weight: 600; color: var(--text); background: transparent; border: none; padding: 0; outline: none; }

/* Board Area */
.board-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  border-radius: 24px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 20px;
  position: relative;
}

#board { width: 100%; aspect-ratio: 1; border-radius: 4px; overflow: hidden; }

/* --- FIX BLACKENING: Explicitly set board base colors --- */
.white-1e1d7 { background-color: var(--board-light) !important; }
.black-3c85d { background-color: var(--board-dark) !important; }

/* --- CUSTOM 6-COLOR HEATMAP PALETTE --- */
/* Light Squares */
.white-1e1d7.highlight-w { background-color: var(--blue-light) !important; }
.white-1e1d7.highlight-b { background-color: var(--red-light) !important; }
.white-1e1d7.highlight-both { background-color: var(--purple-light) !important; }

/* Dark Squares (Using your new refined colors) */
.black-3c85d.highlight-w { background-color: var(--blue) !important; }
.black-3c85d.highlight-b { background-color: var(--red) !important; }
.black-3c85d.highlight-both { background-color: var(--purple) !important; }

/* Selection */
.highlight-selected { 
    box-shadow: inset 0 0 15px 5px rgba(241, 196, 15, 0.8) !important; 
    background-color: rgba(241, 196, 15, 0.2) !important;
}

/* Move Hints: Prevent background breakage */
.highlight-hint { box-shadow: none !important; }

.status-text { text-align: center; font-size: 13px; color: #cccccc; margin-top: 12px; min-height: 20px; font-weight: 500; }

/* Buttons */
.btn { padding: 14px; border-radius: var(--radius-md); font-weight: 600; font-size: 14px; border: none; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn:active { transform: scale(0.97); opacity: 0.9; }
.btn.primary { background: linear-gradient(180deg, var(--blue), #2563eb); color: white; box-shadow: 0 8px 16px rgba(67, 137, 253, 0.25); }
.btn.ghost { background: transparent; border: 1px solid rgba(255, 255, 255, 0.1); color: var(--text-secondary); }
