:root { --gold: #FFD700; --orange: #ff6c2f; --dark-bg: #1a1a1a; --green: #22c55e; }
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', sans-serif; -webkit-tap-highlight-color: transparent; user-select: none; }
body { background-color: #000; height: 100dvh; width: 100vw; overflow: hidden; display: flex; justify-content: center; }
.app-container { width: 100%; max-width: 450px; height: 100%; position: relative; display: flex; flex-direction: column; justify-content: space-between; background: #111; }
.bg-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; filter: brightness(0.6); }

/* Header & UI */
.top-header { position: relative; z-index: 10; padding: 15px 20px; display: flex; justify-content: flex-end; align-items: center; }
.header-icons { display: flex; gap: 12px; }
.icon-circle { width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,0.6); border: 1px solid var(--gold); display: flex; align-items: center; justify-content: center; color: var(--gold); backdrop-filter: blur(4px); cursor: pointer; }
.game-area { position: relative; z-index: 5; flex: 1; display: flex; align-items: center; justify-content: center; }
.roulette-wrapper { position: relative; width: 90%; max-width: 360px; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center; }
.wheel-disk { position: absolute; width: 100%; height: 100%; object-fit: contain; transition: transform 5s cubic-bezier(0.25, 1, 0.5, 1); }
.wheel-center { position: absolute; width: 25%; height: 25%; z-index: 6; object-fit: contain; }
.marker { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); width: 50px; height: auto; z-index: 20; filter: drop-shadow(0px 4px 4px rgba(0,0,0,0.5)); }

/* Animação Idle */
@keyframes sway { 0% { transform: rotate(0deg); } 25% { transform: rotate(2deg); } 75% { transform: rotate(-2deg); } 100% { transform: rotate(0deg); } }
.swaying { animation: sway 3s ease-in-out infinite; }

