/*================================================================================*/
/* 1. THEME & GLOBAL STYLES
/*================================================================================*/

:root {
    --bg-color: #0e0b16;
    --surface-color: #1f1f23;
    --surface-light-color: #2a2a2e;
    --primary-color: #7c3aed;
    --primary-hover-color: #9146ff;
    --text-color: #efeff1;
    --text-muted-color: #adadb8;
    --border-color: #404040;
    --shadow-color: rgba(124, 58, 237, 0.4);
    --success-color: #16a34a;
    --danger-color: #ef4444;
    --heading-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

html[data-theme='light'] {
    --bg-color: #f7f7f8;
    --surface-color: #ffffff;
    --surface-light-color: #f0f0f0;
    --primary-color: #7c3aed;
    --primary-hover-color: #6d28d9;
    --text-color: #0e0b16;
    --text-muted-color: #53535f;
    --border-color: #dedee3;
    --shadow-color: rgba(124, 58, 237, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover-color);
}

.hidden {
    display: none !important;
}


/*================================================================================*/
/* 2. LAYOUT & CORE COMPONENTS
/*================================================================================*/

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.form-container {
    background-color: var(--surface-color);
    padding: 2rem 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 450px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.dashboard-section {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}


/*================================================================================*/
/* 3. HEADER & NAVIGATION                                                         */
/*================================================================================*/
.main-header {
    border-bottom: 1px solid var(--primary-color);
    position: relative;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.logo a,
.logo h3 {
    font-size: 1.5rem;
    align-items: center;
    color: var(--text-color);
}
.logo img {
    height: 100px;
    display: block;
    margin: 0 auto;
}

.logo a:hover {
  color: var(--text-color);
}
.main-nav a {
    margin: 0 1rem;
    font-weight: 500;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-actions a.button {
    margin-left: 0.5rem;
}

.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
}


@media (min-width: 769px) {

    .main-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .logo {
        order: 1;
        margin: 0 auto;
    }

    .main-nav {
        order: 2;
        display: flex;
        justify-content: center;
        width: 100%;
        text-align: center;
        font-size: 1.15rem;
    }

    .user-actions {
        order: 2;
        margin-left: auto;
        margin-right: 2rem;
        transform: translateY(-55px);
        position: relative;
    }

    .mobile-nav-toggle {
        display: none !important;
    }
}


@media (max-width: 768px) {

    .main-header {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .logo {
        order: 1;
        margin-bottom: 0.5rem;
    }

    .mobile-nav-toggle {
        position: static !important;
        display: block !important;
        order: 2 !important;
        margin-bottom: 0.5rem;
    }

    .main-nav {
        order: 3;
        display: flex;
        justify-content: center;
        margin-bottom: 0.5rem;
    }

    .user-actions {
        order: 4;
        justify-content: center;
        width: 100%;
        margin-top: 0.75rem;
    }
}

.return-home-btn {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 0.95rem;
    text-decoration: none;
    transition: 0.25s ease;
    backdrop-filter: blur(6px);
}

.return-home-btn:hover {
    background: var(--primary-color);
    color: #fff;
}

@media(max-width: 768px) {
    .return-home-btn {
        position: static;
        transform: none;
        margin-bottom: 0.5rem;
        order: 0;
    }
}

/* StreamJuice Mini Logo Chip */
.sj-chip {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;

    padding: 6px 12px;
    background: rgba(120, 70, 255, 0.15);
    border: 1px solid var(--primary-color);
    border-radius: 999px;

    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;

    transition: 0.25s ease;
    backdrop-filter: blur(6px);
}

/* Mini logo */
.sj-chip-logo {
    height: 18px;
    width: 18px;
    object-fit: contain;
    display: block;
}

/* Hover animation */
.sj-chip:hover {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 10px var(--primary-color);
}

.sj-chip:hover .sj-chip-logo {
    filter: brightness(1.2);
}

/* Mobile placement */
@media(max-width: 768px) {
    .sj-chip {
        position: static;
        transform: none;
        margin: 0.5rem;
        order: 0;
      width: 90%;
      
    }
}

/*================================================================================*/
/* 4. FORMS & BUTTONS
/*================================================================================*/

.button {
    background-color: var(--surface-light-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-weight: 500;
    text-decoration: none;
}

.button.primary {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.button.small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.button.danger {
    background-color: #e74c3c;
    color: #ffffff;
    border-color: #e74c3c;
}

.button.danger:hover {
    background-color: #c0392b;
    border-color: #c0392b;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 6px;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--shadow-color);
}

.form-message {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 6px;
    text-align: center;
}

.form-message.success {
    background-color: var(--success-color);
    color: white;
}

.form-message.error {
    background-color: var(--danger-color);
    color: white;
}

.form-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-container p {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-muted-color);
}

/* --- Theme Toggle Switch --- */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.theme-switch-wrapper .fa-sun,
.theme-switch-wrapper .fa-moon {
    margin: 0 0.5rem;
    font-size: 1.2rem;
    color: var(--text-muted-color);
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 48px;
}

.theme-switch input {
    display: none;
}
.toggle-wrapper {
    position: absolute; /* Positioned relative to the .form-group */
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
}

.toggle-wrapper label {
    margin: 0;
    cursor: pointer;
    padding-right: 0.5rem;
    font-size: 0.8rem;
    color: #a0aec0;
}

.toggle-box {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

.toggle-box input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    background-color: #53535f;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 16px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 16px;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(24px);
}


.form-group.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}


.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #6c757d;
    transition: .4s;
}


.switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}


.switch input:checked + .slider {
    background-color: #9146ff;
}

.switch input:focus + .slider {
    box-shadow: 0 0 1px #9146ff;
}

.switch input:checked + .slider:before {
    transform: translateX(22px);
}


.switch .slider.round {
    border-radius: 28px;
}

.switch .slider.round:before {
    border-radius: 50%;
}
#muteBtn {
  background: none;
  border: none; 
  cursor: pointer;
  padding: 0 10px;
  font-size: 1.2rem;
  color: var(--text-secondary);
  transition: transform 0.2s ease, color 0.2s ease;
  vertical-align: middle;
}

#muteBtn:hover {
  transform: scale(1.15);
  color: var(--text-primary);
}
/*================================================================================*/
/* 5. PAGE-SPECIFIC: WHEEL
/*================================================================================*/

