/* ===========================
   Roleta da Babs — Styles (otimizado)
   =========================== */

:root {
    --bg: #07070d;
    --surface: rgba(15, 17, 28, 0.78);
    --surface-solid: #0f111c;
    --text: #f1f5f9;
    --text-muted: #64748b;
    --pink: #ec4899;
    --pink-hover: #db2777;
    --pink-glow: rgba(236, 72, 153, 0.35);
    --purple: #a855f7;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

.hidden { display: none !important; }

/* ── LOGIN SCREEN ── */

#login-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

#particles-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.login-card {
    position: relative;
    z-index: 1;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 3.5rem 3rem;
    text-align: center;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 60px var(--pink-glow);
}

.login-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.login-title {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fbc2eb, #a6c1ee, #fbc2eb);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 4s linear infinite;
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-group input {
    flex: 1;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: var(--text);
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.input-group input:focus {
    border-color: var(--pink);
    box-shadow: 0 0 20px var(--pink-glow);
}

.btn-login {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    border: none;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s;
    white-space: nowrap;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--pink-glow);
}

.login-error {
    color: #f87171;
    font-size: 0.9rem;
    margin-top: 1rem;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* ── MAIN LAYOUT ── */

.container {
    display: flex;
    width: 100%;
    height: 100vh;
    position: relative;
}

#particles-app {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ── SIDEBAR ── */

.sidebar {
    position: relative;
    width: 340px;
    min-width: 340px;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                min-width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--border);
}

.sidebar.collapsed {
    width: 0;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: none;
}

.sidebar.collapsed .sidebar-inner {
    opacity: 0;
    pointer-events: none;
}

.sidebar-inner {
    padding: 2.5rem 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100%;
    opacity: 1;
    transition: opacity 0.2s;
}

.sidebar-toggle {
    position: absolute;
    top: 50%;
    right: -16px;
    transform: translateY(-50%);
    width: 32px;
    height: 48px;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 0 10px 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    z-index: 20;
    transition: color 0.25s, border-color 0.25s;
}

.sidebar-toggle:hover {
    color: var(--pink);
    border-color: var(--pink);
}

.sidebar-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-header h2 svg {
    color: var(--pink);
}

.sidebar-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.theme-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.theme-selector label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.theme-options {
    display: flex;
    gap: 0.8rem;
}

.theme-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s, border-color 0.2s;
    opacity: 0.6;
}

.theme-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.theme-btn.active {
    opacity: 1;
    border-color: white;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

#options-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
}

#options-input:focus {
    border-color: var(--pink);
    box-shadow: 0 0 15px var(--pink-glow);
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ── BUTTONS ── */

.btn {
    padding: 0.9rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
    letter-spacing: 0.3px;
}

.btn.primary {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: white;
    box-shadow: 0 4px 15px var(--pink-glow);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--pink-glow);
}

.btn.ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn.ghost:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: rgba(255,255,255,0.03);
}

/* ── WHEEL SECTION ── */

.wheel-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 5;
    overflow: hidden;
}

.main-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 1.8rem;
    background: linear-gradient(135deg, #fbc2eb 0%, #f472b6 30%, #a78bfa 60%, #fbc2eb 100%);
    background-size: 300% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 5s linear infinite;
    letter-spacing: 2px;
    text-transform: uppercase;
    filter: drop-shadow(0 0 20px var(--pink-glow));
    z-index: 10;
    user-select: none;
}

@keyframes shimmer {
    to { background-position: 300% center; }
}

/* ── WHEEL ── */

.wheel-container {
    position: relative;
    width: 620px;
    height: 620px;
    display: flex;
    align-items: center;
    justify-content: center;
    contain: layout paint;
}

.wheel-glow {
    position: absolute;
    inset: -40px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--pink-glow) 0%, transparent 70%);
    opacity: 0.4;
    animation: pulse-glow 3s ease-in-out infinite;
    pointer-events: none;
    will-change: transform, opacity;
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.08); opacity: 0.5; }
}

/* Pausa o pulso enquanto a roleta gira (libera GPU para o canvas) */
.is-spinning .wheel-glow {
    animation-play-state: paused;
}

#wheel-canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    z-index: 1;
    will-change: transform;
}

/* ── POINTER ── */

.wheel-pointer {
    position: absolute;
    top: 50%;
    right: -20px;
    transform: translateY(-50%);
    z-index: 5;
    width: 50px;
    height: 50px;
    filter: drop-shadow(-3px 2px 6px rgba(0,0,0,0.6));
    transform-origin: right center;
}

