:root {
    --puzzle-size: 5;
    --tile-size: 100px;

    --bg: #000;
    --fg: #fff;
    --sidebar-bg: #fafafa;
    --sidebar-fg: #364149;
    --sidebar-non-existant: #aaa;
    --sidebar-active: #008cff;
    --sidebar-spacer: #f4f4f4;
    --scrollbar: #8f8f8f;
    --icons: #747474;
    --icons-hover: #000;
    --links: #20609f;
    --inline-code-color: #6e6b5e;
    --theme-popup-bg: #fafafa;
    --theme-popup-border: #cccccc;
    --theme-hover: #e6e6e6;
    --quote-bg: hsl(197, 37%, 96%);
    --quote-border: hsl(197, 37%, 91%);
    --table-border-color: hsl(0, 0%, 95%);
    --table-header-bg: hsl(0, 0%, 80%);
    --table-alternate-bg: hsl(0, 0%, 97%);
    --searchbar-border-color: #aaa;
    --searchbar-bg: #fafafa;
    --searchbar-fg: #000;
    --searchbar-shadow-color: #aaa;
    --searchresults-header-fg: #666;
    --searchresults-border-color: #888;
    --searchresults-li-bg: #e4f2fe;
    --search-mark-bg: #a2cff5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    font-family: "Open Sans", sans-serif;
    color: var(--fg);
    background-color: var(--bg);
    text-size-adjust: none;
    -webkit-text-size-adjust: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.container {
    max-width: 750px;
    padding: 40px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    font-weight: 500;
    font-size: 2em;
    color: var(--fg);
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.h1-icon {
    height: 3em;
    width: auto;
    margin-right: 0.3em;
    vertical-align: middle;
}

#puzzle-board {
    display: grid;
    grid-template-columns: repeat(var(--puzzle-size), 1fr);
    grid-template-rows: repeat(var(--puzzle-size), 1fr);
    gap: 2px;
    background-color: transparent;
    padding: 2px;
    border-radius: 4px;
}

.puzzle-tile {
    width: var(--tile-size);
    height: var(--tile-size);
    background-size: calc(var(--puzzle-size) * var(--tile-size))
        calc(var(--puzzle-size) * var(--tile-size));
    cursor: pointer;
    transition: transform 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    border-radius: 2px;
}

.puzzle-tile:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.puzzle-tile.empty {
    background-color: transparent;
    cursor: default;
}

.puzzle-tile.empty:hover {
    transform: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    :root {
        --tile-size: 60px;
    }

    .container {
        padding: 20px 10px;
    }

    h1 {
        font-size: 1.5em;
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    :root {
        --tile-size: 45px;
    }
}

#fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}