.wheel-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    width: 100%;
    max-width: 1400px;
}

.wheel-column {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    clip-path: circle(50%);
    overflow: hidden;
}

#wheelCanvas {
    width: 700px;
    height: 700px;
    position: relative;
    z-index: 1;
}

#wheelBackground {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: circle(50%);
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    z-index: 0;
}

#centerImage {
    position: absolute;
    width: 21.5%;
    height: 21.5%;
    max-width: 150px;
    max-height: 150px;
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    background-color: var(--surface-color);
}

#centerImage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#placeholderText {
    position: absolute;
    z-index: 6;
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    text-align: center;
    max-width: 80%;
}

#pointer {
    position: absolute;
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-top: 40px solid rgba(255, 0, 0, 0.6);
    left: 50%;
    top: -1px;
    transform: translateX(-50%);
    z-index: 10;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}

.controls-column {
    display: flex;
    flex-direction: column;
    width: 350px;
    justify-content: space-between;
}

textarea#nameInput {
    background-color: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 100%;
    height: 400px;
    padding: 1rem;
    resize: none;
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea#nameInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--shadow-color);
}

.button-group {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1.5rem;
}

button#spinBtn,
.submit-btn {
    flex-grow: 1;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.2s, transform 0.1s;
}

.form-group.disabled {
    opacity: 0.5;
    pointer-events: none;
}

button#spinBtn:hover:not(:disabled),
.submit-btn:hover {
    background-color: var(--primary-hover-color);
    transform: translateY(-2px);
}

button#spinBtn:disabled {
    background-color: #53535f;
    color: #adadb8;
    cursor: not-allowed;
    transform: none;
}

#resetLink {
    font-size: 1rem;
    color: var(--text-muted-color);
}

#resetLink:hover {
    color: var(--danger-color);
}

#wheelStatus {
    margin-top: 1rem;
    padding: 0.75rem;
    text-align: center;
    font-weight: bold;
    border-radius: 8px;
    color: white;
    border: 1px solid;
}

#wheelStatus.active {
    background-color: var(--success-color);
    border-color: var(--success-color);
    cursor: pointer;
}

#wheelStatus.inactive {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    cursor: pointer;
}

#wheelStatus.disabled-link {
    background-color: #53535f;
    border-color: #53535f;
    cursor: not-allowed;
}


/*================================================================================*/
/* 6. PAGE-SPECIFIC: DASHBOARD
/*================================================================================*/

.dashboard-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 1600px;
}
.dashboard-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: -1.5rem;
}

.dashboard-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 1024px) {
    .dashboard-grid-layout {
        grid-template-columns: repeat(3, 1fr);
    }
    .dashboard-column:first-child {
        grid-column: span 2;
    }
}

.dashboard-section h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.description {
    color: var(--text-muted-color);
    margin-bottom: 1.5rem;
}

.dashboard-section textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-color);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 130px;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.dashboard-section #msg-alert_text_message textarea{
    max-height: 50px;
    min-height: 1px;
}

.dashboard-section textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--shadow-color);
}

