body {
    font-family: sans-serif;
    background-color: #222;
    color: #eee;
    display: flex;
    justify-content: center;
    align-items: flex-start; 
    min-height: 100vh;
    margin: 0;
    padding-top: 20px;
}

.container {
    background-color: #333;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    text-align: center;
    width: 90%;
    max-width: 600px;
    position: relative; /* Added for positioning help button */
}

.timer-display {
    font-size: 3em;        /* Reduced from 4em */
    margin: 5px 0;         /* Reduced from 20px */
    font-weight: bold;
    color: #4CAF50; 
}

button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 4px;
}

button:hover {
    background-color: #45a049;
}

/* --- New Manual Time Adjust Styling --- */
.manual-time-adjust {
    background-color: #2a2a2a; 
    padding: 8px;          /* Reduced from 15px */
    border-radius: 8px;
    margin: 10px auto;     /* Reduced from 20px */
    max-width: 400px;  
    
    /* Flexbox properties integrated here */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;              /* Reduced from 15px */
}

.time-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px; /* Space between "Set Time" label and the Box */
}

.manual-time-adjust input[type="text"] {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #555;
    background-color: #444;
    color: #eee;
    width: 100px;
    text-align: center;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-wrapper input {
    cursor: pointer;
    transform: scale(1.2); /* Make the checkbox a little bigger */
}

.checkbox-wrapper label {
    font-size: 0.95em;
    color: #ccc;
    cursor: pointer;
    user-select: none; /* Prevents highlighting text when clicking quickly */
}

#setManualTimeButton {
    width: 100%; /* Make button fill the width of the container */
    max-width: 200px; /* But don't let it get huge */
}

.preferences {
    margin: 10px 0;        /* Reduced from 30px */
    text-align: left; 
}

.preferences h2 {
    text-align: center;
    color: #bbb;
    font-size: 1.1em;      /* New: Smaller header */
    margin: 5px 0;         /* New: Tighter margin */
}

.preference-item {
    display: flex; 
    align-items: center; 
    margin-bottom: 5px;    /* Reduced from 12px */
    flex-wrap: wrap; 
}

.preference-item label {
    margin-left: 8px;
    margin-right: 15px; 
    flex-shrink: 0; 
    width: 220px; 
}

.preference-item input[type="range"] {
    flex-grow: 1; 
    min-width: 100px; 
    margin-right: 10px;
}

.volume-display {
    font-size: 0.9em;
    color: #ccc;
    min-width: 40px; 
    text-align: right;
}


.timeline-section {
    margin-top: 10px;      /* Reduced from 30px */
}
.timeline-section h2 {
    color: #bbb;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.timeline-container {
    width: 100%;
    height: 45px;          /* Reduced from 60px */
    background-color: #444;
    border-radius: 4px;
    position: relative; 
    overflow-x: auto; 
    margin-top: 5px;
}

.timeline-bar {
    width: 100%;
    height: 100%;
    position: relative;
}

.timeline-event {
    position: absolute;
    bottom: 8px;           /* Adjusted for new height */
    transform: translateX(-50%); 
    width: 24px;           /* Reduced from 30px */
    height: 24px;          /* Reduced from 30px */
    background-color: #ffffff; 
    border-radius: 50%;
    display: flex; 
    justify-content: center; 
    align-items: center; 
    cursor: pointer;
    border: 2px solid #333; 
    overflow: hidden; 
}

.timeline-event img {
    max-width: 90%;  
    max-height: 90%; 
    display: block;  
    object-fit: contain; 
}

.timeline-event .tooltip {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%; 
    left: 50%;
    margin-left: -60px; 
    opacity: 0;
    transition: opacity 0.3s;
}

.timeline-event:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.voice-pack-selector {
    margin-bottom: 10px;   /* Reduced from 20px */
    text-align: center; 
}

.voice-pack-selector label {
    margin-right: 10px;
}

.voice-pack-selector select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #555;
    background-color: #444;
    color: #eee;
    font-size: 1em;
}

/* Help Button Styles */
.help-button {
    position: absolute; 
    top: 15px;          
    left: 15px;         
    width: 30px;
    height: 30px;
    background-color: #ffffff; 
    color: #333;             
    border: 1px solid #ccc;
    border-radius: 50%;      
    font-size: 18px;
    font-weight: bold;
    line-height: 28px; 
    text-align: center;
    cursor: pointer;
    padding: 0; 
    z-index: 1001; 
}

.help-button:hover {
    background-color: #f0f0f0; 
}

/* Help Panel Styles */
.help-panel {
    position: fixed; 
    top: 0;
    left: -350px; 
    width: 320px;  
    height: 100%;
    background-color: #444; 
    color: #eee;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    z-index: 2000; 
    transition: left 0.3s ease-in-out; 
    text-align: left;
    
    /* NEW: Flex Layout to handle top/bottom alignment */
    display: flex;
    flex-direction: column;
    box-sizing: border-box; /* Ensures padding doesn't mess up height */
}

.help-panel.open {
    left: 0; 
}

.help-panel h2 {
    margin-top: 0;
    color: #4CAF50; 
}

.help-panel p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.close-help-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #ccc;
    font-size: 28px; 
    font-weight: bold;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.close-help-button:hover {
    color: #fff;
}

/* Add to style.css */
.checkbox-wrapper {
    display: inline-block;
    margin: 0 10px;
    vertical-align: middle;
}
.checkbox-wrapper label {
    font-size: 0.9em;
    cursor: pointer;
    color: #ccc;
}
/* Pushes the footer to the bottom */
.help-content-top {
    margin-bottom: auto;
    overflow-y: auto; /* Allows just the text to scroll if screen is tiny */
}

/* Styling for the small patch notes at the bottom */
.help-footer-notes {
    border-top: 1px solid #666; /* A nice separating line */
    padding-top: 15px;
    margin-top: 10px;
    font-size: 0.75em; /* Smaller text as requested */
    color: #bbb;       /* Slightly darker/greyer text */
}

.help-footer-notes h3 {
    margin-top: 0;
    margin-bottom: 5px;
    color: #888;
    font-size: 1.1em;
}

.help-footer-notes ul {
    padding-left: 20px;
    margin: 0;
}
/* --- Timer Control Row --- */
/* --- Timer Control Row --- */
.timer-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;              /* Reduced from 10px */
    margin-bottom: 10px;   /* Reduced from 20px */
    flex-wrap: wrap; 
}

/* Specific style for the Start/Pause button to keep it big */
.main-start-btn {
    padding: 10px 25px;    /* Reduced padding */
    font-size: 1.1em;
    font-weight: bold;
    min-width: 100px;
}

/* Style for the adjustment buttons */
.adjust-btn {
    background-color: #555; 
    padding: 8px 12px;     /* Reduced padding */
    font-size: 0.85em;
    min-width: 50px;
}

.adjust-btn:hover {
    background-color: #666;
}
/* --- Game Mode Selector --- */
.gamemode-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;   /* Reduced from 15px */
    background-color: #2a2a2a;
    padding: 6px;          /* Reduced from 10px */
    border-radius: 8px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.gamemode-selector span {
    font-weight: bold;
    color: #4CAF50;
    margin-right: 10px;
}

.radio-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.radio-group input[type="radio"] {
    transform: scale(1.2);
    cursor: pointer;
}

.radio-group label {
    cursor: pointer;
}