/* === RULES PAGE STYLES === */
.rules-body {
    background: url('../img/background.jpg') center center / cover no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px 20px 100px 20px; /* Extra bottom padding for fixed button */
    font-family: 'Arial', sans-serif;
    margin: 0;
}

.rules-container {
    max-width: 1000px;
    margin: 0 auto;
}

.rules-header {
    text-align: center;
    margin-bottom: 40px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    border: 3px solid #3498db;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.logo-container {
    margin-bottom: 20px;
}

.rules-logo {
    max-width: 150px;
    max-height: 150px;
    width: auto;
    height: auto;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.8));
    transition: transform 0.3s ease;
}

.rules-logo:hover {
    transform: scale(1.05);
}

.rules-header h1 {
    color: #3498db;
    font-size: 2.8rem;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9);
    margin: 15px 0 10px 0;
    background: linear-gradient(135deg, #3498db, #5dade2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rules-subtitle {
    font-size: 1.3rem;
    color: #ecf0f1;
    opacity: 0.9;
    font-style: italic;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    margin: 0;
}

.rules-content {
    background: rgba(0, 0, 0, 0.9);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(52, 152, 219, 0.3);
}

.rule-section {
    margin-bottom: 50px;
    position: relative;
    padding-left: 25px;
}

.rule-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #3498db, #2980b9);
    border-radius: 2px;
}

.rule-section h2 {
    color: #ecf0f1; /* Bílá barva pro text */
    font-size: 2rem;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    /* Odstraníme gradient background */
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

.rule-item {
    background: rgba(52, 73, 94, 0.4);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    border: 2px solid rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.rule-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(52, 152, 219, 0.05) 0%, 
        transparent 50%, 
        rgba(52, 152, 219, 0.05) 100%);
    pointer-events: none;
}