.dashboard-section .example-message {
    font-size: 0.875rem;
    color: var(--text-muted-color);
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.dashboard-section select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--surface-light-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-color);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.dashboard-section select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--shadow-color);
}

#color-pickers-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.color-picker-wrapper input[type="color"] {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.color-picker-wrapper .button {
    flex-grow: 0.6;
}

input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: transparent;
    border: none;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch {
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

input[type="color"]::-moz-color-swatch {
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.color-customization-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
}

.color-customization-layout>.form-group {
    flex: 1;
    min-width: 300px;
}

#floating-preview {
    position: fixed;
    width: 300px;
    height: 300px;
    background-color: var(--surface-color);
    border-radius: 50%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    pointer-events: none;
    
    /* MODIFIED: Set visibility and transform for a smoother transition */
    visibility: hidden;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out, transform 0.2s ease-in-out;
}

#floating-preview.visible {
    visibility: visible;
    opacity: 1;
    transform: scale(1);
}

/* The new container handles the grid/flex layout */
.wheel-and-hint-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1; /* Moved from #color-preview-wheel-wrapper */
    min-width: 300px; /* Moved from #color-preview-wheel-wrapper */
}

/* The wheel wrapper is now simpler */
#color-preview-wheel-wrapper {
    position: relative;
    width: 300px; /* Set a fixed size */
    height: 300px;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease;
    z-index: 10;
}

/* On desktop, allow the zoom effect */
@media (min-width: 768px) {
    #color-preview-wheel-wrapper {
        overflow: visible;
        will-change: transform;
    }
}

/* This is the hint text, now positioned correctly */
.wheel-zoom-hint {
    position: absolute;
    bottom: 100%; /* Position above the container */
    margin-bottom: 8px; /* Add a small gap */
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 10px;
    font-size: 0.75rem;
    color: var(--text-color-secondary);
    background: rgba(var(--surface-color-rgb), 0.7);
    border-radius: 12px;
    width: max-content;
    z-index: 20; /* High z-index to ensure it's on top */
    pointer-events: none;
    transition: opacity 0.3s ease; /* Add a fade effect */
    display: none; /* Hide on mobile by default */
}

/* Show on desktop */
@media (min-width: 768px) {
    .wheel-zoom-hint {
        display: block;
    }
}
#color-preview-wheel-wrapper.zoomed-in {
    transform: scale(2.333);
    z-index: 1000;
}

#previewBackground {
    clip-path: circle(50%);
}
#previewBackground,
#colorPreviewCanvas,
#centerImagePreview {
    position: absolute;
    top: 50%;
    left: 50%;
}

#previewBackground {
    width: 300px;
    height: 300px;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    z-index: 1;
}

#colorPreviewCanvas {
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%);
    z-index: 2;
}

#centerImagePreview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    pointer-events: none;
    z-index: 3;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
    background-color: var(--surface-color);
}

#centerImagePreview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.command-input {
    position: relative;
    display: flex;
    align-items: center;
}

.command-input .char-counter-wrapper {
    margin-top: 0;
    position: absolute;
    top: 10px; 
    right: 5px;
    width: 28px;
    height: 28px;
    z-index: 2;
}

.command-input .command-prefix {
    padding: 0.75rem 1rem;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: var(--text-muted-color);
    font-weight: bold;
    font-size: 1rem;
}

.command-input input[type="text"] {
    border-radius: 0 8px 8px 0;
    flex-grow: 1;
}

.command-input input[type="text"]:focus {
    z-index: 2;
}

.command-input input[type="text"]:focus+.command-prefix,
.command-input:focus-within .command-prefix {
    border-color: var(--primary-color);
    z-index: 2;
}

.account-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.account-actions .button {
    width: 100%;
    text-align: center;
}

input.is-valid {
    border-color: #4CAF50;
}

input.is-invalid {
    border-color: #F44336;
}

.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: #999;
    margin-top: 5px;
    height: 1em;
    transition: color 0.2s ease-in-out;
}

.char-counter-wrapper {
    position: relative;
    width: 32px;
    height: 32px;
    float: right;
    margin-top: -38px;
    margin-right: 5px;
}

.counter-svg {

    width: 100%;
    height: 100%;
}

.counter-circle-bg,
.counter-circle-progress {
    fill: none;
    stroke-width: 3;
}


.counter-circle-bg {
    stroke: #eee;
}

.counter-circle-progress {
    stroke: #4CAF50; 
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s ease, stroke 0.3s ease; 
}


.counter-text {
    font-size: 6px;
    font-weight: bold;
    fill: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.modal-content #password-strength-meter {
    height: 8px;
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.modal-content #password-strength-bar {
    height: 100%;
    width: 0; /* JS will override this inline style */
    transition: width 0.4s ease, background-color 0.4s ease;
}

