/* Clean, high-contrast modern theme */
:root {
    --bg: #f5f6fa;
    --bg-surface: #e1e4e8;
    --bg-card: #ffffff;
    --primary: #2d98da;
    --primary-light: #4b7bec;
    --accent: #2d98da;
    --text: #2f3640;
    --text-dim: #718093;
    --success: #20bf6b;
    --danger: #eb3b5a;

    /* Multiplier tints — crisp, standard colors */
    --tw-color: #fc5c65; /* Vivid red */
    --dw-color: #fd9644; /* Orange */
    --tl-color: #45aaf2; /* Bright blue */
    --dl-color: #d1d8e0; /* Pale blue-grey */
    --star-color: #fed330; /* Bright yellow */

    --tile-bg: #fff2cc; /* Warm cream for tiles */
    --tile-text: #2f3640;
    --tile-pending: #ffeaa7; /* Slightly brighter for pending */
    --radius: 6px;
    --cell-gap: 2px;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Board: clean dark grid lines */
.board {
    background: #353b48;
    padding: 2px;
    border-radius: 4px;
    gap: var(--cell-gap);
}

.cell {
    border-radius: 2px;
    font-family: inherit;
}

/* Empty cells: crisp light grey */
.cell--empty:not([class*="cell--bonus"]) {
    background: #f1f2f6;
}

/* Bonus squares: distinct text */
.cell--bonus-tw::after,
.cell--bonus-dw::after,
.cell--bonus-tl::after,
.cell--bonus-dl::after,
.cell--bonus-s::after {
    color: rgba(0, 0, 0, 0.7);
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0;
}

/* Occupied tiles: flat, clean, highly readable */
.cell--occupied {
    background: var(--tile-bg);
    color: var(--tile-text);
    font-weight: 800;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
    text-shadow: none;
}

/* Pending tiles */
.cell--pending {
    background: var(--tile-pending);
    color: var(--tile-text);
    box-shadow: 0 0 0 2px var(--primary), inset 0 -3px 0 rgba(0,0,0,0.15);
    text-shadow: none;
    font-weight: 800;
}

.cell--drop-target {
    background: rgba(45, 152, 218, 0.2);
    box-shadow: inset 0 0 0 2px var(--primary);
}

/* Rack tiles */
.rack-tile {
    background: var(--tile-bg);
    color: var(--tile-text);
    border: none;
    border-radius: 4px;
    box-shadow: 0 3px 0 rgba(0,0,0,0.15), 0 3px 6px rgba(0,0,0,0.1);
    text-shadow: none;
    font-family: inherit;
    font-weight: 800;
}

.rack-tile--dragging {
    opacity: 0.3;
}

.drag-ghost {
    background: var(--tile-bg);
    color: var(--tile-text);
    border: none;
    border-radius: 4px;
    box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 8px 16px rgba(0,0,0,0.2);
    text-shadow: none;
    font-family: inherit;
    font-weight: 800;
}

.rack--drop-target {
    outline-color: var(--primary);
}

/* Logo */
.logo {
    font-family: inherit;
    color: var(--primary);
    font-weight: 900;
    letter-spacing: -1px;
}

.logo-small {
    font-family: inherit;
    color: var(--primary);
    font-weight: 800;
}

/* Buttons */
button {
    background: #ffffff;
    color: var(--text);
    border: 1px solid #dcdde1;
    border-radius: 6px;
    font-family: inherit;
    font-weight: 600;
}

button:active {
    background: #f5f6fa;
    transform: scale(0.97);
}

.action-btn.primary {
    background: var(--primary);
    color: #ffffff;
    border: none;
}

.action-btn.primary:active {
    background: var(--primary-light);
}

#btn-login, #btn-new-game {
    background: var(--primary);
    color: #ffffff;
    border: none;
}

/* Inputs */
input[type="text"], input[type="password"] {
    background: #ffffff;
    border: 2px solid #dcdde1;
    color: var(--text);
    font-family: inherit;
    border-radius: 6px;
}

input:focus {
    border-color: var(--primary);
    outline: none;
}

/* Headers and surfaces */
.lobby-header,
.game-header,
.stats-header {
    background: #ffffff;
    border-bottom: 1px solid #dcdde1;
}

.game-info-row {
    background: #f5f6fa;
    color: var(--text-dim);
}

/* Score display */
.score.you { color: var(--text); font-weight: 800; }
.score.opp { color: var(--text-dim); }
.score-sep { color: #dcdde1; }

.turn-indicator.your-turn {
    background: var(--success);
    color: #ffffff;
    font-weight: 700;
    border: none;
}

.turn-indicator.their-turn {
    background: #dcdde1;
    color: var(--text-dim);
    border: none;
}

/* Game cards */
.game-card {
    background: #ffffff;
    border: 1px solid #dcdde1;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.game-card:active {
    background: #f5f6fa;
}

.game-turn.your-turn {
    background: var(--primary);
    color: #ffffff;
}

.game-turn.their-turn {
    background: #f5f6fa;
    color: var(--text-dim);
}

.game-turn.finished {
    background: #dcdde1;
    color: var(--text-dim);
}

/* Suggestions */
.suggestions {
    background: #ffffff;
    border-color: #dcdde1;
}

.suggestion-item:hover {
    background: #f5f6fa;
}

/* Modal */
.modal-backdrop {
    background: rgba(47, 54, 64, 0.6);
}

.modal-content {
    background: #ffffff;
    border: none;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.modal-header .word {
    color: var(--text);
    font-family: inherit;
    font-weight: 800;
}

.modal-close {
    color: var(--text-dim);
}

.definition {
    color: var(--text);
    font-family: inherit;
    line-height: 1.5;
}

/* Blank picker */
.blank-picker h3 {
    color: var(--text);
}

.letter-grid button {
    background: #ffffff;
    color: var(--text);
    border: 1px solid #dcdde1;
    border-radius: 4px;
    font-weight: 800;
    font-size: 1.2rem;
}

.letter-grid button:active {
    background: #f5f6fa;
}

/* Stats */
.stat-card {
    background: #ffffff;
    border: 1px solid #dcdde1;
    border-radius: 6px;
}

.stat-item .stat-value {
    color: var(--text);
    font-weight: 800;
}

.word-list li {
    border-bottom-color: #f5f6fa;
}

.word-list .word-name {
    color: var(--text);
    font-weight: 700;
}

/* Banner */
.banner {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
}

/* Move history */
.move-history {
    background: #f5f6fa;
}

.history-entry {
    border-bottom-color: #dcdde1;
}

.history-entry .move-words {
    color: var(--text);
    font-weight: 600;
}
