:root { 
    --bg: #050505; 
    --panel: #111111; 
    --border: #333333; 
    --text-main: #e0e0e0; 
    --text-muted: #666; 
    --accent: #b30000; 
    --accent-glow: rgba(179, 0, 0, 0.4); 
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html { overflow-y: scroll; scroll-behavior: smooth; }
body { background-color: var(--bg); color: var(--text-main); font-family: var(--font); margin: 0; padding: 20px; line-height: 1.6; }
a { text-decoration: none !important; color: inherit; }
.container { max-width: 600px; margin: 0 auto; width: 100%; box-sizing: border-box; }

/* HEADER */
header { text-align: center; margin-bottom: 40px; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
h1 { font-weight: 800; font-size: 3.5rem; margin: 0; letter-spacing: 2px; color: var(--text-main); text-transform: uppercase; line-height: 1; }
h1 a { color: inherit; text-decoration: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.site-logo { height: 1em; width: auto; object-fit: contain; }
.subtitle { color: var(--text-muted); font-size: 0.85rem; margin-top: 15px; text-transform: uppercase; letter-spacing: 1px; }

/* EFEKTY */
@keyframes pulse-glow {
    0% { border-color: var(--border); box-shadow: 0 0 0 0 transparent; }
    50% { border-color: var(--accent); box-shadow: 0 0 15px 0 var(--accent-glow); }
    100% { border-color: var(--border); box-shadow: 0 0 0 0 transparent; }
}
@keyframes fire-flicker {
    0% { text-shadow: 0 0 3px #fff, 0 -2px 5px #fffd37, 0 -5px 10px #ff7c00, 0 -10px 15px #b30000; }
    50% { text-shadow: 0 0 3px #fff, 0 -3px 5px #fffd37, 0 -6px 12px #ff7c00, 0 -11px 18px #b30000; }
    100% { text-shadow: 0 0 3px #fff, 0 -2px 5px #fffd37, 0 -5px 10px #ff7c00, 0 -10px 15px #b30000; }
}
.hell-fire { color: #f5f5f5; animation: fire-flicker 1s infinite alternate linear; }

/* ANIMACJA TRZĘSIENIA */
@keyframes shake-hard {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-3px, -2px) rotate(-1deg); } 
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-3px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.shaking {
    animation: shake-hard 0.5s infinite !important; 
    transition: none !important; 
    border-color: #ff0000 !important;
    box-shadow: 0 0 25px rgba(255, 0, 0, 0.6) !important;
}

/* MODAL / POPUP */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(3px);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    padding: 30px;
    width: 90%;
    max-width: 500px;
    
    /* ZMIANA: Wysokość automatyczna, dopasowana do tekstu */
    height: auto; 
    max-height: 90vh; /* Ale nie wyższa niż ekran */
    
    overflow-y: auto;
    border-radius: 4px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.9);
    animation: pulse-glow 4s infinite ease-in-out;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #666;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}
.close-modal:hover { color: var(--accent); }

.modal-body { font-size: 0.95rem; color: #ccc; line-height: 1.6; }
.modal-body p { margin-bottom: 15px; }

/* FORMULARZ */
.confess-box { background: var(--panel); padding: 30px; border: 1px solid var(--border); border-top: 3px solid var(--accent); margin-bottom: 50px; position: relative; border-radius: 4px; animation: pulse-glow 3s infinite ease-in-out; transition: all 0.3s; }

textarea, input[type="text"] { width: 100%; background: #000; border: 1px solid var(--border); color: #fff; padding: 15px; font-family: inherit; font-size: 1rem; border-radius: 4px; box-sizing: border-box; outline: none; transition: border-color 0.3s; }
textarea:focus, input:focus { border-color: var(--accent); }
textarea { height: 150px; resize: none; margin-bottom: 5px; }
input[type="text"] { margin-bottom: 15px; }

.char-counter { display: block; width: 100%; text-align: center; font-size: 0.75rem; color: var(--text-muted); pointer-events: none; transition: color 0.3s; margin-bottom: 15px; font-weight: bold; }
.char-counter.too-short { color: #555; } 
.char-counter.ok { color: var(--accent); text-shadow: 0 0 5px var(--accent-glow); } 

/* Guzik z paskiem postępu */
button.pray-btn { width: 100%; background: var(--accent); color: #fff; border: none; padding: 16px; font-weight: 700; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 2px; cursor: pointer; border-radius: 4px; transition: 0.1s; opacity: 1; position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; }
button.pray-btn:hover { background: #ff1a1a; box-shadow: 0 0 15px var(--accent-glow); }
button.pray-btn:disabled { background: #222; color: #555; cursor: not-allowed; box-shadow: none; opacity: 0.5; }
button.pray-btn:active { transform: scale(0.98); }
.btn-progress { position: absolute; bottom: 0; left: 0; height: 4px; background: #fff; width: 0%; transition: width 0.1s linear; }

.error-message { color: #ff4444; font-size: 0.8rem; margin-bottom: 10px; text-align: center; border: 1px solid #ff4444; padding: 10px; border-radius: 4px; background: rgba(255, 68, 68, 0.1); }
.website-field { opacity: 0; position: absolute; top: 0; left: 0; height: 0; width: 0; z-index: -1; }
.banned-box { background: #1a0505; border: 1px solid #500; padding: 30px; text-align: center; color: #f55; font-weight: bold; text-transform: uppercase; margin-bottom: 50px; border-radius: 4px; }

/* KARTY GRZECHÓW */
.list-header { text-align: center; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 25px; text-transform: uppercase; letter-spacing: 2px; font-weight: bold; }
.sin-card { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 4px; padding: 25px; margin-bottom: 20px; position: relative; transition: transform 0.2s, border-color 0.2s; }
.sin-card:hover { border-color: #555; transform: translateY(-2px); }
.sin-card-clickable { cursor: pointer; }
.sin-meta { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }
.sin-author { color: var(--accent); font-weight: bold; font-size: 1.3rem; } 
.sin-author.large { font-size: 2.4rem; line-height: 1.1; }
.sin-content { font-size: 1.05rem; margin-bottom: 15px; color: #fff; font-weight: 400; word-wrap: break-word; line-height: 1.5; } 
.penance-text { color: var(--text-muted); font-size: 0.85rem; font-style: italic; margin-top: 15px; padding-top: 10px; border-top: 1px solid #222; }
.card-footer { display: flex; justify-content: flex-end; align-items: center; margin-top: 20px; gap: 10px; }

.btn-uniform { background: transparent; border: 1px solid #333; color: #777; padding: 8px 16px; font-size: 0.75rem; border-radius: 3px; cursor: pointer; text-transform: uppercase; transition: 0.2s; text-decoration: none; display: inline-block; font-weight: bold; line-height: 1; }
.btn-uniform:hover { border-color: #fff; color: #fff; }
.read-more-btn { border: 1px solid #333; color: #777; padding: 6px 12px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; border-radius: 3px; transition: 0.3s; display: inline-block; text-decoration: none; }
.sin-card:hover .read-more-btn { background: var(--accent); color: #fff; border-color: var(--accent); }
.sin-nav-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; padding: 0 5px; }
.sin-nav-btn { color: #555; text-decoration: none !important; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; transition: color 0.3s; }
.sin-nav-btn:hover { color: var(--accent); text-shadow: 0 0 5px var(--accent-glow); }
.sin-nav-btn.disabled { opacity: 0; pointer-events: none; }
.back-btn { display: inline-block; margin: 5px 0; color: var(--text-muted); text-decoration: none !important; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 2px; font-weight: 800; transition: all 0.3s ease; }
.back-btn:hover { color: var(--accent); transform: translateX(-5px); text-shadow: 0 0 10px var(--accent-glow); }
.pagination { display: flex; justify-content: center; gap: 10px; margin-top: 40px; margin-bottom: 40px; }
.page-btn { padding: 10px 20px; background: var(--panel); color: var(--text-main); text-decoration: none !important; border-radius: 4px; border: 1px solid var(--border); font-size: 0.9rem; transition: 0.2s; }
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.disabled { opacity: 0.3; pointer-events: none; }
.page-info { align-self: center; font-size: 0.8rem; color: var(--text-muted); }

/* FOOTER - POPRAWIONY */
footer { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border); text-align: center; font-size: 0.75rem; color: var(--text-muted); padding-bottom: 10px; }

/* Elastyczny kontener linków */
.footer-links { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    flex-wrap: wrap; 
    gap: 15px; /* Odstęp między linkami */
    margin-bottom: 10px; 
}
.footer-links a { 
    color: var(--text-muted); 
    text-decoration: none !important; 
    transition: color 0.3s; 
    font-weight: 600; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    position: relative;
    white-space: nowrap; /* Nie łam tekstu w środku linka */
}
.footer-links a:hover { color: #fff; }

/* Kreseczka rozdzielająca na PC (dodawana przez CSS) */
.footer-links a:not(:last-child)::after {
    content: "|";
    position: absolute;
    right: -10px; /* Połowa gapu, trochę przesunięte */
    color: #444;
    font-weight: normal;
    pointer-events: none;
}

.admin-body { background: #050505; color: #ccc; }

/* MOBILE */
@media (max-width: 480px) {
    body { padding: 15px; }
    h1 { font-size: 2.0rem; letter-spacing: 1px; }
    .confess-box { padding: 20px; }
    .sin-card { padding: 20px; }
    textarea { height: 120px; }
    .card-footer { flex-direction: row; gap: 10px; }
    .btn-uniform { flex: 1; text-align: center; padding: 12px; }
    
    /* Na telefonie linki w stopce jeden pod drugim */
    .footer-links {
        flex-direction: column; /* Pionowo */
        gap: 10px;
    }
    /* Ukrywamy kreski rozdzielające na telefonie */
    .footer-links a:not(:last-child)::after {
        content: none;
    }
}