#password-match-indicator {
    font-size: 0.9rem;
    margin-top: 8px;
    font-weight: bold;
}

.match {
    color: var(--success-color, #4CAF50);
}

.no-match {
    color: var(--danger-color, #F44336);
}

#color_opacity, #text-stroke-width, #text-glow-amount, #font-size, #alert_font_size, #alert_width, #alert_height, #alert_border_width, #alert_border_radius, #alert_box_glow_radius, #spin_duration, #winner_announce_delay, .survey-scale-input, #wo-font-size, #wo-stroke-width, #wo-glow-amount, #wo-av-size, #wo-intensity-amount {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 5px;
    outline: none;
    opacity: 0.9;
    transition: opacity .2s;
}

#color_opacity:hover, #text-stroke-width:hover, #text-glow-amount:hover, #font-size:hover, #alert_font_size:hover, #alert_width:hover, #alert_height:hover, #alert_border_width:hover, #alert_border_radius:hover, #alert_box_glow_radius:hover, #spin_duration:hover, #winner_announce_delay:hover, .survey-scale-input:hover, #wo-stroke-width:hover, #wo-glow-amount:hover, #wo-av-size:hover, #wo-intensity-amount:hover {
    opacity: 1;
}

#color_opacity::-webkit-slider-thumb, #text-stroke-width::-webkit-slider-thumb, #text-glow-amount::-webkit-slider-thumb, #font-size::-webkit-slider-thumb, #alert_font_size::-webkit-slider-thumb, #alert_width::-webkit-slider-thumb, #alert_height::-webkit-slider-thumb, #alert_border_width::-webkit-slider-thumb, #alert_border_radius::-webkit-slider-thumb, #alert_box_glow_radius::-webkit-slider-thumb, #spin_duration::-webkit-slider-thumb, #winner_announce_delay::-webkit-slider-thumb, .survey-scale-input::-webkit-slider-thumb, #wo-font-size::-webkit-slider-thumb, #wo-stroke-width::-webkit-slider-thumb, #wo-glow-amount::-webkit-slider-thumb, #wo-av-size::-webkit-slider-thumb, #wo-intensity-amount::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color, #7c3aed);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--surface-color);
    box-shadow: 0 0 4px rgba(0,0,0,0.4);
}

#color_opacity::-moz-range-thumb, #text-stroke-width::-moz-range-thumb, #text-glow-amount::-moz-range-thumb, #font-size::-moz-range-thumb, #alert_font_size::-moz-range-thumb, #alert_width::-moz-range-thumb, #alert_height::-moz-range-thumb, #alert_border_width::-moz-range-thumb, #alert_border_radius::-moz-range-thumb, #alert_box_glow_radius::-moz-range-thumb, #spin_duration::-moz-range-thumb, #winner_announce_delay::-moz-range-thumb, .survey-scale-input::-moz-range-thumb, #wo-font-size::-moz-range-thumb, #wo-stroke-width::-moz-range-thumb, #wo-glow-amount::-moz-range-thumb, #wo-av-size::-moz-range-thumb, #wo-intensity-amount::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-color, #7c3aed);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--surface-color);
    box-shadow: 0 0 4px rgba(0,0,0,0.4);
}

.color-customization-layout {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}


.dashboard-section .choices__inner {
    background-color: var(--surface-light-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem !important;
    font-size: 1rem;
    color: var(--text-color);
    min-height: auto;
}

.dashboard-section .is-focused .choices__inner {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--shadow-color);
}


.dashboard-section .choices__list--dropdown.is-active {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.dashboard-section .choices__item--choice {
    color: var(--text-muted-color);
    padding: 0.75rem 1rem !important;
}

.dashboard-section .choices__item--choice.is-highlighted {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.dashboard-section .choices__item.is-selected {
    color: var(--text-color);
}

#text-color, #text-stroke-color, #text-glow-color, #alert_bg_color, #alert_text_color, #alert_highlight_color, #alert_box_glow_color, #alert_border_color, #wo-font-color, #wo-stroke-color, #wo-glow-color, #wo-bg-color {
    width: 100%; /* Make it fill the available space */
    height: 45px;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px;
    padding: 5px; /* Add some padding around the swatch */
    background-color: var(--surface-light-color);
}
#text-color::-webkit-color-swatch, #text-stroke-color::-webkit-color-swatch, #text-glow-color::-webkit-color-swatch, #alert_bg_color::-webkit-color-swatch, #alert_text_color::-webkit-color-swatch, #alert_highlight_color::-webkit-color-swatch, #alert_box_glow_color::-webkit-color-swatch, #alert_border_color::-webkit-color-swatch, #wo-font-color::-webkit-color-swatch, #wo-stroke-color::-webkit-color-swatch, #wo-glow-color::-webkit-color-swatch, #wo-bg-color::-webkit-color-swatch  {
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
#text-color::-moz-color-swatch, #text-stroke-color::-moz-color-swatch, #text-glow-color::-moz-color-swatch, #alert_bg_color::-moz-color-swatch, #alert_text_color::-moz-color-swatch, #alert_highlight_color::-moz-color-swatch, #alert_box_glow_color::-moz-color-swatch, #alert_border_color::-moz-color-swatch, #wo-font-color::-moz-color-swatch, #wo-stroke-color::-moz-color-swatch, #wo-glow-color::-moz-color-swatch, #wo-bg-color::-moz-color-swatch  {
    border: 1px solid var(--border-color);
    border-radius: 4px;
}
/*================================================================================*/
/* 7. MODALS & OVERLAYS
/*================================================================================*/
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal.hidden {
  display: none;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--surface-color);
    padding: 2rem 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 450px;
    position: relative;
}

