#pragma once

// --- Hardware pins (PicoResTouch-LCD-2.8) ---
#define LCD_CS 9
#define LCD_DC 8
#define LCD_RST 15
#define LCD_BL 13
#define TCH_CS 16
#define TCH_IRQ 17

// --- Layout (portrait 240x320) ---
const int SCREEN_W = 240;
const int SCREEN_H = 320;
const int COLS = 7;
const int ROWS = 6;
const int CELL = 32;
const int DISC_R = 13;
const int BRD_X = 8; // (240 - 7*32) / 2
const int BRD_Y = 56;
const int STAT_Y = 254;
const int SSTAT_Y = 278;

// --- Colors (RGB565, matching JS canvas palette) ---
#define C565(r, g, b) (uint16_t)(((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3))

const uint16_t C_BG = C565(26, 26, 46);
const uint16_t C_BOARD = C565(22, 33, 62);
const uint16_t C_GRID = C565(15, 52, 96);
const uint16_t C_EMPTY = C565(10, 22, 40);
const uint16_t C_P1 = C565(255, 215, 0);
const uint16_t C_P2 = C565(230, 57, 70);
const uint16_t C_P1DIM = C565(100, 85, 0);
const uint16_t C_P2DIM = C565(90, 25, 30);
const uint16_t C_TEXT = C565(224, 224, 224);
const uint16_t C_TXTDIM = C565(102, 102, 128);
const uint16_t C_MENUSEL = C565(15, 52, 96);
const uint16_t C_MULTI = C565(93, 173, 226);

// --- Game defaults (overridable via build flags) ---
#ifndef DEFAULT_LOOK_AHEAD
#define DEFAULT_LOOK_AHEAD 8
#endif
#ifndef DEFAULT_IDLE_TIMEOUT
#define DEFAULT_IDLE_TIMEOUT 60
#endif
#ifndef DEMO_RESET_PAUSE
#define DEMO_RESET_PAUSE 20000
#endif
#ifndef MAX_GAME_LOG
#define MAX_GAME_LOG 100
#endif
#ifndef BLUNDER_ENABLED
#define BLUNDER_ENABLED 0
#endif
#ifndef BLUNDER_CHANCE
#define BLUNDER_CHANCE 20
#endif
