/* CSS Variables for Premium Gaming Theme */
:root {
    --bg-dark: #0a0a0f;
    --bg-main: #11111a;
    --bg-card: rgba(22, 22, 33, 0.7);
    --bg-card-hover: rgba(30, 30, 45, 0.85);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-focus: rgba(168, 85, 247, 0.4);
    
    --neon-purple: #a855f7;
    --neon-purple-glow: rgba(168, 85, 247, 0.3);
    --neon-cyan: #06b6d4;
    --neon-cyan-glow: rgba(6, 182, 212, 0.3);
    --neon-green: #10b981;
    --neon-green-glow: rgba(16, 185, 129, 0.3);
    --neon-red: #ef4444;
    --neon-red-glow: rgba(239, 68, 68, 0.3);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

/* Layout */
.app-layout {
    display: grid;
    grid-template-columns: 340px 1fr;
    height: 100vh;
    width: 100vw;
}

/* SIMULATOR SIDEBAR */
.sim-sidebar {
    background-color: #0d0d14;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 24px;
    z-index: 10;
}

.sim-header {
    margin-bottom: 24px;
}

.sim-badge {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
    border-radius: 99px;
    color: white;
    display: inline-flex;
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding: 4px 12px;
}

.sim-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.sim-header p {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}

.sim-timeline {
    position: relative;
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 16px;
}

.sim-timeline-line {
    position: absolute;
    left: 17px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background-color: rgba(255, 255, 255, 0.05);
    z-index: 1;
}

.sim-step {
    position: relative;
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    opacity: 0.4;
    transition: opacity var(--transition-fast);
    z-index: 2;
}

.sim-step.active {
    opacity: 1;
}

.sim-step.completed {
    opacity: 0.75;
}

.sim-step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #1a1a26;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.sim-step.active .sim-step-num {
    background: var(--neon-purple);
    border-color: var(--neon-purple);
    box-shadow: 0 0 12px var(--neon-purple-glow);
    color: white;
}

.sim-step.completed .sim-step-num {
    background: var(--neon-green);
    border-color: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green-glow);
    color: white;
}

.sim-step-info h3 {
    font-size: 13px;
    font-weight: 600;
    margin-top: 2px;
}

.sim-step.active .sim-step-info h3 {
    color: var(--neon-purple);
}

.sim-step.completed .sim-step-info h3 {
    color: var(--neon-green);
}

.sim-step-info p {
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
}

.sim-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.sim-instruction-box {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    line-height: 1.5;
}

