/* Team Games AI Platform Master Stylesheet */
@font-face {
    font-family: 'Space Grotesk';
    src: url('../fonts/space-grotesk.woff2') format('woff2');
    font-weight: 400 700;
    font-display: swap;
}

@font-face {
    font-family: 'DM Sans';
    src: url('../fonts/dm-sans.woff2') format('woff2');
    font-weight: 400 600 700;
    font-display: swap;
}

:root {
    --bg-main: #060913;
    --bg-card: #0d1222;
    --bg-card-hover: #131b31;
    --bg-elevated: #161e36;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 212, 255, 0.3);
    
    --cyan: #00d4ff;
    --cyan-glow: rgba(0, 212, 255, 0.4);
    --magenta: #ff3366;
    --magenta-glow: rgba(255, 51, 102, 0.4);
    --yellow: #ffb703;
    --green: #2ed573;
    --purple: #9b51e0;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, .brand-font {
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.02em;
}

/* NAVBAR */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: rgba(6, 9, 19, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-badge {
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
}

.nav-item {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
}

.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-item.active {
    color: var(--cyan);
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.25);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--cyan);
}

.wallet-badge {
    color: var(--green);
    background: rgba(46, 213, 115, 0.12);
    padding: 2px 8px;
    border-radius: 12px;
    font-family: 'Space Grotesk', monospace;
    font-size: 12px;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff, #0088ff);
    color: #050b18;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-accent {
    background: linear-gradient(135deg, #ff3366, #ff6b8b);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.3);
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 51, 102, 0.5);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* APP CONTAINER */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
}

.view-section {
    display: none;
}

.view-section.active {
    display: block;
    animation: fadeIn 0.25s ease-in-out;
}

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

/* GRID & CARDS */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.16);
}

/* AI STUDIO & BUILDER */
.prompt-hero {
    background: linear-gradient(180deg, rgba(0, 212, 255, 0.08) 0%, rgba(13, 18, 34, 0.95) 100%);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.prompt-bar-wrap {
    display: flex;
    gap: 12px;
    background: var(--bg-main);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: var(--radius-lg);
    padding: 8px 12px;
    margin-top: 18px;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.12);
}

.prompt-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    padding: 6px 10px;
}

.prompt-input::placeholder {
    color: var(--text-muted);
}

.template-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.chip:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--cyan);
    color: #fff;
}

/* AGENT STATUS PIPELINE */
.agent-pipeline {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.agent-node {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    transition: all 0.2s ease;
}

.agent-node.active {
    border-color: var(--cyan);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.25);
}

.agent-node.completed {
    border-color: var(--green);
}

.agent-role {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--cyan);
    font-weight: 700;
    letter-spacing: 0.05em;
}

.agent-name {
    font-weight: 700;
    font-size: 13px;
    color: #fff;
}

.agent-status-text {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}

/* PLAYTEST CANVAS SANDBOX */
.studio-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.canvas-container {
    background: #030610;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.canvas-toolbar {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#gameCanvas {
    width: 100%;
    height: auto;
    max-height: 560px;
    background: #060913;
    display: block;
    cursor: crosshair;
}

/* TWITCH-STYLE LIVE SPECTATOR TV */
.tv-layout {
    display: grid;
    grid-template-columns: 2.4fr 1fr;
    gap: 20px;
    height: calc(100vh - 120px);
}

