:root {
    --foreground: #eee;
    --background: #16181f;
    --success-bg: #2d4c2f;
    --success-bg-hover: #365d39;
    --success-fg: #fff;
    --danger-bg: #4f2525;
    --danger-bg-hover: #874a4a;
    --danger-fg: #fff;
    --info-bg: #516e84;
    --info-bg-hover: #385265;
    --info-fg: #fff;
    --warning-bg: #836342;
    --warning-bg-hover: #6f5335;
    --warning-fg: #fff;
    --pro-color: #ffdbcf;
    --admin-color: #e0ffc4;
    --nav-bg: var(--background);
    --nav-fg: var(--foreground);
    --footer-bg: var(--background);
    --footer-fg: #ffffff80;
    --card-bg: var(--background);
    --drawer-bg: var(--background);
    --input-bg: #fff;
    --link: #abb6de;
    --muted: #666;
    --default-spacing: 16px;
    --default-border-color: #ffffff20;
    --default-border-hover-color: #777;
    --default-border: 1px solid var(--default-border-color);
    --underlay: #00000070;
    --pill-border: 1px solid #ffffff30;
    --table-row-hover: #00000020;
    --transition:
        background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    min-height: 100dvh;
}

h1 {
    font-size: 1.5rem;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 16px;
}

main {
    padding: var(--default-spacing) 0;
    height: 100%;
}

nav#navbar {
    width: 100%;
    background: var(--nav-bg);
    color: var(--nav-fg);
    padding: 8px 0;
}

nav#navbar h1 {
    margin: 0;
    font-size: 1.2rem;
}

nav#navbar a {
    color: inherit;
    text-decoration: none;
}

nav#navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

nav#navbar a.btn,
nav#navbar button {
    color: inherit;
    border: 1px solid #00000000;
}

nav#navbar a.btn:hover,
nav#navbar button:hover {
    border: var(--pill-border);
}

#app_drawer {
    position: fixed;
    top: 0;
    right: 0;
}

img {
    flex-shrink: 0;
}

footer#footer {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    text-align: center;
    width: 100%;
    color: var(--footer-fg);
    background: var(--footer-bg);
    font-size: 0.9rem;
    padding: 12px 0;
}

footer#footer ul {
    margin: 0;
    padding: 0;
    list-style-type: none;
}

.flex {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--default-spacing);
}

.flex-col {
    display: flex;
    flex-direction: column;
    gap: var(--default-spacing);
}

.space-between {
    justify-content: space-between;
}

.gap-0 {
    gap: 0 !important;
}

.gap-1 {
    gap: 4px;
}

.gap-2 {
    gap: 8px;
}

.items-center {
    align-items: center;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.muted {
    color: var(--muted);
}

p {
    margin: 0;
    padding: 0;
}

h1,
h2,
h3 {
    font-weight: 900;
    margin: 0;
    padding: 0;
}

.card {
    padding: var(--default-spacing);
    background: var(--card-bg);
    border-radius: 12px;
    border: var(--pill-border);
}

form .form-control,
form .form-control label {
    display: block;
    width: 100%;
}

form .form-control label {
    font-weight: 900;
    margin-bottom: 2px;
}

input[type="checkbox"] {
    width: fit-content;
}

input,
textarea,
select {
    padding: 8px;
    border-radius: 8px;
    border: var(--default-border);
    font-size: 1rem;
    width: 100%;
    background: var(--input-bg);
    transition: var(--transition);
}

select:focus,
textarea:focus,
input:focus {
    outline: 0;
    border-color: var(--default-border-hover-color);
}

a:link,
a:visited,
button.link {
    text-decoration: underline;
    color: var(--link);
    padding: 0;
    font-weight: normal;
}

button {
    display: inline-block;
    border: 0;
    background: none;
    font-size: inherit;
    padding: 0;
    cursor: pointer;
    font-weight: 900;
}

img.avatar {
    padding: 0;
    max-width: 32px;
    max-height: 32px;
    border-radius: 100%;
}

.btn {
    padding: 6px 10px;
    border-radius: 6px;
    transition: var(--transition);
    text-decoration: none;
}

.btn.play {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    width: 100%;
    max-width: 480px;
    padding: 10px;
    gap: 4px;
    font-size: 1.25rem;
    text-decoration: none;
    font-weight: 900 !important;
}

button.outline {
    border: var(--default-border);
}

button.outline-hover {
    border: 1px solid #ffffff00;
}

button.outline:hover,
button.outline-hover:hover {
    border: 1px solid var(--default-border-hover-color);
}

a.success,
button.success {
    border: var(--pill-border);
    background: var(--success-bg);
    color: var(--success-fg);
}

a.success:hover,
button.success:hover {
    background: var(--success-bg-hover);
}

button.info {
    border: var(--pill-border);
    background: var(--info-bg);
    color: var(--info-fg);
}

button.info:hover {
    background: var(--info-bg-hover);
}

button.warning {
    border: var(--pill-border);
    background: var(--warning-bg);
    color: var(--warning-fg);
}

button.warning:hover {
    background: var(--warning-bg-hover);
}

button.danger {
    border: var(--pill-border);
    background: var(--danger-bg);
    color: var(--danger-fg);
}

button.danger:hover {
    background: var(--danger-bg-hover);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    border: 2px solid #ffffff20;
    width: 100%;
    max-width: 480px;
    margin: 32px auto;
}

.gutter,
.game-grid .locked,
.game-grid input {
    padding: 24px;
    border: 1px solid #ffffff20;
    aspect-ratio: 1 / 1;
    background: none;
    border-radius: 0;
    text-align: center;
    color: var(--foreground);
    font-size: 2.5rem;
    font-weight: 900;
}

.game-grid .locked span {
    visibility: hidden;
}

.game-grid .gutter {
    background: #1d243d;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

h1.hero {
    font-size: 2.25rem;
}

p.sub-hero {
    font-size: 1.5rem;
}

.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

@media screen and (max-width: 512px) {
    .game-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(4, 1fr);
        border: 2px solid #ffffff20;
        width: 90%;
        margin: 32px auto;
    }

    .gutter,
    .game-grid .locked,
    .game-grid input {
        padding: 24px;
        border: 1px solid #ffffff20;
        aspect-ratio: 1 / 1;
        background: none;
        border-radius: 0;
        text-align: center;
        color: var(--foreground);
        font-size: 1.2rem;
        font-weight: 900;
    }

    .btn.play {
        font-size: 1.25rem;
    }

    h1.hero {
        font-size: 2.25rem;
    }

    p.sub-hero {
        font-size: 1.15rem;
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: flex;
    }
}
