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

:root {
    --primary: #FF6B35;
    --primary-dark: #E85A2A;
    --secondary: #004E89;
    --accent: #FFD23F;
    --dark: #1A1A2E;
    --light: #F8F9FA;
    --success: #06D6A0;
    --danger: #EF476F;

    --gradient-1: linear-gradient(135deg, #FF6B35 0%, #FFD23F 100%);
    --gradient-2: linear-gradient(135deg, #004E89 0%, #06D6A0 100%);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.2);
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    word-break: keep-all;
}

/* 헤더 */
header {
    background: var(--gradient-1);
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.logo {
    font-family: 'Righteous', cursive;
    font-size: 1.8rem;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    flex-shrink: 0;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: transform 0.2s;
    display: inline-block;
    white-space: nowrap;
}

.nav-links a:hover {
    transform: translateY(-2px);
    text-decoration: underline;
}

/* 히어로 섹션 */
.hero {
    background: var(--gradient-2);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    animation: slideDown 0.6s ease-out;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: slideDown 0.6s ease-out 0.2s backwards;
}

.cta-button {
    background: var(--accent);
    color: var(--dark);
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s;
    animation: slideDown 0.6s ease-out 0.4s backwards;
    text-decoration: none;
    display: inline-block;
}

.cta-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

/* 게임 섹션 */
.games-section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--dark);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.game-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
    cursor: pointer;
    animation: fadeInUp 0.6s ease-out backwards;
}

.game-card:nth-child(2) {
    animation-delay: 0.1s;
}

.game-card:nth-child(3) {
    animation-delay: 0.2s;
}

.game-card:nth-child(4) {
    animation-delay: 0.3s;
}

.game-card:nth-child(5) {
    animation-delay: 0.4s;
}

.game-card:nth-child(6) {
    animation-delay: 0.5s;
}

.game-card:nth-child(7) {
    animation-delay: 0.6s;
}

.game-card:nth-child(8) {
    animation-delay: 0.7s;
}

.game-card:nth-child(9) {
    animation-delay: 0.8s;
}

.game-card:nth-child(10) {
    animation-delay: 0.9s;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.game-header {
    padding: 2rem;
    background: var(--gradient-1);
    color: white;
    text-align: center;
}

.game-card:nth-child(2) .game-header,
.game-card:nth-child(4) .game-header {
    background: var(--gradient-2);
}

.game-card:nth-child(5) .game-header {
    background: linear-gradient(135deg, #5f27cd 0%, #EF476F 100%);
}

.game-card:nth-child(6) .game-header {
    background: linear-gradient(135deg, #06D6A0 0%, #004E89 100%);
}

.game-card:nth-child(7) .game-header {
    background: linear-gradient(135deg, #EF476F 0%, #FF6B35 100%);
}

.game-card:nth-child(8) .game-header {
    background: linear-gradient(135deg, #5f27cd 0%, #a29bfe 100%);
}

.game-card:nth-child(9) .game-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd43b 100%);
}

.game-card:nth-child(10) .game-header {
    background: linear-gradient(135deg, #00b4d8 0%, #0077b6 100%);
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.game-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.game-subtitle {
    opacity: 0.9;
    font-size: 0.95rem;
}

.game-body {
    padding: 2rem;
}

.game-description {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 10px;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
}

.play-button {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.play-button:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

/* 게임 모달 */
.game-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    padding: 2rem;
    overflow-y: auto;
}

.game-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.3s;
}

.modal-header {
    background: var(--gradient-1);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.close-button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.close-button:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    overflow-x: hidden;
}

/* 게임 컨트롤 */
.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 10px;
}

.difficulty-selector {
    display: flex;
    gap: 0.5rem;
}

.difficulty-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}

.difficulty-btn.active {
    background: var(--primary);
    color: white;
}

.game-info {
    display: flex;
    gap: 1rem;
}

.info-item {
    text-align: center;
}

.info-label {
    font-size: 0.8rem;
    color: #666;
}

.info-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

/* 스도쿠 그리드 */
.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    grid-template-rows: repeat(9, minmax(0, 1fr));
    gap: 1px;
    background: var(--dark);
    border: 3px solid var(--dark);
    margin: 0 auto 1.5rem;
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1;
}

.sudoku-cell {
    background: white;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.sudoku-cell:hover:not(.fixed) {
    background: #e3f2fd;
}

.sudoku-cell.fixed {
    background: #f5f5f5;
    color: var(--dark);
    cursor: default;
}

.sudoku-cell.selected {
    background: #bbdefb;
}

.sudoku-cell.error {
    background: #ffebee;
    color: var(--danger);
}

.sudoku-cell:nth-child(3n) {
    border-right: 3px solid var(--dark);
}

.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 3px solid var(--dark);
}

/* 2048 그리드 */
.game-2048-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: 10px;
    background: #bbada0;
    padding: 10px;
    border-radius: 10px;
    margin: 0 auto 1.5rem;
    max-width: 400px;
    aspect-ratio: 1;
    touch-action: none;
}

.tile-2048 {
    background: #cdc1b4;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 900;
    color: var(--dark);
    aspect-ratio: 1;
    transition: all 0.15s;
}

.tile-2048[data-value="2"] { background: #eee4da; color: #776e65; }
.tile-2048[data-value="4"] { background: #ede0c8; color: #776e65; }
.tile-2048[data-value="8"] { background: #f2b179; color: #f9f6f2; }
.tile-2048[data-value="16"] { background: #f59563; color: #f9f6f2; }
.tile-2048[data-value="32"] { background: #f67c5f; color: #f9f6f2; }
.tile-2048[data-value="64"] { background: #f65e3b; color: #f9f6f2; }
.tile-2048[data-value="128"] { background: #edcf72; color: #f9f6f2; font-size: 1.8rem; }
.tile-2048[data-value="256"] { background: #edcc61; color: #f9f6f2; font-size: 1.8rem; }
.tile-2048[data-value="512"] { background: #edc850; color: #f9f6f2; font-size: 1.8rem; }
.tile-2048[data-value="1024"] { background: #edc53f; color: #f9f6f2; font-size: 1.5rem; }
.tile-2048[data-value="2048"] { background: #edc22e; color: #f9f6f2; font-size: 1.5rem; }

/* 키패드 */
.number-pad {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
    max-width: 450px;
    margin: 0 auto 1rem;
}

.number-btn {
    padding: 1rem;
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.number-btn:hover {
    background: var(--primary);
    color: white;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.action-btn {
    flex: 1;
    padding: 0.8rem;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-new {
    background: var(--success);
    color: white;
}

.btn-hint {
    background: var(--accent);
    color: var(--dark);
}

.btn-check {
    background: var(--secondary);
    color: white;
}

/* 푸터 */
footer {
    background: var(--dark);
    color: white;
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: var(--accent);
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--accent);
}

.copyright {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    opacity: 0.6;
}

/* 애니메이션 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 랭킹 섹션 */
.ranking-section {
    max-width: 800px;
    margin: 0 auto 4rem;
    padding: 0 2rem;
}

.ranking-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.ranking-tab {
    padding: 0.6rem 2rem;
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.ranking-tab.active {
    background: var(--primary);
    color: white;
}

.ranking-table-wrap {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table thead {
    background: var(--gradient-1);
    color: white;
}

.ranking-table th,
.ranking-table td {
    padding: 0.9rem 1.25rem;
    text-align: center;
    font-size: 0.95rem;
}

.ranking-table th {
    font-weight: 700;
}

.ranking-table tbody tr:nth-child(even) {
    background: var(--light);
}

.ranking-table tbody tr:hover {
    background: #fff3e0;
}

.ranking-notice {
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    margin-top: 1rem;
}

/* 반응형 - 태블릿 (768px 이하) */
@media (max-width: 768px) {
    .logo {
        font-size: 1.4rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .hero {
        padding: 2.5rem 1.5rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .games-section {
        margin: 2rem auto;
        padding: 0 1rem;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .games-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* 모달 - 하단 시트 스타일 */
    .game-modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        border-radius: 20px 20px 0 0;
        max-height: 95vh;
        max-width: 100%;
        width: 100%;
    }

    .modal-header {
        padding: 1rem 1.5rem;
        border-radius: 20px 20px 0 0;
    }

    .modal-body {
        padding: 0.75rem;
        overflow-x: hidden;
    }

    /* 게임 컨트롤 세로 정렬 */
    .game-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .difficulty-selector {
        width: 100%;
        justify-content: space-between;
    }

    .difficulty-btn {
        flex: 1;
        text-align: center;
        padding: 0.6rem 0.5rem;
        font-size: 0.9rem;
    }

    .game-info {
        width: 100%;
        justify-content: space-around;
    }

    /* 스도쿠 그리드 */
    .sudoku-grid {
        max-width: 100%;
    }

    .sudoku-cell {
        font-size: 1.1rem;
    }

    /* 숫자 패드 */
    .number-pad {
        max-width: 100%;
    }

    .number-btn {
        padding: 0.75rem 0.2rem;
        font-size: 1.1rem;
        min-height: 48px;
    }

    /* 액션 버튼 */
    .action-buttons {
        gap: 0.5rem;
    }

    .action-btn {
        padding: 0.9rem 0.5rem;
        font-size: 0.95rem;
        min-height: 48px;
    }

    /* 2048 그리드 */
    .game-2048-grid {
        max-width: 100%;
        gap: 8px;
        padding: 8px;
    }

    .tile-2048 {
        font-size: 1.5rem;
    }

    .tile-2048[data-value="128"],
    .tile-2048[data-value="256"],
    .tile-2048[data-value="512"] {
        font-size: 1.2rem;
    }

    .tile-2048[data-value="1024"],
    .tile-2048[data-value="2048"] {
        font-size: 1rem;
    }

    /* 푸터 */
    footer {
        padding: 2rem 1rem;
        margin-top: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* 반응형 - 소형 폰 (480px 이하) */
@media (max-width: 480px) {
    header {
        padding: 0.75rem 0;
    }

    nav {
        padding: 0 0.75rem;
        gap: 0.25rem;
    }

    .logo {
        font-size: 1.1rem;
    }

    .nav-links {
        gap: 0.5rem;
        font-size: 0.78rem;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    .cta-button {
        padding: 0.8rem 1.8rem;
        font-size: 1rem;
    }

    .game-header {
        padding: 1.5rem;
    }

    .game-body {
        padding: 1.25rem;
    }

    .sudoku-cell {
        font-size: 0.95rem;
    }

    .number-btn {
        padding: 0.6rem 0.25rem;
        font-size: 1rem;
        min-height: 44px;
    }

    .tile-2048 {
        font-size: 1.2rem;
    }

    .tile-2048[data-value="128"],
    .tile-2048[data-value="256"],
    .tile-2048[data-value="512"] {
        font-size: 1rem;
    }

    .tile-2048[data-value="1024"],
    .tile-2048[data-value="2048"] {
        font-size: 0.8rem;
    }
}

/* ========================================
   새 헤더/네비게이션
   ======================================== */
.site-header {
    background: var(--gradient-1);
    color: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 200;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-container .logo {
    font-family: 'Righteous', cursive;
    font-size: 1.6rem;
    font-weight: 900;
    color: white;
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.nav-desktop {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
}

.nav-desktop > li > a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.4rem 0;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.nav-desktop > li > a:hover { opacity: 0.8; }

/* 드롭다운 */
.nav-dropdown { position: relative; }

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    list-style: none;
    min-width: 160px;
    overflow: hidden;
    z-index: 300;
}

.nav-dropdown:hover .dropdown-menu { display: block; }

.dropdown-menu li a {
    display: block;
    padding: 0.7rem 1.2rem;
    color: var(--dark);
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background 0.2s;
}

.dropdown-menu li a:hover { background: var(--light); color: var(--primary); }

/* 햄버거 버튼 */
.nav-toggle {
    display: none;
    background: none;
    border: 2px solid rgba(255,255,255,0.7);
    color: white;
    font-size: 1.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
}

/* 모바일 메뉴 */
.nav-mobile {
    display: none;
    background: rgba(0,0,0,0.15);
    border-top: 1px solid rgba(255,255,255,0.2);
}

.nav-mobile.active { display: block; }

.mobile-menu-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.mobile-menu-grid a {
    color: white;
    text-decoration: none;
    background: rgba(255,255,255,0.15);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    transition: background 0.2s;
}

.mobile-menu-grid a:hover { background: rgba(255,255,255,0.3); }

@media (max-width: 768px) {
    .nav-desktop { display: none; }
    .nav-toggle { display: block; }
}

/* ========================================
   두뇌 게임 효과 섹션
   ======================================== */
.benefits-section {
    background: white;
    padding: 4rem 2rem;
}

.benefits-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.benefit-card {
    background: var(--light);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.benefit-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.benefit-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.benefit-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--dark); }
.benefit-card p { font-size: 0.9rem; color: #555; line-height: 1.6; }

.cta-button-secondary {
    display: inline-block;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
}

.cta-button-secondary:hover {
    background: var(--primary);
    color: white;
}

/* ========================================
   자료실 프로모 섹션
   ======================================== */
.library-promo-section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.section-subtitle {
    text-align: center;
    color: #666;
    font-size: 1rem;
    margin-top: -2rem;
    margin-bottom: 2.5rem;
}

.library-promo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.library-promo-card {
    display: block;
    border-radius: 16px;
    padding: 2rem;
    text-decoration: none;
    color: var(--dark);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.library-promo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.sudoku-card { background: #E8F5E9; border: 2px solid #4CAF50; }
.game2048-card { background: #FFF3E0; border: 2px solid #FF9800; }
.health-card { background: #E3F2FD; border: 2px solid #2196F3; }

.promo-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.library-promo-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.library-promo-card p { font-size: 0.9rem; color: #555; line-height: 1.5; }

.promo-arrow {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    font-size: 1.3rem;
    color: #999;
}

/* ========================================
   새 푸터
   ======================================== */
.site-footer {
    background: var(--dark);
    color: rgba(255,255,255,0.85);
    padding: 3rem 2rem 0;
}

.site-footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 2rem;
    padding-bottom: 2.5rem;
}

.footer-logo {
    font-family: 'Righteous', cursive;
    font-size: 1.4rem;
    color: white;
    margin-bottom: 0.75rem;
}

.site-footer .footer-section p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.7);
}

.footer-contact { margin-top: 0.75rem; font-size: 0.85rem !important; }

.site-footer .footer-section h3 {
    color: white;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.site-footer .footer-section ul { list-style: none; }

.site-footer .footer-section ul li { margin-bottom: 0.4rem; }

.site-footer .footer-section ul a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.site-footer .footer-section ul a:hover { color: var(--accent); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.25rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .site-footer .footer-content {
        grid-template-columns: 1fr 1fr;
    }
    .benefits-grid { grid-template-columns: 1fr 1fr; }
    .mobile-menu-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .site-footer .footer-content { grid-template-columns: 1fr; }
    .benefits-grid { grid-template-columns: 1fr; }
    .mobile-menu-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========================================
   서브페이지 헤더/푸터 호환 클래스 (library, downloads)
   footer-container = footer-content
   footer-brand / footer-links = footer-section
   logo-link = nav-container .logo
   ======================================== */

/* 로고 링크 */
.logo-link {
    font-family: 'Righteous', cursive;
    font-size: 1.6rem;
    font-weight: 900;
    color: white;
    text-decoration: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.logo-link:hover { opacity: 0.9; }
.logo-icon { font-size: 1.5rem; }
.logo-text { font-size: 1.3rem; }

/* 푸터 레이아웃 */
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 2rem;
    padding-bottom: 2.5rem;
}

.footer-brand p,
.footer-brand .footer-logo {
    font-family: 'Righteous', cursive;
    font-size: 1.4rem;
    color: white;
    margin: 0 0 0.75rem;
}

.footer-brand p:not(.footer-logo) {
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.7);
}

.footer-contact {
    margin-top: 0.75rem;
    font-size: 0.85rem !important;
    color: rgba(255,255,255,0.55) !important;
}

.footer-links h4 {
    color: white;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links ul li { margin-bottom: 0.4rem; }

.footer-links ul a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.footer-links ul a:hover { color: var(--accent); }

/* breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    background: #f8f9fa;
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
    border-bottom: 1px solid #dee2e6;
}
.breadcrumb a { color: #555; text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: #999; }

@media (max-width: 768px) {
    .footer-container { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .footer-container { grid-template-columns: 1fr; }
    .logo-text { font-size: 1.1rem; }
}

/* ========================================
   게임 결과 공유 버튼 (share.js)
   share-slot     : stat-box 형제 슬롯 (HTML에 정적 선언)
   share-slot-btn : 슬롯 안 버튼
   bpz-share-wrap : renderButtons()로 동적 삽입 시 래퍼
   bpz-share-btn  : 동적 삽입 버튼
   ======================================== */

/* ── 정적 슬롯 방식 (stat-box 행 안에 포함) ── */
.share-slot {
    overflow: hidden;
    padding: 0 !important;
}

.share-slot-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 88px;
    border: none;
    border-radius: 12px;
    background: var(--primary, #FF6B35);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    font-family: 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    line-height: 1.4;
    padding: 0.8rem 0.5rem;
    text-align: center;
}

.share-slot-btn:hover  { opacity: 0.88; transform: translateY(-2px); }
.share-slot-btn:active { transform: translateY(0); }

.bpz-share-wrap {
    margin-top: 1.2rem;
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* 게임 스탯 행(flex) 안에 삽입될 때 — stat-box와 동일한 크기/스타일 */
[class*="-stats"] .bpz-share-wrap,
[class*="-result"] .bpz-share-wrap {
    flex: 1;
    margin-top: 0;
    padding: 0;
    background: var(--light, #F8F9FA);
    border-radius: 12px;
    min-width: 0;
}

[class*="-stats"] .bpz-share-btn,
[class*="-result"] .bpz-share-btn {
    width: 100%;
    height: 100%;
    min-height: 80px;
    border-radius: 12px;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.88rem;
    padding: 0.8rem 0.6rem;
}

.bpz-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 1.4rem;
    border: none;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Noto Sans KR', sans-serif;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.bpz-share-btn:hover  { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,0.18); }
.bpz-share-btn:active { transform: translateY(0); }
.bpz-share-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

.bpz-share-main {
    background: var(--primary, #FF6B35);
    color: #fff;
}

/* 토스트 알림 */
#bpzToast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: #1A1A2E;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 9999;
    transition: transform 0.3s ease;
    white-space: nowrap;
    pointer-events: none;
}

#bpzToast.bpz-toast-show {
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 480px) {
    .bpz-share-btn { font-size: 0.88rem; padding: 0.6rem 1.1rem; }
}
