@font-face {
    font-family: 'Gagalin';
    src: url('https://raw.githubusercontent.com/nemobgs/mrBurger/master/fonts/wpid-gagalin/Gagalin-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --bg-color: #d3c4b1;
    --accent-red: #ff4d4d;
    --ui-black: #080808;
    --text-white: #ffffff;
    --font-main: 'Gagalin', sans-serif;
}

* {
    box-sizing: border-box;
    user-select: none;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    background-color: var(--bg-color);
    font-family: var(--font-main);
    overflow: hidden;
    letter-spacing: 1px;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 10px 20px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.title {
    font-size: 48px;
    margin: 0;
    color: #000;
    line-height: 1;
    transform: rotate(-1deg);
}

.controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

.row-top,
.row-bottom {
    display: flex;
    gap: 8px;
}

.ui-btn {
    background: var(--ui-black);
    color: var(--text-white);
    border: 4px solid var(--accent-red);
    border-radius: 16px;
    padding: 10px 24px;
    font-family: var(--font-main);
    font-size: 24px;
    cursor: pointer;
    text-transform: uppercase;
    outline: none;
    transition: transform 0.1s;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
}

.ui-btn:hover {
    background: #1a1a1a;
}

.ui-btn:active {
    transform: scale(0.96);
}

.ui-select-wrapper {
    background: var(--ui-black);
    color: var(--text-white);
    border: 4px solid var(--accent-red);
    border-radius: 16px;
    padding: 10px 24px;
    font-family: var(--font-main);
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
}

.ui-select-invisible {

    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent !important;
    color: var(--text-white);
    border: none !important;
    font-family: var(--font-main);
    font-size: 24px;
    cursor: pointer;
    outline: none;
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 0;
}

.ui-select-invisible option {
    background: #000;
    color: #fff;
}

.select-btn {
    appearance: none;
    text-align: center;
}

.main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.canvas-container {
    padding: 6px;
    background: var(--accent-red);
    border-radius: 20px;
    box-shadow: 4px 6px 15px rgba(0, 0, 0, 0.2);
    height: 52vh;
    width: auto;
    aspect-ratio: 900/700;
    max-width: 100%;
    display: flex;
}

#game {
    display: block;
    background: #000;
    border-radius: 14px;
    cursor: crosshair;
    width: 100%;
    height: 100%;
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 6px;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.credit {
    font-family: sans-serif;
    font-size: 12px;
    color: #000;
    font-weight: 500;
}

.snow-btn {
    background: var(--ui-black);
    border: 3px solid var(--accent-red);
    border-radius: 12px;
    width: 48px;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.1s;
    z-index: 20;
}

.snow-btn:active {
    transform: scale(0.9);
}

.snow-btn img {
    width: 24px;
    height: 24px;
}

#snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    display: none;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: #fff;
    font-size: 1em;
    opacity: 0.8;
    user-select: none;
}

.custom-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 110%;
    left: 0;
    min-width: 100%;
    background-color: var(--ui-black);
    border: 4px solid var(--accent-red);
    border-radius: 12px;
    z-index: 100;
    box-shadow: 0px 10px 20px rgba(0,0,0,0.4);
    overflow: hidden;
}

.dropdown-item {
    color: var(--text-white);
    padding: 12px 16px;
    font-family: var(--font-main);
    font-size: 20px;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    border-bottom: 2px solid rgba(255,77,77,0.2);
    transition: background 0.1s;
}

.dropdown-item:last-child{
    border-bottom: none;
}

.dropdown-item:hover{
    background-color: #222;
    color: var(--accent-red);
}

.show-dropdown {
    display: block;
}

.toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translate(-50%);
    background-color: var(--ui-black);
    color: var(--text-white);
    border: 3px solid var(--accent-red);
    border-radius: 12px;
    padding: 12px 24px;
    font-family: var(--font-main);
    font-size: 24px;
    text-transform: uppercase;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    opacity: 1;
    transition: opacity 0.3s ease-in-out, top 0.3s ease-in-out;
    pointer-events: none;
}

.toast.hidden{
    opacity: 0;
    top: 80px;
}

.game-wrapper{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

#move-counter {
    font-family: var(--font-main);
    font-size: 28;
    color: var(--text-white);
    text-transform: uppercase;
    letter-spacing: 1px;
    background-color: var(--ui-black);
    border: 4px solid var(--accent-red);
    border-radius: 16px;
    padding: 8px 24px;
    box-shadow: 3px 3px 0px rgba(0,0,0,0.2);
    margin-bottom: 5px;
    z-index: 20;
}