  :root {
    --bg: #0f0f11;
    --surface: #1a1a1f;
    --surface2: #242429;
    --border: #2e2e36;
    --text: #f0ede8;
    --muted: #6b6b78;
    --accent: #c8a96e;
    --accent2: #7b9cba;
    --highlight: #2a2a1a;
    --selected: #c8a96e22;
    --same-val: #7b9cba18;
    --given: #000;
    --user-color: #c8a96e;
    --note-color: #7b9cba;
    --cell-size: min(10vw, 56px);
  }

  .game_header {
    width: 100%;
    max-width: 480px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0px 20px 12px;
  }

  .game_header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.5px;
    color: var(--accent);
  }

  .subtitle {
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 2px;
    text-transform: uppercase;
  }

  .stats-row {
    width: 100%;
    max-width: 480px;
    display: flex;
    gap: 12px;
    padding: 0 20px 16px;
  }

  .stat {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    text-align: center;
  }

  .stat-val {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    display: block;
  }

  .stat-label {
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: block;
    margin-top: 2px;
  }

  .difficulty-row {
    width: 100%;
    max-width: 480px;
    display: flex;
    gap: 8px;
    padding: 0 20px 16px;
  }

  .diff-btn {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 8px 4px;
    cursor: pointer;
    transition: all 0.15s;
  }

  .diff-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #0f0f11;
    font-weight: 500;
  }

  .diff-btn:hover:not(.active) {
    border-color: var(--accent);
    color: var(--accent);
  }

  .board-wrap {
    width: 100%;
    max-width: 480px;
    padding: 0 16px;
  }

  .board {
    width: 100%;
    aspect-ratio: 1;
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    border: 2px solid var(--accent);
    border-radius: 4px;
    overflow: hidden;
    gap: 0;
    background: transparent;
  }

  .cell {
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--cell-size) * 0.38);
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: background 0.1s;
    border-right: 0.5px solid #c8a96e;
    border-bottom: 0.5px solid #c8a96e;
  }

  .cell:nth-child(3n):not(:nth-child(9n)) {
    border-right: 1.5px solid var(--accent);
  }

  .cell-row:nth-child(3n):not(:last-child) .cell {
    border-bottom: 1.5px solid var(--accent);
  }

  .board > .cell:nth-child(n+1):nth-child(-n+9) { border-top: none; }
  .board > .cell:nth-child(9n+1) { border-left: none; }

  .board {
    gap: 0.5px;
  }

  .cell.given { color: var(--given); }
  .cell.user-input { color: var(--user-color); }
  .cell.selected { background: var(--selected) !important; }
  .cell.same-group { background: var(--accent2); }
  .cell.same-value { background: var(--same-val); }

  .cell .notes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 90%;
    height: 90%;
    gap: 0;
  }

  .cell .note-digit {
    font-family: 'DM Mono', monospace;
    font-size: clamp(7px, 1.8vw, 11px);
    font-weight: 400;
    color: var(--note-color);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    opacity: 0.8;
  }

  .cell .note-digit:empty { opacity: 0; }

  .thick-border-right { border-right: 2px solid var(--accent) !important; }
  .thick-border-bottom { border-bottom: 2px solid var(--accent) !important; }

  .controls {
    width: 100%;
    max-width: 480px;
    padding: 14px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .numpad {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 6px;
  }

  .num-btn {
    aspect-ratio: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Playfair Display', serif;
    font-size: clamp(10px, 4vw, 12px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.12s;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .num-btn:hover { border-color: var(--accent); color: var(--accent); }
  .num-btn:active { transform: scale(0.93); background: var(--highlight); }

  .num-btn.used {
    opacity: 0.3;
    pointer-events: none;
  }

  .action-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .action-btn {
    padding: 11px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--muted);
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.12s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .action-btn .icon { font-size: 14px; }
  .action-btn:hover { border-color: var(--accent2); color: var(--accent2); }
  .action-btn:active { transform: scale(0.97); }
  .action-btn.note-mode-on { border-color: var(--note-color); color: var(--note-color); background: #7b9cba12; }

  .new-game-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .new-game-btn {
    padding: 13px;
    border-radius: 10px;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid var(--accent);
    color: var(--accent);
    background: transparent;
  }

  .new-game-btn:hover { background: var(--accent); color: var(--bg); }
  .new-game-btn.primary { background: var(--accent); color: var(--bg); }
  .new-game-btn.primary:hover { opacity: 0.88; }

  .win-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,15,17,0.92);
    z-index: 100;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
  }

  .win-overlay.show { display: flex; }

  .win-card {
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
    max-width: 320px;
    width: 90%;
  }

  .win-emoji { font-size: 48px; margin-bottom: 12px; }
  .win-title {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    color: var(--accent);
    margin-bottom: 8px;
  }
  .win-time { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
  .win-errors { font-size: 13px; color: #c85a5a; margin-bottom: 24px; min-height: 20px; }
  .win-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    color: var(--bg);
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
  }
  .win-btn:hover { opacity: 0.88; }