:root {
    --bg-base: #0f0c1b;
    --bg-surface: rgba(22, 17, 43, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --primary-grad: linear-gradient(135deg, #312ecf 0%, #e2196e 100%);
    --shadow-neon: 0 8px 32px 0 rgba(49, 46, 207, 0.25);
    --font-outfit: 'Outfit', 'Noto Sans Thai', sans-serif;
}

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

body {
    background-color: var(--bg-base);
    background-image:
        radial-gradient(at 0% 0%, rgba(49, 46, 207, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(226, 25, 110, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    font-family: var(--font-outfit);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Glassmorphism scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Effect Overlay (transparent OBS capability) */
.effect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 1080px;
    height: 1920px;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

#effect-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Dynamic overlay styles for pure stream view */
body.pure-overlay {
    background: transparent !important;
}

body.pure-overlay #control-panel {
    display: none !important;
}

/* Control Panel Card Container */
.pad-container {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 90%;
    max-width: 950px;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Header style matching standard client layouts */
.pad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sparkles-icon {
    width: 24px;
    height: 24px;
    color: #e2196e;
    filter: drop-shadow(0 0 8px rgba(226, 25, 110, 0.6));
    animation: sparkle-pulse 2s infinite alternate;
}

@keyframes sparkle-pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.15);
        opacity: 1;
    }
}

.header-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* URL Share section */
.url-bar-container {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 4px 8px 4px 14px;
    max-width: 480px;
    width: 100%;
    margin: 0 16px;
    transition: border-color 0.3s;
}

.url-bar-container:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.url-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    width: 100%;
    text-overflow: ellipsis;
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.copy-icon {
    width: 16px;
    height: 16px;
}

/* Unified wide URL bar */
.url-bar-container-wide {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px 6px 6px 14px;
    width: 100%;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.url-bar-container-wide:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.url-input-wide {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    width: 100%;
    text-overflow: ellipsis;
    padding: 0;
}

.copy-btn-wide {
    background: #e2196e;
    border: none;
    color: #ffffff;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 12px;
    flex-shrink: 0;
}

.copy-btn-wide:hover {
    background: #ff2a85;
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(226, 25, 110, 0.5);
}

.copy-btn-wide:active {
    transform: scale(0.95);
}

.link-icon-svg {
    width: 18px;
    height: 18px;
}

.close-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

/* Columns Section */
.pad-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    padding: 24px;
    max-height: 520px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .pad-content {
        grid-template-columns: 1fr;
    }
}

.pad-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
    transition: all 0.3s ease;
}

.grid-card.active-highlight {
    border-color: #e2196e !important;
    box-shadow: 0 0 15px rgba(226, 25, 110, 0.6) !important;
}

.section-title {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    padding-left: 4px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    margin-left: 16px;
}

.glow-text {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.buttons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.buttons-grid::-webkit-scrollbar {
    width: 4px;
}
.buttons-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 2px;
}
.buttons-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}
.buttons-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Premium Card Design with Custom Colored Glow */
.grid-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    text-align: center;
}

.grid-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--card-color);
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(var(--card-color), 0.15);
}

.grid-card:active {
    transform: translateY(-1px);
}

.card-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    background: var(--card-color);
    filter: blur(35px);
    opacity: 0.15;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: opacity 0.3s;
}

.grid-card:hover .card-glow {
    opacity: 0.3;
}

.card-icon {
    font-size: 1.75rem;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s;
}

.grid-card:hover .card-icon {
    transform: scale(1.15) rotate(5deg);
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
}

.card-desc {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

/* Footer Section */
.pad-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.01);
}

.expand-btn {
    background: var(--primary-grad);
    border: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-neon);
    transition: all 0.3s;
}

.expand-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(49, 46, 207, 0.4);
    filter: brightness(1.1);
}

.expand-btn:active {
    transform: translateY(0);
}

.arrow-icon {
    width: 14px;
    height: 14px;
}

/* Toast Message Feedback styling */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 12px 28px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Custom Overlay Elements styles (Paint splatters, eggs, freeze screen) */
.custom-overlay-freeze {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 120px rgba(0, 210, 255, 0.7);
    border: 15px solid rgba(0, 210, 255, 0.4);
    backdrop-filter: blur(4px) saturate(1.5) contrast(1.1);
    -webkit-backdrop-filter: blur(4px) saturate(1.5) contrast(1.1);
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, transparent 20%, rgba(0, 210, 255, 0.15) 80%);
}

