/* General Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    background-color: #f0f2f5;
    padding: 40px 20px;
    box-sizing: border-box;
    overflow-y: auto;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Main wrapper for the game and controls */
.main-content-wrapper {
    display: flex;
    align-items: center;
    gap: 40px;
}

/* Main container for the game elements */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Wrapper for the canvas and pointer */
.wheel-wrapper {
    width: 90vw;
    max-width: 600px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    animation: wheel-glow 3s infinite ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

#wheelCanvas {
    width: 100%;
    height: 100%;
}

#logoImage {
    position: absolute;
    max-width: 25%;
    max-height: 25%;
    pointer-events: none;
    z-index: 5;
}

#wheel-pointer {
    position: absolute;
    left: 50%;
    top: -15px;
    width: 60px;
    height: auto;
    transform: translateX(-50%);
    z-index: 10;
    filter: drop-shadow(0 4px 2px rgba(0, 0, 0, 0.4));
}

#spinButton {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    color: white;
    background-color: #2b988e;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    animation: glow 2.5s infinite ease-in-out;
}

#spinButton:hover {
    background-color: #35b8aa;
}

.controls-container {
    width: 90vw;
    max-width: 400px;
    background-color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* MEDIA QUERY FOR MOBILE */
@media (max-width: 900px) {
    body { padding: 20px 10px; }
    .main-content-wrapper { flex-direction: column; gap: 20px; }
    .controls-container { max-width: 600px; }
    #winnerText { font-size: 24px; }
}

/* Standard Control Styles */
.controls-container h2 { text-align: center; margin-top: 0; color: #333; }
.controls-container label { font-weight: 500; color: #555; }
#nameInput { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 5px; font-family: inherit; font-size: 14px; box-sizing: border-box; }
.checkbox-wrapper { display: flex; align-items: center; gap: 10px; }
#removeWinnerCheckbox { width: 18px; height: 18px; }
.color-customizer-wrapper { display: flex; flex-direction: column; gap: 10px; }
.selected-colors { display: flex; gap: 10px; margin-bottom: 5px; }
.color-swatch { width: 40px; height: 40px; border-radius: 8px; cursor: pointer; border: 3px solid #ccc; transition: transform 0.2s ease, border-color 0.2s ease; }
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.active-swatch { border-color: #2980b9; transform: scale(1.1); }
.color-palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.palette-color { width: 100%; aspect-ratio: 1 / 1; border-radius: 5px; cursor: pointer; border: 1px solid rgba(0, 0, 0, 0.1); transition: transform 0.2s ease; }
.palette-color:hover { transform: scale(1.15); }
.text-color-picker { display: flex; flex-direction: column; gap: 10px; }
.text-color-options { display: flex; gap: 10px; }
.text-color-swatch { padding: 8px 16px; border: 2px solid #ccc; border-radius: 5px; cursor: pointer; font-weight: bold; color: #888; background-color: #f0f2f5; transition: all 0.2s ease; }
.text-color-swatch:hover { border-color: #888; }
.text-color-swatch.active-text-color { border-color: #2980b9; color: #fff; background-color: #2980b9; }
#fireworksCanvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 999; pointer-events: none; }
.config-manager button, #resetButton { padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer; color: white; font-size: 16px; font-weight: bold; transition: background-color 0.3s ease; }
.config-manager #saveConfigButton { background-color: #28a745; }
.config-manager #deleteConfigButton { background-color: #dc3545; }
#resetButton { background-color: #e74c3c; }
#resetButton:hover { background-color: #c0392b; }
#toggleControlsButton { position: fixed; top: 20px; right: 20px; padding: 10px 15px; font-size: 14px; font-weight: bold; color: #333; background-color: rgba(255, 255, 255, 0.8); border: 1px solid #ccc; border-radius: 8px; cursor: pointer; z-index: 100; }

/* Modal Styles */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); display: flex; justify-content: center; align-items: center; z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease-in-out; }
.modal-overlay.visible { opacity: 1; pointer-events: auto; }
.modal-content { background: white; padding: 40px 50px; border-radius: 16px; text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.2); transform: scale(0.9); transition: transform 0.3s ease-in-out; }
.modal-overlay.visible .modal-content { transform: scale(1); }
#winnerText { font-family: 'Poppins', sans-serif; font-size: 36px; }
#closeModalButton { padding: 15px 40px; font-family: 'Poppins', sans-serif; font-size: 18px; font-weight: 600; color: white; background-image: linear-gradient(to right, #2a9ff4, #41c352); border: none; border-radius: 10px; cursor: pointer; }

/* Animation Keyframes */
@keyframes glow { 0%, 100% { box-shadow: 0 0 10px #2b998e; } 50% { box-shadow: 0 0 25px #35b8aa; } }
@keyframes wheel-glow { 0%, 100% { box-shadow: 0 0 20px 5px rgba(255, 255, 255, 0.7); } 50% { box-shadow: 0 0 35px 15px rgba(167, 210, 232, 0.8); } }

/* UPDATED Instructions Modal Styles */
#instructionsButton { position: fixed; top: 20px; left: 20px; z-index: 100; padding: 10px 15px; font-size: 14px; font-weight: bold; color: #333; background-color: rgba(255, 255, 255, 0.8); border: 1px solid #ccc; border-radius: 8px; cursor: pointer; }

.instructions-content {
    text-align: left;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 0; /* Remove padding to allow image to be flush */
    overflow-x: hidden;
}

.instructions-header-img {
    width: 100%;
    display: block;
}

.instructions-text-wrapper {
    padding: 20px 40px 30px 40px;
    text-align: center;
}

.instructions-text-wrapper h2,
.instructions-text-wrapper h4,
.instructions-text-wrapper ul,
.instructions-text-wrapper p {
    text-align: left;
}

.instructions-text-wrapper h2 {
    text-align: center;
}

.instructions-text-wrapper h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #2b998e;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.instructions-text-wrapper ul {
    padding-left: 20px;
    margin: 0;
}

.instructions-text-wrapper li {
    margin-bottom: 10px;
}

.instructions-link {
    display: block;
    margin-top: 25px;
    margin-bottom: 25px;
    font-weight: bold;
    color: #2b998e;
    text-decoration: none;
}
.instructions-link:hover {
    text-decoration: underline;
}

#closeInstructionsButton {
    padding: 10px 30px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    background-color: #f0f2f5;
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
#closeInstructionsButton:hover { background-color: #fff; }

/* --- Lead Gen Form & Gating Styles --- */
.lead-gen-modal-content {
    max-width: 500px;
    text-align: left;
    padding: 0;
    padding-bottom: 30px;
    overflow: hidden;
    max-height: 85vh;
    overflow-y: auto;
}

.form-header-img {
    width: 100%;
    display: block;
}

.lead-gen-modal-content h3 {
    text-align: center;
    margin: 20px 0 10px 0;
    font-size: 24px;
    color: #333;
}

.lead-gen-modal-content p {
    text-align: center;
    margin: 0 30px 25px 30px;
    color: #666;
    line-height: 1.5;
}

#leadGenForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0 30px;
}

#leadGenForm label {
    font-weight: 600;
    font-size: 14px;
    color: #444;
    margin-bottom: -8px;
}

#leadGenForm input, #leadGenForm select {
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#leadGenForm input {
    padding: 12px;
}

#leadGenForm select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 12px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 1em;
}

#leadGenForm input:focus, #leadGenForm select:focus {
    outline: none;
    border-color: #2b988e;
    box-shadow: 0 0 8px rgba(43, 152, 142, 0.4);
}

#leadGenForm button {
    padding: 15px;
    margin-top: 10px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background-color: #2b988e;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    animation: glow 2.5s infinite ease-in-out;
}

#leadGenForm button:hover {
    background-color: #35b8aa;
}

#closeLeadGenButton {
    background: none;
    border: none;
    color: #2b998e;
    font-size: 12px;
    font-weight: normal;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    margin-top: 5px;
    animation: none;
    transition: color 0.2s ease;
}
#closeLeadGenButton:hover {
    background-color: transparent;
    color: #248279;
}

.a2p-checkbox-wrapper {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 10px;
    margin-top: 5px;
}

.a2p-checkbox-wrapper input {
    width: auto;
    margin-top: 4px;
}

.a2p-checkbox-wrapper label {
    font-weight: normal;
    font-size: 12px;
    color: #555;
    line-height: 1.4;
}

#gatedFeaturesContainer.locked {
    opacity: 0.4;
    filter: grayscale(80%);
}


/* Footer Styles */
footer { position: fixed; bottom: 0; left: 0; width: 100%; padding: 10px 0; background-color: rgba(0, 0, 0, 0.75); color: #ccc; text-align: center; font-size: 14px; z-index: 50; }
footer a { color: #fff; text-decoration: none; margin: 0 10px; }
footer a:hover { text-decoration: underline; }