.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-muted-color);
    cursor: pointer;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #53535f;
    transition: .4s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: var(--primary-color);
}

input:disabled+.toggle-slider {
    background-color: #333;
    cursor: not-allowed;
}

input:checked+.toggle-slider:before {
    transform: translateX(24px);
}

#winnerOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1001;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#winnerOverlay.show {
    visibility: visible;
    opacity: 1;
}

#winnerName {
    font-size: 4rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 15px var(--primary-color), 0 0 30px var(--primary-hover-color);
    animation: pulse 1.5s ease-in-out infinite;
}

#closeOverlay {
    margin-top: 3rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    background: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    visibility: hidden;
    opacity: 0;
    transition: opacity 1s ease, background-color 0.2s;
}

#closeOverlay.show {
    visibility: visible;
    opacity: 1;
}

#closeOverlay:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

#fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
    z-index: 1002;
}

.firework {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    opacity: 1;
    pointer-events: none;
    z-index: 1002;
}

#wheel-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1003;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 0;
}

.settings-modal-content {
    background-color: var(--surface-color);
    color: var(--text-color);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.settings-modal-content h2 {
    margin-bottom: 1.5rem;
}

.settings-modal-content .form-group {
    margin-bottom: 1rem;
}

.settings-modal-content .form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.settings-modal-content .form-group input {
    width: 100%;
    padding: 0.5rem;
}

.settings-modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

#start-wheel-btn {
    background-color: var(--success-color);
    color: white;
}

#stop-wheel-btn {
    background-color: var(--danger-color);
    color: white;
}

.alert-editor-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    align-items: start;
    margin-top: 1.5rem;
}

.alert-controls-column h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}
.alert-controls-column h4:first-child { margin-top: 0; }

.alert-customization-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.alert-preview-column {
    margin-top: 2.5rem;
}
#wheel-customization-form h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}
#alert-preview-container {
    display: flex;
    min-height: 250px;
    background-color: var(--background-alt-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    overflow: hidden;
    background-image: linear-gradient(45deg, var(--surface-color) 25%, transparent 25%), 
                      linear-gradient(-45deg, var(--surface-color) 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, var(--surface-color) 75%), 
                      linear-gradient(-45deg, transparent 75%, var(--surface-color) 75%);
    background-size: 20px 20px;
    transition: justify-content 0.3s ease, align-items 0.3s ease;
}

/* --- NEW: Positioning Classes --- */
#alert-preview-container.pos-top-left { justify-content: flex-start; align-items: flex-start; }
#alert-preview-container.pos-top-center { justify-content: center; align-items: flex-start; }
#alert-preview-container.pos-top-right { justify-content: flex-end; align-items: flex-start; }
#alert-preview-container.pos-bottom-left { justify-content: flex-start; align-items: flex-end; }
#alert-preview-container.pos-bottom-center { justify-content: center; align-items: flex-end; }
#alert-preview-container.pos-bottom-right { justify-content: flex-end; align-items: flex-end; }

#live-alert-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    padding: 0 1.5rem;
    transition: all 0.2s ease-in-out;
    opacity: 1;
    transform: none;
}

#live-alert-preview .preview-username { font-weight: 700; }

#live-alert-preview.is-animating {
    animation-duration: 6s;
    animation-fill-mode: forwards;
}

