body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding-top: 90px;
    background-color: #f4f4f4;
    color: #333;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #333;
    color: #fff;
    padding: 0.6em 0;
    text-align: center;
    z-index: 1000; /* Ensure header stays on top of other content */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

nav {
    margin-top: 10px;
}

nav button {
    background-color: #555;
    color: #fff;
    border: none;
    padding: 10px 15px;
    margin: 0 5px;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
}

nav button:hover {
    background-color: #6c757d;
    transform: translateY(-2px);
}

nav button.selected {
    background-color: #007bff;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

main {
    padding: 20px;
    margin: 20px auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #333;
}

ul {
    list-style: none;
    padding: 0;
}

li {
    background-color: #eee;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
}

li a {
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
}

li a:hover {
    text-decoration: underline;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tbody tr {
    cursor: pointer;
}

tbody tr:hover {
    background-color: #f5f5f5;
}

.item-image {
    float: right;
    max-width: 150px;
    margin-left: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
}



#game-info {
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
    margin-bottom: 20px;
}

#game-info h2 {
    color: #007bff;
    margin-top: 0;
    margin-bottom: 15px; /* Added margin */
}

#game-info p {
    margin-bottom: 10px; /* Added margin */
    font-size: 1.1em; /* Slightly larger font for points */
}

#game-info p strong {
    color: #333; /* Ensure strong text is visible */
}

#game-info h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #333;
}

#game-info ul {
    list-style: none; /* Changed to none for custom styling */
    padding: 0;
    margin-left: 0;
}

#game-info li {
    background-color: #e9ecef; /* Lighter background for list items */
    border-left: 5px solid #007bff; /* Accent border */
    margin-bottom: 8px;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#game-info li:last-child {
    border-bottom: none;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.9); /* Black w/ opacity */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* Collapsible Sections Styles */
.collapsible-header {
    background-color: transparent; /* No background */
    color: #333; /* Match h3 color */
    padding: 5px 0; /* Reduced padding */
    border: none;
    border-bottom: 1px solid #ccc; /* Subtle bottom border */
    text-align: left;
    outline: none;
    font-size: 1.1em;
    cursor: pointer;
    width: 100%;
    border-radius: 0; /* No border-radius */
    transition: background-color 0.3s ease;
    margin-bottom: 10px; /* Keep margin-bottom for spacing */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapsible-header:hover {
    background-color: #f0f0f0; /* Subtle hover effect */
}

.collapsible-header .arrow {
    transition: transform 0.2s ease-out;
}

.collapsible-header.active .arrow {
    transform: rotate(90deg);
}

.collapsible-content {
    padding: 0 18px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out;
    background-color: #f1f1f1;
    border-radius: 5px;
    margin-bottom: 10px;
}

.collapsible-content.active {
    max-height: 1000px; /* Adjust as needed, should be larger than content */
    padding-top: 10px;
    padding-bottom: 10px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.input-group input[type="text"],
.input-group input[type="number"] {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.input-group button {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.input-group button:hover {
    background-color: #0056b3;
}

#player-list li, #creature-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #e9ecef;
    border-left: 5px solid #007bff;
    margin-bottom: 8px;
    padding: 10px 15px;
    border-radius: 4px;
}

#player-list li div button, #creature-list li div button {
    margin-left: 5px;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

#player-list li div .edit-button, #creature-list li div .edit-button {
    background-color: #ffc107;
    color: #333;
    border: none;
}

#player-list li div .edit-button:hover, #creature-list li div .edit-button:hover {
    background-color: #e0a800;
}

#player-list li div .delete-button, #creature-list li div .delete-button {
    background-color: #dc3545;
    color: white;
    border: none;
}

#player-list li div .delete-button:hover, #creature-list li div .delete-button:hover {
    background-color: #c82333;
}

/* Points Visualizer Styles */
#points-visualizer {
    display: flex;
    width: 100%;
    height: 20px; /* Height of the visualizer */
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 15px;
    margin-bottom: 15px;
}

.point-bar {
    height: 100%;
    transition: width 0.5s ease-out; /* Smooth transition for width changes */
}

#positive-bar {
    background-color: #28a745; /* Green for positive points */
}

#negative-bar {
    background-color: #dc3545; /* Red for negative points */
}

#scrollTopBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 99;
    font-size: 18px;
    border: none;
    outline: none;
    background-color: #555;
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: background-color 0.3s;
}

#scrollTopBtn:hover {
    background-color: #007bff;
}

