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

:root {
    --bg-dark: #0a0b0e;
    --bg-panel: rgba(18, 20, 26, 0.7);
    --bg-editor: #16181d;
    --bg-editor-tabs: #1e222b;
    --bg-editor-active: #282c34;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 229, 255, 0.2);
    
    --text-main: #f5f6f8;
    --text-muted: #8b949e;
    --text-cyan: #00e5ff;
    --text-purple: #b042ff;
    --text-green: #39ff14;
    --text-yellow: #ffd700;
    
    --discord-blurple: #5865f2;
    --discord-blurple-hover: #4752c4;
    
    --danger-red: #ff3838;
    --danger-glow: rgba(255, 56, 56, 0.4);
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Outfit', sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    --transition-speed: 0.3s;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Background Glowing Orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.4;
}
.orb-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--text-cyan) 0%, transparent 70%);
}
.orb-2 {
    bottom: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--text-purple) 0%, transparent 70%);
}
.orb-3 {
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(176, 66, 255, 0.2) 0%, transparent 60%);
}

/* Header Styling */
.app-header {
    background: rgba(10, 11, 14, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

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

.badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-cyan);
    border: 1px solid var(--text-cyan);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    text-shadow: 0 0 5px rgba(0, 229, 255, 0.4);
    box-shadow: inset 0 0 4px rgba(0, 229, 255, 0.2);
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: 30px;
}

.view-status {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.view-status strong {
    color: var(--text-main);
}

.toggle-label {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Switch Toggle Slider */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    transition: var(--transition-speed);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-main);
    transition: var(--transition-speed);
}

input:checked + .slider {
    background-color: var(--text-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}

input:checked + .slider:before {
    transform: translateX(24px);
    background-color: var(--bg-dark);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Layout container */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: calc(100vh - 78px);
    position: relative;
}

.facade-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2.5rem;
    transition: width var(--transition-speed), flex var(--transition-speed);
    position: relative;
}

.scrollable {
    overflow-y: auto;
}

/* Discord profile banner overlay */
.discord-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(88, 101, 242, 0.15);
    border: 1px solid rgba(88, 101, 242, 0.3);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.discord-avatar-container {
    position: relative;
}

#discord-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #23272a;
    border: 2px solid var(--discord-blurple);
}

.discord-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #23a55a;
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
}

.discord-user-info {
    flex-grow: 1;
}

.discord-username-row {
    font-size: 1.1rem;
    font-weight: 700;
}
.discord-tag {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

.role-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.role-badge.admin {
    background: rgba(255, 215, 0, 0.15);
    color: var(--text-yellow);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Sections */
.view-section {
    display: none;
    flex-direction: column;
    animation: fadeIn 0.4s ease;
    height: 100%;
}
.view-section.active {
    display: flex;
}

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

/* Hero Section */
.hero-banner {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 16px;
    margin-bottom: 2rem;
    box-shadow: 0 0 40px rgba(0, 229, 255, 0.15), 0 0 80px rgba(176, 66, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.hero-section {
    text-align: center;
    margin-bottom: 3rem;
}
.hero-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #ffffff, #888, var(--text-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle {
    color: var(--text-muted);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Marketing Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(12px);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
}

.discord-card:hover {
    box-shadow: 0 10px 30px rgba(88, 101, 242, 0.15);
    border-color: rgba(88, 101, 242, 0.4);
}
.admin-card:hover {
    box-shadow: 0 10px 30px rgba(176, 66, 255, 0.15);
    border-color: rgba(176, 66, 255, 0.4);
}
.reset-card:hover {
    box-shadow: 0 10px 30px rgba(255, 56, 56, 0.15);
    border-color: rgba(255, 56, 56, 0.4);
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.admin-badge-preview {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: rgba(176, 66, 255, 0.1);
    color: var(--text-purple);
    border: 1px solid rgba(176, 66, 255, 0.25);
    padding: 0.5rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-purple);
}
.dot.pulse {
    animation: pulseGlow 1.5s infinite alternate;
}

@keyframes pulseGlow {
    from { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(176, 66, 255, 0.7); }
    to { transform: scale(1.1); box-shadow: 0 0 8px 3px rgba(176, 66, 255, 0.4); }
}

/* Quote container */
.quote-container {
    background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 100%);
    border-left: 4px solid var(--text-cyan);
    border-radius: 0 12px 12px 0;
    padding: 2rem;
    margin-bottom: 3rem;
    backdrop-filter: blur(10px);
}

.quote-text {
    font-style: italic;
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    color: #e2e8f0;
}

.quote-author {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-cyan);
}

.dashboard-cta {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.separator-line {
    width: 80px;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--text-muted), transparent);
}

/* General Buttons */
.btn {
    font-family: var(--font-sans);
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--text-cyan) 0%, #00a8cc 100%);
    color: var(--bg-dark);
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.45);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-red) 0%, #d32f2f 100%);
    color: #fff;
    box-shadow: 0 4px 15px var(--danger-glow);
}
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 56, 56, 0.6);
}

