/* Article Page Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.article-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.article-header {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.article-header .emoji {
    font-size: 64px;
    margin-bottom: 15px;
}

.article-header h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.article-header .subtitle {
    font-size: 16px;
    opacity: 0.8;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.back-link:hover {
    color: white;
}

.article-content {
    padding: 40px 30px;
}

.article-content h2 {
    font-size: 24px;
    color: #1a202c;
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
}

.article-content h2:first-child {
    margin-top: 0;
}

.article-content p {
    font-size: 16px;
    color: #4a5568;
    margin-bottom: 15px;
}

.article-content ul,
.article-content ol {
    margin: 15px 0 15px 25px;
    color: #4a5568;
}

.article-content li {
    margin-bottom: 10px;
}

/* Info boxes */
.info-box {
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.info-box.tip {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
}

.info-box.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border-left: 4px solid #ffc107;
}

.info-box.danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left: 4px solid #dc3545;
}

.info-box h4 {
    font-size: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box p {
    font-size: 14px;
    margin-bottom: 0;
}

/* Visual diagram */
.diagram {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.diagram-title {
    font-size: 14px;
    color: #718096;
    margin-bottom: 15px;
}

.grid-example {
    display: inline-grid;
    grid-template-columns: repeat(4, 50px);
    gap: 8px;
    background: #bbada0;
    padding: 10px;
    border-radius: 8px;
}

.grid-cell {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.grid-cell.empty {
    background: rgba(238, 228, 218, 0.35);
}

.grid-cell.t2 {
    background: #eee4da;
    color: #776e65;
}

.grid-cell.t4 {
    background: #ede0c8;
    color: #776e65;
}

.grid-cell.t8 {
    background: #f2b179;
    color: #f9f6f2;
}

.grid-cell.t16 {
    background: #f59563;
    color: #f9f6f2;
}

.grid-cell.t32 {
    background: #f67c5f;
    color: #f9f6f2;
}

.grid-cell.t64 {
    background: #f65e3b;
    color: #f9f6f2;
}

.grid-cell.t128 {
    background: #edcf72;
    color: #f9f6f2;
}

.grid-cell.t256 {
    background: #edcc61;
    color: #f9f6f2;
}

.grid-cell.t512 {
    background: #edc850;
    color: #f9f6f2;
}

.grid-cell.t1024 {
    background: #edc53f;
    color: #f9f6f2;
    font-size: 12px;
}

.grid-cell.t2048 {
    background: #edc22e;
    color: #f9f6f2;
    font-size: 12px;
}

.grid-cell.highlight {
    box-shadow: 0 0 0 3px #ff6b6b;
}

/* Mistakes list */
.mistakes-list {
    list-style: none;
    margin-left: 0 !important;
}

.mistakes-list li {
    padding: 15px;
    background: #fff5f5;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #fc8181;
}

.mistakes-list li::before {
    content: "❌ ";
}

/* Tips list */
.tips-list-article {
    list-style: none;
    margin-left: 0 !important;
}

.tips-list-article li {
    padding: 15px;
    background: #f0fff4;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #68d391;
}

.tips-list-article li::before {
    content: "✅ ";
}

/* Navigation */
.article-nav {
    display: flex;
    justify-content: space-between;
    padding: 20px 30px;
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.nav-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

@media (max-width: 600px) {
    .article-header h1 {
        font-size: 24px;
    }

    .article-content {
        padding: 25px 20px;
    }

    .grid-example {
        grid-template-columns: repeat(4, 40px);
    }

    .grid-cell {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }
}