/* ACADE 공통 보강 (2026-12-06): /style.css 위에 덧씌움. 디자인은 그대로, 모바일·터치·스크롤만 보강 */

/* 세로로 쌓고, 화면보다 길면 스크롤 (가운데 정렬은 auto 여백으로) */
body {
    flex-direction: column;
    justify-content: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px 0;
}
.arcade-container { margin-top: auto; flex-shrink: 0; }
.game-info { margin-bottom: auto; }

#gameCanvas { touch-action: none; }
.overlay-screen { overflow-y: auto; }
.retro-btn:disabled { opacity: 0.4; cursor: default; }

/* 쇼츠용 자동 플레이 표시 */
.ai-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 50;
    font-size: 8px;
    color: var(--neon-pink);
    text-shadow: 0 0 6px var(--neon-pink);
    border: 1px solid var(--neon-pink);
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.6);
    pointer-events: none;
}
.ai-badge[hidden] { display: none; }
.ai-note { font-size: 9px; color: var(--neon-pink); margin: 16px 0; }
.ai-note[hidden] { display: none; }

/* 터치 기기에서만 보이는 것 / 키보드 기기에서만 보이는 것 */
.touch-only { display: none; }
.touch-pad { display: none; }
@media (hover: none) and (pointer: coarse) {
    .touch-only { display: block; }
    .kbd-only { display: none; }
    .touch-pad {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin-top: 12px;
        flex-wrap: nowrap;
    }
}
.touch-btn {
    width: 48px;
    height: 48px;
    background: rgba(0, 255, 255, 0.06);
    border: 2px solid var(--neon-blue);
    border-radius: 10px;
    color: var(--neon-blue);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI Symbol', sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    padding: 0;
    text-shadow: 0 0 5px var(--neon-blue);
    -webkit-user-select: none;
    user-select: none;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}
.touch-btn.on { background: var(--neon-blue); color: #000; }

/* 작은 화면 (휴대폰) */
@media (max-width: 640px) {
    body { padding: 6px 0; }
    .arcade-container {
        width: calc(100% - 12px) !important;
        border-width: 8px;
        border-radius: 12px;
        padding: 10px;
    }
    .neon-text { font-size: 16px; margin-bottom: 10px; }
    .game-stats { font-size: 8px; }
    h2 { font-size: 20px; margin-bottom: 18px; }
    .retro-btn { font-size: 11px; padding: 10px 14px; margin: 6px; }
    #player-name { width: 160px; font-size: 12px; }
    .high-scores-preview { margin-top: 16px; }
    .instructions { margin: 12px 0; }
}

/* 게임 아래 소개 글 */
.game-info {
    width: min(600px, calc(100% - 24px));
    margin-top: 28px;
    color: #aaa;
    font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
    font-size: 14px;
    line-height: 1.8;
}
.game-info h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 11px;
    color: var(--neon-blue);
    text-shadow: 0 0 5px var(--neon-blue);
    margin: 24px 0 10px;
}
.game-info ul { padding-left: 1.2em; }
.game-info a { color: var(--neon-blue); }
.game-info strong { color: #fff; }

/* 랭킹 탭: ALL / 7 DAYS (2026-12-06) */
.rank-tabs { display: flex; justify-content: center; gap: 6px; margin: -4px 0 10px; }
.rank-tabs button {
    background: transparent;
    border: 1px solid #444;
    color: #777;
    font-family: 'Press Start 2P', cursive;
    font-size: 7px;
    padding: 5px 8px;
    cursor: pointer;
}
.rank-tabs button.on { border-color: var(--neon-blue); color: var(--neon-blue); text-shadow: 0 0 5px var(--neon-blue); }

/* 쇼츠 영상 */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.video-card {
    position: relative; padding: 0; border: 1px solid rgba(0, 255, 255, 0.25); border-radius: 10px; overflow: hidden;
    background: #000; cursor: pointer; aspect-ratio: 9 / 16;
}
.video-card img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }
.video-card::after {
    content: '▶'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 28px; color: #fff; text-shadow: 0 0 12px var(--neon-pink);
}
.video-title {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 8px; font-size: 12px; color: #fff; text-align: left;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}
.video-frame { width: 100%; aspect-ratio: 9 / 16; border: 0; border-radius: 10px; }
