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

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background:
        linear-gradient(
            180deg,
            #75d8ff 0%,
            #b8edff 55%,
            #f5f5f5 100%
        );

    overflow: hidden;
    user-select: none;
    touch-action: manipulation;
}

button {
    font: inherit;
}

.game-wrapper {
    width: 100%;
    min-height: 100vh;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.topbar {
    width: min(100%, 520px);

    min-height: 60px;
    padding: 10px 14px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.game-title {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;

    text-shadow:
        0 2px 3px rgba(0, 0, 0, 0.25);
}

.small-button {
    border: 0;
    border-radius: 12px;

    padding: 10px 14px;

    background: rgba(255, 255, 255, 0.9);
    color: #222;

    font-weight: 700;

    cursor: pointer;

    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.12);
}

.small-button:active {
    transform: scale(0.96);
}

.online-status {
    font-size: 12px;
    font-weight: 700;

    color: white;

    background: rgba(0, 0, 0, 0.18);

    padding: 7px 10px;
    border-radius: 999px;

    white-space: nowrap;
}

.game-area {
    position: relative;

    width: min(94vw, 480px);

    aspect-ratio: 9 / 16;

    max-height: calc(100vh - 130px);

    overflow: hidden;

    border-radius: 20px;

    background: #73d8ff;

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.22);

    touch-action: none;
}

#gameCanvas {
    display: block;

    width: 100%;
    height: 100%;

    touch-action: none;
}

.hud {
    position: absolute;

    top: 14px;
    left: 14px;
    right: 14px;

    display: flex;
    justify-content: center;
    gap: 14px;

    pointer-events: none;
}

.score,
.high-score {
    min-width: 95px;

    padding: 7px 15px;

    border-radius: 14px;

    text-align: center;

    color: white;

    background: rgba(0, 0, 0, 0.22);

    backdrop-filter: blur(4px);
}

.score span,
.high-score span {
    display: block;

    font-size: 11px;
    font-weight: 700;

    opacity: 0.9;
}

.score strong,
.high-score strong {
    display: block;

    margin-top: 1px;

    font-size: 25px;
    line-height: 1;

    text-shadow:
        0 2px 3px rgba(0, 0, 0, 0.3);
}

.overlay {
    position: absolute;

    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.18);

    z-index: 5;
}

.hidden {
    display: none;
}

.panel {
    width: min(90%, 330px);

    padding: 28px 24px;

    text-align: center;

    background: rgba(255, 255, 255, 0.96);

    border-radius: 24px;

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.22);
}

.bird-icon {
    font-size: 60px;

    margin-bottom: 4px;
}

.panel h1,
.panel h2 {
    margin: 5px 0 10px;

    color: #222;
}

.panel p {
    margin: 0 0 22px;

    color: #666;
}

.main-button,
.secondary-button {
    width: 100%;

    min-height: 48px;

    border: 0;
    border-radius: 14px;

    font-weight: 800;

    cursor: pointer;
}

.main-button {
    color: white;

    background: #ffb000;

    box-shadow:
        0 4px 0 #d58f00;
}

.main-button:active {
    transform: translateY(2px);

    box-shadow:
        0 2px 0 #d58f00;
}

.secondary-button {
    margin-top: 10px;

    color: #555;

    background: #eeeeee;
}

.secondary-button:active {
    transform: scale(0.98);
}

.result {
    display: flex;
    justify-content: center;

    gap: 25px;

    margin: 20px 0;
}

.result div {
    min-width: 85px;
}

.result span {
    display: block;

    font-size: 13px;
    color: #777;
}

.result strong {
    display: block;

    margin-top: 4px;

    font-size: 30px;
    color: #222;
}

.hint {
    display: flex;

    justify-content: center;
    gap: 8px;

    padding: 10px;

    color: #555;

    font-size: 13px;
    font-weight: 600;
}

@media (max-height: 700px) {
    .topbar {
        min-height: 48px;
        padding: 6px 10px;
    }

    .game-area {
        max-height: calc(100vh - 90px);
    }

    .hint {
        display: none;
    }
}

@media (max-width: 380px) {
    .game-area {
        width: 96vw;
    }

    .topbar {
        padding-left: 8px;
        padding-right: 8px;
    }

    .game-title {
        font-size: 17px;
    }

    .online-status {
        font-size: 10px;
        padding: 6px 8px;
    }
}
