@font-face {
    font-family: 'Zabars';
    src: url('./fonts/zabars.regular.ttf') format('truetype');
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    min-height: 100%;
    overflow: hidden;
}

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(180deg, #f8d77a, #e48727);
    color: #2d1b00;
}

button,
a {
    font: inherit;
}

button {
    border: 0;
}

button:not(.mobile-btn),
a {
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

.game-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
}

h1 {
    font-family: 'Zabars', Arial, sans-serif;
    font-size: clamp(42px, 7vw, 78px);
    letter-spacing: 4px;
    text-shadow: 2px 2px 0 #f9e5b2;
}

.game-stage {
    position: relative;
    width: min(100%, 720px);
    aspect-ratio: 3 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 5px solid #6b2d00;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.game-stage:fullscreen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
}

.fullscreen-btn,
.stage-overlay-btn,
.page-imprint-link,
.overlay-action-btn,
.overlay-close,
.imprint-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 2px solid #6b2d00;
    background: rgba(255, 226, 153, 0.94);
    color: #3a1600;
    transition: transform 120ms ease, background 120ms ease;
}

.fullscreen-btn:hover,
.stage-overlay-btn:hover,
.page-imprint-link:hover,
.overlay-action-btn:hover,
.overlay-close:hover,
.imprint-back-link:hover {
    transform: translateY(-1px);
    background: #fff1c6;
}

.fullscreen-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 46px;
    height: 46px;
    z-index: 3;
    font-size: 22px;
}

.stage-overlay-btn {
    position: absolute;
    z-index: 3;
    min-height: 42px;
    padding: 0 16px;
    font-weight: 700;
}

.start-screen-help {
    top: 16px;
    right: 70px;
    left: auto;
    width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
}

.start-screen-imprint {
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
}

.help-button-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.page-imprint-link,
.imprint-back-link {
    min-height: 46px;
    padding: 0 18px;
    font-weight: 700;
}

.page-imprint-link {
    display: inline-flex;
}

.game-stage .stage-overlay-btn,
.game-stage .page-imprint-link {
    opacity: 0;
    pointer-events: none;
}

.game-stage.show-start-screen-actions .stage-overlay-btn {
    opacity: 1;
    pointer-events: auto;
}

.rotate-device-hint {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    text-align: center;
    font-weight: 700;
    font-size: 24px;
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    z-index: 5;
}

.mobile-controls {
    position: absolute;
    inset: 0;
    display: none;
    align-items: flex-end;
    justify-content: space-between;
    padding: 16px;
    pointer-events: none;
    z-index: 2;
}

.mobile-controls-move,
.mobile-controls-throw,
.mobile-controls-bottom {
    display: flex;
    gap: 12px;
}

.mobile-controls-move {
    flex-direction: column;
    align-items: center;
}

.mobile-controls-bottom {
    justify-content: center;
}

.mobile-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 28px;
    font-weight: 700;
    pointer-events: auto;
    user-select: none;
    cursor: default;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.mobile-btn-throw {
    width: 88px;
    border-radius: 999px;
    font-size: 18px;
}

.page-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.72);
    z-index: 40;
}

.page-overlay.is-visible {
    display: flex;
}

.overlay-open {
    overflow: hidden;
}

.overlay-panel,
.imprint-panel {
    position: relative;
    width: min(100%, 880px);
    max-height: min(90vh, 760px);
    overflow: auto;
    padding: 28px;
    border-radius: 22px;
    border: 3px solid #6b2d00;
    background: #fff6de;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
}

.overlay-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    font-size: 24px;
}

.overlay-panel h2,
.imprint-panel h1 {
    margin-bottom: 12px;
    font-family: 'Zabars', Arial, sans-serif;
    font-size: clamp(34px, 5vw, 54px);
    letter-spacing: 2px;
}

.overlay-intro,
.imprint-intro {
    margin-bottom: 20px;
    line-height: 1.5;
}

.help-grid,
.imprint-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.overlay-card,
.imprint-card {
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 239, 198, 0.85);
    border: 2px solid rgba(107, 45, 0, 0.18);
}

.overlay-card h3,
.imprint-card h2 {
    margin-bottom: 10px;
}

.overlay-list {
    padding-left: 18px;
    line-height: 1.5;
}

.overlay-actions {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

.overlay-action-btn {
    min-height: 48px;
    padding: 0 22px;
    font-weight: 700;
}

.imprint-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

@media (max-width: 900px), (max-height: 700px) {
    .page-imprint-link {
        display: none;
    }

    .start-screen-imprint {
        display: inline-flex;
        right: 16px;
        left: auto;
        bottom: 16px;
        transform: none;
    }

    .start-screen-imprint:hover {
        transform: translateY(-1px);
    }
}