@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --bg-dark: #07070d;
    --bg-darker: #030306;
    --panel-bg: rgba(13, 13, 23, 0.75);
    --border-color: rgba(255, 255, 255, 0.06);
    --primary: #9f75ff;
    --primary-glow: rgba(159, 117, 255, 0.45);
    --accent: #ec4899;
    --accent-glow: rgba(236, 72, 153, 0.4);
    --gold: #f59e0b;
    --gold-glow: rgba(245, 158, 11, 0.35);
    --crimson: #ef4444;
    --crimson-glow: rgba(239, 68, 68, 0.45);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.35);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --font-outfit: 'Outfit', 'Inter', sans-serif;
    --font-inter: 'Inter', sans-serif;
}

/* Reset Geral */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 5% 5%, rgba(159, 117, 255, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 95% 95%, rgba(236, 72, 153, 0.09) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(13, 13, 23, 0) 0%, rgba(3, 3, 6, 0.6) 100%);
    color: var(--text-main);
    font-family: var(--font-inter);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbars Premium */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Layout */
.app-container {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
}

/* Header */
header {
    background: rgba(9, 9, 14, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-outfit);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #a78bfa 0%, #d946ef 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.logo span {
    color: #fff;
    background: var(--primary);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    -webkit-text-fill-color: initial;
    box-shadow: 0 0 15px var(--primary-glow);
}

.user-status {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.balance-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-outfit);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.02);
}

.balance-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.balance-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gold);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.balance-value.animate-up {
    color: var(--success);
    transform: scale(1.1);
}

.balance-value.animate-down {
    color: var(--crimson);
    transform: scale(0.9);
}

.btn-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border: none;
    color: #fff;
    font-family: var(--font-outfit);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.55rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-secondary-header {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: var(--font-outfit);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.55rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary-header:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Dashboard Principal */
main {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: calc(100vh - 75px);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-right: 0.5rem;
    width: 100%;
}

/* Abas de Navegação SPA */
.tabs-container {
    background: rgba(15, 15, 26, 0.4);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    backdrop-filter: blur(12px);
}

.btn-tab {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-outfit);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.7rem 1.4rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-tab:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.05);
}

.btn-tab.active {
    background: linear-gradient(135deg, rgba(159, 117, 255, 0.15) 0%, rgba(236, 72, 153, 0.1) 100%);
    color: #fff;
    border: 1px solid rgba(159, 117, 255, 0.35);
    box-shadow: 0 4px 15px rgba(159, 117, 255, 0.15);
    transform: translateY(-1px);
}

