:root {
    --bg-color: #1a1a2e;
    --board-color: #16213e;
    --accent-color: #0f3460;
    --highlight-color: #e94560;
    --text-color: #ffffff;
    --tile-color: #f0f0f0;
    --pip-color: #333;
    --tile-width: 40px;
    --tile-height: 80px;
    --gap: 5px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.game-container {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 10px;
    backdrop-filter: blur(10px);
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--highlight-color);
}

.score-board {
    display: flex;
    gap: 20px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-item .label {
    font-size: 0.8rem;
    opacity: 0.7;
}

.score-item .value {
    font-size: 1.2rem;
    font-weight: bold;
}

.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.hand-container {
    height: 100px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    gap: 10px;
    transition: all 0.3s ease;
}

.computer-hand {
    opacity: 0.8;
}

.board-container {
    flex: 1;
    background: var(--board-color);
    border-radius: 16px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden; /* We'll use JS/CSS transform to pan/zoom if needed later, for now simple overflow */
    display: flex;
    justify-content: center;
    align-items: center;
}

.board-scroll-area {
    position: absolute;
    /* Center conceptually, will grow */
    display: flex;
    flex-wrap: wrap; 
    justify-content: center;
    align-items: center;
    width: 2000px; /* Large area for tiles */
    height: 2000px;
    transform-origin: center;
    transition: transform 0.3s ease;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Domino Tile Styles */
.domino-tile {
    width: var(--tile-width);
    height: var(--tile-height);
    background-color: var(--tile-color);
    border-radius: 6px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.domino-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(255,255,255,0.2);
}

.domino-tile.horizontal {
    width: var(--tile-height);
    height: var(--tile-width);
    flex-direction: row;
}

.domino-tile .line {
    position: absolute;
    background: #ccc;
}
/* Vertical line */
.domino-tile:not(.horizontal) .line {
    top: 50%;
    left: 10%;
    width: 80%;
    height: 1px;
}
/* Horizontal line */
.domino-tile.horizontal .line {
    left: 50%;
    top: 10%;
    height: 80%;
    width: 1px;
}

.half-tile {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    place-items: center;
}

.pip {
    width: 6px;
    height: 6px;
    background-color: var(--pip-color);
    border-radius: 50%;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.5);
}

/* Pip positioning helper classes */
/* We will generate pips via JS or have classes like .p-1 .p-2 etc */

/* Tile Back for Computer */
.tile-back {
    width: var(--tile-width);
    height: var(--tile-height);
    background: linear-gradient(135deg, #444 25%, #333 25%, #333 50%, #444 50%, #444 75%, #333 75%, #333 100%);
    background-size: 10px 10px;
    border-radius: 6px;
    border: 2px solid #555;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

/* Controls */
.controls-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
}

.status-message {
    font-weight: 600;
    margin-right: 20px;
    color: #ccc;
}

.action-btn {
    background: var(--highlight-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s, transform 0.1s;
}

.action-btn:hover:not(:disabled) {
    background: #ff6b81;
    transform: scale(1.05);
}

.action-btn:disabled {
    background: #555;
    cursor: not-allowed;
    opacity: 0.7;
}

.action-btn.secondary {
    background: transparent;
    border: 1px solid var(--highlight-color);
    color: var(--highlight-color);
}

.action-btn.secondary:hover {
    background: rgba(233, 69, 96, 0.1);
}

/* Board Placement classes */
.tile-on-board {
    position: relative;
    /* absolute positioning removed to allow flex flow */
}

.start-marker {
    color: rgba(255,255,255,0.1);
    font-size: 2rem;
    font-weight: bold;
    border: 2px dashed rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
}

/* Responsive adjustments */
@media (max-height: 600px) {
    .hand-container {
        height: 70px;
        gap: 5px;
    }
    :root {
        --tile-width: 30px;
        --tile-height: 60px;
    }
}
