/* index.css — extracted from inline <style> blocks. Generated by scripts/h1-extract.mjs */
:root {
    --bg: #0f1115;
    --panel: #1a1e27;
    --panel2: #232833;
    --accent: #f0a830;
    --text: #e6e8ed;
    --muted: #8a93a6;
    --ok: #4ade80;
    --bad: #ef4444;
    --grid: #1f2530;
    --path: #5a4530;
    --pathEdge: #745838;
  }
  * { box-sizing: border-box; }
  html, body {
    margin: 0; padding: 0; height: 100%;
    background: var(--bg); color: var(--text);
    font-family: -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
    user-select: none; overflow: hidden;
  }
  #app {
    display: flex; flex-direction: column;
    height: 100vh; width: 100vw;
  }
  header {
    display: flex; align-items: center; gap: 16px;
    padding: 10px 16px; background: var(--panel);
    border-bottom: 1px solid #000;
  }
  header h1 {
    margin: 0; font-size: 18px; color: var(--accent);
    letter-spacing: 1px;
  }
  .stat {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; background: var(--panel2);
    border-radius: 6px; font-size: 14px; font-weight: 600;
  }
  .stat .label { color: var(--muted); font-weight: 400; font-size: 12px; }
  button, .btn {
    background: var(--panel2); color: var(--text);
    border: 1px solid #2f3644; padding: 8px 14px;
    border-radius: 6px; cursor: pointer; font-size: 13px;
    font-family: inherit; transition: all 0.15s;
  }
  button:hover:not(:disabled) { background: #2d3547; border-color: var(--accent); }
  button:disabled { opacity: 0.4; cursor: not-allowed; }
  button.primary { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }
  button.primary:hover:not(:disabled) { background: #ffb840; }
  button.danger { background: #3a1a1a; border-color: #5a2a2a; }
  button.danger:hover:not(:disabled) { background: #5a1a1a; }
  .spacer { flex: 1; }
  main {
    display: flex; flex: 1; min-height: 0;
  }
  #gameWrap {
    flex: 1; display: flex; align-items: center; justify-content: center;
    background: #0a0c10; position: relative;
  }
  canvas {
    background: #1a2028; cursor: crosshair;
    image-rendering: pixelated;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
  }
  #sidebar {
    width: 240px; background: var(--panel);
    border-left: 1px solid #000;
    display: flex; flex-direction: column;
    overflow-y: auto;
  }
  .section {
    padding: 12px; border-bottom: 1px solid #0a0c10;
  }
  .section h3 {
    margin: 0 0 10px 0; font-size: 12px;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--muted);
  }
  .tower-btn {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 10px; margin-bottom: 6px;
    text-align: left; background: var(--panel2);
    border: 2px solid transparent; border-radius: 6px;
    cursor: pointer;
  }
  .tower-btn:hover:not(:disabled) { background: #2d3547; }
  .tower-btn.selected { border-color: var(--accent); background: #2d3547; }
  .tower-btn:disabled { opacity: 0.4; cursor: not-allowed; }
  .tower-icon {
    width: 32px; height: 32px; border-radius: 4px;
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700;
  }
  .tower-meta { flex: 1; min-width: 0; }
  .tower-name { font-size: 13px; font-weight: 600; }
  .tower-cost { font-size: 11px; color: var(--accent); }
  .tower-key {
    font-size: 10px; color: var(--muted);
    background: #0a0c10; padding: 2px 5px; border-radius: 3px;
  }
  .info-row {
    display: flex; justify-content: space-between;
    font-size: 12px; padding: 3px 0; color: var(--muted);
  }
  .info-row span:last-child { color: var(--text); font-weight: 600; }
  .btn-row { display: flex; gap: 6px; margin-top: 8px; }
  .btn-row button { flex: 1; padding: 8px; font-size: 12px; }
  #message {
    position: absolute; top: 20px; left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85); color: var(--accent);
    padding: 12px 24px; border-radius: 6px;
    font-size: 16px; font-weight: 700;
    pointer-events: none; opacity: 0;
    transition: opacity 0.3s;
    border: 1px solid var(--accent);
  }
  #message.show { opacity: 1; }
  #editorHelp {
    position: absolute; bottom: 20px; left: 20px;
    background: rgba(0,0,0,0.85); padding: 10px 14px;
    border-radius: 6px; font-size: 12px; color: var(--muted);
    line-height: 1.6; max-width: 280px;
    border: 1px solid #2f3644;
  }
  #editorHelp b { color: var(--accent); }
  #editorHelp kbd {
    background: #2d3547; padding: 1px 5px; border-radius: 3px;
    font-size: 11px; color: var(--text);
  }
  .editor-tools {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  }
  .editor-tools button { padding: 8px; font-size: 11px; }
  .editor-tools button.selected { border-color: var(--accent); background: #2d3547; }
  #gameOver {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.85);
    display: none; align-items: center; justify-content: center;
    flex-direction: column; gap: 20px;
    z-index: 10;
  }
  #gameOver h2 { font-size: 48px; margin: 0; color: var(--accent); }
  #gameOver p { font-size: 18px; color: var(--muted); margin: 0; }
  #gameOver.show { display: flex; }
  .hidden { display: none !important; }

  /* ============ MOBILE ============ */
  @media (max-width: 768px) {
    html, body { overflow-y: auto; }
    #app { height: auto; min-height: 100vh; }
    header {
      flex-wrap: wrap; gap: 6px; padding: 8px;
    }
    header h1 { font-size: 14px; width: 100%; }
    .stat { padding: 5px 8px; font-size: 12px; min-height: 32px; }
    .stat .label { font-size: 10px; }
    .spacer { display: none; }
    header button {
      min-height: 44px; padding: 8px 10px;
      font-size: 11px; flex: 1 1 auto;
    }
    main { flex-direction: column; }
    #gameWrap { padding: 6px; min-height: 0; }
    canvas {
      width: 100% !important;
      max-width: 100%;
      height: auto !important;
      max-height: 60vh;
    }
    #sidebar {
      width: 100%; max-height: none;
      border-left: none; border-top: 1px solid #000;
    }
    .section { padding: 10px; }
    .section h3 { font-size: 11px; margin-bottom: 8px; }
    .tower-btn {
      min-height: 48px; padding: 8px;
    }
    .tower-name { font-size: 12px; }
    .tower-cost { font-size: 10px; }
    .tower-key { font-size: 10px; }
    .info-row { font-size: 11px; }
    .btn-row button { min-height: 44px; font-size: 11px; }
    .editor-tools button { min-height: 44px; font-size: 11px; }
    #editorHelp { font-size: 10px; padding: 8px; max-width: 90%; bottom: 10px; left: 10px; }
    #gameOver h2 { font-size: 32px; }
    #gameOver p { font-size: 14px; padding: 0 20px; text-align: center; }
  }
  @media (max-width: 480px) {
    header { padding: 6px; gap: 4px; }
    header h1 { font-size: 12px; }
    .stat { padding: 4px 6px; font-size: 11px; min-height: 30px; }
    .stat .label { font-size: 10px; }
    header button { font-size: 10px; min-height: 44px; padding: 6px 8px; }
    canvas { max-height: 50vh; }
    .section { padding: 8px; }
    .tower-btn { padding: 6px; }
    .tower-name { font-size: 11px; }
    .tower-cost { font-size: 10px; }
    .tower-icon { width: 28px; height: 28px; font-size: 16px; }
    #gameOver h2 { font-size: 24px; }
  }
