main {
    width: 100%;
    padding: 2rem;
}

.game-page-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.game-title-bar {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

#titleLogo {
    max-height: 80px;
}

.game-title-bar h1 {
    margin: 0;
    font-family: 'Oswald', sans-serif;
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--cream);
}

.mode-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 14px;
    flex-wrap: wrap;
}

.mode-selector select {
    padding: 0.5rem 0.75rem;
    background: var(--bg-card);
    color: var(--cream);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.game-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.board-with-supply {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    flex: 1;
}

.board-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

canvas {
    border: 2px solid var(--border);
    background: #ffffff;
    cursor: grab;
    touch-action: none;
    max-width: 100%;
    height: auto;
}

canvas.dragging {
    cursor: grabbing;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.controls.hidden {
    display: none;
}

button {
    padding: 0.5rem 1rem;
    background: var(--copper);
    color: var(--bg-dark);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

button:hover {
    background: var(--copper-light);
}

button:active {
    background: #d4a843;
}

button:disabled {
    background: #666;
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.6;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.speed-control input {
    width: 100px;
}

.speed-control label {
    font-size: 14px;
}

.bot-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.bot-selector label {
    font-size: 14px;
}

.supply-panels {
    display: flex;
    justify-content: center;
    gap: 1rem;
    width: 100%;
}

.supply-panel {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 8px;
    min-width: 200px;
    border: 1px solid var(--border);
}

.supply-panel h3 {
    margin-bottom: 0.75rem;
    font-size: 16px;
    color: var(--cream);
}

.supply-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 14px;
}

.draggable-pieces {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.draggable-piece {
    width: 50px;
    height: 50px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 4px;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: opacity 0.2s;
    overflow: hidden;
}

.draggable-piece img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 2px;
    user-select: none;
    -webkit-user-drag: none;
}

.draggable-piece.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.draggable-piece:not(.disabled):hover {
    border-color: var(--copper-light);
    background: var(--bg-mid);
}

.current-player {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--cream);
}

.game-status {
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    color: #d4a843;
}

.info-panel {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid var(--border);
    flex: 0 0 300px;
}

.info-panel h3 {
    margin-bottom: 0.75rem;
    color: var(--cream);
}

.info-panel p {
    margin-bottom: 0.5rem;
}

.analyse-panel {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    display: none;
    border: 1px solid var(--border);
    flex: 1;
}

.analyse-panel.visible {
    display: block;
}

.analyse-panel h3 {
    margin-bottom: 1rem;
    font-size: 18px;
    color: var(--cream);
}

.analyse-input-group {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.analyse-input-group label {
    font-size: 14px;
}

.analyse-input-group input {
    padding: 0.5rem 0.75rem;
    background: var(--bg-light);
    color: var(--cream);
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 100px;
}

.analyse-progress {
    margin: 1rem 0;
    display: none;
}

.analyse-progress.visible {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--copper), var(--copper-light));
    width: 0%;
    transition: width 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--bg-dark);
    font-weight: bold;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
    display: none;
}

.stats-grid.visible {
    display: grid;
}

.stat-item {
    background: var(--bg-light);
    padding: 0.75rem;
    border-radius: 4px;
    border-left: 3px solid var(--copper);
}

.stat-label {
    font-size: 12px;
    color: #aaa;
    text-transform: uppercase;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    margin-top: 0.25rem;
    color: #fff;
}

@media (max-width: 1024px) {
    .game-container {
        flex-direction: column;
        gap: 1.5rem;
    }

    .info-panel {
        flex: 1;
        width: 100%;
    }

    .analyse-panel {
        flex: 1;
        width: 100%;
    }

    .supply-panels {
        flex-direction: column;
    }

    .supply-panel {
        min-width: unset;
        width: 100%;
    }

    .mode-selector {
        flex-direction: column;
        align-items: stretch;
    }

    .mode-selector select,
    .bot-selector select {
        width: 100%;
    }

    .bot-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    #btnPlay {
        width: 100%;
        margin-top: 0.5rem;
    }

    canvas {
        aspect-ratio: 1 / 1;
    }
}

@media (max-width: 768px) {
    main {
        padding: 1rem;
    }

    .game-title-bar {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1rem;
    }

    .game-title-bar h1 {
        font-size: 1.75rem;
    }

    #titleLogo {
        max-height: 60px;
    }

    .mode-selector {
        font-size: 12px;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .mode-selector select,
    .bot-selector select,
    .bot-selector input {
        width: 100%;
        padding: 0.5rem;
    }

    .bot-selector {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .bot-selector label {
        font-size: 12px;
    }

    #btnPlay {
        width: 100%;
        padding: 0.75rem;
        min-height: 44px;
    }

    canvas {
        aspect-ratio: 1 / 1;
        width: 100%;
    }

    .current-player,
    .game-status {
        font-size: 14px;
        padding: 0.5rem;
    }

    .controls {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .controls button {
        width: 100%;
        padding: 0.75rem;
        font-size: 16px;
        min-height: 44px;
    }

    .speed-control {
        flex-direction: column;
        width: 100%;
    }

    .speed-control input {
        width: 100%;
    }

    .speed-control label {
        font-size: 12px;
    }

    .supply-panel {
        padding: 0.75rem;
    }

    .supply-panel h3 {
        font-size: 14px;
        margin-bottom: 0.5rem;
    }

    .supply-items {
        font-size: 12px;
        gap: 0.25rem;
    }

    .draggable-pieces {
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    .draggable-piece {
        width: 44px;
        height: 44px;
    }

    .analyse-panel {
        padding: 1rem;
    }

    .analyse-panel h3 {
        font-size: 16px;
        margin-bottom: 1rem;
    }

    .analyse-input-group {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .analyse-input-group label {
        font-size: 12px;
    }

    .analyse-input-group input {
        width: 100%;
        padding: 0.5rem;
    }

    .analyse-input-group button {
        width: 100%;
        padding: 0.75rem;
        min-height: 44px;
        font-size: 16px;
    }

    .info-panel {
        padding: 0.75rem;
        font-size: 13px;
    }

    .info-panel h3 {
        font-size: 14px;
        margin-bottom: 0.5rem;
    }

    .info-panel p {
        margin-bottom: 0.25rem;
        line-height: 1.4;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        margin-top: 1rem;
    }

    button {
        min-height: 44px;
        padding: 0.75rem;
        font-size: 14px;
    }

    button:disabled {
        opacity: 0.5;
    }
}