/* Keyframes remain the same */
@keyframes slide-in-left-out { 0%, 100% { transform: translateX(-110%); opacity: 0; } 10%, 90% { transform: translateX(0); opacity: 1; } }
@keyframes slide-in-right-out { 0%, 100% { transform: translateX(110%); opacity: 0; } 10%, 90% { transform: translateX(0); opacity: 1; } }
@keyframes slide-in-up-out { 0%, 100% { transform: translateY(110%); opacity: 0; } 10%, 90% { transform: translateY(0); opacity: 1; } }
@keyframes fade-in-down-out { 0%, 100% { opacity: 0; transform: translate3d(0, -100%, 0); } 10%, 90% { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes zoom-in-out { 0%, 100% { opacity: 0; transform: scale3d(0.3, 0.3, 0.3); } 10%, 90% { opacity: 1; transform: scale3d(1, 1, 1); } }
@keyframes bounce-in-out { 0%, 100% { opacity: 0; } 0% { transform: scale3d(0.3, 0.3, 0.3); } 10% { transform: scale3d(1.1, 1.1, 1.1); } 12% { transform: scale3d(0.9, 0.9, 0.9); } 15% { opacity: 1; transform: scale3d(1.03, 1.03, 1.03); } 17% { transform: scale3d(0.97, 0.97, 0.97); } 20%, 90% { opacity: 1; transform: scale3d(1, 1, 1); } }
@keyframes rubber-band-out { 0%, 100% { opacity: 0; } 0% { transform: scale3d(1, 1, 1); } 5% { transform: scale3d(1.25, 0.75, 1); } 7% { transform: scale3d(0.75, 1.25, 1); } 10% { transform: scale3d(1.15, 0.85, 1); } 12% { transform: scale3d(0.95, 1.05, 1); } 15% { transform: scale3d(1.05, 0.95, 1); } 20%, 90% { opacity: 1; transform: scale3d(1, 1, 1); } }

.join-alert-preview.animate-slide-in-out {
    animation: slide-in-out 4s ease-in-out 1;
}
.join-alert-preview.animate-fade-in-out {
    animation: fade-in-out 4s ease-in-out 1;
}
.join-alert-preview.animate-bounce-in-down {
    animation: bounce-in-down 4s ease-in-out 1;
}
/*================================================================================*/
/* 8. FOOTER & COOKIE UI
/*================================================================================*/

.main-footer {
    background-color: var(--surface-color);
    padding: 1.5rem 2rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted-color);
}

.footer-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.footer-nav a {
    margin: 0 0.75rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .footer-nav {
        flex-direction: column;
    }
    
    .footer-nav a {
        margin: 0.5rem 0;
        white-space: normal;
    }
}

#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.5s ease-in-out;
}

#cookie-banner.show {
    transform: translateY(0);
}

.cookie-text {
    max-width: 60%;
}

.cookie-actions button {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    margin-left: 1rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

#cookie-customize-btn {
    background-color: var(--surface-light-color);
    color: var(--text-color);
}

#cookie-accept-all-btn {
    background-color: var(--primary-color);
    color: white;
}

#cookie-prefs-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1003;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 5vh;
}

.cookie-modal-content {
    position: relative;
    background-color: var(--surface-color);
    color: var(--text-color);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    max-height: 85vh;
    overflow-y: auto;
}

.support-modal-content {
    position: relative;
    background-color: var(--surface-color);
    color: var(--text-color);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    max-height: 85vh;
    overflow-y: auto;
    animation: dropBounce 0.5s ease-in-out;
}

.cookie-modal-content h2 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.cookie-modal-content p {
    margin-bottom: 1.5rem;
    color: var(--text-muted-color);
    line-height: 1.6;
}

.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-muted-color);
    cursor: pointer;
    line-height: 1;
}

.close-modal-btn:hover {
    color: var(--text-color);
}

.cookie-category {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.cookie-category label {
    font-weight: bold;
}

.modal-actions {
    text-align: right;
    margin-top: 1.5rem;
}

#cookie-save-prefs-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}


/*================================================================================*/
/* 9. ANIMATIONS & KEYFRAMES
/*================================================================================*/

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes dropBounce {
  0% {
    opacity: 0;
    transform: translateY(-100px);
  }
  60% {
    opacity: 1;
    transform: translateY(10px);
  }
  100% {
    transform: translateY(0);
  }
}
/*================================================================================*/
/* 10. RESPONSIVE MEDIA QUERIES
/*================================================================================*/

@media (max-width: 1100px) {
    .wheel-layout {
        flex-direction: column;
        gap: 2rem;
    }
    .wheel-column {
        width: 100%;
        max-width: 500px;
    }
    #wheelCanvas {
        width: 100%;
        height: auto;
    }
    .controls-column {
        width: 100%;
        max-width: 500px;
    }
    textarea#nameInput {
        height: 250px;
    }
}

