@font-face {
    font-family: 'PT Serif';
    src: url(../fonts/PTSerif-Regular.ttf);
    font-weight: bold;
}

@font-face {
    font-family: 'Luckiest Guy';
    src: url(../fonts/LuckiestGuy-Regular.ttf);
    font-weight: bold;
}

html,
body {
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    background-color: #d8b27d;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

body {
    position: fixed;
    inset: 0;
    background-color: #ead8b7;
    background:
        radial-gradient(circle at center, rgba(255, 251, 240, 0.98) 0%, rgba(248, 237, 214, 0.94) 52%, rgba(234, 215, 181, 0.92) 100%),
        linear-gradient(180deg, rgba(255, 250, 241, 0.98) 0%, rgba(245, 230, 202, 0.96) 100%);
}

#game-root {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background-color: #ead8b7;
    background:
        radial-gradient(circle at center, rgba(255, 251, 240, 0.98) 0%, rgba(248, 237, 214, 0.94) 52%, rgba(234, 215, 181, 0.92) 100%),
        linear-gradient(180deg, rgba(255, 250, 241, 0.98) 0%, rgba(245, 230, 202, 0.96) 100%);
}

body.screen-preload {
    background-color: #ead8b7;
    background:
        radial-gradient(circle at center, rgba(255, 251, 240, 0.98) 0%, rgba(248, 237, 214, 0.94) 52%, rgba(234, 215, 181, 0.92) 100%),
        linear-gradient(180deg, rgba(255, 250, 241, 0.98) 0%, rgba(245, 230, 202, 0.96) 100%);
}

body.screen-preload::before {
    content: '';
    position: fixed;
    left: 50%;
    top: clamp(32px, calc(50dvh - 214px), 132px);
    width: min(340px, 50vw, calc(100dvh - 176px));
    aspect-ratio: 1048 / 416;
    transform: translateX(-50%);
    background: url('/images/bg/titulo.png') center center / contain no-repeat;
    pointer-events: none;
    z-index: 20;
}

body.screen-boot {
    background-color: #ead8b7;
    background:
        url('/images/bg/bg.png') center center / cover no-repeat,
        radial-gradient(circle at center, rgba(255, 251, 240, 0.98) 0%, rgba(248, 237, 214, 0.94) 52%, rgba(234, 215, 181, 0.92) 100%),
        linear-gradient(180deg, rgba(255, 250, 241, 0.98) 0%, rgba(245, 230, 202, 0.96) 100%);
}

body.screen-game {
    background-color: #ead8b7;
    background:
    url('/images/bg/bg.png') center center / cover no-repeat,
    radial-gradient(circle at center, rgba(255, 251, 240, 0.98) 0%, rgba(248, 237, 214, 0.94) 52%, rgba(234, 215, 181, 0.92) 100%),
    linear-gradient(180deg, rgba(255, 250, 241, 0.98) 0%, rgba(245, 230, 202, 0.96) 100%);
}

body.screen-boot #game-root {
    background-color: #ead8b7;
}

body.screen-preload #game-root {
    background-color: #f5f1e6;
    background:
        radial-gradient(circle at center, rgba(255, 251, 240, 0.98) 0%, rgba(248, 237, 214, 0.94) 52%, rgba(234, 215, 181, 0.92) 100%),
        linear-gradient(180deg, rgba(255, 250, 241, 0.98) 0%, rgba(245, 230, 202, 0.96) 100%);
}

body.screen-game #game-root {
    background-color: #ead8b7;
}

canvas {
    display: block;
    margin: 0;
    image-rendering: pixelated;
}

body.age-gate-active canvas {
    pointer-events: none;
}

body.age-gate-active .cookie-consent {
    visibility: hidden;
    pointer-events: none;
}

.age-gate {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: rgba(54, 24, 8, 0.26);
}

.age-gate__panel {
    width: min(460px, calc(100vw - 32px));
    box-sizing: border-box;
    padding: 24px;
    border: 1px solid rgba(89, 42, 13, 0.28);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 249, 240, 0.98) 0%, rgba(242, 224, 192, 0.98) 100%);
    box-shadow: 0 18px 50px rgba(77, 45, 18, 0.28);
    color: #3d220d;
    font-family: 'PT Serif', serif;
}

.age-gate__title {
    display: block;
    margin-bottom: 8px;
    font-family: 'Luckiest Guy', cursive;
    font-size: 30px;
    letter-spacing: 0.04em;
}

.age-gate__description {
    margin: 0 0 16px;
    font-size: 15px;
    line-height: 1.5;
}

.age-gate__check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 15px;
    line-height: 1.4;
    cursor: pointer;
}

.age-gate__checkbox {
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: #7b1e12;
    flex-shrink: 0;
}

.age-gate__button {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    cursor: pointer;
    font-family: 'Luckiest Guy', cursive;
    font-size: 16px;
    letter-spacing: 0.04em;
    background: #7b1e12;
    color: #fff7ea;
    box-shadow: 0 8px 18px rgba(123, 30, 18, 0.28);
    transition: transform 120ms ease, opacity 120ms ease, box-shadow 120ms ease;
}