/* Footer */
.bottom-ui { position: relative; z-index: 10; padding: 10px 15px 25px 15px; background: linear-gradient(to top, #000 80%, transparent 100%); display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.col-side { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ui-btn { background: linear-gradient(180deg, #2a2a2a 0%, #111 100%); border: 1px solid #333; border-left: 3px solid var(--gold); border-radius: 8px; padding: 8px 10px; color: white; font-size: 11px; font-weight: 700; display: flex; align-items: center; gap: 8px; cursor: pointer; justify-content: center; }
.ui-btn.deposit { background: linear-gradient(90deg, #B8860B 0%, #FFD700 100%); color: black; border: none; text-transform: uppercase; }
.display-box { background: rgba(0,0,0,0.8); border: 1px solid #333; border-radius: 8px; padding: 4px 8px; display: flex; flex-direction: column; }
.display-label { font-size: 9px; color: #888; text-transform: uppercase; }
.display-value { font-size: 13px; color: var(--gold); font-weight: bold; }
.spin-btn { width: 85px; height: 85px; border-radius: 50%; background-color: #000; background-image: url('copa/girar_1770058125.png'); background-size: 105%; background-position: center; border: 2px solid var(--gold); box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); cursor: pointer; transition: transform 0.1s; }
.spin-btn:active { transform: scale(0.95); }
.spin-btn.disabled { filter: grayscale(1); cursor: not-allowed; }

/* Modals */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px); z-index: 1200; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.modal-backdrop.active, .modal-overlay.show { opacity: 1; visibility: visible; }
.modal-overlay { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.85); opacity: 0; visibility: hidden; transition: 0.3s; }
.modal-container { position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center; z-index: 1250; overflow-y: auto; padding: 20px; padding-top: 10vh; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.modal-container.active { opacity: 1; visibility: visible; }
.modal-wrapper { width: 100%; max-width: 420px; position: relative; }
.modal-card { background: #18181b; border: 1px solid #FFD700; border-radius: 16px; overflow: hidden; position: relative; box-shadow: 0 18px 40px rgba(0,0,0,0.6); display: flex; flex-direction: column; color: white; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.2); border-radius: 50%; color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 100; }
.deposit-header-img, .auth-header-image { width: 100%; height: 120px; object-fit: cover; border-bottom: 1px solid rgba(255, 213, 79, 0.2); }
.modal-body { padding: 20px; }

/* Profile, History, Affiliate */
#profile-modal-content { width: 90%; max-width: 400px; background: rgba(10, 20, 50, 0.95); border: 2px solid #FFD700; border-radius: 16px; padding: 18px; color: #ffd54f; display: flex; flex-direction: column; gap: 14px; position: relative; backdrop-filter: blur(10px); }
#profile-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed rgba(255,213,79,0.2); padding-bottom: 15px; }
.profile-top-left { display: flex; align-items: center; gap: 12px; }
.profile-avatar { width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(135deg,#ffd54f,#ffb74d); color: #000; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; }
.profile-balance { font-size: 0.9rem; color: #fff; margin-top: 2px; }
#close-profile-button, .affiliate-modal-close, .history-modal-close { background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; position: absolute; right: 15px; top: 10px; }
.profile-actions { display: flex; flex-direction: column; gap: 10px; }
.profile-button { display: flex; align-items: center; gap: 10px; padding: 12px; background: rgba(255,255,255,0.05); border: none; border-radius: 8px; color: #fff; cursor: pointer; text-align: left; font-size: 1rem; transition: 0.2s; }
.profile-button:hover { background: rgba(255,255,255,0.1); }
.profile-button i { width: 24px; text-align: center; color: var(--gold); }
.profile-button.logout { background: rgba(220, 38, 38, 0.2); color: #ff6b6b; margin-top: 10px; }

.affiliate-modal-content, .history-modal-content { position: relative; max-width: 400px; width: 90%; background-color: #1a1a1a; padding: 20px; border-radius: 16px; border: 1px solid #333; color: white; box-shadow: 0 10px 30px rgba(0,0,0,0.5); display: flex; flex-direction: column; max-height: 85vh; }
.affiliate-modal-header, .history-modal-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 15px; border-bottom: 1px solid rgba(255, 108, 47, 0.3); margin-bottom: 15px; }
.affiliate-modal-title, .history-modal-title { font-size: 1.2rem; font-weight: bold; color: #ffc83d; }
.affiliate-section { background-color: #252525; border-radius: 10px; padding: 15px; margin-bottom: 15px; }
.section-title { font-size: 1rem; font-weight: 600; color: #e5e7eb; margin: 0 0 10px 0; display: flex; align-items: center; gap: 8px; }
.link-container { display: flex; background-color: #111; border: 1px solid #444; border-radius: 8px; overflow: hidden; }
#affiliate-link-input { flex-grow: 1; background: transparent; border: none; color: #ddd; padding: 10px; font-size: 0.8rem; outline: none; }
#copy-link-btn { background-color: #ff6c2f; border: none; color: white; padding: 0 15px; cursor: pointer; font-weight: bold; }
.stats-grid-affiliate { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; }
.stat-item-affiliate { background: #111; padding: 10px; border-radius: 8px; }
.stat-item-affiliate .value { font-size: 1.2rem; font-weight: bold; color: #ffc83d; }
.stat-item-affiliate .label { font-size: 0.7rem; color: #aaa; text-transform: uppercase; }
#history-list { overflow-y: auto; max-height: 400px; display: flex; flex-direction: column; gap: 8px; }
.history-item { background-color: #252525; border-radius: 8px; padding: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; border-left: 4px solid #ff6c2f; align-items: center; }
.history-item.win { border-left-color: var(--green); }
.history-item.loss { border-left-color: #ef4444; }
.history-item .label { color: #888; font-size: 0.75rem; }
.history-item .value { font-weight: bold; font-size: 0.9rem; }
.history-item .value.green { color: var(--green); }
.history-item .value.red { color: #ef4444; }
.history-item .date { grid-column: 1 / -1; text-align: right; font-size: 0.7rem; color: #666; margin-top: 4px; }

/* Inputs & Forms */
.auth-tabs { display: flex; background: #27272a; border-radius: 8px; padding: 4px; margin-bottom: 20px; }
.auth-tab { flex: 1; padding: 10px; background: transparent; border: none; color: #888; font-weight: bold; cursor: pointer; border-radius: 6px; }
.auth-tab.active { background: #3f3f46; color: white; }
.auth-form-container { display: none; }
.auth-form-container.active { display: block; }
.input-group { margin-bottom: 15px; }
.input-group.compact { margin-bottom: 10px; }
.input-label { display: block; font-size: 12px; color: #aaa; margin-bottom: 5px; }
.amount-input, .text-input, .pix-input, .pix-selector { width: 100%; padding: 14px; background: #27272a; border: 1px solid #3f3f46; border-radius: 8px; color: white; font-size: 16px; outline: none; }
.generate-btn { width: 100%; padding: 16px; border-radius: 12px; border: none; font-size: 16px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--green); color: white; }
.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 15px; }
.value-btn { background: #27272a; border: 1px solid #3f3f46; color: white; border-radius: 8px; padding: 10px 5px; font-size: 14px; font-weight: 700; position: relative; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; }
.value-btn.selected { background: var(--green); border-color: var(--green); }
.badge-tag { position: absolute; top: -8px; background: #FFD700; color: black; font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: 8px; text-transform: uppercase; }
.qr-section { display: none; text-align: center; flex-direction: column; gap: 15px; align-items: center; }
.qr-section.active { display: flex; }
.qr-image-wrapper { position: relative; width: 200px; height: 200px; background: white; padding: 5px; border-radius: 10px; }
.qr-image { width: 100%; height: 100%; }
.qr-paid-overlay { position: absolute; inset: 0; background: rgba(34, 197, 94, 0.95); border-radius: 10px; display: none; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; color: white; }
.qr-paid-overlay.active { display: flex; }
.qr-code-container { display: flex; gap: 8px; width: 100%; }
.copy-btn { background: var(--orange); color: white; border: none; padding: 0 15px; border-radius: 8px; cursor: pointer; }
.loading-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.8); z-index: 50; display: none; align-items: center; justify-content: center; }
.loading-overlay.active { display: flex; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid rgba(255,255,255,0.2); border-top-color: var(--gold); animation: spinLoad 1s linear infinite; }
@keyframes spinLoad { to { transform: rotate(360deg); } }
.pix-input-container { display: flex; gap: 5px; }
.pix-selector { width: 90px; padding: 10px; font-size: 12px; }
.dual-inputs { display: flex; gap: 10px; }
.half-width { flex: 1; }