@media (max-width: 850px) {
    .mobile-nav-toggle {
        display: block;
    }
    .main-nav,
    .user-actions {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        background-color: var(--surface-color);
        z-index: 1000;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }
    .main-nav.nav-visible,
    .user-actions.nav-visible {
        transform: translateX(0);
    }
    .main-nav {
        width: 70%;
        max-width: 300px;
        padding: 6rem 2rem 2rem;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    .main-nav a {
        font-size: 1.2rem;
        margin: 0;
    }
    .user-actions {
        transform: translateX(200%);
        width: 70%;
        max-width: 300px;
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 2rem;
        gap: 1.5rem;
        top: auto;
        bottom: 0;
        height: auto;
        border-top: 1px solid var(--border-color);
    }
    .user-actions.nav-visible {
        transform: translateX(0);
    }
    .user-actions .theme-switch-wrapper {
        width: 100%;
        justify-content: space-between;
    }
    #user-actions-links,
    #anonymous-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }
    .user-actions a.button {
        margin: 0;
        text-align: center;
    }
}

@media (max-width: 600px) {
    #cookie-banner {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    .cookie-actions {
        width: 100%;
        justify-content: center;
    }
    .cookie-actions button {
        flex-grow: 1;
    }
}
/*================================================================================*/
/* 11. BLOG PAGE STYLES
/*================================================================================*/

.blog-container {
    padding: 2rem;
    max-width: 1500px;
    margin: 0 auto;
}

.blog-header {
    text-align: center;
    margin-bottom: 2rem;
}

.blog-header h1 {
    font-family: var(--heading-font);
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.intro-text {
    color: var(--text-muted-color);
}

.blog-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.search-bar input,
.sort-options select {
    background-color: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.search-bar input:focus,
.sort-options select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

@media (max-width: 1024px) {
    .blog-posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

.post-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    font-size: 1.5rem;
    font-family: var(--heading-font);
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.card-content p {
    font-size: 0.9rem;
    color: var(--text-muted-color);
    line-height: 1.5;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination-controls button {
    background-color: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.pagination-controls button.active,
.pagination-controls button:hover {
    background-color: var(--primary-color);
    color: white;
}

#single-post-view.hidden {
    display: none;
}

.back-to-blog-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted-color);
    text-decoration: none;
    font-weight: bold;
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.back-to-blog-btn:hover {
    color: var(--primary-color);
}

.post-content-wrapper {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

#post-title {
    font-size: 3rem;
    font-family: var(--heading-font);
    text-align: center;
    margin-bottom: 1.5rem;
}

.post-featured-image {
    width: 100%;
    margin-bottom: 2rem;
    text-align: center;
}

.post-featured-image img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
}

#post-article-content {
    line-height: 1.8;
    color: var(--text-color);
    font-size: 1.1rem;
}

#post-article-content p, 
#post-article-content li {
    margin-bottom: 1rem;
}

.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem auto;
    padding: 1rem;
    background-color: var(--background-color);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
}

.ad-container.ad-top {
    display: block; 
    min-height: 100px; 
    width: 100%;
    margin: 1rem auto;
    text-align: center; 
}

.ad-container.ad-bottom {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
}

.ad-container a {
    display: block;
    width: 100%;
    height: 150px; 
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    transition: transform 0.3s ease-in-out;
}

.ad-container a:hover img {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .blog-container {
        padding: 2rem 1rem;
    }
    
    .post-content-wrapper {
        max-width: 100%;
        padding: 2rem 1rem;
    }

    .ad-container.ad-bottom {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        max-width: 100%;
    }
    
    .ad-container a {
        height: auto;
        aspect-ratio: 1 / 1;
        width: 100%;
    }
}

.scroll-to-top-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.scroll-to-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-to-top-btn:hover {
    background-color: var(--primary-hover-color);
}

.scroll-to-top-btn svg {
    width: 24px;
    height: 24px;
    color: var(--background-color);
}
#post-article-content p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

#post-article-content h2,
#post-article-content h3,
#post-article-content h4 {
    font-family: var(--heading-font);
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

#post-article-content h2 {
    font-size: 2.2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

#post-article-content h3 {
    font-size: 1.8rem;
}

#post-article-content ul,
#post-article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

#post-article-content li {
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

#post-article-content ul li {
    list-style-type: disc;
}

#post-article-content strong,
#post-article-content b {
    color: var(--text-color);
}

#post-article-content a {
    color: var(--primary-hover-color);
    text-decoration: underline;
    transition: color 0.2s;
}

#post-article-content a:hover {
    color: var(--primary-color);
}

#post-article-content pre {
    background-color: var(--background-color);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

#post-article-content code {
    font-family: 'Courier New', monospace;
}

#post-article-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 2px solid var(--primary-color);
    box-shadow: inset 0 -4px 0 0 rgba(148, 179, 253, 0.4);
    transition: all 0.2s ease-in-out;
    font-weight: bold;
}