.btn-discord {
    background-color: var(--discord-blurple);
    color: white;
    width: 100%;
}
.btn-discord:hover {
    background-color: var(--discord-blurple-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(88, 101, 242, 0.4);
}

.btn-link {
    background: transparent;
    color: var(--text-muted);
    align-self: flex-start;
    padding: 0;
    margin-bottom: 1.5rem;
}
.btn-link:hover {
    color: var(--text-main);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
}
.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 12px;
}
.btn-block {
    width: 100%;
}

.icon {
    width: 18px;
    height: 18px;
}

/* Tournament Configurator View */
.dashboard-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.dashboard-header-row h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
}

.format-select-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.form-select {
    background: var(--bg-editor);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    outline: none;
    font-family: var(--font-sans);
    cursor: pointer;
}
.form-select:focus {
    border-color: var(--text-cyan);
}

.tournament-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: start;
    flex: 1;
}

.glass-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
}

.tournament-controls-panel h3,
.tournament-visualization-panel h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.add-player-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.form-input {
    flex-grow: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: var(--text-main);
    outline: none;
    font-family: var(--font-sans);
}
.form-input:focus {
    border-color: var(--text-cyan);
}

.player-list-section {
    margin-bottom: 1.5rem;
}
.player-list-section h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.styled-list {
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
}
.styled-list li {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}
.styled-list li:last-child {
    border-bottom: none;
}

.delete-player-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
}
.delete-player-btn:hover {
    color: var(--danger-red);
}

.empty-list-msg {
    color: var(--text-muted);
    text-align: center;
    padding: 1.5rem !important;
    font-style: italic;
}

.controls-action-block {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Visualization Panel */
.panel-header-tabbed {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.admin-indicator {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 4px;
}
.admin-indicator.active {
    color: var(--text-green);
    background: rgba(57, 255, 20, 0.1);
    border-color: rgba(57, 255, 20, 0.2);
}

.visualization-content {
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: auto;
}

.empty-state-visual {
    text-align: center;
    color: var(--text-muted);
}
.visual-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Bracket Renders */
.bracket-container {
    display: flex;
    gap: 3rem;
    padding: 1rem;
    align-items: center;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 2rem;
    height: 100%;
}

.round-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    margin-bottom: 0.5rem;
}

.bracket-match {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 200px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
}
.bracket-match:hover {
    transform: scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
}
.bracket-match.selected {
    border-color: var(--text-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
}

.match-team {
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}
.match-team:first-child {
    border-bottom: 1px solid var(--border-color);
}
.match-team.winner {
    color: var(--text-green);
    font-weight: 600;
}
.match-team.loser {
    color: var(--text-muted);
    text-decoration: line-through;
}

.team-score {
    font-family: var(--font-mono);
    font-weight: 600;
}

/* League Table Render */
.league-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}
.league-table th {
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}
.league-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.league-table tr:hover {
    background: rgba(255,255,255,0.02);
}

.rank-col { font-weight: 700; width: 40px; color: var(--text-cyan); }
.score-col { font-family: var(--font-mono); }

/* Match Edit Panel / Admin Controls */
.panel-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

.match-edit-panel {
    position: relative;
    animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
    from { transform: translateY(15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.match-edit-panel h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.admin-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 20, 26, 0.95);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 8px;
    padding: 1rem;
}
.lock-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 5px rgba(255,215,0,0.4));
}
.admin-lock-overlay p {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.admin-lock-overlay .sub-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.match-edit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.team-edit {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}
.team-edit:last-child {
    justify-content: flex-end;
}

.score-input {
    width: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.4rem;
    color: var(--text-main);
    font-family: var(--font-mono);
    text-align: center;
    font-size: 1.1rem;
    outline: none;
}
.score-input:focus {
    border-color: var(--text-cyan);
}

.vs-label {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-muted);
}

/* RIGHT PANEL: Behind the scenes mock IDE */
.backend-panel {
    width: 45%;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background-color: var(--bg-editor);
    transition: width var(--transition-speed);
}

.backend-panel.hidden {
    display: none;
}

/* Split view states */
#main-layout.split-active .facade-panel {
    flex: 0 0 55%;
    width: 55%;
}

.editor-header {
    background-color: var(--bg-editor-tabs);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--bg-dark);
}

