:root {
    --bg-main: #1a1a1a;
    --bg-box: #2a2a2a;
    --text: #f0f0f0;
    --text-muted: #aaaaaa;
    --accent: #128ee0;
    --accent-hover: #0e6caa;
    --accent-green: #28a745;
    --border: #555;
    --shadow: rgba(0, 0, 0, 0.5);
    --white: #ffffff;
}

body {
    font-family: sans-serif;
    margin: 0;
    background-color: var(--bg-main);
    color: var(--text);
    overflow-y: hidden;
}

#generator {
    text-align: center;
    margin: 2em auto;
}

#poster-box {
    display: inline-block;
    background: var(--bg-box);
    padding: 1em;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    width: 160px;
    cursor: grab;
}

#poster-box img {
    width: 100%;
    border-radius: 6px;   
}

button {
    margin-top: 1em;
    padding: 0.5em 1.2em;
    font-size: 1em;
    background-color: var(--accent);
    color: var(--white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--accent-hover);
}

h2 {
    text-align: center;
    margin-bottom: 1em;
    color: var(--text);
}

#timeline-container {
    position: absolute;
    left: 0;
    right: 0;
    padding: 0 0em 0em 1em;
    background-color: transparent;
    z-index: 1000;
}

#lives {
    text-align: center;
    margin-bottom: 6px;
    font-size: 24px;
    user-select: none;
    color: var(--text);
}

#timeline {
    display: flex;
    gap: 16px;
    padding-left: 30px;
    overflow-x: hidden;
    min-height: 140px;
    max-height: 250px;
    align-items: center;
    position: relative;
}

#timeline::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    border-top: 2px dashed var(--border);
    transform: translateY(-50%);
}

.timeline-item-wrapper {
    position: relative;
    margin: 0 5px 10px;
    border-radius: 4px;
    flex-shrink: 0;
    cursor: grab;
    display: inline-block;
    user-select: none;
}

.timeline-item {
    width: 100px;
    height: 150px;
    border-radius: 4px;
    display: block;
    user-select: none;
    
}

.info-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-weight: bold;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 16px;
    line-height: 18px;
    padding: 0;
    user-select: none;
}

.dragging {
    opacity: 0.5;
}

.placeholder {
    width: 160px;
    height: 220px;
    border: 2px dashed var(--text-muted);
    border-radius: 4px;
    flex-shrink: 0;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
}

#game-over {
    text-align: center;
    font-size: 24px;
    color: #ff4d4d;
    font-weight: bold;
    margin-top: 1em;
    user-select: none;
}

/* MODALE */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

#modal {
    background: var(--bg-box);
    padding: 1.8em;
    max-width: 800px;
    width: 90%;
    border-radius: 12px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px var(--shadow);
    font-size: 15px;
    color: var(--text);
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
}

#modal-overlay.show #modal {
    transform: translateY(0);
    opacity: 1;
}

#modal h3 {
    margin-top: 0;
    margin-bottom: 0.75em;
    font-size: 20px;
    font-weight: bold;
    color: var(--text);
}

#modal .close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text);
    transition: transform 0.2s ease;
}

#modal .close-btn:hover {
    transform: scale(1.2);
}

#modal img {
    max-width: 100%;
    border-radius: 6px;
    margin-bottom: 1em;    
}

.decade-btn {
    padding: 0.5em 1em;
    margin: 0.25em;
    font-size: 1em;
    border: none;
    border-radius: 20px;
    background-color: var(--accent);
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.decade-btn:hover {
    background-color: var(--accent-hover);
}

.decade-btn.selected {
    background-color: var(--accent-green);
}

/* TMDB Attribution */
#tmdb-attribution {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.95);
    padding: 10px 20px;
    text-align: center;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

#tmdb-attribution p {
    margin: 0;
    font-size: 0.85em;
    color: #ccc;
    font-weight: 400;
}

#tmdb-attribution img {
    margin-top: 5px;
    max-width: 100%;
    height: auto;    
}

/* NAV BAR */
nav {
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

nav img {
    height: 120px;
    border-radius: 8px;    
}

nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
}

nav ul li {
    margin: 0;
}

nav ul li a {
    display: block;
    padding: 14px 20px;
    color: var(--text);
    text-decoration: none;
    text-align: center;
    border-radius: 6px;
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#start-screen {
    top: 0;
    left: 0;
    width: 100%;
    height: 60vh;
    color: #fff;
    background-color: var(--bg-main);
    ;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2em;
    text-align: center;
}