.custom-overlay-freeze.show {
    opacity: 1;
}

/* Freeze cracks SVG style */
.freeze-crack {
    width: 60%;
    height: 60%;
    stroke: rgba(255, 255, 255, 0.95);
    stroke-width: 2.5;
    fill: none;
    filter: drop-shadow(0 0 12px rgba(0, 210, 255, 0.8));
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw-crack 0.8s forwards ease-out;
}

@keyframes draw-crack {
    to {
        stroke-dashoffset: 0;
    }
}

/* Flashing lightning strike overlay */
.custom-overlay-thunder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    opacity: 0;
    pointer-events: none;
}

.custom-overlay-thunder.flash {
    animation: thunder-flash-anim 0.6s cubic-bezier(0.1, 0.8, 0.1, 1) forwards;
}

@keyframes thunder-flash-anim {
    0% {
        opacity: 0;
    }

    5% {
        opacity: 0.95;
    }

    15% {
        opacity: 0.1;
    }

    20% {
        opacity: 0.85;
    }

    40% {
        opacity: 0.0;
    }

    100% {
        opacity: 0.0;
    }
}

/* Flashing Timeup warning neon frame */
.custom-overlay-timeup {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 80px rgba(255, 60, 65, 0.8);
    border: 8px solid rgba(255, 60, 65, 0.5);
    pointer-events: none;
    opacity: 0;
}

.custom-overlay-timeup.active {
    animation: timeup-warning 0.5s infinite alternate;
}

@keyframes timeup-warning {
    0% {
        opacity: 0.2;
    }

    100% {
        opacity: 1;
    }
}

/* Paint splatter element style */
.paint-splat {
    position: absolute;
    width: 120px;
    height: 120px;
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    transform: scale(0);
    animation: splat-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes splat-pop {
    to {
        transform: scale(1) rotate(var(--splat-rot));
    }
}

/* Egg splat element style */
.egg-splat {
    position: absolute;
    width: 180px;
    height: 180px;
    pointer-events: none;
    transform: scale(0);
    animation: egg-splat-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, egg-slide-down 4s 0.8s ease-in forwards;
}

@keyframes egg-splat-pop {
    to {
        transform: scale(1) rotate(var(--egg-rot));
    }
}

@keyframes egg-slide-down {
    to {
        transform: translateY(120px) scale(0.9) rotate(var(--egg-rot));
        opacity: 0;
    }
}

/* Bottom Horizontal Carousels Stylings */
.carousel-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 0 24px;
}

.carousel-header-row.no-btn {
    margin-top: 16px;
}

.carousel-section-title {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.hide-carousel-btn {
    background: rgba(226, 25, 110, 0.1);
    border: 1px solid rgba(226, 25, 110, 0.2);
    color: #e2196e;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-outfit);
}

.hide-carousel-btn:hover {
    background: #e2196e;
    color: white;
}

.horizontal-carousel {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 12px 24px 16px 24px;
    margin-top: 6px;
}

.horizontal-carousel::-webkit-scrollbar {
    height: 6px;
}

.horizontal-carousel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.horizontal-carousel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.horizontal-carousel::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.carousel-card {
    flex: 0 0 110px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    text-align: center;
    font-family: var(--font-outfit);
}

.carousel-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--card-color);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.25),
        0 0 12px rgba(var(--card-color), 0.15);
}

.carousel-card-icon {
    font-size: 1.6rem;
    transition: transform 0.3s;
}

.carousel-card:hover .carousel-card-icon {
    transform: scale(1.15);
}

.carousel-card-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.carousel-card-number {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
}

.carousel-card-star {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.7rem;
    color: #ffb700;
}

/* Audio unblock overlay style */
.audio-unlock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    cursor: pointer;
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.audio-unlock-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.unlock-card {
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 35px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: unlock-pulse 2s infinite alternate ease-in-out;
    max-width: 90%;
    width: 320px;
}

.unlock-icon {
    font-size: 4rem;
    margin-bottom: 18px;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.unlock-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.unlock-desc {
    font-family: 'Noto Sans Thai', sans-serif;
    font-size: 0.95rem;
    color: #94a3b8;
    line-height: 1.4;
}

@keyframes unlock-pulse {
    0% { transform: scale(0.97); box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.4); }
    100% { transform: scale(1.03); box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.6); }
}