:root {
    --color-bg: #f0f0f0;
    --color-light: #e0e0e0;
    --color-dark: #333;
    --color-white: #ffffff;
    --color-gray-text: #555;
    --color-link: #0d61e7;
    --shadow-small: 0 2px 5px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-panel: 0 0 10px rgba(0, 0, 0, 0.1);
    --radius-small: 4px;
    --radius-medium: 8px;
    --transition-speed: 0.2s;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--color-bg);
    margin: 0;
    padding: 0;
    position: relative;
}

body::before,
body::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8.75%;
    background-color: var(--color-light);
    z-index: -1;
}

body::before {
left: 0;
}

body::after {
right: 0;
}

a {
    color: var(--color-link);
    text-decoration: none;
    word-break: break-word;
}

a:hover {
    text-decoration: underline;
}

h1, h2 {
    text-align: center;
}

header {
    background-color: var(--color-dark);
    color: var(--color-white);
    padding: 1em 0;
}

.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 1em;
}

.nav-btn {
    background-color: #fafafa;
    color: var(--color-dark);
    padding: 0.75em 2.25em;
    min-width: 180px;
    text-align: center;
    border: 2px solid #ccc;
    border-radius: var(--radius-medium);
    font-size: 1em;
    font-weight: bold;
    text-decoration: none;
    box-shadow: var(--shadow-small);
    transition: background-color var(--transition-speed), transform 0.1s ease, box-shadow var(--transition-speed);
}

.nav-btn:hover {
    background-color: var(--color-light);
    transform: scale(1.03);
    box-shadow: var(--shadow-hover);
}

main {
    max-width: 1000px; /* Widened */
    margin: 2em auto;
    background: var(--color-white);
    padding: 1.5em;
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-panel);
}

.demon-list,
.annotations-list,
#extendedList {
    list-style: none;
    padding: 0;
    margin-top: -10px;
}

.list-title {
    font-size: 1.6em;
    font-weight: bold;
    margin-bottom: 1em;
    margin-top: -0.5em;
    color: var(--color-dark);
}

.demon-list li,
#extendedList li,
.annotations-list li {
    background: #e9e9e9;
    margin: 0.5em 0;
    padding: 1em;
    border-radius: var(--radius-small);
    transition: background 0.2s, transform 0.2s;
    cursor: pointer;
}

.demon-list li:hover,
#extendedList li:hover,
.annotations-list li:hover {
    background: #dcdcdc;
    transform: scale(1.01);
}

.level-layout {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    width: 100%;
}

.level-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

.level-left strong {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.level-center {
    text-align: center;
    white-space: nowrap;
    justify-self: center;
}

.level-right {
    text-align: right;
    white-space: nowrap;
}

.thumb-link {
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.thumb-link:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.thumb {
    display: block;
    width: 160px;
    height: 90px;
    border-radius: 8px;
    object-fit: cover;
}
.level-center,
.level-right {
    font-size: 1.1em;
    font-weight: 500;
    color: var(--color-gray-text);
}

footer {
    text-align: center;
    padding: 1em 0;
    background: var(--color-dark);
    color: var(--color-white);
    margin-top: 2em;
}

/* Mobile styles */
@media (max-width: 768px) {
    main {
        margin: 1em;
        padding: 1em;
    }

    .demon-list li,
    #extendedList li,
    .annotations-list li {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.25em;
    }

.label {
    font-weight: bold;
    margin-right: 4px;
    color: #333;
}

    .level-layout {
        grid-template-columns: 1fr;
        gap: 0.75em;
        text-align: center;
    }

    .level-left,
    .level-center,
    .level-right {
        justify-content: center;
        text-align: center;
    }

    .level-left {
        flex-direction: column;
        gap: 0.5em;
    }

    .thumb {
        width: 100%;
        max-width: 240px;
        height: auto;
    }

    .nav-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1em;
    }

    .nav-btn {
        width: 100%;
        max-width: 280px;
    }
}