:root {
    --color-wood-dark: #2c1810;
    --color-wood-medium: #5d4037;
    --color-wood-light: #d7ccc8;
    --color-batik-gold: #c5a059;
    --color-batik-red: #8b0000;
    --color-tile: #f3e5ab;
    --color-tile-text: #2c1810;
    --bg-dark: #121212;
    --font-serif: 'Playfair Display', serif;
    --font-display: 'Cormorant Garamond', serif;
    --font-sans: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at center, rgba(44, 24, 16, 0.4) 0%, rgba(18, 18, 18, 1) 100%);
    color: #fff;
    font-family: var(--font-sans);
    height: 100vh;
    overflow: hidden;
}

.game-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

/* Header */
.game-header {
    padding: 1rem 2rem;
    background: rgba(44, 24, 16, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--color-batik-gold);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--color-batik-gold);
}

.logo span {
    color: #fff;
    font-weight: 300;
}

.score-item {
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    border: 1px solid rgba(197, 160, 89, 0.3);
}

.score-item .label {
    display: block;
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    color: var(--color-batik-gold);
}

.score-item .value {
    font-family: var(--font-serif);
    font-size: 1.5rem;
}

.game-controls {
    display: flex;
    gap: 1rem;
}

/* Board */
.board-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    overflow: hidden;
}

.board {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    gap: 2px;
    background-color: var(--color-wood-dark);
    border: 8px solid var(--color-wood-dark);
    aspect-ratio: 1 / 1;
    width: 100%;
    max-height: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.cell {
    background-color: var(--color-wood-medium);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cell:hover {
    background-color: var(--color-wood-light);
}

/* Special Cells */
.cell.tw {
    background-color: #ff4757;
}

/* Triple Word */
.cell.dw {
    background-color: #ff7f50;
}

/* Double Word */
.cell.tl {
    background-color: #1e90ff;
}

/* Triple Letter */
.cell.dl {
    background-color: #70a1ff;
}

/* Double Letter */
.cell.star {
    background-color: var(--color-batik-gold);
}

.cell::after {
    font-size: 0.5rem;
    text-align: center;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.6);
}

.cell.tw::after {
    content: '3W';
}

.cell.dw::after {
    content: '2W';
}

.cell.tl::after {
    content: '3L';
}

.cell.dl::after {
    content: '2L';
}

.cell.star::after {
    content: '★';
    font-size: 1rem;
}

/* Tiles */
.tile {
    width: 90%;
    height: 90%;
    background-color: var(--color-tile);
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    border-radius: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-tile-text);
    font-family: var(--font-serif);
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    user-select: none;
}

.tile .points {
    position: absolute;
    bottom: 2px;
    right: 3px;
    font-size: 0.5rem;
}

.tile.temp {
    opacity: 0.8;
    transform: scale(0.95);
    border: 2px dashed var(--color-batik-gold);
}

/* Player Rack */
.player-area {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(197, 160, 89, 0.2);
}

.rack-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.rack {
    display: flex;
    gap: 8px;
    background: var(--color-wood-dark);
    padding: 10px;
    border-radius: 4px;
    min-width: 350px;
    height: 60px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.rack .tile {
    width: 45px;
    height: 45px;
    cursor: grab;
}

.rack .tile:active {
    cursor: grabbing;
}

.rack .tile.selected {
    outline: 3px solid var(--color-batik-gold);
    transform: translateY(-5px);
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--color-batik-gold);
    color: var(--color-wood-dark);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.overlay.hidden {
    display: none;
}

.batik-text {
    font-family: var(--font-display);
    font-size: 4rem;
    color: var(--color-batik-gold);
    margin-bottom: 1rem;
}

.info-bar {
    text-align: center;
    color: var(--color-tile-text);
    background: var(--color-tile);
    font-size: 0.75rem;
    padding: 2px 0;
    font-weight: bold;
}

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-batik-red);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: bold;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s;
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
}