/* Base styles */
html {
    overflow-y: auto; /* Allow scrolling for the whole page */
    background: #000428;
    background: -webkit-linear-gradient(to top, #004e92, #000428);
    background: linear-gradient(to top, #004e92, #000428);
    background-attachment: fixed;
}

body {
    font-family: 'Arial', sans-serif;
    color: #333;
    display: flex;
    flex-direction: column; /* Stack main container and history */
    align-items: center; /* Center containers horizontally */
    min-height: 100vh;
    margin: 0;
    position: relative;
    padding: 2em 1em;
    box-sizing: border-box;
}

/* --- Randomized Snow Effect --- */
@keyframes fall {
    from { transform: translateY(0); }
    to { transform: translateY(200vh); }
}

html::before, body::before, body::after {
    content: '';
    position: fixed; /* Use fixed to stay in place while page scrolls */
    left: 0;
    top: -100vh;
    width: 1px;
    height: 1px;
    background: white;
    border-radius: 50%;
    animation-name: fall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    z-index: -1; /* Make sure snow is behind content */
}

/* ... (Snow layer styles remain the same) ... */
body::after {
    --speed: 30s; --opacity: 0.7; opacity: var(--opacity);
    box-shadow: 73vw 15vh 0 0 white, 83vw 106vh 1px 1px white, 61vw 83vh 1px 1px white, 36vw 162vh 0 0 white, 2vw 4vh 1px 1px white, 13vw 181vh 0 0 white, 55vw 85vh 0 0 white, 85vw 123vh 1px 1px white, 43vw 19vh 0 0 white, 3vw 93vh 1px 1px white, 96vw 152vh 1px 1px white, 31vw 82vh 1px 1px white, 6vw 1vh 0 0 white, 58vw 127vh 1px 1px white, 43vw 9vh 0 0 white, 8vw 102vh 0 0 white, 25vw 55vh 0 0 white, 45vw 110vh 1px 1px white, 65vw 15vh 1px 1px white, 85vw 140vh 0 0 white, 5vw 75vh 1px 1px white, 95vw 95vh 0 0 white, 15vw 195vh 0 0 white, 50vw 135vh 1px 1px white;
    animation-duration: var(--speed);
}
body::before {
    --speed: 20s; --opacity: 0.8; width: 2px; height: 2px; opacity: var(--opacity); top: -100vh;
    box-shadow: 4vw 89vh 0 0 white, 77vw 109vh 0 0 white, 29vw 23vh 0 0 white, 87vw 122vh 0 0 white, 13vw 81vh 1px 1px white, 81vw 137vh 1px 1px white, 43vw 12vh 1px 1px white, 8vw 59vh 0 0 white, 64vw 146vh 0 0 white, 94vw 41vh 1px 1px white, 22vw 104vh 1px 1px white, 73vw 60vh 1px 1px white, 83vw 9vh 0 0 white, 2vw 193vh 0 0 white, 91vw 82vh 1px 1px white, 40vw 192vh 0 0 white, 19vw 33vh 1px 1px white, 49vw 177vh 0 0 white, 69vw 79vh 0 0 white, 89vw 29vh 1px 1px white, 39vw 141vh 1px 1px white, 59vw 12vh 0 0 white, 99vw 188vh 0 0 white, 9vw 155vh 1px 1px white;
    animation-duration: var(--speed);
}
html::before {
    --speed: 12s; --opacity: 1.0; width: 3px; height: 3px; opacity: var(--opacity); top: -100vh;
    box-shadow: 10vw 82vh 1px 1px white, 75vw 127vh 0 0 white, 25vw 13vh 0 0 white, 80vw 72vh 1px 1px white, 18vw 145vh 1px 1px white, 65vw 73vh 0 0 white, 93vw 130vh 1px 1px white, 33vw 40vh 0 0 white, 5vw 11vh 1px 1px white, 88vw 103vh 0 0 white, 23vw 92vh 1px 1px white, 68vw 108vh 1px 1px white, 48vw 182vh 0 0 white, 28vw 63vh 1px 1px white, 58vw 1vh 0 0 white, 78vw 150vh 1px 1px white;
    animation-duration: var(--speed);
}

/* --- Original Styles --- */
.container {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2em;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 90%;
    max-width: 400px;
    z-index: 1;
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
}

/* --- Previous Lotteries Section --- */
.previous-lotteries {
    margin-top: 2em;
    background-color: rgba(255, 255, 255, 0.8);
    max-height: none; /* Override the main container max-height */
}

#previous-lotteries-list {
    list-style-type: none;
    padding: 0;
    text-align: left;
}

#previous-lotteries-list li {
    background-color: #f9f9f9;
    padding: 0.75em;
    margin-top: 0.5em;
    border-radius: 5px;
}

#previous-lotteries-list a {
    text-decoration: none;
    color: #337ab7;
    font-weight: bold;
}

#clear-history-btn {
    background-color: #f0ad4e;
    width: 100%;
    margin-top: 1em;
}
#clear-history-btn:hover {
    background-color: #ec971f;
}

h1 {
    color: #d9534f;
    margin-bottom: 1em;
}

.input-section {
    display: flex;
    gap: 0.5em;
    margin-bottom: 1.5em;
}

#name-input {
    flex-grow: 1;
    padding: 0.8em;
    border: 1px solid #ccc;
    border-radius: 5px;
}

button {
    padding: 0.8em 1.2em;
    border: none;
    border-radius: 5px;
    background-color: #5cb85c;
    color: white;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #4cae4c;
}

#draw-names-btn, #reveal-btn {
    background-color: #d9534f;
    width: 100%;
}

#draw-names-btn:hover, #reveal-btn:hover {
    background-color: #c9302c;
}

.participants-section {
    margin-bottom: 1.5em;
}

h2 {
    color: #337ab7;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5em;
    margin-bottom: 0.5em;
}

#participants-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    max-height: 150px;
    overflow-y: auto;
}

#participants-list li {
    background-color: #f9f9f9;
    padding: 0.8em;
    margin-top: 0.5em;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.options-section {
    margin-bottom: 1.5em;
    text-align: left;
    font-size: 0.9em;
}

.options-section label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.options-section input {
    margin-right: 0.5em;
}

a.back-link {
    display: inline-block;
    margin-top: 1em;
    color: #337ab7;
    text-decoration: none;
}

a.back-link:hover {
    text-decoration: underline;
}

/* --- Admin Page Styles --- */
.link-entry {
    margin-bottom: 1em;
    text-align: left;
}

.link-entry strong {
    display: block;
    margin-bottom: 0.25em;
}

.input-wrapper {
    display: flex;
    align-items: center;
}

.input-wrapper input {
    flex-grow: 1;
    padding: 0.5em;
    border: 1px solid #ccc;
    border-radius: 5px 0 0 5px;
    background-color: #f9f9f9;
}

.copy-btn {
    background-color: #337ab7;
    border-radius: 0 5px 5px 0;
    padding: 0.5em 0.75em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background-color: #286090;
}

.copy-btn.copied {
    background-color: #5cb85c;
    font-size: 0.8em;
}
