:root {
    --bg-color: #1a1a2e;
    /* Dark purple/blue base */
    --bg-card: rgba(30, 30, 50, 0.7);
    --bg-hover: rgba(50, 50, 80, 0.8);
    --text-main: #f0e6ff;
    /* Ghost white */
    --text-muted: #a09eb5;
    --accent: #9d4edd;
    --accent-hover: #7b2cbf;
    --danger: #cfcac2;
    --productivity: #3a86ff;
    --entertainment: #ff006e;
    --tombstone-bg: #8d99ae;
    --tombstone-text: #2b2d42;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Background Effects */
.spooky-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top, #241b35 0%, var(--bg-color) 60%);
    z-index: -2;
}

.spooky-fog {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40vh;
    background: linear-gradient(to top, rgba(141, 153, 174, 0.1), transparent);
    filter: blur(20px);
    z-index: -1;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
    animation: floatDown 1s ease-out;
}

.logo {
    font-family: 'Creepster', cursive;
    font-size: 4rem;
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(157, 78, 221, 0.8);
    letter-spacing: 2px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.hidden {
    display: none !important;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Upload Section */
.upload-zone {
    border: 2px dashed rgba(157, 78, 221, 0.4);
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(157, 78, 221, 0.1);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-zone input {
    display: none;
}

.upload-zone p {
    color: var(--text-muted);
    margin: 1rem 0 2rem;
    font-size: 0.9rem;
}

.demo-controls {
    margin-top: 1.5rem;
    text-align: center;
}

.muted {
    color: var(--text-muted);
    margin: 0 1rem;
}

/* Buttons & Inputs */
.btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(157, 78, 221, 0.2);
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(207, 202, 194, 0.1);
}

.input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: inherit;
    outline: none;
}

.input:focus {
    border-color: var(--accent);
}

/* Dashboard Controls */
.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem 1.5rem;
}

.filters,
.actions {
    display: flex;
    gap: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border-top: 3px solid rgba(255, 255, 255, 0.1);
}

.graveyard-stat {
    border-top-color: var(--accent);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: 'Creepster', cursive;
    letter-spacing: 2px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Charts Area */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.chart-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
}

.chart-card h3 {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 1rem;
}

/* Cemetery Grid */
.cemetery-section h2,
.guilt-section h2 {
    font-family: 'Creepster', cursive;
    font-size: 2.5rem;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: 2px;
}

.cemetery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

/* Tombstone Animation & Styling */
@keyframes thud {
    0% {
        transform: translateY(-50px) rotate(rand(-5deg, 5deg));
        opacity: 0;
    }

    60% {
        transform: translateY(10px);
        opacity: 1;
    }

    80% {
        transform: translateY(-5px);
    }

    100% {
        transform: translateY(0) rotate(var(--rot));
        opacity: 1;
    }
}

.tombstone {
    background: var(--tombstone-bg);
    color: var(--tombstone-text);
    border-radius: 100px 100px 5px 5px;
    padding: 2.5rem 1rem 1rem;
    text-align: center;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2), 0 10px 15px rgba(0, 0, 0, 0.5);
    animation: thud 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    --rot: 0deg;
    /* Set by JS */
    transform-origin: bottom center;
    cursor: help;
    transition: filter 0.2s;
}

.tombstone:hover {
    filter: brightness(1.1);
}

.tombstone::after {
    content: 'R.I.P';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    font-family: 'Creepster', cursive;
    font-size: 1.2rem;
    color: rgba(0, 0, 0, 0.4);
}

.ts-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ts-domain {
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.6);
    margin-bottom: 1rem;
    word-break: break-all;
}

.ts-date {
    font-size: 0.7rem;
    color: rgba(0, 0, 0, 0.5);
    font-style: italic;
}

.ts-grass {
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 10px;
    background: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(46, 56, 46, 0.4) 5px, rgba(46, 56, 46, 0.4) 10px);
}

/* Guilt List */
.guilt-section {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 4rem;
}

.guilt-section p {
    text-align: center;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
}

.guilt-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.guilt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border-left: 4px solid var(--accent);
}

.guilt-item:hover {
    background: rgba(0, 0, 0, 0.4);
}

.g-meta span {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-right: 1rem;
}

.g-title {
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
}

.g-title:hover {
    text-decoration: underline;
}

.g-count {
    background: var(--accent);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Notification */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--text-main);
    color: var(--bg-color);
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 100;
    transition: opacity 0.3s;
}

@keyframes floatDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {

    .charts-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }
}