.sim-instruction-box h4 {
    color: var(--neon-cyan);
    font-size: 12px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* APP MAIN AREA */
.app-main {
    background: radial-gradient(circle at 80% 20%, #171228 0%, var(--bg-main) 70%);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

/* NAVIGATION */
.app-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    padding: 0 32px;
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(10, 10, 15, 0.4);
    backdrop-filter: blur(10px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.logo-text {
    font-family: 'Outfit', sans-serif;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.logo-text span {
    color: var(--neon-cyan);
}

.nav-widgets {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-widget {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    transition: all var(--transition-fast);
}

.wallet-widget {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.1);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    padding: 4px 14px 4px 4px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

/* GLASS PANEL COMMON */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

/* App View Wrapper */
.app-view-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.app-view {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
    z-index: 1;
}

.app-view.active-view {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    z-index: 2;
}

/* VIEW 1: SIGNUP VIEW */
.signup-card {
    width: 480px;
    padding: 40px;
}

.signup-header {
    text-align: center;
    margin-bottom: 32px;
}

.signup-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
}

.signup-header p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.input-wrapper input {
    width: 100%;
    height: 48px;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 14px;
    padding-left: 48px;
    padding-right: 16px;
    transition: all var(--transition-fast);
}

.input-wrapper input:focus {
    border-color: var(--neon-purple);
    outline: none;
    box-shadow: 0 0 10px var(--neon-purple-glow);
}

.steam-connect-box {
    background: rgba(0, 0, 0, 0.15);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.steam-status {
    font-size: 12px;
}

.status-badge {
    border-radius: 4px;
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-offline {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--neon-red);
    color: var(--neon-red);
}

.status-online {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
}

/* BUTTONS */
.btn {
    border: none;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 24px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

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

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.5);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.1);
}

.btn-secondary:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-steam {
    background-color: #1b2838;
    color: #c7d5e0;
    border: 1px solid #101822;
}

.btn-steam:hover {
    background-color: #2a3f5a;
    color: white;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
}

.btn-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 0;
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.5);
}

/* VIEW 2: DASHBOARD VIEW */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    height: 100%;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.dashboard-chat-area {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 118px);
    overflow: hidden;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.agent-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.agent-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    position: relative;
}

.online-indicator {
    width: 12px;
    height: 12px;
    background-color: var(--neon-green);
    border: 2px solid var(--bg-dark);
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    right: 0;
}

.agent-details h3 {
    font-size: 15px;
    font-weight: 700;
}

.agent-details p {
    color: var(--neon-cyan);
    font-size: 11px;
    font-weight: 600;
}

.group-members-count {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 99px;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Message Bubbles */
.message-row {
    display: flex;
    gap: 12px;
    max-width: 80%;
}

.message-row.row-creator {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-row.row-agent {
    align-self: flex-start;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.msg-avatar.agent-msg-avatar {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
}

.msg-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.msg-sender {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}

.message-row.row-creator .msg-sender {
    text-align: right;
}

.msg-bubble {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
}

.message-row.row-creator .msg-bubble {
    background-color: var(--neon-purple);
    border-color: var(--neon-purple);
    box-shadow: 0 4px 12px var(--neon-purple-glow);
    color: white;
}

.message-row.row-agent .msg-bubble {
    background-color: rgba(6, 182, 212, 0.05);
    border-color: rgba(6, 182, 212, 0.2);
}

/* Typing Indicator */
.typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 12px 18px;
}

.typing-bubble span {
    width: 6px;
    height: 6px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    display: inline-block;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.typing-bubble span:nth-child(1) { animation-delay: -0.32s; }
.typing-bubble span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Chat Input */
.chat-input-bar {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.15);
}

.chat-input-bar input {
    flex: 1;
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-family: inherit;
    font-size: 14px;
    padding: 0 16px;
    transition: all var(--transition-fast);
}

.chat-input-bar input:focus {
    border-color: var(--neon-cyan);
    outline: none;
    box-shadow: 0 0 8px var(--neon-cyan-glow);
}

.chat-input-bar input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Custom Widgets embedded inside messages */
.chat-widget-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-top: 8px;
    padding: 16px;
    width: 380px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* Library Check widget */
.lib-scan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.lib-scan-header h5 {
    font-size: 13px;
    font-weight: 700;
}

.scan-indicator {
    font-size: 11px;
    font-weight: 600;
    color: var(--neon-cyan);
}

.lib-scan-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lib-scan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.lib-scan-item .user-lbl {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lib-scan-item .user-lbl img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.owned-badge {
    font-size: 11px;
    font-weight: 700;
}

.owned-badge.yes { color: var(--neon-green); }
.owned-badge.no { color: var(--neon-red); }
.owned-badge.pending { color: var(--text-muted); }

/* Polling Widget */
.poll-widget h5 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}

.poll-option-row {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 8px;
    padding: 10px 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    transition: all var(--transition-fast);
}

.poll-option-row:hover:not(.voted) {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--neon-cyan);
}

.poll-fill-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(6, 182, 212, 0.1);
    z-index: 1;
    transition: width 0.6s cubic-bezier(0.1, 0.8, 0.3, 1);
}

.poll-opt-text {
    position: relative;
    z-index: 2;
    font-weight: 600;
}

.poll-votes-text {
    position: relative;
    z-index: 2;
    font-size: 11px;
    color: var(--text-secondary);
}

/* Post game summary widget */
.summary-widget-card {
    width: 440px;
    background: linear-gradient(135deg, rgba(30, 20, 45, 0.9), rgba(15, 10, 25, 0.95));
    border: 1px solid var(--neon-purple);
    box-shadow: 0 0 20px var(--neon-purple-glow);
}

.summary-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(168, 85, 247, 0.2);
    padding-bottom: 10px;
}

.summary-title-row i {
    color: var(--neon-purple);
    font-size: 20px;
}

.summary-title-row h5 {
    font-size: 15px;
    font-weight: 800;
}

.summary-subtitle {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 16px;
}

.summary-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.summary-stat-box {
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
}

.summary-stat-box h6 {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.summary-stat-box div {
    font-size: 16px;
    font-weight: 700;
    color: var(--neon-cyan);
}

.achievements-list h6 {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.achievement-row {
    display: flex;
    gap: 10px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 6px;
    align-items: center;
}

.achievement-badge {
    width: 28px;
    height: 28px;
    background: rgba(168, 85, 247, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neon-purple);
    font-size: 12px;
}

.achievement-details h7 {
    display: block;
    font-size: 12px;
    font-weight: 700;
}

.achievement-details p {
    font-size: 10px;
    color: var(--text-secondary);
}

/* RIGHT PANEL WIDGETS */
.dashboard-widgets {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: calc(100vh - 118px);
    overflow-y: auto;
    padding-right: 4px;
}

.widget-card {
    padding: 20px;
}

.widget-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.widget-header h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wallet-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.wallet-amount {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: var(--neon-cyan);
}

.wallet-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.wallet-funding-input {
    margin-bottom: 16px;
}

.quick-fund-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.wallet-ledger h5 {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.ledger-list {
    list-style: none;
    max-height: 110px;
    overflow-y: auto;
    font-size: 11px;
}

.ledger-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.ledger-item.deposit { color: var(--neon-green); }
.ledger-item.payment { color: var(--neon-red); }

.ledger-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 12px 0;
}

.krew-members-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.krew-member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    padding: 8px 12px;
}

.member-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.member-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
}

