/* Basic Reset & Full Height Setup */
html {
    height: 100%;
    box-sizing: border-box;
}
*, *:before, *:after {
    box-sizing: inherit;
}

body {
    margin: 0;
    min-height: 100%;
    padding: 20px; /* Add padding around the centered container */
    /* Beat Saber Gradient Background */
    background: linear-gradient(135deg, #df1c44, #202845); /* Red to Blue/Purple */
    background-attachment: fixed; /* Keep gradient fixed during scroll */
}

/* The main container for the roller content */
#roller-container {
    max-width: 650px;
    margin: 0 auto; /* Center the container horizontally */
    padding: 20px;
    background-color: #ffffff; /* White background for the roller */
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25); /* Add shadow for depth */
    /* Font styles moved from body */
    font-family: sans-serif;
    line-height: 1.6;
}


/* Keep all the previous styles for elements *inside* the roller */
/* They will now apply relative to #roller-container */

.header-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 15px;
}

h1 {
    text-align: center;
    color: #333;
    margin: 0;
    flex-grow: 1;
    padding-right: 50px; /* Space for the button */
}

#settingsToggleBtn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px 8px;
    line-height: 1;
    color: #555;
}
#settingsToggleBtn:hover {
    background-color: #eee;
}

/* Settings Panel - Hidden by default */
#settingsPanel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, border-bottom-color 0.4s ease-out, margin-bottom 0.4s ease-out;
    border-bottom: 1px solid transparent;
    margin-bottom: 0;
}

#settingsPanel.visible {
    max-height: 700px; /* Increased height */
    overflow: visible;
    border-bottom-color: #ccc;
    margin-bottom: 20px;
    transition: max-height 0.4s ease-in, border-bottom-color 0.4s ease-in, margin-bottom 0.4s ease-in;
}

#settingsArea {
    padding: 15px;
    border: 1px solid #ccc;
    border-top: none; /* Remove top border as it duplicates panel border */
    border-radius: 0 0 5px 5px; /* Rounded bottom corners */
    background-color: #f8f8f8; /* Slightly off-white */
}

#settingsArea h2 {
    margin-top: 0;
    text-align: center;
    color: #333;
    margin-bottom: 15px;
}

#settingsArea fieldset {
    margin-bottom: 15px;
    border: 1px solid #ddd; /* Lighter border */
    padding: 10px 15px;
    background-color: #ffffff; /* White fieldsets */
    border-radius: 3px;
}

#settingsArea legend {
    font-weight: bold;
    padding: 0 5px;
    color: #444;
}

/* Pack Checkbox Specifics */
.pack-controls {
    margin-bottom: 10px;
    text-align: right;
}
.pack-controls button {
    margin-left: 5px;
    padding: 3px 8px;
    font-size: 0.9em;
    cursor: pointer;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    border-radius: 3px;
}
.pack-controls button:hover {
    background-color: #e0e0e0;
}


#packCheckboxes {
    max-height: 220px; /* Adjusted height */
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #ccc;
    background-color: #fff;
    margin-bottom: 10px;
    border-radius: 3px;
}

#packCheckboxes div {
    margin-bottom: 6px;
    display: block;
}
#packCheckboxes input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
}
#packCheckboxes label {
    vertical-align: middle;
    cursor: pointer;
    font-size: 0.95em; /* Slightly smaller font */
}

/* General Filter Inputs */
#settingsArea fieldset div:not(#packCheckboxes):not(.pack-controls) {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

#settingsArea label:not(#packCheckboxes label) {
    display: inline-block;
    margin-right: 8px;
    min-width: 100px; /* Adjusted width */
    text-align: right;
    font-size: 0.95em;
    color: #333;
}

#settingsArea input[type="number"],
#settingsArea select {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    flex-grow: 1;
    font-size: 0.95em;
}


/* Action Buttons Container */
.action-buttons {
    display: flex;
    justify-content: center; /* Center buttons */
    align-items: center;
    gap: 15px; /* Space between buttons */
    margin: 20px auto; /* Vertical margin */
}

/* Roll Button */
#rollButton {
    /* margin is now handled by the container */
    display: block;
    padding: 12px 25px;
    font-size: 1.1em;
    cursor: pointer;
    background-color: #5c67f2; /* Blue */
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

#rollButton:hover {
    background-color: #4a54c4;
}

/* Style for the Refresh Button */
#refreshButton {
    padding: 10px 12px;
    font-size: 1.3em;
    cursor: pointer;
    background-color: #f0f0f0;
    color: #555;
    border: 1px solid #ccc;
    border-radius: 5px;
    line-height: 1;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

#refreshButton:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
}


/* Result Area */
#resultArea {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9; /* Slightly different bg */
    border: 1px solid #ddd;
    border-radius: 5px;
}

#resultArea h2 {
    margin-top: 0;
    text-align: center;
    color: #333;
    margin-bottom: 10px;
}

#resultArea p {
    margin: 8px 0;
    font-size: 1.1em;
}

#resultArea span {
    font-weight: normal;
    color: #555;
}