:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --gradient: linear-gradient(135deg, #6366f1, #a855f7);
    --bg: #f1f5f9;
    --surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --danger: #ef4444;
    --success: #10b981;
    --kakao: #FEE500;
    --kakao-text: #000000;
    --radius-box: 24px;
    --radius-btn: 14px;
    --tap-min: 44px;
    --ladder-col-w: 120px;
    /* 게임 UI 공통 리듬 */
    --space-xs: 0.3rem;
    --space-sm: 0.55rem;
    --space-md: 0.8rem;
    --space-lg: 1.05rem;
    --space-xl: 1.25rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    background-color: var(--bg);
    color: var(--text-main);
    padding: 2rem 1rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.container {
    background: var(--surface);
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
    flex: 1;
    padding: 3rem;
    border-radius: var(--radius-box);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.05);
}
h1 {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1.25;
    word-break: keep-all;
}

/* MPA 네비게이션 탭 */
.tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: var(--space-lg);
    background: #e2e8f0;
    padding: 0.4rem;
    border-radius: 20px;
    flex-wrap: wrap;
    justify-content: center;
}
.tab-btn {
    flex: 1 1 calc(25% - 0.8rem);
    min-width: 90px;
    min-height: var(--tap-min);
    padding: 0.9rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1.05rem;
    color: #475569;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    -webkit-tap-highlight-color: transparent;
}
.tab-btn:hover { background: rgba(255,255,255,0.5); }
.tab-btn.active { background: var(--surface); color: var(--primary); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }

/* 폼 요소 */
.step-label { font-size: 1.25rem; font-weight: 900; color: #1e293b; margin-bottom: 0; display: block; }
.hint {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0;
}
.step-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.1rem 1.5rem 1.25rem;
    margin-bottom: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.step-box > .flex-between,
.step-box > .step-toolbar,
.step-box > .step-toolbar-actions,
.step-box > .step-edit-actions,
.step-box > .step-create-row,
.step-box > .step-label,
.step-box > .hint,
.step-box > .setup-fields,
.step-box > .action-btn-row { margin-top: 0; margin-bottom: 0; }
.step-box > .btn-primary,
.step-box > .btn-reset,
.step-box > .btn-kakao { margin-top: 0; margin-bottom: 0; }
/* 소제목/편집 버튼 다음 입력 영역: 전 게임 동일 간격 */
.step-box > .step-edit-actions + .setup-fields,
.step-box > .step-toolbar + .setup-fields {
    margin-top: var(--space-xs);
}
.step-edit-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-xs);
    flex-wrap: wrap;
    width: 100%;
}
.game-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}
.game-panel > .step-toolbar,
.game-panel > .step-label,
.game-panel > .action-btn-row,
.game-panel > .hint,
.game-panel > .flex-between,
.game-panel > .team-grid,
.game-panel > .dice-grid,
.game-panel > .action-group { margin-top: 0; margin-bottom: 0; }
.game-panel > .btn-primary,
.game-panel > .btn-reset,
.game-panel > .btn-kakao { margin-top: 0; margin-bottom: 0; }
.result-box {
    margin-top: 0;
    margin-bottom: var(--space-xl);
}
/* 결과 컨테이너: 표시 시 flex 간격 유지 (block으로 열면 gap 무력화됨) */
.result-box.game-panel {
    flex-direction: column;
    gap: var(--space-md);
    padding: 1.15rem 1.4rem 1.3rem;
}
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

textarea, input[type="number"], input[type="text"] {
    width: 100%;
    min-height: var(--tap-min);
    padding: 1rem 1.2rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-btn);
    font-size: 1.05rem;
    font-weight: 600;
    background: var(--surface);
    outline: none;
    font-family: inherit;
    color: #0f172a;
}
textarea { min-height: 88px; }
textarea:focus, input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,0.1); }