.wheel-pointer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    clip-path: polygon(0% 50%, 100% 0%, 100% 100%);
    border-radius: 3px;
}

.wheel-pointer::after {
    content: '';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(255,255,255,0.5);
}

@keyframes pinBounce {
    0%   { transform: translateY(-50%) rotate(0deg); }
    40%  { transform: translateY(-50%) rotate(-20deg); }
    100% { transform: translateY(-50%) rotate(0deg); }
}

.wheel-pointer.tick-anim {
    animation: pinBounce 0.1s ease-out;
}

/* ── CENTER BUTTON ── */

.wheel-center {
    position: absolute;
    width: 90px;
    height: 90px;
    background: linear-gradient(145deg, #ffffff, #e0e0e0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.8);
    z-index: 10;
    border: 4px solid rgba(255,255,255,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.wheel-center span {
    color: #1a1a2e;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 2px;
}

.wheel-center:hover {
    transform: scale(1.08);
    box-shadow: 0 0 30px var(--pink-glow), inset 0 2px 4px rgba(255,255,255,0.8);
}

.wheel-center:active {
    transform: scale(0.94);
}

/* ── RESULT MODAL ── */

#result-display {
    position: fixed;
    inset: 0;
    background: rgba(7, 7, 13, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s;
}

#result-display.hidden {
    opacity: 0;
    pointer-events: none;
}

.result-content {
    background: var(--surface-solid);
    padding: 3.5rem 4rem;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 60px var(--pink-glow);
    border: 1px solid var(--border);
    max-width: 500px;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#result-display.hidden .result-content {
    transform: scale(0.7);
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: float 2s ease-in-out infinite;
}

.result-content h3 {
    color: var(--pink);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 600;
}

.result-content p {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: white;
    word-break: break-word;
    line-height: 1.2;
}

/* ── SPIN COUNTER ── */

#spin-counter-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    z-index: 10;
    flex-wrap: wrap;
    justify-content: center;
}

.counter-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(15, 17, 28, 0.85);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.6rem 1.2rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: border-color 0.3s, box-shadow 0.3s;
    min-width: 200px;
}

.counter-badge.has-spins {
    border-color: rgba(236, 72, 153, 0.3);
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.15);
}

.counter-icon {
    font-size: 1.6rem;
    line-height: 1;
}

.counter-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.counter-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.counter-number {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.counter-number.bump {
    transform: scale(1.35);
}

.counter-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pix-input-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.pix-input-group:focus-within {
    border-color: var(--pink);
    box-shadow: 0 0 12px var(--pink-glow);
}

.pix-prefix {
    padding: 0.5rem 0.6rem 0.5rem 0.8rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    user-select: none;
}

#pix-value-input {
    width: 70px;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    padding: 0.5rem 0.6rem 0.5rem 0;
    outline: none;
    -moz-appearance: textfield;
}

#pix-value-input::-webkit-inner-spin-button,
#pix-value-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.btn-add-pix {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 1rem;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 10px;
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-add-pix:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-add-pix:active {
    transform: scale(0.96);
}

.btn-add-one {
    padding: 0.55rem 0.9rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.btn-add-one:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn-add-one:active {
    transform: scale(0.96);
}

/* Notificação flutuante de PIX */
.pix-notification {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(15, 17, 28, 0.92);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 14px;
    padding: 1rem 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 200;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(16, 185, 129, 0.15);
    animation: slideInNotif 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), fadeOutNotif 0.4s ease 3.6s forwards;
    pointer-events: none;
}

.pix-notification .notif-icon {
    font-size: 1.5rem;
}

.pix-notification .notif-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pix-notification .notif-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #10b981;
}

.pix-notification .notif-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

@keyframes slideInNotif {
    0% { transform: translateX(120%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOutNotif {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(50px); }
}

/* Bloquear botão GIRAR quando sem roletas */
.wheel-center.blocked {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.wheel-center.blocked:hover {
    transform: none;
    box-shadow: 0 0 20px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.8);
}

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

.counter-badge.no-spins-shake {
    animation: noSpinsShake 0.4s ease;
    border-color: #f87171 !important;
    box-shadow: 0 0 15px rgba(248, 113, 113, 0.3) !important;
}

/* ── REDUCED MOTION ── */

@media (prefers-reduced-motion: reduce) {
    .login-logo,
    .login-title,
    .main-title,
    .wheel-glow,
    .result-icon {
        animation: none !important;
    }
    .wheel-pointer.tick-anim {
        animation: none !important;
    }
}
