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

body {
    background: #ffffff;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Poppins', sans-serif;
    color: #1e2a3a;
}

/* ---------- Navigation ---------- */
.royal-nav {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    padding: 0.8rem 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid #e9ecef;
}

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

.logo-area {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #1f6392, #2c4e6e);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.8rem;
    font-weight: 500;
}

.nav-links a {
    text-decoration: none;
    color: #3a6b8c;
    transition: 0.2s;
    font-size: 0.9rem;
}

.nav-links a:hover {
    color: #1f4b6e;
}

/* ---------- Main Content ---------- */
.main-content {
    max-width: 1300px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 2rem;
}

.seo-h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1e4b6e;
    text-align: center;
    margin-bottom: 1.2rem;
    line-height: 1.3;
}

@media (max-width: 640px) {
    .seo-h1 {
        font-size: 1.4rem;
    }
}

/* ---------- Game Layout ---------- */
.game-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2rem;
}

.board-area {
    background: transparent;
    display: flex;
    justify-content: center;
}

.board-simple {
    display: flex;
    justify-content: center;
    align-items: center;
}

#gomokuCanvas {
    border: 0.5px solid #8b6946;
    border-radius: 4px;
    background-color: #e1c78c;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    cursor: pointer;
}

@media (max-width: 780px) {
    canvas {
        max-width: 100%;
        height: auto;
    }
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: 340px;
    background: #f8fafc;
    border-radius: 1.5rem;
    padding: 1.5rem 1.2rem;
    border: 1px solid #e2edf2;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.02);
    text-align: left;
}

.diff-section {
    margin-bottom: 1.8rem;
}

.diff-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #5f7f9c;
    letter-spacing: 1px;
    margin-bottom: 0.6rem;
}

.difficulty-group {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.difficulty-btn {
    background: transparent;
    border: 1px solid #cbdde9;
    padding: 0.4rem 1rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.2s;
    color: #2c5a7a;
}

.difficulty-btn.active {
    background: #2c5a7a;
    border-color: #2c5a7a;
    color: white;
    box-shadow: 0 2px 6px rgba(44, 90, 122, 0.15);
}

.info-section {
    background: #ffffff;
    border-radius: 1.2rem;
    padding: 1rem;
    margin: 1.5rem 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    border: 1px solid #e9edf2;
}

.turn-status {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2c3e44;
    margin-bottom: 0.8rem;
}

.score-panel {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.score-item {
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.score-value {
    font-weight: 800;
    font-size: 1.2rem;
    min-width: 32px;
}

.reset-score-btn {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    padding: 0 0.2rem;
    color: #5f7f9c;
    transition: 0.2s;
}

.reset-score-btn:hover {
    color: #1f4b6e;
    transform: scale(1.1);
}

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

.royal-btn {
    background: #eef2f7;
    border: 1px solid #d4dee6;
    padding: 0.7rem 0;
    border-radius: 60px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: 0.2s;
    color: #245e83;
    width: 100%;
    text-align: center;
}

.royal-btn.primary {
    background: #2c5a7a;
    border: none;
    color: white;
    box-shadow: 0 2px 6px rgba(44, 90, 122, 0.1);
}

.royal-btn.primary:hover {
    background: #1e4868;
    transform: scale(0.98);
}

.royal-btn:hover {
    background: #e3eaf1;
    transform: translateY(-1px);
}

/* ---------- Info Cards ---------- */
.info-vertical {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0 1.5rem;
}

.info-card {
    background: #ffffff;
    border-radius: 1.8rem;
    padding: 1.4rem 1.8rem;
    border: 1px solid #e9edf2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.info-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.6rem;
    color: #255c7c;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-card p {
    font-size: 0.95rem;
    line-height: 1.55;
    color: #2c3e44;
}

.strategy-list {
    margin: 0.8rem 0 0.2rem 1.2rem;
    padding-left: 0.2rem;
}

.strategy-list li {
    margin-bottom: 0.6rem;
    font-size: 0.92rem;
    line-height: 1.5;
}

/* ---------- FAQ Section ---------- */
.faq-section {
    margin: 2rem 0 1.5rem;
    background: #ffffff;
    border-radius: 1.8rem;
    border: 1px solid #e9edf2;
    padding: 1.2rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.faq-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e4b6e;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.faq-item {
    border-bottom: 1px solid #e2e8f0;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 0.2rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    color: #2c5a7a;
    transition: 0.2s;
}

.faq-question:hover {
    color: #1f4b6e;
    background: #f8fafc;
    border-radius: 12px;
    padding-left: 0.8rem;
    padding-right: 0.8rem;
}

.faq-question .icon {
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 0.2rem;
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.5;
    background: #fefefe;
    border-radius: 12px;
}

.faq-answer.show {
    max-height: 300px;
    padding: 0.6rem 0.8rem 0.9rem 0.8rem;
    margin-bottom: 0.5rem;
    background: #f9fbfd;
}

/* ---------- Footer ---------- */
.footer-info {
    background: #f8fafc;
    border-radius: 2rem;
    padding: 1rem 1.5rem;
    margin-top: 1.2rem;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.language-select {
    background: white;
    border: 1px solid #cbdde9;
    border-radius: 40px;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
    color: #245e83;
    outline: none;
}

.footer-link {
    text-decoration: none;
    color: #4f6f8a;
    transition: 0.2s;
}

.footer-link:hover {
    color: #1f4b6e;
    text-decoration: underline;
}

.footer-copyright {
    color: #6c8eaa;
    text-align: right;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .game-layout {
        flex-direction: column;
        align-items: center;
    }
    .sidebar {
        width: 100%;
        max-width: 400px;
    }
    .footer-info {
        flex-direction: column;
        text-align: center;
    }
    .footer-links {
        justify-content: center;
    }
    .footer-copyright {
        text-align: center;
    }
}