.preset-select {
    min-height: var(--tap-min);
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    outline: none;
    background: #ffffff;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.preset-select:focus { border-color: var(--primary); }

button.btn-primary {
    width: 100%;
    min-height: 52px;
    background: var(--gradient);
    color: white;
    border: none;
    padding: 1.2rem;
    border-radius: var(--radius-btn);
    font-weight: 800;
    font-size: 1.15rem;
    cursor: pointer;
    margin-top: 1rem;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
button.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 15px 20px -3px rgba(99, 102, 241, 0.4); }
button.btn-primary:active { transform: scale(0.98); }

.btn-small {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    min-height: var(--tap-min);
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}
.btn-small:hover { background: #f1f5f9; color: #0f172a; border-color: #94a3b8; }

.btn-reset {
    background: #ffffff;
    border: 1px solid var(--danger);
    color: var(--danger);
    min-height: 52px;
    padding: 1.2rem;
    border-radius: 14px;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    margin-top: 1rem;
    font-family: inherit;
}
.btn-reset:hover { background: #fef2f2; transform: translateY(-2px); }

.btn-kakao {
    background: var(--kakao);
    color: var(--kakao-text);
    border: none;
    min-height: 52px;
    padding: 1.2rem;
    border-radius: 14px;
    font-weight: 900;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    transition: all 0.2s;
    font-family: inherit;
}
.btn-kakao:hover { filter: brightness(0.95); transform: translateY(-2px); }

.hidden { display: none !important; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.step-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: 0;
}
.step-toolbar .step-label { margin-bottom: 0; flex: 1 1 auto; min-width: 0; }
.step-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-xs);
    flex-wrap: wrap;
    margin-left: auto;
    flex: 0 0 auto;
}
/* PC: 짧은 소제목 + 편집 버튼 한 줄 / 모바일에서만 아래로 스택 */
.step-toolbar-responsive {
    flex-wrap: nowrap;
    gap: var(--space-sm);
}
.step-create-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
}
.step-create-row input[type="number"] {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}
.step-create-row .btn-primary {
    flex: 0 0 auto;
    width: auto;
    min-width: 5.5rem;
    margin-top: 0;
    padding: 0.9rem 1.1rem;
}
.action-btn-row { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.action-btn-row > .btn-small,
.action-btn-row > button { flex: 1 1 140px; min-height: var(--tap-min); }
.action-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    margin-bottom: 0;
}
.game-panel > .action-group,
.step-box > .action-group,
.result-box > .action-group {
    margin-top: 0;
}
.action-group > .action-btn-row { margin-bottom: 0; }
.action-group > .btn-kakao { margin-bottom: 0; }

/* 글로벌 푸터 */
.global-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border);
    text-align: center;
    font-size: 0.95rem;
}
.global-footer h3 { font-size: 1.2rem; font-weight: 900; margin-bottom: 1rem; color: #0f172a; }
.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.25rem 1.1rem;
    margin-bottom: 1.1rem;
}
.footer-nav a {
    color: var(--primary);
    font-weight: 800;
    font-size: 1.05rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-min);
}
.footer-nav a:hover { text-decoration: underline; }
.footer-contact { margin-bottom: 1.1rem; }
.footer-note {
    margin-top: 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.6;
    word-break: keep-all;
}
.blog-post-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; list-style: none; margin-bottom: 2rem; }
.blog-post-list a {
    color: #475569;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    min-height: var(--tap-min);
    padding: 0.35rem 0;
}
.blog-post-list a:hover { color: var(--primary); text-decoration: underline; }
.legal-links a {
    color: #64748b;
    font-weight: 700;
    text-decoration: none;
    margin: 0 10px;
    display: inline-flex;
    align-items: center;
    min-height: var(--tap-min);
}
.legal-links a:hover { color: var(--danger); }

