:root {
    --bg: #ededed;
    --card-bg: #f7f7f7;
    --text: #181818;
    --text-light: #555555;
    --accent: #222222;
    --accent-hover: #000000;
    --border: #cccccc;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] {
    --bg: #181818;
    --card-bg: #232323;
    --text: #f7f7f7;
    --text-light: #bbbbbb;
    --accent: #ededed;
    --accent-hover: #ffffff;
    --border: #232323;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 32px;
    line-height: 1.7;
    font-size: 1.15rem;
    transition: background 0.3s, color 0.3s;
}

h1 {
    text-align: center;
    margin: 0 0 36px 0;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--accent);
}

h2 {
    margin: 0 0 14px 0;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text);
}

h3 {
    margin: 0 0 18px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
}

p {
    margin: 8px 0;
    color: var(--text-light);
    font-size: 1.08rem;
}

a {
    color: var(--accent);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
}

#demon-list {
    max-width: 900px;
    margin: 40px auto;
    display: grid;
    gap: 20px;
}

.demon-entry {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    padding: 24px 28px;
    height: 160px;
    margin: 8px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1.5px solid var(--border);
    transition: box-shadow 0.2s, border 0.2s;
}

.demon-entry:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.13);
    border-color: var(--accent);
}

.demon-place {
    font-size: 2em;
    font-weight: 900;
    margin-right: 28px;
    color: var(--accent);
    min-width: 2.8em;
    text-align: center;
    letter-spacing: -2px;
}

.demon-video {
    margin-right: 20px;
}

.video-link {
    display: flex;
    align-items: center;
    color: var(--text);
}

.video-icon {
    width: 180px;
    height: 130px;
    background: var(--bg);
    border-radius: 6px;
    margin-right: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.link-text {
    font-weight: 700;
    font-size: 1.05em;
}

.demon-info {
    flex: 1;
}

.demon-info h2 {
    font-size: 1.2em;
    color: var(--text);
}

.level-container {
    max-width: 900px;
    height: 400px;
    margin: 40px auto;
    background: var(--card-bg);
    padding: 25px 28px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1.5px solid var(--border);
}

.level-details-card {
    max-width: 600px;
    margin: 40px auto;
    background: var(--card-bg);
    padding: 32px 28px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1.5px solid var(--border);
}

.level-title {
    text-align: center;
    font-size: 2em;
    font-weight: 900;
    margin-bottom: 12px;
    color: var(--accent);
}

.level-verified {
    text-align: center;
    font-size: 1.1em;
    color: var(--accent);
    margin-bottom: 20px;
    font-weight: 700;
}

.level-description {
    text-align: center;
    margin-bottom: 20px;
}

.level-desc-text {
    font-size: 1.1em;
    margin-bottom: 10px;
}

.level-video {
    text-align: center;
    margin: 20px 0;
}

.level-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.level-stat-box {
    background: var(--bg);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.level-stat-label {
    color: var(--text-light);
    font-size: 0.95em;
    margin-bottom: 5px;
}

.level-stat-value {
    font-size: 1.15em;
    font-weight: bold;
}

#level-meta,
.level-meta-box {
    background: var(--bg);
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.level-victors-section {
    background: var(--bg);
    padding: 20px;
    margin-top: 20px;
    border-radius: 8px;
    text-align: center;
    position: relative;
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.level-victors-section h3 {
    text-align: center;
}

.level-victors-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.level-victors-section li {
    padding: 8px 0;
    color: var(--text-light);
    font-size: 1.05em;
}

.percent-required-label {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent);
    color: var(--bg);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.95em;
    font-weight: bold;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
}

.back-link {
    display: inline-block;
    margin-bottom: 15px;
    color: var(--accent);
    font-size: 1.05em;
    font-weight: 600;
}

.tab-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.tab-btn {
    background: var(--bg);
    border: 2px solid var(--border);
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    font-size: 1em;
    transition: background 0.2s, color 0.2s, border 0.2s;
}

.tab-btn.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.demon-list-tab {
    max-width: 900px;
    margin: 0 auto 30px auto;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    color: var(--bg);
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.13);
    transition: background 0.2s;
}

.theme-toggle:hover {
    background: var(--accent-hover);
}

@media (max-width: 900px) {

    #demon-list,
    .level-container,
    .level-details-card,
    .demon-list-tab {
        max-width: 98vw;
        padding-left: 2vw;
        padding-right: 2vw;
    }
}

@media (max-width: 768px) {
    .demon-entry {
        flex-direction: column;
        text-align: center;
        gap: 14px;
        padding: 18px 8px;
    }

    .demon-place {
        margin-right: 0;
        font-size: 1.5em;
    }

    .demon-video {
        margin-right: 0;
    }

    .level-stats {
        grid-template-columns: 1fr;
    }

    .tab-container {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .theme-toggle {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
        font-size: 15px;
    }
}

/* Add these styles to your existing CSS file */
.header-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 36px;
}

.dark-mode-btn {
    position: absolute;
    right: 20px;
    top: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.2s;
}

.dark-mode-btn:hover {
    transform: scale(1.1);
    background: var(--accent);
    color: var(--bg);
}