.rule-item:hover {
    border-color: rgba(52, 152, 219, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(52, 152, 219, 0.2);
}

.rule-item h3 {
    color: #5dade2;
    font-size: 1.4rem;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.rule-item p, .rule-item li {
    color: #ecf0f1;
    line-height: 1.7;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.rule-item ol, .rule-item ul {
    margin-left: 25px;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.rule-item strong {
    color: #f39c12;
    font-weight: bold;
}

.highlight-box {
    background: rgba(52, 152, 219, 0.25);
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    position: relative;
    z-index: 1;
}

.spawn-rule {
    background: rgba(46, 204, 113, 0.25);
    border-color: #2ecc71;
}

.frag-bonus {
    background: rgba(241, 196, 15, 0.25);
    border-color: #f1c40f;
}

.dice-rules {
    display: grid;
    gap: 15px;
    margin: 20px 0;
    position: relative;
    z-index: 1;
}

.dice-rule {
    background: rgba(52, 73, 94, 0.6);
    padding: 15px 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.dice-rule:hover {
    background: rgba(52, 73, 94, 0.8);
    transform: translateX(5px);
}

.special-rolls {
    display: grid;
    gap: 20px;
    margin: 25px 0;
    position: relative;
    z-index: 1;
}

.roll-type {
    padding: 20px;
    border-radius: 12px;
    border: 3px solid;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.roll-type::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.roll-type:hover::before {
    left: 100%;
}

.roll-type.critical {
    background: rgba(231, 76, 60, 0.25);
    border-color: #e74c3c;
}

.roll-type.critical:hover {
    background: rgba(231, 76, 60, 0.35);
    transform: scale(1.02);
}

.roll-type.lucky {
    background: rgba(241, 196, 15, 0.25);
    border-color: #f1c40f;
}

.roll-type.lucky:hover {
    background: rgba(241, 196, 15, 0.35);
    transform: scale(1.02);
}

.game-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 25px 0;
    position: relative;
    z-index: 1;
}

.mode-card {
    background: rgba(52, 73, 94, 0.6);
    border: 2px solid #7f8c8d;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(52, 152, 219, 0.1) 0%, 
        transparent 50%, 
        rgba(52, 152, 219, 0.1) 100%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mode-card:hover::before {
    opacity: 1;
}

.mode-card:hover {
    border-color: #3498db;
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(52, 152, 219, 0.3);
}

.mode-card h4 {
    color: #3498db;
    font-size: 1.3rem;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.mode-card p {
    position: relative;
    z-index: 1;
}

.note {
    font-style: italic;
    color: #bdc3c7;
    text-align: center;
    margin-top: 30px;
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

.bottom-spacing {
    height: 60px;
}

/* Fixed back button */
.fixed-back-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 15px;
    background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 70%, transparent 100%);
    backdrop-filter: blur(10px);
}

.fixed-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    max-width: 300px;
    margin: 0 auto;
    border: 2px solid transparent;
    transition: all 0.4s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(52, 152, 219, 0.3);
}

.fixed-back-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f6391);
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(52, 152, 219, 0.4);
    border-color: #5dade2;
}

.fixed-back-btn:active {
    transform: translateY(-1px);
}

/* Interactive elements */
.interactive-hint {
    color: #3498db;
    font-style: italic;
    margin: 10px 0 0 0;
    font-size: 0.9rem;
    text-align: center;
}

.clickable-term {
    color: #3498db;
    cursor: pointer;
    text-decoration: underline;
    transition: all 0.3s ease;
    position: relative;
}

.clickable-term:hover {
    color: #2980b9;
    background: rgba(52, 152, 219, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
    text-decoration: none;
}

.clickable-term::after {
    content: " ℹ️";
    font-size: 0.8em;
    opacity: 0.7;
    margin-left: 2px;
}

/* Rules Modal */
.rules-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.rules-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.rules-modal-content {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: 3px solid #3498db;
    border-radius: 20px;
    padding: 0;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.rules-modal-overlay.visible .rules-modal-content {
    transform: scale(1) translateY(0);
}

.rules-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #bdc3c7;
    transition: all 0.3s ease;
    z-index: 10001;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
}

.rules-modal-close:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.2);
    transform: scale(1.1);
}

.rules-modal-body {
    padding: 40px;
    overflow-y: auto;
    max-height: 80vh;
    color: #ecf0f1;
}

.rules-modal-body h3 {
    color: #3498db;
    margin: 0 0 25px 0;
    font-size: 1.8rem;
    text-align: center;
    border-bottom: 2px solid rgba(52, 152, 219, 0.3);
    padding-bottom: 15px;
}

.rules-modal-body p {
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.rules-modal-body ul, .rules-modal-body ol {
    margin: 15px 0;
    padding-left: 25px;
}

.rules-modal-body li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.rules-modal-body strong {
    color: #f39c12;
}

.rules-modal-body .example-box {
    background: rgba(52, 152, 219, 0.1);
    border: 2px solid rgba(52, 152, 219, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.rules-modal-body .example-title {
    color: #3498db;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.rules-modal-body .warning-box {
    background: rgba(231, 76, 60, 0.1);
    border: 2px solid rgba(231, 76, 60, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.rules-modal-body .tip-box {
    background: rgba(46, 204, 113, 0.1);
    border: 2px solid rgba(46, 204, 113, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
}

.highlight-box.twist-cards {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    border-left: 4px solid #6c3483;
}

.highlight-box.twist-cards strong {
    color: #f4d03f;
}

/* Mobile responsive for modal */
@media (max-width: 768px) {
    .rules-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .rules-modal-body {
        padding: 30px 25px;
    }
    
    .rules-modal-body h3 {
        font-size: 1.5rem;
    }
    
    .clickable-term::after {
        display: none; /* Hide info icon on mobile for cleaner look */
    }
}

@media (max-width: 480px) {
    .rules-modal-body {
        padding: 25px 20px;
    }
    
    .rules-modal-body h3 {
        font-size: 1.3rem;
    }
    
    .rules-modal-body p {
        font-size: 1rem;
    }
}

/* Mobile responsive for rules */
@media (max-width: 768px) {
    .rules-body {
        padding: 15px 15px 120px 15px;
    }
    
    .rules-header {
        padding: 25px 20px;
        margin-bottom: 30px;
    }
    
    .rules-logo {
        max-width: 120px;
        max-height: 120px;
    }
    
    .rules-header h1 {
        font-size: 2.2rem;
    }
    
    .rules-subtitle {
        font-size: 1.1rem;
    }
    
    .rules-content {
        padding: 25px 20px;
    }
    
    .rule-section {
        padding-left: 20px;
        margin-bottom: 40px;
    }
    
    .rule-section h2 {
        font-size: 1.6rem;
    }
    
    .rule-item {
        padding: 20px;
    }
    
    .rule-item h3 {
        font-size: 1.2rem;
    }
    
    .game-modes {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .fixed-back-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .rules-body {
        padding: 10px 10px 140px 10px;
    }
    
    .rules-header {
        padding: 20px 15px;
    }
    
    .rules-logo {
        max-width: 100px;
        max-height: 100px;
    }
    
    .rules-header h1 {
        font-size: 1.8rem;
    }
    
    .rules-content {
        padding: 20px 15px;
    }
    
    .rule-section {
        padding-left: 15px;
    }
    
    .rule-item {
        padding: 15px;
    }
    
    .fixed-back-btn {
        padding: 10px 20px;
        font-size: 0.95rem;
        gap: 8px;
    }
}