.member-role {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
}

.calendar-display {
    background: rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    line-height: 1.5;
}

.calendar-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 12px 0;
}

.calendar-active-card h5 {
    color: var(--neon-cyan);
    font-weight: 700;
    margin-bottom: 4px;
}

.calendar-time {
    color: var(--text-secondary);
    font-size: 11px;
    margin-bottom: 8px;
}

.calendar-footer {
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 8px;
    padding-top: 8px;
    color: var(--text-muted);
    font-size: 10px;
}

/* LAUNCH OVERLAY */
.launch-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(20px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

.launch-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.overlay-stage {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 600px;
    max-width: 90%;
}

.overlay-stage.active-stage {
    display: flex;
}

/* Spinner */
.spinner-box {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 24px;
}

.double-spinner {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid transparent;
    border-top-color: var(--neon-cyan);
    border-bottom-color: var(--neon-purple);
    border-radius: 50%;
    animation: spin-pulse 2s infinite linear;
}

.center-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: white;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes spin-pulse {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.05); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.overlay-stage h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.overlay-stage p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

.daemon-checklist {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.check-item {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

.check-item i.fa-circle-notch {
    color: var(--neon-cyan);
}

.check-item.done {
    color: var(--text-primary);
}

.check-item.done i {
    color: var(--neon-green) !important;
}

/* Party Status Box */
.party-status-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    margin-bottom: 32px;
}

.party-member {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.party-member.ready {
    border-color: var(--neon-green);
    background: rgba(16, 185, 129, 0.05);
}

.party-member img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.party-member span {
    font-size: 14px;
    font-weight: 700;
}

.party-member .badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.2);
}

.party-member.ready .badge {
    color: var(--neon-green);
}

/* Countdown */
.launch-countdown-box {
    text-align: center;
    margin-top: 16px;
}

.countdown-label {
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 4px;
}

.countdown-num {
    font-family: 'Outfit', sans-serif;
    font-size: 64px;
    font-weight: 900;
    color: var(--neon-cyan);
    animation: scale-up 1s infinite linear;
}

@keyframes scale-up {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(1.2); opacity: 1; }
}

/* Game Window Sandbox */
.overlay-stage#stage-gameplay {
    width: 960px;
    max-width: 95%;
}

.game-window {
    background-color: #0b0e14;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

.game-header {
    background-color: #1c2130;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.window-controls {
    display: flex;
    gap: 6px;
}

.window-controls span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.2);
}

.game-screen-content {
    padding: 40px;
    background: radial-gradient(circle at center, #1b263b 0%, #080b11 100%);
    min-height: 480px;
}

.game-ui-mock {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.game-title {
    font-family: 'Outfit', sans-serif;
    font-size: 44px;
    font-weight: 900;
    letter-spacing: 4px;
    color: white;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    margin-bottom: 4px;
}

.game-subtitle {
    font-size: 13px;
    color: var(--neon-cyan);
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 24px;
}

.party-banner {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid var(--neon-purple);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    padding: 8px 20px;
    margin-bottom: 32px;
}

.gameplay-simulation {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
    width: 100%;
    margin-bottom: 32px;
    text-align: left;
}

.game-log {
    background-color: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    height: 150px;
    overflow-y: auto;
    padding: 12px;
    font-family: monospace;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #a0aec0;
}

.game-log div {
    line-height: 1.4;
}

.combat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 12px;
    height: 150px;
}

.grid-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.grid-card:nth-child(3) {
    grid-column: span 2;
}

.grid-card h5 {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.stat-big {
    font-size: 20px;
    font-weight: 800;
    color: var(--neon-green);
}

.stat-big.countdown-timer {
    color: var(--neon-cyan);
}

.game-footer {
    width: 100%;
}

.game-footer p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

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

/* Theme Overrides */

/* 1. Cyberpunk Theme (Default) */
body.theme-cyber {
    /* Variables are already set to cyber defaults in root */
}

/* 2. Retro Arcade Theme (8-Bit Style) */
body.theme-retro {
    --bg-dark: #16120e;
    --bg-main: #251b14;
    --bg-card: #32251a;
    --border-color: #7c501a;
    
    --neon-purple: #ff6600; /* Arcade Orange */
    --neon-purple-glow: rgba(255, 102, 0, 0.25);
    --neon-cyan: #00ff55;   /* Arcade Green */
    --neon-cyan-glow: rgba(0, 255, 85, 0.25);
    --neon-green: #39ff14;  /* Bright lime */
    --neon-green-glow: rgba(57, 255, 20, 0.25);
    --neon-red: #ff2222;
    --neon-red-glow: rgba(255, 34, 34, 0.25);
    
    --text-primary: #ffebcc;
    --text-secondary: #d4a373;
    --text-muted: #8c6239;
    
    font-family: 'Courier New', Courier, monospace;
}

body.theme-retro .glass-panel {
    background: var(--bg-card);
    border: 4px double var(--border-color);
    border-radius: 4px;
    box-shadow: 6px 6px 0px #000;
    backdrop-filter: none;
}

body.theme-retro .btn {
    border-radius: 0;
    border: 2px solid #000;
    box-shadow: 3px 3px 0px #000;
}

body.theme-retro .btn-primary {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-purple));
    box-shadow: 3px 3px 0px #000;
}