.tv-stream-area {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tv-video-wrap {
    background: #000;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tv-chat-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chat-bubble {
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.chat-badge {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 700;
    margin-right: 6px;
    text-transform: uppercase;
}

.badge-creator { background: var(--purple); color: #fff; }
.badge-mod { background: var(--green); color: #000; }
.badge-donor { background: var(--yellow); color: #000; }
.badge-vip { background: var(--cyan); color: #000; }
.badge-viewer { background: rgba(255,255,255,0.1); color: var(--text-muted); }

.chat-input-bar {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 8px;
    background: var(--bg-elevated);
}

.donation-banner-live {
    background: linear-gradient(90deg, rgba(255, 183, 3, 0.2), rgba(255, 51, 102, 0.2));
    border-left: 3px solid var(--yellow);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    animation: flashPulse 1.5s infinite alternate;
}

@keyframes flashPulse {
    from { opacity: 0.85; }
    to { opacity: 1; }
}

/* FLOATING REACTION EMOJIS */
.reactions-bar {
    display: flex;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.btn-reaction {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    font-size: 18px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.btn-reaction:hover {
    transform: scale(1.25);
    background: rgba(255, 255, 255, 0.15);
}

/* STATS COUNTER TILES */
.stat-tile {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    color: #fff;
}

/* CO-CREATOR SLIDERS */
.co-creator-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.split-slider {
    flex: 1;
    accent-color: var(--cyan);
}

/* MODALS */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 16, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 580px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    position: relative;
}

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

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

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

/* FORMS */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

/* ARCADE GAME CARDS */
.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--cyan);
    box-shadow: 0 12px 30px rgba(0, 212, 255, 0.15);
}

.game-thumb {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #090e1f;
}

.game-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.game-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .studio-layout, .tv-layout, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    .agent-pipeline {
        grid-template-columns: 1fr 1fr;
    }
}

/* SUB-NAVIGATION TABS FOR DASHBOARDS */
.subnav-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    padding-bottom: 2px;
}

.subnav-item {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    transition: all 0.2s ease;
}

.subnav-item:hover {
    color: #fff;
    background: var(--bg-card);
}

.subnav-item.active {
    color: var(--cyan);
    background: var(--bg-card);
    border-color: var(--border-color);
    border-bottom: 2px solid var(--cyan);
}

/* STATUS BADGES */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-pending {
    background: rgba(255, 183, 3, 0.15);
    color: var(--yellow);
    border: 1px solid rgba(255, 183, 3, 0.3);
}

.badge-paid, .badge-published, .badge-active {
    background: rgba(46, 213, 115, 0.15);
    color: var(--green);
    border: 1px solid rgba(46, 213, 115, 0.3);
}

.badge-rejected, .badge-draft {
    background: rgba(255, 51, 102, 0.15);
    color: var(--magenta);
    border: 1px solid rgba(255, 51, 102, 0.3);
}

.badge-featured {
    background: linear-gradient(135deg, rgba(255, 183, 3, 0.25), rgba(255, 51, 102, 0.25));
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.4);
}

/* AUTH TABS */
.auth-tabs {
    display: flex;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 20px;
}

.auth-tab-btn {
    flex: 1;
    text-align: center;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.auth-tab-btn.active {
    background: var(--bg-card);
    color: var(--cyan);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* INTERACTIVE CROWD CONTROL & MODIFIERS */
.modifier-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.modifier-item-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

.modifier-booster-card {
    border-left: 3px solid var(--cyan);
}

.modifier-blocker-card {
    border-left: 3px solid var(--magenta);
}

.modifier-price-tag {
    font-weight: 700;
    font-size: 13px;
    color: var(--yellow);
    background: rgba(255, 183, 3, 0.12);
    border: 1px solid rgba(255, 183, 3, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
}

.btn-trigger-booster {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 212, 255, 0.35));
    border: 1px solid var(--cyan);
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-trigger-booster:hover {
    background: var(--cyan);
    color: #060913;
    box-shadow: 0 0 14px var(--cyan-glow);
    transform: translateY(-1px);
}

.btn-trigger-blocker {
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.2), rgba(255, 51, 102, 0.35));
    border: 1px solid var(--magenta);
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-trigger-blocker:hover {
    background: var(--magenta);
    color: #fff;
    box-shadow: 0 0 14px var(--magenta-glow);
    transform: translateY(-1px);
}

.badge-interactive_booster {
    background: rgba(0, 212, 255, 0.2);
    color: var(--cyan);
    border: 1px solid rgba(0, 212, 255, 0.4);
    font-weight: 700;
}

.badge-interactive_blocker {
    background: rgba(255, 51, 102, 0.2);
    color: var(--magenta);
    border: 1px solid rgba(255, 51, 102, 0.4);
    font-weight: 700;
}
