/* SPDX-FileCopyrightText: 2022-2026 Mahjongg Contributors
 * SPDX-License-Identifier: GPL-2.0-or-later */

/* Theme colors */
:root {
    --bg-postmodern: #e8e9f2;
    --bg-smooth: #eeede3;
    --bg-educational: #edf5f3;
    --bg-lightness-factor: 1;
    --tile-contrast: 100%;
    --tile-brightness: 100%;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-postmodern: #2a2d49;
        --bg-smooth: #373521;
        --bg-educational: #1d3a32;
        --tile-contrast: 140%;
        --tile-brightness: 80%;
    }
}

@media (prefers-contrast: more) {
    :root {
        --tile-contrast: 130%;
        --tile-brightness: 90%;
    }

    @media (prefers-color-scheme: dark) {
        :root {
            --bg-lightness-factor: 0.9;
            --tile-contrast: 150%;
            --tile-brightness: 80%;
        }
    }
}

/* Backgrounds */
window toolbarview.postmodern {
    background: hsl(from var(--bg-postmodern) h s calc(l * var(--bg-lightness-factor)));
}

window toolbarview.smooth {
    background: hsl(from var(--bg-smooth) h s calc(l * var(--bg-lightness-factor)));
}

window toolbarview.educational {
    background: hsl(from var(--bg-educational) h s calc(l * var(--bg-lightness-factor)));
}

/* Compact mode */
window toolbarview > .top-bar {
    transition: margin 85ms ease-in-out;
}

window.compact toolbarview > .top-bar {
    margin-top: -5px;
}

window.compact sheet toolbarview > .top-bar {
    margin-top: initial;
    margin-bottom: initial;
}

/* Game view */
stack.game {
    margin-top: -11px;
    min-height: 11px;
    transition: opacity 200ms ease-out;
}

stack.tile-filter {
    filter: contrast(var(--tile-contrast)) brightness(var(--tile-brightness));
}

.pause-overlay {
    margin-top: -11px;
}

/* Scores */
columnview {
    background: transparent;
}

columnview header button,
columnview row cell {
    padding-left: 12px;
    padding-right: 12px;
}