.tab-content {
    width: 100%;
    animation: fadeInTab 0.3s ease;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Vidro Premium Glassmorphism */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 15px 35px 0 rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
    border-color: rgba(159, 117, 255, 0.15);
    box-shadow: 0 15px 35px 0 rgba(0, 0, 0, 0.7), 0 0 20px rgba(159, 117, 255, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.panel-title {
    font-family: var(--font-outfit);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

/* Input Fields Premium */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.input-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    font-weight: 600;
}

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

.number-input-wrapper input {
    width: 100%;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    font-family: var(--font-outfit);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 0.8rem 1.1rem;
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.number-input-wrapper input:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 15px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Quick buttons */
.bet-quick-grids {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.btn-quick {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-quick:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Dificuldade Grid */
.difficulty-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.diff-option {
    position: relative;
}

.diff-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.diff-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    font-family: var(--font-outfit);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    text-align: center;
}

.diff-label .sub {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.diff-option input:checked + .diff-label {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.2);
}

/* Botão Start / Cash Out */
.btn-action-main {
    width: 100%;
    padding: 1rem;
    font-family: var(--font-outfit);
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 20px rgba(139, 92, 246, 0.4);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-action-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

.btn-action-main:active {
    transform: translateY(1px);
}

.btn-action-main.cashout {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: #000;
    box-shadow: 0 5px 20px rgba(251, 191, 36, 0.4);
}

.btn-action-main.cashout:hover {
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.6);
}

.btn-action-main:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Área Central de Jogo */
.game-viewport {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

/* Masmorra Visual Board */
.dungeon-board {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.floor-indicator {
    font-family: var(--font-outfit);
    font-weight: 800;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Estrutura das 3 Portas */
.doors-grid {
    display: grid;
    grid-template-columns: repeat(3, 160px);
    gap: 2.5rem;
    perspective: 1000px;
    justify-content: center;
    width: 100%;
    padding: 1rem;
}

.door-card {
    height: 250px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s;
    cursor: pointer;
    border-radius: 16px;
}

.door-card:hover:not(.disabled) {
    transform: translateY(-10px) scale(1.04);
}

.door-card.disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

/* Frente e Verso do Card */
.door-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Frente (Fechada) */
.door-front {
    background: linear-gradient(145deg, #1a1a2e 0%, #08080f 100%);
    border: 2px solid rgba(159, 117, 255, 0.25);
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.door-front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 30%, rgba(159, 117, 255, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.door-card:hover:not(.disabled) .door-front {
    border-color: var(--primary);
    box-shadow: 0 0 25px var(--primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.door-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s;
}

.door-card:hover:not(.disabled) .door-icon {
    transform: scale(1.1);
}

.door-number {
    font-family: var(--font-outfit);
    font-weight: 800;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* Verso (Aberta) */
.door-back {
    transform: rotateY(180deg);
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-outfit);
    text-align: center;
    padding: 1.5rem;
}

.door-back.safe {
    background: linear-gradient(145deg, #064e3b 0%, #022c22 100%);
    border: 2px solid var(--success);
    color: #fff;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.2);
}

.door-back.safe .result-icon {
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 10px var(--gold-glow));
    animation: bounce 1s infinite alternate;
}

.door-back.trap {
    background: linear-gradient(145deg, #7f1d1d 0%, #450a0a 100%);
    border: 2px solid var(--crimson);
    color: #fff;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.2);
}

.door-back.trap .result-icon {
    font-size: 3rem;
    color: #fff;
    margin-bottom: 0.5rem;
    animation: shake 0.5s infinite;
}

/* Flip animations */
.door-card.revealed-safe {
    transform: rotateY(180deg) translateY(-8px);
}

.door-card.revealed-trap {
    transform: rotateY(180deg);
    animation: earthquake 0.6s ease;
}

/* Consola Narrativa (Storyteller) */
.storyteller-panel {
    display: grid;
    grid-template-columns: 1fr;
    height: 100%;
    overflow: hidden;
}

.story-console {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.25rem;
    overflow-y: auto;
    font-family: var(--font-outfit);
    font-size: 0.95rem;
    line-height: 1.7;
    color: #d1d5db;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.4);
}

.story-entry {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    padding-bottom: 0.5rem;
    animation: fadeIn 0.3s ease;
}

.story-entry.system {
    color: var(--primary);
    font-weight: 600;
}

.story-entry.victory {
    color: var(--gold);
    font-weight: 700;
}

.story-entry.loss {
    color: var(--crimson);
    font-weight: 700;
}

/* Layout Abas Missões */
.missions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
    padding-bottom: 2rem;
}

.mission-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
}

.mission-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.mission-title {
    font-family: var(--font-outfit);
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.25rem;
}

.mission-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.mission-reward {
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    color: var(--gold);
    padding: 0.25rem 0.6rem;
    border-radius: 8px;
    font-family: var(--font-outfit);
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.mission-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

.mission-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    box-shadow: 0 0 8px var(--primary-glow);
    border-radius: 4px;
    transition: width 0.4s ease;
}

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

.mission-progress-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.btn-claim-mission {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: var(--font-outfit);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.2);
}

.btn-claim-mission:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.btn-claim-mission:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    border: 1px solid var(--border-color);
}

/* Layout Aba Roleta */
.wheel-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    width: 100%;
}

#wheel_canvas {
    max-width: 100%;
    height: auto;
}

.wheel-canvas-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 1.5rem;
}

.wheel-pointer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -180px);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid var(--accent);
    filter: drop-shadow(0 0 10px var(--accent-glow));
    z-index: 10;
}

.wheel-center-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--bg-darker);
    border: 4px solid var(--primary);
    border-radius: 50%;
    z-index: 5;
    box-shadow: 0 0 20px var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-family: var(--font-outfit);
    font-weight: 800;
}

.wheel-spin-btn {
    width: 100%;
    padding: 1rem;
    font-family: var(--font-outfit);
    font-size: 1.15rem;
    font-weight: 800;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(217, 70, 239, 0.4);
    transition: all 0.2s ease;
}

.wheel-spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 7px 25px rgba(217, 70, 239, 0.6);
}