.window-buttons {
    display: flex;
    gap: 6px;
}
.win-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.win-btn.close { background-color: #ff5f56; }
.win-btn.minimize { background-color: #ffbd2e; }
.win-btn.maximize { background-color: #27c93f; }

.editor-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.editor-metrics {
    display: flex;
    gap: 0.5rem;
}
.metric-pill {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.metric-pill.security-bad {
    color: var(--danger-red);
    background: rgba(255, 56, 56, 0.1);
    border: 1px solid rgba(255, 56, 56, 0.2);
}

.editor-tabs {
    background-color: var(--bg-editor-tabs);
    display: flex;
    border-bottom: 1px solid var(--bg-dark);
}

.editor-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    cursor: pointer;
    border-right: 1px solid var(--bg-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s;
}
.editor-tab:hover {
    background-color: rgba(255,255,255,0.02);
}
.editor-tab.active {
    background-color: var(--bg-editor-active);
    color: var(--text-main);
    border-bottom: 1px solid var(--text-cyan);
}

.editor-workspace {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

.line-numbers {
    background-color: var(--bg-editor);
    padding: 1rem 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.2);
    text-align: right;
    width: 40px;
    user-select: none;
    line-height: 1.5;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.code-area-container {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

.warning-floating-banner {
    background: rgba(255, 215, 0, 0.1);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    color: var(--text-yellow);
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    font-family: var(--font-sans);
}

#code-textarea {
    flex: 1;
    background: var(--bg-editor-active);
    border: none;
    resize: none;
    outline: none;
    color: #abb2bf;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
    padding: 1rem;
    white-space: pre;
    overflow: auto;
}

.editor-footer {
    background-color: var(--bg-editor-tabs);
    border-top: 1px solid var(--bg-dark);
    padding: 0.35rem 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.footer-item {
    font-family: var(--font-mono);
}

/* Modals & Dialogs */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-overlay.hidden {
    display: none;
}

.discord-modal-box {
    background-color: #313338;
    border-radius: 8px;
    width: 440px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
    animation: scaleUp 0.25s ease-out;
}
@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.discord-modal-header {
    background-color: #2b2d31;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.discord-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.discord-modal-body {
    padding: 1.5rem;
}

.discord-app-desc {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: #dbdee1;
}

.discord-permissions-list {
    list-style: none;
    background: #2b2d31;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.03);
}
.discord-permissions-list li {
    font-size: 0.85rem;
    color: #dbdee1;
    margin-bottom: 0.5rem;
}
.discord-permissions-list li:last-child {
    margin-bottom: 0;
}

.discord-account-select {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 1rem;
}
.discord-account-select .sub-text {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #949ba4;
    margin-bottom: 0.5rem;
}

.discord-accounts-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.discord-account-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #2b2d31;
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, background-color 0.2s;
}
.discord-account-option:hover {
    background-color: #35373c;
}
.discord-account-option.active {
    border-color: var(--discord-blurple);
    background-color: rgba(88, 101, 242, 0.05);
}

.mini-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}
.account-details {
    display: flex;
    flex-direction: column;
}
.opt-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}
.opt-badge {
    font-size: 0.75rem;
}

.discord-modal-actions {
    background-color: #2b2d31;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.discord-btn {
    border-radius: 4px;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    font-family: var(--font-sans);
}
.discord-btn-secondary {
    background: transparent;
    color: white;
}
.discord-btn-secondary:hover {
    text-decoration: underline;
}
.discord-btn-primary {
    background-color: var(--discord-blurple);
    color: white;
}
.discord-btn-primary:hover {
    background-color: var(--discord-blurple-hover);
}

/* WIPE GLITCH EFFECT */
.glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #000;
    color: #ff3333;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
}
.glitch-overlay.hidden {
    display: none;
}

.glitch-screen {
    width: 600px;
    max-width: 90%;
    padding: 2rem;
    border: 2px solid #ff3333;
    background-color: #0d0000;
    box-shadow: 0 0 30px rgba(255, 51, 51, 0.3);
    animation: glitchShake 0.4s infinite alternate;
}

@keyframes glitchShake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(0px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(2px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(2px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.glitch-title {
    font-size: 2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 2px 2px #00ffff;
}

.glitch-details {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #ff8888;
}

.glitch-bar {
    height: 10px;
    background: #330000;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.glitch-bar-fill {
    height: 100%;
    width: 0%;
    background-color: #ff3333;
    box-shadow: 0 0 10px #ff3333;
    animation: fillProgress 1.8s forwards;
}

@keyframes fillProgress {
    to { width: 100%; }
}

.glitch-console-logs {
    height: 150px;
    overflow-y: auto;
    background-color: #050000;
    border: 1px solid #330000;
    padding: 0.75rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #ff5555;
}

/* Utilities */
.hidden {
    display: none !important;
}
.text-cyan { color: var(--text-cyan); }
.text-purple { color: var(--text-purple); }
.text-warning { color: var(--text-yellow); }
.text-muted { color: var(--text-muted); }

/* Responsive adjustments */
@media (max-width: 1024px) {
    .tournament-layout {
        grid-template-columns: 1fr;
    }
    .main-container {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
    }
    .facade-panel {
        overflow-y: visible;
        padding: 1.5rem;
        width: 100% !important;
        flex: none !important;
    }
    .backend-panel {
        width: 100% !important;
        height: 500px;
        border-left: none;
        border-top: 1px solid var(--border-color);
        flex: none !important;
    }
    #main-layout.split-active .facade-panel {
        width: 100% !important;
    }
}
