:root {
    --bg-color: #050508;
    --text-primary: #e0e0e0;
    --text-secondary: #888899;
    --accent: #bb86fc;
    --accent-glow: rgba(187, 134, 252, 0.4);
    --tombstone-bg: #111116;
    --tombstone-border: #22222a;
    --cause-color: #cf6679;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    background-image: 
        radial-gradient(circle at 50% 0%, #151525 0%, transparent 50%),
        radial-gradient(circle at 50% 100%, #0a0a10 0%, #050508 100%);
}

/* Atmospheric effects */
.mist-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="0.65" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noiseFilter)" opacity="0.03"/></svg>');
    pointer-events: none;
    z-index: 100;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    background-color: var(--accent);
    border-radius: 50%;
    filter: blur(2px);
    animation: float 15s infinite linear;
    opacity: 0.3;
}

@keyframes float {
    0% { transform: translateY(100vh) scale(1); opacity: 0; }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { transform: translateY(-100px) scale(0.5); opacity: 0; }
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.header-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Glow Button */
.glow-button {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--accent);
    padding: 0.8rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px var(--accent-glow);
}

.glow-button:hover {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-2px);
}

/* Main Grid */
.graveyard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    padding: 2rem 5% 5rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

/* Tombstone Card */
.tombstone {
    background: var(--tombstone-bg);
    border: 1px solid var(--tombstone-border);
    border-radius: 12px 12px 4px 4px; /* Tombstone shape */
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Tombstone top curve */
.tombstone::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--tombstone-bg);
    border: 1px solid var(--tombstone-border);
    border-bottom: none;
    border-radius: 50% 50% 0 0;
    z-index: -1;
}

.tombstone:hover {
    transform: translateY(-5px);
    border-color: rgba(187, 134, 252, 0.3);
    box-shadow: 0 15px 40px rgba(0,0,0,0.6), 0 0 20px var(--accent-glow);
}

.dates {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-align: center;
    letter-spacing: 2px;
}

.tombstone h2 {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: #fff;
}

.cause {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(207, 102, 121, 0.1);
    border-radius: 4px;
    border-left: 2px solid var(--cause-color);
}

.cause span {
    color: var(--cause-color);
    font-weight: 600;
}

.description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #aaa;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.tombstone-footer {
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--tombstone-border);
    padding-top: 1rem;
}

.candle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.candle-btn:hover {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.candle-btn.active .candle-icon {
    animation: flicker 1s infinite alternate;
}

@keyframes flicker {
    0% { transform: scale(1); text-shadow: 0 0 5px #ffd700; }
    100% { transform: scale(1.1); text-shadow: 0 0 15px #ffd700, 0 0 25px #ff8c00; }
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-box {
    background: #111116;
    border: 1px solid var(--tombstone-border);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 30px var(--accent-glow);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.modal-backdrop.hidden .modal-box {
    transform: translateY(50px);
}

.modal-box h2 {
    margin-bottom: 2rem;
    font-size: 1.8rem;
    color: #fff;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

input, select, textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid #333;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
}

/* Footer & Admin */
.footer {
    border-top: 1px solid var(--tombstone-border);
    margin-top: 4rem;
    padding: 3rem 5%;
    text-align: center;
    background: rgba(0,0,0,0.5);
    position: relative;
    z-index: 10;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-content h3 {
    margin-bottom: 1rem;
    color: #fff;
}

.footer-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.kofi-btn {
    display: inline-block;
    background: #FF5E5B;
    color: #fff;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kofi-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 94, 91, 0.4);
}

.admin-link {
    color: #444;
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

.admin-link:hover {
    color: var(--accent);
}

.admin-badge {
    position: absolute;
    top: -15px;
    right: 20px;
    background: #ffd700;
    color: #000;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    z-index: 5;
}

.admin-tombstone {
    border-color: rgba(255, 215, 0, 0.3);
}

.admin-tombstone::before {
    border-color: rgba(255, 215, 0, 0.3);
}

.hidden {
    display: none !important;
}

/* Resurrected Tombstone */
.resurrected-tombstone {
    border-color: rgba(0, 255, 204, 0.4);
    box-shadow: 0 10px 30px rgba(0, 255, 204, 0.1), inset 0 1px 0 rgba(255,255,255,0.05);
}

.resurrected-tombstone::before {
    border-color: rgba(0, 255, 204, 0.4);
}

.resurrected-tombstone:hover {
    box-shadow: 0 15px 40px rgba(0, 255, 204, 0.2), 0 0 20px rgba(0, 255, 204, 0.3);
}

.resurrected-tombstone h2 {
    color: #00ffcc;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.4);
}

.resurrected-cause {
    background: rgba(0, 255, 204, 0.1);
    border-left-color: #00ffcc;
}

.resurrected-cause span {
    color: #00ffcc;
}

.live-link {
    color: #00ffcc;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(0, 255, 204, 0.1);
    border-radius: 5px;
    border: 1px solid rgba(0, 255, 204, 0.3);
}

.live-link:hover {
    background: rgba(0, 255, 204, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.4);
    transform: translateY(-2px);
}

.resurrect-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 255, 204, 0.1);
    border: 1px solid #00ffcc;
    color: #00ffcc;
    border-radius: 5px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
}

.resurrect-btn:hover {
    background: rgba(0, 255, 204, 0.3);
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}
