:root {
    --bg-black: #0a0a0a;
    --card-bg: rgba(15, 15, 15, 0.6);
    --border: rgba(255, 255, 255, 0.08);
    --primary: #ef4444;
    /* Change to XorByte Red */
    --primary-glow: rgba(239, 68, 68, 0.3);
    --text-white: #ededed;
    --text-muted: #a1a1aa;
    --font-main: 'Outfit', sans-serif;
}

/* Force everything to fit the screen */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-black);
    color: var(--text-white);
    font-family: var(--font-main);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* XorByte Styled Background Effects */
.background-effects {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.glow-vignette {
    position: absolute;
    top: -10%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.12) 0%, transparent 70%);
    filter: blur(80px);
}

.glow-vignette-2 {
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.08) 0%, transparent 70%);
    filter: blur(80px);
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 100%);
}

.container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header styling */
header {
    display: flex;
    justify-content: center;
    /* Center the title */
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 50;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(0, 0, 0, 0.4) 100%);
    border: 2px solid rgba(239, 68, 68, 0.25);
    border-radius: 22px;
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.6),
        0 8px 16px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.logo-icon-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.05), transparent);
}

.logo-img {
    height: 44px;
    width: 44px;
    object-fit: contain;
    border-radius: 12px;
    z-index: 2;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 4px;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

/* Layout - Panel at far left, wheel centered in viewport */
.app-layout {
    flex: 1;
    display: flex;
    position: relative;
    min-height: 0;
    width: 100%;
    align-items: center;
    justify-content: center;
    /* This ensures the wheel-container is centered */
}

/* Sidebar / Card styling - Moved slightly right and enlarged */
.panel.input-panel {
    width: 480px;
    /* Increased width */
    height: calc(100% - 4rem);
    max-height: 900px;
    /* Increased height */
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    /* Slightly more rounded */
    padding: 3rem;
    /* More spacing inside */
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
    position: absolute;
    left: 5rem;
    /* Shifted slightly to the right from the edge */
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.panel-header {
    margin-bottom: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.count-badge {
    background: rgba(239, 68, 68, 0.1);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.input-area {
    flex: 1;
    margin-bottom: 1.2rem;
    min-height: 0;
}

textarea {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

textarea:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}

/* Custom Scrollbar for fluidity */
textarea::-webkit-scrollbar {
    width: 6px;
}

textarea::-webkit-scrollbar-track {
    background: transparent;
}

textarea::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(239, 68, 68, 0.3);
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.btn {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-white);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-muted);
}

.btn.danger {
    color: #ef4444;
}

.btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* Wheel Section */
.wheel-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
}

.wheel-inner-box {
    position: relative;
    width: 75vh;
    height: 75vh;
    max-width: 700px;
    max-height: 700px;
}

.pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 50px;
    background: #fff;
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    z-index: 10;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

.center-circle {
    position: absolute;
    inset: 41%;
    background: #0a0a0a;
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

.center-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures square logo fills the circle */
}

canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: transform 4s cubic-bezier(0.1, 0.7, 0.1, 1);
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.5);
}

/* Spin Button Styled like XorByte main buttons */
.big-btn {
    background: #fff !important;
    color: #000 !important;
    padding: 1.2rem 4rem !important;
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    border-radius: 100px !important;
    border: none !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 40px rgba(255, 255, 255, 0.1);
}

.big-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 60px rgba(255, 255, 255, 0.2);
}

.big-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal - XorByte Style */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #0f0f0f;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3.5rem;
    border-radius: 16px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content h2 {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1.5rem;
}

.winner-name {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, #fff 0%, #ef4444 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.4));
    animation: winnerPulse 1.5s infinite alternate ease-in-out;
}

@keyframes winnerPulse {
    from {
        transform: scale(1);
        filter: drop-shadow(0 0 15px rgba(239, 68, 68, 0.4));
    }

    to {
        transform: scale(1.05);
        filter: drop-shadow(0 0 25px rgba(239, 68, 68, 0.6));
    }
}

/* Responsive Scaling */
@media (max-width: 1024px) {
    .app-layout {
        flex-direction: column;
        gap: 1.5rem;
        overflow-y: auto;
        padding-top: 5rem;
    }

    .panel.input-panel {
        position: relative;
        left: unset;
        top: unset;
        transform: none;
        width: 90%;
        max-width: 500px;
        height: auto;
        max-height: 400px;
        margin: 0 auto;
    }

    .wheel-container {
        margin-top: 1rem;
    }

    .wheel-inner-box {
        width: 50vh;
        height: 50vh;
    }
}