#burger-menu {
    display: none; /* Hidden by default */
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px; /* Added padding */
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1001;
    background-color: #555; /* A slightly lighter background for the button itself */
    border-radius: 3px;
}

#burger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding-top: 50px; /* Further reduced */
    }

    header {
        padding: 0.1em 0.5em; /* Further reduced vertical padding */
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    header h1 {
        font-size: 1.2em;
        margin: 0;
    }

    nav {
        margin-top: 5px;
    }

    #burger-menu {
        display: block;
    }

    #nav-links {
        display: none; /* Hide the nav links by default */
        position: fixed; /* Changed from absolute */
        top: 50px; /* Match body padding-top */
        left: 0;
        width: 100%;
        background-color: #333;
        flex-direction: column;
        align-items: center;
        padding: 10px 0;
        z-index: 999; /* Ensure it's below the header but above content */
        border-bottom: 2px solid #555;
    }

    #nav-links.active {
        display: flex; /* Show the nav links when active */
    }

    #nav-links button {
        width: 90%;
        margin: 5px 0;
    }

    main {
        margin: 10px;
        padding: 10px;
        width: auto;
        max-width: none;
    }

    .item-image {
        float: none;
        display: block;
        margin: 10px auto;
        max-width: 100px;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group input[type="text"],
    .input-group input[type="number"],
    .input-group button {
        width: 100%;
        box-sizing: border-box; /* Ensure padding doesn't add to width */
    }
}
.col-hidden { display: none; }
.col-wide { min-width: 10.5em; }

#filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
}
#filter-container div {
    display: flex;
    flex-direction: column;
}
#filter-container label {
    font-size: 0.8em;
    margin-bottom: 4px;
    color: #555;
    font-weight: bold;
}
#filter-container select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.table-thumbnail {
    max-width: 50px;
    max-height: 50px;
    border-radius: 4px;
    object-fit: cover;
}

/* --- TIMELINE STYLES --- */
.timeline-container {
    position: relative;
    max-width: 1000px;
    margin: 40px auto;
    padding: 20px 0;
}

/* The central vertical line */
.timeline-container::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: #007bff;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    box-sizing: border-box;
}

/* The circle on the timeline */
.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -12px;
    background-color: white;
    border: 4px solid #007bff;
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

/* Position the items on the left */
.timeline-item.left {
    left: 0;
}

/* Position the items on the right */
.timeline-item.right {
    left: 50%;
}

/* Add arrows to the left container (pointing right) */
.timeline-item.left::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    right: 30px;
    border: medium solid white;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent white;
}

/* Add arrows to the right container (pointing left) */
.timeline-item.right::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    left: 30px;
    border: medium solid white;
    border-width: 10px 10px 10px 0;
    border-color: transparent white transparent transparent;
}

/* Fix the circle for right-sided items */
.timeline-item.right::after {
    left: -12px;
}

.timeline-content {
    padding: 20px 30px;
    background-color: white;
    position: relative;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.timeline-content h3 {
    margin-top: 0;
    color: #007bff;
}

.timeline-date {
    font-size: 0.9em;
    font-weight: bold;
    color: #555;
    margin-bottom: 0;
}

/* Responsive timeline */
@media screen and (max-width: 768px) {
    .timeline-container::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item::before {
        left: 60px;
        border: medium solid white;
        border-width: 10px 10px 10px 0;
        border-color: transparent white transparent transparent;
    }

    .timeline-item.left::after, .timeline-item.right::after {
        left: 19px;
    }

    .timeline-item.right {
        left: 0%;
    }
}

/* Styles pour la pile d'images miniatures */
.thumbnail-stack {
    position: relative;
    width: 50px;  /* Correspond à .table-thumbnail */
    height: 50px; /* Correspond à .table-thumbnail */
    display: flex;
    align-items: center;
    justify-content: center;
}

.thumbnail-stack img {
    position: absolute;
    width: 85%; /* Légèrement plus petit pour voir la pile */
    height: 85%;
    object-fit: cover;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* On inverse l'ordre pour que la 1ère image de la liste soit au-dessus */
.thumbnail-stack img:nth-last-child(1) {
    z-index: 3;
    transform: rotate(-8deg);
}

.thumbnail-stack img:nth-last-child(2) {
    z-index: 2;
    transform: rotate(4deg) scale(0.9);
}

.thumbnail-stack img:nth-last-child(3) {
    z-index: 1;
    transform: rotate(12deg) scale(0.8);
}