body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Game container base styles handled by global.css */
.game-container {
    text-align: center;
    max-width: 800px;
}

.game-area {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

h1 {
    color: var(--primary-color);
    margin: 0;
}

.status {
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: bold;
    color: #2c3e50;
    height: 1.5em;
}

/* Hex Board Wrapper with edge labels */
.hex-board-wrapper {
    position: relative;
    display: inline-block;
    padding: 35px 50px;
    margin-bottom: 20px;
}

.hex-edge-label {
    position: absolute;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.hex-edge-top {
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: #d63031;
}

.hex-edge-bottom {
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: #d63031;
}

.hex-edge-left {
    left: 5px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
    color: #0984e3;
}

.hex-edge-right {
    right: 5px;
    top: 50%;
    transform: translateY(-50%) rotate(90deg);
    color: #0984e3;
}

/* Hex Board */
.hex-board {
    position: relative;
    /* Dimensions set dynamically by JS */
}

/* Border indicators on edges */
.hex-board::before,
.hex-board::after {
    content: '';
    position: absolute;
    z-index: 0;
    border-radius: 4px;
}

/* Individual hex cell */
.hex-cell {
    position: absolute;
    width: 40px;
    height: 46px;
    cursor: pointer;
    transition: transform 0.15s ease;
    z-index: 1;
}

.hex-cell:hover {
    transform: scale(1.1);
    z-index: 2;
}

.hex-cell svg {
    width: 100%;
    height: 100%;
    display: block;
}

.hex-cell .hex-shape {
    fill: #dfe6e9;
    stroke: #b2bec3;
    stroke-width: 2;
    transition: fill 0.2s ease, stroke 0.2s ease;
}

.hex-cell:hover .hex-shape {
    stroke: #636e72;
    stroke-width: 2.5;
}

/* Edge cells have colored borders to indicate which player connects */
.hex-cell.edge-top .hex-shape,
.hex-cell.edge-bottom .hex-shape {
    stroke: #d63031;
    stroke-width: 2.5;
}

.hex-cell.edge-left .hex-shape,
.hex-cell.edge-right .hex-shape {
    stroke: #0984e3;
    stroke-width: 2.5;
}

/* Corner cells belong to both edges - use a gradient-like dual stroke */
.hex-cell.edge-top.edge-left .hex-shape,
.hex-cell.edge-top.edge-right .hex-shape,
.hex-cell.edge-bottom.edge-left .hex-shape,
.hex-cell.edge-bottom.edge-right .hex-shape {
    stroke: #6c5ce7;
    stroke-width: 2.5;
}

/* Hover preview for current player */
.hex-cell.hover-red .hex-shape {
    fill: rgba(214, 48, 49, 0.3);
}

.hex-cell.hover-blue .hex-shape {
    fill: rgba(9, 132, 227, 0.3);
}

/* Placed stones */
.hex-cell.red .hex-shape {
    fill: #d63031;
    stroke: #c0392b;
}

.hex-cell.blue .hex-shape {
    fill: #0984e3;
    stroke: #0652dd;
}

/* Winning path highlight */
.hex-cell.win-path .hex-shape {
    animation: winPulse 0.6s ease-in-out 3;
    stroke: #fdcb6e;
    stroke-width: 3.5;
    filter: drop-shadow(0 0 6px rgba(253, 203, 110, 0.8));
}

@keyframes winPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* Disabled cell (already placed or not your turn) */
.hex-cell.disabled {
    cursor: not-allowed;
}

.hex-cell.disabled:hover {
    transform: none;
}

/* Swap rule offer */
.swap-offer {
    background: #ffeaa7;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #fdcb6e;
}

.swap-offer p {
    margin-bottom: 12px;
    color: #2d3436;
}

.swap-offer button {
    margin: 0 5px;
}

/* Game Buttons */
.game-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

#exit-game-btn {
    padding: 10px 20px;
    font-size: 1rem;
}

/* Online Game Info */
.online-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.opponent-name {
    font-weight: 600;
    color: var(--text-muted, #666);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .hex-board-wrapper {
        padding: 30px 25px;
        overflow-x: auto;
    }

    .hex-cell {
        width: 28px;
        height: 32px;
    }

    .game-area {
        padding: 15px;
    }

    .hex-edge-label {
        font-size: 0.7rem;
    }
}