/* 사다리 공통 (페이지 인라인 스타일과 동기화용) */
.ladder-scroll-area {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    /* pan-x만 두면 영역 위 세로 스크롤이 막힘 → 가로·세로 모두 허용 */
    touch-action: pan-x pan-y;
    border: 2px solid var(--border);
    border-radius: 20px;
    background: #ffffff;
    padding: 1rem 0;
    text-align: center;
    cursor: grab;
    scrollbar-width: thin;
}
.ladder-col {
    width: var(--ladder-col-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 0;
    position: relative;
}
.ladder-start-btn {
    background: #fef08a;
    border: 2px solid #ca8a04;
    color: #854d0e;
    font-size: 0.95rem;
    font-weight: 800;
    min-height: var(--tap-min);
    padding: 10px 16px;
    border-radius: 12px;
    margin-top: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    -webkit-tap-highlight-color: transparent;
}
.ladder-scroll-hint {
    display: none;
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-align: center;
}

/* 가이드 글 공통 (기존 12개 파일에 중복돼 있던 인라인 스타일을 통합) */
.breadcrumb {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    word-break: keep-all;
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0; margin: 0; }
.breadcrumb li { display: inline-flex; align-items: center; gap: 0.35rem; }
.breadcrumb li + li::before { content: "›"; color: #cbd5e1; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: #334155; }

.post-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}
.post-header { border-bottom: 2px solid #f1f5f9; padding-bottom: 1.5rem; margin-bottom: 1.5rem; }
.post-meta { font-size: 0.9rem; color: var(--text-muted); font-weight: 600; margin-bottom: 0.5rem; }
.post-title { font-size: 1.6rem; font-weight: 900; color: var(--text-main); line-height: 1.4; letter-spacing: -0.5px; }
.post-byline {
    margin-top: 0.9rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.6;
    word-break: keep-all;
}
.post-byline a { color: var(--primary); text-decoration: none; font-weight: 700; }
.post-byline a:hover { text-decoration: underline; }

.post-content { color: #334155; line-height: 1.8; font-size: 1.05rem; font-weight: 500; word-break: keep-all; }
.post-content p { margin-bottom: 1.2rem; }
.post-content h2 {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text-main);
    margin-top: 2.6rem;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.post-content h3 { font-size: 1.2rem; font-weight: 800; color: var(--primary); margin-top: 1.9rem; margin-bottom: 0.8rem; }
.post-content ul, .post-content ol { margin: 0 0 1.2rem 1.4rem; }
.post-content li { margin-bottom: 0.5rem; }
.post-content dl { margin: 0 0 1.2rem; }
.post-content dt { font-weight: 800; color: var(--text-main); margin-top: 1rem; margin-bottom: 0.3rem; }
.post-content dd { margin: 0 0 0.75rem; }
.post-content blockquote {
    margin: 1.3rem 0;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    border-left: 4px solid var(--primary);
    border-radius: 4px;
    font-weight: 600;
    color: #1e293b;
}
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content code {
    background: #f1f5f9;
    padding: 0.15em 0.4em;
    border-radius: 5px;
    font-size: 0.93em;
    font-weight: 700;
    color: #4338ca;
}

/* 비교표 — 모바일에서는 가로 스크롤 */
.table-scroll { overflow-x: auto; margin-bottom: 1.4rem; -webkit-overflow-scrolling: touch; }
.post-content table { border-collapse: collapse; width: 100%; min-width: 480px; font-size: 0.97rem; }
.post-content th, .post-content td {
    border: 1px solid var(--border);
    padding: 0.7rem 0.85rem;
    text-align: left;
    vertical-align: top;
    line-height: 1.6;
}
.post-content th { background: #f8fafc; font-weight: 800; color: var(--text-main); }
.post-content caption {
    caption-side: bottom;
    padding-top: 0.6rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
}

.copy-block {
    margin: 1.3rem 0;
    padding: 1.1rem 1.25rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.75;
    white-space: pre-line;
    word-break: keep-all;
}

.post-content .notice-box {
    margin: 1.25rem 0 1.5rem;
    padding: 1rem 1.15rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #9a3412;
    line-height: 1.7;
    word-break: keep-all;
}

.post-nav {
    margin-top: 2.2rem;
    padding-top: 1.4rem;
    border-top: 1px solid var(--border);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.9;
}
.post-nav a { color: var(--primary); font-weight: 800; text-decoration: none; }
.post-nav a:hover { text-decoration: underline; }

.back-btn-wrapper { text-align: center; margin-top: 2rem; }
.btn-outline {
    background: transparent;
    border: 2px solid #cbd5e1;
    color: #475569;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    min-height: var(--tap-min);
}
.btn-outline:hover { background: #f8fafc; border-color: #94a3b8; color: var(--text-main); }

@media (max-width: 640px) {
    .post-container { padding: 1.2rem; }
    .post-title { font-size: 1.35rem; }
    .post-content h2 { font-size: 1.25rem; margin-top: 2.1rem; }
    .post-content h3 { font-size: 1.1rem; }
}

/* CLS 완화: 블로그 이미지 비율 예약 */
.post-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    margin: 1.5rem 0;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: block;
}

/* 모바일 대응 */
@media (max-width: 640px) {
    body { padding: 1rem 0.75rem; padding-bottom: max(1.25rem, env(safe-area-inset-bottom, 0px)); }
    .container { padding: 1.25rem 1rem; border-radius: 18px; }
    h1 { margin-bottom: 1rem; }
    h1.page-heading { margin-bottom: 0.85rem; }
    .site-brand { margin-bottom: 0.5rem; }
    .step-box { padding: 0.95rem 1rem 1.05rem; }
    .step-label { font-size: 1.1rem; }

    /* 탭: 4열×2행으로 한눈에 보이게 */
    .tabs {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.3rem;
        overflow: visible;
        margin-bottom: var(--space-md);
        padding: 0.35rem;
    }
    .tab-btn {
        flex: none;
        width: 100%;
        min-width: 0;
        min-height: var(--tap-min);
        padding: 0.55rem 0.2rem;
        font-size: 0.78rem;
        white-space: nowrap;
        letter-spacing: -0.03em;
    }

    .flex-between { flex-wrap: wrap; }
    /* 사다리 등 짧은 소제목: 한 줄(좌 라벨 / 우 프리셋) */
    .step-toolbar {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: var(--space-xs);
        margin-bottom: 0;
    }
    .step-toolbar .step-label {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 1.05rem;
        line-height: 1.3;
    }
    .step-toolbar-actions {
        width: auto;
        flex: 0 0 auto;
        margin-left: auto;
        justify-content: flex-end;
        gap: 6px;
    }
    .step-toolbar-actions .preset-select {
        max-width: min(46vw, 9.5rem);
        font-size: 0.85rem;
        padding: 0.45rem 0.55rem;
    }
    .step-toolbar-actions .btn-small {
        flex: 0 0 auto;
        padding: 0.55rem 0.75rem;
        font-size: 0.85rem;
    }
    /* 원판·팀원 등 긴 소제목: 라벨 한 줄 + 프리셋은 아래 우측 */
    .step-toolbar-stack,
    .step-toolbar-responsive {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: var(--space-xs);
    }
    .step-toolbar-stack .step-label,
    .step-toolbar-responsive .step-label {
        flex: none;
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.95rem;
        letter-spacing: -0.04em;
    }
    .step-toolbar-stack .step-toolbar-actions,
    .step-toolbar-responsive .step-toolbar-actions {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
    }
    .step-box > .step-edit-actions + .setup-fields,
    .step-box > .step-toolbar + .setup-fields {
        margin-top: var(--space-xs);
    }
    .step-create-row {
        width: 100%;
        margin-top: 0;
    }
    .action-btn-row > .btn-small,
    .action-btn-row > button { flex: 1 1 100%; }

    .blog-post-list { grid-template-columns: 1fr; }
    .ladder-scroll-hint { display: block; }
    :root { --ladder-col-w: 96px; }
}

@media (max-width: 480px) {
    :root { --ladder-col-w: 80px; }
    .tabs { gap: 0.25rem; padding: 0.3rem; }
    .tab-btn {
        font-size: 0.72rem;
        padding: 0.5rem 0.15rem;
        border-radius: 12px;
    }
    .modal-box { padding: 1.5rem; width: 94%; }
    .modal-actions { flex-wrap: wrap; }
    .modal-actions .btn-small,
    .modal-actions .btn-primary { flex: 1 1 100%; min-height: var(--tap-min); }
}

/* 토스트: 하단 배너와 겹침 방지 */
#toast-container {
    position: fixed;
    bottom: max(20px, env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    width: min(92vw, 420px);
}
.toast {
    background: #1e293b;
    color: white;
    padding: 14px 28px;
    border-radius: 30px;
    font-weight: 800;
    animation: toastEnter 0.3s forwards;
    font-family: inherit;
    text-align: center;
    word-break: keep-all;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
@keyframes toastEnter { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

.dev-footer-btn {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
    min-height: var(--tap-min);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
    font-family: inherit;
}
.dev-footer-btn:hover { background: #f1f5f9; color: #0f172a; border-color: #94a3b8; transform: translateY(-2px); }

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: all 0.2s;
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
}
.modal-box {
    background: white;
    padding: 2.5rem;
    border-radius: 24px;
    width: 90%;
    max-width: 420px;
    max-height: min(90vh, 720px);
    overflow-y: auto;
    transition: transform 0.2s;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    text-align: left;
}
.modal-title { font-size: 1.5rem; font-weight: 900; margin-bottom: 0.8rem; color: #0f172a; }
.modal-desc { font-size: 1.05rem; color: #475569; margin-bottom: 1.5rem; line-height: 1.6; font-weight: 600; white-space: pre-wrap; max-height: 50vh; overflow-y: auto; }
.modal-input { margin-bottom: 1.5rem; width: 100%; padding: 1rem 1.2rem; border: 2px solid var(--border); border-radius: var(--radius-btn); font-size: 1.05rem; font-weight: 600; background: var(--surface); outline: none; font-family: inherit; color: #0f172a; min-height: var(--tap-min); }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; }

/* 하단 고정 광고와 겹치지 않도록 상단 문서 흐름에 배치 */
.cookie-consent-banner {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 720px;
    margin: 0 auto 1rem;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.08);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    animation: fadeInCookie 0.3s ease-out;
    text-align: left;
}
.cookie-consent-title { font-size: 1.15rem; font-weight: 800; color: #0f172a; display: flex; align-items: center; gap: 6px; }
.cookie-consent-desc { font-size: 0.95rem; color: #475569; line-height: 1.6; font-weight: 600; word-break: keep-all; }
.cookie-consent-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.cookie-consent-actions .btn-small,
.cookie-consent-actions .btn-primary { min-height: var(--tap-min); }
@keyframes fadeInCookie { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 640px) {
    .cookie-consent-banner { width: calc(100% - 1.5rem); margin: 0 0.75rem 1rem; padding: 1.1rem; gap: 0.75rem; }
    .cookie-consent-actions { flex-direction: column-reverse; }
    .cookie-consent-actions .btn-small,
    .cookie-consent-actions .btn-primary { width: 100%; justify-content: center; }
    #toast-container { bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
}

/* 고정 오버레이 캔버스: 레이아웃에 영향 없음 */
#confettiCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

/* 브랜드 표기 (h1 아님) — 페이지 주제는 h1에 둔다 */
.site-brand {
    text-align: center;
    margin-bottom: 0.65rem;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1.25;
    word-break: keep-all;
    color: #0f172a;
}
.site-brand a { color: inherit; text-decoration: none; }
.site-brand a:hover { color: var(--primary); }
h1.page-heading {
    text-align: center;
    margin-bottom: 1.1rem;
    font-size: clamp(1.25rem, 3.2vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #334155;
}
h1.post-title { text-align: left; margin-bottom: 0; }

/* 게임 페이지·가이드 공통 본문 (기존 인라인 스타일 규격 복구) */
.seo-guide {
    border-top: 2px dashed #e2e8f0;
    padding-top: 1.5rem;
    margin-top: 2.5rem;
    color: #334155;
    line-height: 1.8;
}
.seo-guide h2 {
    font-size: 1.5rem;
    font-weight: 900;
    color: #0f172a;
    margin-top: 0;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}
.seo-guide h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: #6366f1;
    margin-top: 2rem;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}
.seo-guide ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    font-weight: 500;
}
.seo-guide li { margin-bottom: 0.5rem; }
.seo-guide p {
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 1rem;
    word-break: keep-all;
}
.seo-guide .guide-faq dt {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    margin-top: 1rem;
    margin-bottom: 0.35rem;
}
.seo-guide .guide-faq dd {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: #334155;
    line-height: 1.8;
}
.seo-guide .guide-related {
    margin-top: 1.5rem;
    margin-bottom: 0;
    padding: 1rem 1.2rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.8;
}
.seo-guide .guide-related a { color: #6366f1; font-weight: 800; text-decoration: none; }
.seo-guide .guide-related a:hover { text-decoration: underline; }
.seo-guide .notice-box {
    margin: 1.25rem 0 1.5rem;
    padding: 1rem 1.15rem;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #9a3412;
    line-height: 1.7;
    word-break: keep-all;
}
.content-hub {
    margin: 1.5rem 0 0;
    padding: 1.25rem 1.2rem 1.35rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}
.content-hub h2 {
    margin: 0 0 0.65rem;
    font-size: 1.2rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.3px;
}
.content-hub p {
    margin: 0 0 0.85rem;
    font-size: 0.98rem;
    font-weight: 600;
    color: #475569;
    line-height: 1.7;
    word-break: keep-all;
}
.content-hub ul {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.98rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.75;
}
.content-hub li { margin-bottom: 0.4rem; }
.content-hub a { color: #6366f1; font-weight: 800; text-decoration: none; }
.content-hub a:hover { text-decoration: underline; }

/* 상단 sticky 배너 — 하단 Auto ads와 겹침 방지 */
body.has-cookie-banner {
    padding-top: 0;
}