/* rules.css — Moderní stylování stránky pravidel Shithead / Kakhead */

:root {
    --primary: #1877f2;
    --primary-hover: #166fe5;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --kak-purple: #6f42c1;
    --dark-bg: #0f172a;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

body.rules-page {
    background: #f8fafc;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    padding-bottom: 40px;
}

.rules-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header & Hero */
.rules-hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    border-radius: 14px;
    padding: 28px 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.rules-hero::before {
    content: "🃏";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 8rem;
    opacity: 0.08;
    pointer-events: none;
}

.rules-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.rules-hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.rules-hero-subtitle {
    color: #94a3b8;
    font-size: 1.05rem;
    max-width: 700px;
}

.rules-meta-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.rules-tag {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Navigation Quick Links */
.rules-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 2px 14px 2px;
    margin-bottom: 18px;
    scrollbar-width: thin;
}

.rules-nav-link {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.rules-nav-link:hover {
    background: #f1f5f9;
    color: var(--primary);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

/* Rule Card Section */
.rule-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 24px;
    margin-bottom: 20px;
}

.rule-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.rule-card-header h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

.rule-card-icon {
    font-size: 1.5rem;
    background: #eff6ff;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--primary);
}

/* Flow diagram for phases */
.phases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

.phase-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    position: relative;
    border-top: 4px solid var(--primary);
}

.phase-item.phase-2 {
    border-top-color: #f59e0b;
}

.phase-item.phase-3 {
    border-top-color: #ef4444;
}

.phase-number {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.phase-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

/* Ability Cards Grid */
.abilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.ability-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    gap: 16px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ability-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    background: #ffffff;
}

.ability-mini-card {
    width: 52px;
    height: 74px;
    background: #fff;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px 6px;
    font-weight: 800;
    flex-shrink: 0;
    user-select: none;
}

.ability-mini-card.rank-kak {
    background: linear-gradient(135deg, #6f42c1 0%, #4a154b 100%);
    color: #fff;
    border-color: #9d72ff;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.2;
}

.ability-content {
    flex: 1;
}

.ability-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ability-tag {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    text-transform: uppercase;
}

.tag-reset { background: #e0f2fe; color: #0369a1; }
.tag-mirror { background: #f3e8ff; color: #7e22ce; }
.tag-save { background: #dcfce7; color: #15803d; }
.tag-down { background: #fef3c7; color: #b45309; }
.tag-skip { background: #ffedd5; color: #c2410c; }
.tag-burn { background: #fee2e2; color: #b91c1c; }
.tag-combo { background: #fae8ff; color: #86198f; }
.tag-high { background: #f1f5f9; color: #334155; }

.ability-desc {
    font-size: 0.88rem;
    color: #475569;
    line-height: 1.45;
}

/* Examples / Cheat Sheet Table */
.example-table-wrap {
    overflow-x: auto;
    margin-top: 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.example-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: #fff;
}

.example-table th {
    background: #f1f5f9;
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
    color: #334155;
    border-bottom: 2px solid var(--border-color);
}

.example-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.example-table tr:last-child td {
    border-bottom: none;
}

.example-table tr:hover {
    background: #f8fafc;
}

.play-sequence {
    font-family: monospace;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.play-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-valid { background: #dcfce7; color: #166534; }
.badge-invalid { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0f2fe; color: #075985; }

/* Callout Box */
.rules-callout {
    background: #eff6ff;
    border-left: 4px solid var(--primary);
    padding: 14px 16px;
    border-radius: 0 8px 8px 0;
    margin: 14px 0;
    font-size: 0.9rem;
    color: #1e3a8a;
}

.rules-callout.callout-warning {
    background: #fffbeb;
    border-left-color: #f59e0b;
    color: #92400e;
}

.rules-callout.callout-danger {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #991b1b;
}

.rules-footer {
    text-align: center;
    margin-top: 30px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 640px) {
    .rules-hero {
        padding: 20px 16px;
    }
    .rules-hero-title {
        font-size: 1.5rem;
    }
    .rule-card {
        padding: 16px;
    }
    .abilities-grid {
        grid-template-columns: 1fr;
    }
}