.age-gate__button:hover {
    transform: translateY(-1px);
}

.age-gate__button:active {
    transform: translateY(0);
}

.age-gate__button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

.orientation-guard {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background:
        radial-gradient(circle at center, rgba(255, 247, 222, 0.94) 0%, rgba(233, 208, 165, 0.9) 54%, rgba(198, 157, 102, 0.96) 100%),
        linear-gradient(180deg, rgba(255, 248, 233, 0.95) 0%, rgba(226, 193, 142, 0.95) 100%);
    color: #4b250d;
    text-align: center;
}

.orientation-guard__panel {
    max-width: 420px;
}

.orientation-guard__title {
    margin: 0 0 14px;
    font-family: 'Luckiest Guy', cursive;
    font-size: 34px;
    line-height: 1.1;
    letter-spacing: 0.04em;
}

.orientation-guard__text {
    margin: 0;
    font-family: 'PT Serif', serif;
    font-size: 18px;
    line-height: 1.5;
}

.android-exit-dialog {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: rgba(54, 24, 8, 0.32);
}

.android-exit-dialog__panel {
    width: min(420px, calc(100vw - 32px));
    box-sizing: border-box;
    padding: 24px;
    border: 1px solid rgba(89, 42, 13, 0.28);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 249, 240, 0.98) 0%, rgba(242, 224, 192, 0.98) 100%);
    box-shadow: 0 18px 50px rgba(77, 45, 18, 0.28);
    color: #3d220d;
    font-family: 'PT Serif', serif;
}

.android-exit-dialog__title {
    display: block;
    margin-bottom: 8px;
    font-family: 'Luckiest Guy', cursive;
    font-size: 28px;
    letter-spacing: 0.04em;
}

.android-exit-dialog__description {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.5;
}

.android-exit-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.android-exit-dialog__button {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    cursor: pointer;
    font-family: 'Luckiest Guy', cursive;
    font-size: 16px;
    letter-spacing: 0.04em;
    transition: transform 120ms ease, opacity 120ms ease, box-shadow 120ms ease;
}

.android-exit-dialog__button:active {
    transform: translateY(0);
}

.android-exit-dialog__button--primary {
    background: #7b1e12;
    color: #fff7ea;
    box-shadow: 0 8px 18px rgba(123, 30, 18, 0.28);
}

.android-exit-dialog__button--secondary {
    background: rgba(123, 30, 18, 0.12);
    color: #7b1e12;
}

body.app-loaded.orientation-locked canvas,
body.app-loaded.orientation-locked #game-root,
body.app-loaded.orientation-locked .cookie-consent,
body.app-loaded.orientation-locked .age-gate {
    visibility: hidden;
    pointer-events: none;
}

body.app-loaded.orientation-locked .orientation-guard {
    display: flex;
    visibility: visible;
    pointer-events: auto;
}

.cookie-consent {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 2000;
    width: min(720px, calc(100vw - 24px));
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid rgba(89, 42, 13, 0.28);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 249, 240, 0.98) 0%, rgba(242, 224, 192, 0.98) 100%);
    box-shadow: 0 18px 50px rgba(77, 45, 18, 0.28);
    color: #3d220d;
    font-family: 'PT Serif', serif;
}

.cookie-consent__content {
    min-width: 0;
}

.cookie-consent__title {
    display: block;
    margin-bottom: 4px;
    font-size: 20px;
    line-height: 1.1;
}

.cookie-consent__description {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
}

.cookie-consent__actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-consent__button {
    border: 0;
    border-radius: 999px;
    padding: 10px 16px;
    cursor: pointer;
    font-family: 'Luckiest Guy', cursive;
    font-size: 16px;
    letter-spacing: 0.04em;
    transition: transform 120ms ease, opacity 120ms ease, box-shadow 120ms ease;
}

.cookie-consent__button:hover {
    transform: translateY(-1px);
}

.cookie-consent__button:active {
    transform: translateY(0);
}

.cookie-consent__button--primary {
    background: #7b1e12;
    color: #fff7ea;
    box-shadow: 0 8px 18px rgba(123, 30, 18, 0.28);
}

.cookie-consent__button--secondary {
    background: rgba(111, 73, 39, 0.12);
    color: #4f2b10;
}

@media (max-width: 640px) {
    .age-gate {
        padding: 16px;
    }

    .age-gate__panel {
        padding: 18px;
    }

    .age-gate__title {
        font-size: 26px;
    }

    .cookie-consent {
        flex-direction: column;
        align-items: stretch;
        bottom: 12px;
        padding: 14px;
    }

    .cookie-consent__actions {
        width: 100%;
    }

    .cookie-consent__button {
        flex: 1 1 0;
        text-align: center;
    }

    .orientation-guard__title {
        font-size: 28px;
    }

    .orientation-guard__text {
        font-size: 16px;
    }
}