/* Layout Aba Afiliados */
.referrals-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.stat-num {
    font-family: var(--font-outfit);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

.stat-num.gold {
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
}

/* Tabela Afiliados */
.table-container {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    max-height: calc(100vh - 350px);
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

th {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1rem;
    font-family: var(--font-outfit);
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
    color: #fff;
}

/* Modais Base */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 9, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    width: 90%;
    max-width: 480px;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(139, 92, 246, 0.1);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-family: var(--font-outfit);
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-close-modal:hover {
    color: #fff;
}

/* Modais Form */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.btn-modal-action {
    width: 100%;
    padding: 0.85rem;
    font-family: var(--font-outfit);
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-modal-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* Fatura Pix e QR Code */
.pix-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1rem;
    text-align: center;
}

.qr-code-box {
    background: #fff;
    padding: 1rem;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 200px;
    height: 200px;
}

.qr-code-box img {
    width: 100%;
    height: 100%;
}

.copia-cola-box {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    border-radius: 10px;
    align-items: center;
}

.copia-cola-text {
    flex: 1;
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.btn-copy {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-family: var(--font-outfit);
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-copy:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* Provably Fair Detalhes */
.provably-seed-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem;
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-muted);
    word-break: break-all;
    margin-bottom: 0.75rem;
}

.provably-seed-label {
    font-family: var(--font-outfit);
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

/* Animações CSS */
@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

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

@keyframes earthquake {
    0%, 100% { transform: rotateY(180deg) rotate(0); }
    20%, 60% { transform: rotateY(180deg) rotate(-4deg) translateY(-4px); }
    40%, 80% { transform: rotateY(180deg) rotate(4deg) translateY(4px); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ====================================================================
   EXTREME RESPONSIVENESS AND DEVICE COMPATIBILITY SYSTEM
   ==================================================================== */

/* Monitores Médios e Tablets (max-width: 900px) */
@media (max-width: 900px) {
    main {
        flex-direction: column;
        height: auto;
        overflow: visible;
        padding: 1rem 1rem;
    }
    .sidebar {
        height: auto;
        overflow-y: visible;
        padding-right: 0;
    }
    .game-viewport {
        grid-template-rows: auto auto;
        height: auto;
    }
    .doors-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    .door-card {
        height: 220px;
    }
    .wheel-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .referrals-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .missions-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* Smartphones Grandes e Tablets Retratos (max-width: 768px) */
@media (max-width: 768px) {
    header {
        padding: 0.75rem 1rem;
    }
    .header-content {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
    .user-status {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.6rem;
    }
    .balance-card {
        width: 100%;
        justify-content: center;
        padding: 0.4rem 0.8rem;
    }
    .btn-header, .btn-secondary-header {
        flex: 1;
        justify-content: center;
        text-align: center;
        font-size: 0.85rem;
        padding: 0.5rem 0.8rem;
    }
}

/* Smartphones Médios (max-width: 600px) */
@media (max-width: 600px) {
    .tabs-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
        padding: 0.4rem;
        border-radius: 12px;
    }
    .btn-tab {
        justify-content: center;
        padding: 0.6rem;
        font-size: 0.85rem;
        border-radius: 8px;
    }
    .doors-grid {
        gap: 0.75rem;
        padding: 0.25rem;
    }
    .door-card {
        height: 170px;
    }
    .door-icon {
        font-size: 2.2rem;
        margin-bottom: 0.4rem;
    }
    .door-number {
        font-size: 0.8rem;
    }
    .door-back {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    .door-back.safe .result-icon, .door-back.trap .result-icon {
        font-size: 2rem;
    }
    .modal-content {
        padding: 1.5rem;
        border-radius: 20px;
    }
    .modal-title {
        font-size: 1.15rem;
    }
    .wheel-canvas-container {
        padding: 0.75rem;
    }
    .wheel-pointer {
        transform: translate(-50%, -150px);
    }
    .wheel-center-glow {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }
}

/* Aparelhos Ultra-Pequenos / Celulares Legados (max-width: 380px) */
@media (max-width: 380px) {
    .doors-grid {
        gap: 0.4rem;
    }
    .door-card {
        height: 140px;
    }
    .door-icon {
        font-size: 1.8rem;
        margin-bottom: 0.25rem;
    }
    .door-number {
        font-size: 0.7rem;
    }
    .wheel-pointer {
        transform: translate(-50%, -125px);
    }
    .btn-tab {
        font-size: 0.75rem;
        padding: 0.5rem;
    }
}

/* ====================================================================
   TAILWIND-INSPIRED LIGHTWEIGHT UTILITY CLASSES
   ==================================================================== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.m-0 { margin: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }

.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--primary); }
.text-accent { color: var(--accent); }
.text-gold { color: var(--gold); }
.text-success { color: var(--success); }
.text-crimson { color: var(--crimson); }
.text-white { color: #ffffff; }

.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

/* Micro-animations & Interactive glows */
.hover-scale {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.hover-scale:hover {
    transform: scale(1.02);
}
.hover-scale-lg:hover {
    transform: scale(1.05);
}

.glow-primary {
    box-shadow: 0 0 15px var(--primary-glow);
}
.glow-accent {
    box-shadow: 0 0 15px var(--accent-glow);
}
.glow-gold {
    box-shadow: 0 0 15px var(--gold-glow);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 15px var(--primary-glow);
    }
    50% {
        box-shadow: 0 0 25px rgba(159, 117, 255, 0.7);
    }
}

.animate-pulse-glow {
    animation: pulse-glow 2s infinite alternate;
}

/* ====================================================================
   NEON BADGE STYLES (OBSIDIAN THEME)
   ==================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.65rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-outfit);
    border: 1px solid transparent;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.badge.completed {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    border-color: rgba(16, 185, 129, 0.25);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.1);
}

.badge.pending {
    background: rgba(251, 191, 36, 0.12);
    color: var(--gold);
    border-color: rgba(251, 191, 36, 0.25);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.1);
}

.badge.failed {
    background: rgba(239, 68, 68, 0.12);
    color: var(--crimson);
    border-color: rgba(239, 68, 68, 0.25);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.1);
}

/* ====================================================================
   DIRECTIONAL SPACING UTILITIES (PADDING & MARGIN)
   ==================================================================== */
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }

.my-1 { margin-top: 0.25rem; margin-bottom: 0.25rem; }
.my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.my-3 { margin-top: 0.75rem; margin-bottom: 0.75rem; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }

.mx-1 { margin-left: 0.25rem; margin-right: 0.25rem; }
.mx-2 { margin-left: 0.5rem; margin-right: 0.5rem; }
.mx-3 { margin-left: 0.75rem; margin-right: 0.75rem; }
.mx-4 { margin-left: 1rem; margin-right: 1rem; }