body.theme-retro .btn-primary:hover:not(:disabled) {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0px #000;
}

body.theme-retro .sim-step-num {
    border-radius: 4px;
}

body.theme-retro .user-avatar, 
body.theme-retro .member-avatar, 
body.theme-retro .msg-avatar {
    image-rendering: pixelated;
    border-radius: 4px;
}

/* 3. Tactical Slate Theme (Military Ops Style) */
body.theme-tactical {
    --bg-dark: #1a1c1e;
    --bg-main: #22252a;
    --bg-card: #2c3038;
    --border-color: #485264;
    
    --neon-purple: #f59e0b; /* Tactical Amber/Yellow */
    --neon-purple-glow: rgba(245, 158, 11, 0.15);
    --neon-cyan: #84cc16;   /* Tactical Olive Green */
    --neon-cyan-glow: rgba(132, 204, 22, 0.15);
    --neon-green: #22c55e;
    --neon-green-glow: rgba(34, 197, 94, 0.15);
    --neon-red: #ef4444;
    --neon-red-glow: rgba(239, 68, 68, 0.15);
    
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    font-family: 'Consolas', 'Courier New', monospace;
}

body.theme-tactical .glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    backdrop-filter: none;
}

body.theme-tactical .btn {
    border-radius: 4px;
    border: 1px solid var(--border-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 12px;
}

body.theme-tactical .btn-primary {
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-purple));
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    color: #000;
}

body.theme-tactical .btn-primary:hover:not(:disabled) {
    transform: none;
    background: #e08e0b;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

body.theme-tactical .sim-step-num {
    border-radius: 2px;
}

body.theme-tactical .logo-icon {
    border-radius: 4px;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
    color: #000;
}

/* Krew+ Sub & Early Access Styles */
.ea-game-item.unlocked {
    opacity: 1 !important;
    border-color: var(--neon-cyan) !important;
    box-shadow: 0 0 10px var(--neon-cyan-glow);
}

.ea-game-item.unlocked .status-badge {
    background-color: rgba(6, 182, 212, 0.15) !important;
    border: 1px solid var(--neon-cyan) !important;
    color: var(--neon-cyan) !important;
}

#sub-status-badge.subscribed {
    background-color: rgba(168, 85, 247, 0.15) !important;
    border: 1px solid var(--neon-purple) !important;
    color: var(--neon-purple) !important;
}

/* Disabled selectors styling when not subscribed */
#theme-selector.locked-switcher {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Theme selector option styling */
#theme-selector option:disabled {
    color: var(--text-muted);
    background-color: var(--bg-dark);
}

/* Hardware & Upgrades custom UI styling */
.member-hw-spec {
    font-family: inherit;
    transition: all 0.5s ease-in-out;
}

.hw-upgraded-glow {
    color: var(--neon-green) !important;
    text-shadow: 0 0 8px var(--neon-green-glow);
    animation: pulseGlow 1.5s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    from {
        text-shadow: 0 0 4px var(--neon-green-glow);
    }
    to {
        text-shadow: 0 0 12px var(--neon-green-glow);
    }
}

/* Specs comparison table */
.spec-comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 11px;
}
.spec-comparison-table th, .spec-comparison-table td {
    padding: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}
.spec-comparison-table th {
    color: var(--text-muted);
    font-weight: 500;
}
.spec-comparison-table td.spec-warn {
    color: var(--neon-red);
    font-weight: 600;
}
.spec-comparison-table td.spec-ok {
    color: var(--neon-green);
    font-weight: 600;
}