#post-article-content a:hover {
    color: var(--primary-hover-color);
    border-bottom-color: var(--primary-hover-color);
    box-shadow: inset 0 -4px 0 0 rgba(148, 179, 253, 0.8);
}
@media (max-width: 768px) {
    #post-title {
        font-size: 2rem;
        text-align: left;
        padding: 0 1rem;
    }

    .post-featured-image img {
        max-height: 250px;
    }

    .post-content-wrapper {
        padding: 2rem 1rem;
    }
}
/* Social Share Container */
.social-share-container {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.social-share-container h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #444;
}

.social-share-links {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
    gap: 1.5rem;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto;
}

.social-share-links li {
    display: inline-block;
}

.share-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    transition: transform 0.2s ease-in-out;
}

.share-btn:hover {
    transform: translateY(-3px) scale(1.05);
}

.share-btn.x {
    background-color: #000;
}

.share-btn.facebook {
    background-color: #3b5998;
}

.share-btn.linkedin {
    background-color: #0077b5;
}

.share-btn.reddit {
    background-color: #ff4500;
}

.share-btn.discord {
    background-color: #5865f2;
}

.share-btn.email {
    background-color: #7d7d7d;
}

.share-btn.copy-link {
    background-color: #6c757d;
}

.share-btn.pinterest {
    background-color: #e60023;
}

.donate-page {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--heading-font);
}
.button-group .small {
    background: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all .15s ease;
}

.button-group .small:hover {
    background: var(--surface-light-color);
    border-color: var(--primary-hover-color);
    color: var(--primary-hover-color);
    box-shadow: 0 0 6px var(--shadow-color);
}

.button-group select.small {
    appearance: none;
    background: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 4px 28px 4px 10px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all .15s ease;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted-color) 50%),
                      linear-gradient(135deg, var(--text-muted-color) 50%, transparent 50%);
    background-position: calc(100% - 14px) calc(50% - 3px),
                         calc(100% - 10px) calc(50% + 3px);
    background-size: 5px 5px,5px 5px;
    background-repeat: no-repeat;
}

.button-group select.small:hover {
    border-color: var(--primary-hover-color);
    color: var(--primary-hover-color);
    box-shadow: 0 0 6px var(--shadow-color);
}
.button-group select.small:disabled {
    display: none;
}
#dashboard-wrapper {
    display: flex;
    height: calc(100vh - 80px); /* assuming header ~80px tall */
}

#side-nav {
    width: 260px;
    background: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nav-section-title {
    padding: 1rem;
    font-weight: 700;
    opacity: 0.6;
    font-size: .8rem;
}

.nav-item {
    background: none;
    color: var(--text-color);
    padding: 1rem 1.2rem;
    border: none;
    border-bottom: 1px solid var(--surface-light-color);
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--surface-light-color);
}

#editor-canvas {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}
.canvas-placeholder {
    opacity: 0.5;
    font-size: 1.2rem;
}
.builder-grid input[type="number"] {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color, #333);
  color: var(--text-color, #fff);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.builder-grid input[type="number"]:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.25);
  outline: none;
}

/* --- Toggle Switch Style --- */
.builder-toggles label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--surface-color);
  border: 1px solid var(--border-color, #333);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s;
}

.builder-toggles label:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.builder-toggles input[type="checkbox"] {
  appearance: none;
  width: 38px;
  height: 20px;
  background-color: #555;
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: background-color 0.25s ease;
}

.builder-toggles input[type="checkbox"]::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
}

.builder-toggles input[type="checkbox"]:checked {
  background-color: var(--primary-color);
}

.builder-toggles input[type="checkbox"]:checked::before {
  transform: translateX(18px);
}

/* Disabled state (for alert-only lockout) */
.builder-toggles input[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.builder-grid input[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
/* 2-column responsive grid */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.5rem;
}

/* compact mode to reduce vertical stacking */
.form-group.compact {
    margin-bottom: 0.5rem;
}

.description.small {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* WINNER NAME ANIMATIONS */
@keyframes wo-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

@keyframes wo-seesaw {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(6deg); }
    75% { transform: rotate(-6deg); }
}

@keyframes wo-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

@keyframes wo-wiggle {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(8deg); }
    40% { transform: rotate(-8deg); }
    60% { transform: rotate(4deg); }
    80% { transform: rotate(-4deg); }
}

@keyframes wo-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* classes that apply the animations */
.wo-anim-bounce {
    animation: wo-bounce 1.4s ease-in-out infinite;
}
.wo-anim-seesaw {
    animation: wo-seesaw 1.4s ease-in-out infinite;
}
.wo-anim-pulse {
    animation: wo-pulse 1.2s ease-in-out infinite;
}
.wo-anim-wiggle {
    animation: wo-wiggle 1.1s ease-in-out infinite;
}
.wo-anim-shake {
    animation: wo-shake 0.9s ease-in-out infinite;
}
