/* 퇴근 버드 (Flappy Worker) — 페이지 스타일 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    background: #1a1c22;
    overflow: hidden;
    font-family: "Pretendard", -apple-system, "Segoe UI", "Noto Sans KR", "Malgun Gothic", sans-serif;
    /* 모바일에서 더블탭 확대·스크롤 제스처가 게임 입력을 방해하지 않도록 */
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    display: flex;
    flex-direction: column;
}

#stage {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#game {
    /* 내부 해상도 360x640, 화면에는 비율 유지 최대 크기로.
       하단 광고 바가 있으면 #stage 가 그만큼 줄어들고 캔버스도 함께 줄어든다. */
    height: 100%;
    max-height: 100%;
    max-width: 100vw;
    aspect-ratio: 9 / 16;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    background: #7ec8e3;
    display: block;
}

/* ------------------------------------------------------ 하단 배너 광고 바 */

#ad-bar {
    flex: 0 0 auto;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #101218;
    border-top: 1px solid #2a2e3a;
    overflow: hidden;
}

/* ------------------------------------------------ 오버레이 (시작/게임오버) */

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
    color: #fff;
    background: rgba(12, 14, 20, 0.62);
    padding: 24px;
}

.overlay.hidden {
    display: none;
}

.overlay__eyebrow {
    font-size: 11px;
    letter-spacing: 0.3em;
    color: #9adcff;
    font-weight: 700;
}

.overlay__title {
    font-size: clamp(2.4rem, 9vw, 3.4rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45);
}

.overlay__sub {
    font-family: Consolas, monospace;
    font-size: 13px;
    letter-spacing: 0.34em;
    color: #ffd76a;
    font-weight: 700;
}

.overlay__desc {
    font-size: 15px;
    line-height: 1.8;
    color: #dfe6f3;
}

.overlay__hint {
    font-size: 12px;
    color: #93a0b8;
}

.overlay__best {
    font-size: 13px;
    color: #ffd76a;
}

.overlay__gameover {
    font-size: clamp(1.6rem, 7vw, 2.3rem);
    font-weight: 900;
    color: #ff6b6b;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
    animation: stamp 0.35s cubic-bezier(0.2, 2.4, 0.4, 1) both;
}

@keyframes stamp {
    from { transform: scale(2.6) rotate(-14deg); opacity: 0; }
    to   { transform: scale(1) rotate(-3deg); opacity: 1; }
}

.overlay__stats {
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid #3d4356;
    border-radius: 10px;
    padding: 14px 26px;
    display: grid;
    gap: 6px;
    font-size: 14px;
    color: #c4cddc;
}

.overlay__stats strong {
    color: #fff;
    font-size: 17px;
    margin-left: 8px;
}

.overlay__newrecord {
    color: #ffd76a;
    font-weight: 700;
    animation: blink 0.9s step-end infinite;
}

.overlay__newrecord.hidden {
    display: none;
}

@keyframes blink {
    50% { opacity: 0.25; }
}

.btn-retro {
    font: inherit;
    font-size: 18px;
    font-weight: 800;
    color: #2b1d0e;
    background: linear-gradient(#ffe082, #ffb74d);
    border: 3px solid #2b1d0e;
    border-radius: 12px;
    box-shadow: 0 5px 0 #2b1d0e;
    padding: 13px 34px;
    cursor: pointer;
    transition: transform 0.06s ease, box-shadow 0.06s ease;
}

.btn-retro:active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 #2b1d0e;
}

.overlay__backlink a {
    font-size: 12px;
    color: #93a0b8;
}

.ad-placeholder {
    font-family: Consolas, monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4em;
    color: rgba(255, 255, 255, 0.16);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 8px 26px 8px 32px;
}
