/* Mahjong Specific Styles */
.game-surface {
    flex: 0 0 auto; /* Prevent stretching */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    min-height: 0;
    width: 100%;
    position: relative;
}

.canvas-shell {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10; /* Default for desktop */
    max-width: 100%;
    max-height: 55vh;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 600px) {
    .canvas-shell {
        aspect-ratio: 6 / 10; /* Mobile grid is 6x10 */
        max-height: 65vh; /* Allow more height on mobile for larger tiles */
    }
}

#game-canvas, #fx-canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#game-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#fx-canvas {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

.mahjong-accessible-board {
    position: absolute;
    inset: 0;
    z-index: 9;
    pointer-events: none;
}

.mahjong-tile-control {
    position: absolute;
    padding: 0;
    border: 0;
    border-radius: 16%;
    background: transparent;
    color: transparent;
    pointer-events: auto;
    cursor: pointer;
}

.mahjong-tile-control:focus-visible {
    outline: 3px solid var(--game-accent);
    outline-offset: -3px;
    background: color-mix(in srgb, var(--game-accent) 14%, transparent);
}

.mahjong-board-status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.toast {
    position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%) translateY(12px);
    background: rgba(30, 41, 59, 0.9); color: #fff; padding: 10px 18px;
    border-radius: 999px; opacity: 0; pointer-events: none;
    transition: opacity 0.2s, transform 0.2s; z-index: 3000; font-size: 13px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.record-list p {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title.small {
    font-size: 14px;
    margin-bottom: 8px;
}
