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

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Droid Sans Mono', 'Source Code Pro', monospace;
    background: #0a0e27;
    color: #fff;
    min-height: 100vh;
    padding: 0;
    overflow: hidden;
    width: 100%;
}

.header {
    background: linear-gradient(135deg, #ff0080 0%, #7928ca 50%, #ff0080 100%);
    background-size: 200% 200%;
    animation: gradient 3s ease infinite;
    padding: 10px 25px;
    text-align: left;
    border-bottom: 3px solid #ff0080;
    box-shadow: 0 4px 20px rgba(255, 0, 128, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    z-index: 100;
    position: relative;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0; /* Allow flex items to shrink below content size */
    overflow: hidden;
}

.header-challenge {
    font-size: 0.9em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    padding-left: 20px;
    border-left: 2px solid rgba(255, 255, 255, 0.3);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0; /* Prevent shrinking */
}

.gold-balance-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.5);
}

.btn-leaderboard {
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(255, 0, 128, 0.3), rgba(255, 215, 0, 0.3));
    border: 1px solid rgba(255, 215, 0, 0.6);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-leaderboard:hover {
    background: linear-gradient(135deg, rgba(255, 0, 128, 0.5), rgba(255, 215, 0, 0.5));
    border-color: #ffd700;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.btn-signup {
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(255, 0, 128, 0.3), rgba(121, 40, 202, 0.3));
    border: 1px solid rgba(255, 0, 128, 0.6);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-signup:hover {
    background: linear-gradient(135deg, rgba(255, 0, 128, 0.5), rgba(121, 40, 202, 0.5));
    border-color: #ff0080;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 0, 128, 0.3);
}

.user-account-btn {
    position: relative;
}

.user-profile-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #2d3561;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    color: #fff;
    transition: all 0.2s ease;
}

.user-profile-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ff0080;
}

.user-avatar {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.user-email-text {
    font-size: 13px;
    font-weight: 600;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 10px;
    color: #8b92b0;
    transition: transform 0.2s ease;
}

.user-account-btn.open .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 220px;
    background: #0f1425;
    border: 1px solid #2d3561;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow: hidden;
}

.user-menu-header {
    padding: 15px;
    background: #1a1f3a;
    border-bottom: 1px solid #2d3561;
}

.user-menu-email {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    word-break: break-word;
}

.user-menu-item {
    width: 100%;
    padding: 12px 15px;
    background: none;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-menu-item.logout {
    color: #ff0080;
    border-top: 1px solid #2d3561;
}

.user-menu-item.logout:hover {
    background: rgba(255, 0, 128, 0.1);
}

.btn-how-it-works {
    padding: 8px 16px;
    background: rgba(121, 40, 202, 0.2);
    border: 1px solid rgba(121, 40, 202, 0.5);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-how-it-works:hover {
    background: rgba(121, 40, 202, 0.4);
    border-color: #7928ca;
    transform: translateY(-1px);
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.header h1 {
    font-size: 1.5em;
    margin-bottom: 0;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 20px rgba(255, 0, 128, 0.5);
    white-space: nowrap;
    flex-shrink: 0; /* Don't shrink the title */
}

.header .tagline {
    font-size: 1.2em;
    opacity: 0.95;
    font-weight: 600;
}

.challenge-banner {
    background: #1a1f3a;
    padding: 20px;
    text-align: center;
    border-bottom: 2px solid #2d3561;
}

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

.challenge-banner h2 {
    color: #ff0080;
    font-size: 1.5em;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.challenge-rules {
    display: flex;
    justify-content: center;
    gap: 40px;
    font-size: 0.9em;
    color: #8b92b0;
}

.challenge-rules span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.challenge-rules .value {
    color: #00ff88;
    font-weight: 700;
}

.gold-balance-header {
    background: linear-gradient(135deg, #1a1f3a 0%, #2a2410 100%);
    padding: 15px 30px;
    border-radius: 12px;
    border: 2px solid #ffd700;
    text-align: center;
}

.gold-label {
    font-size: 0.7em;
    color: #8b92b0;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.gold-amount {
    font-size: 2em;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.gold-icon {
    margin-right: 5px;
}

.container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 8px 12px 18px;
    display: grid;
    grid-template-columns: minmax(330px, 24vw) 1fr minmax(330px, 24vw);
    gap: 12px;
    align-items: start;
}

/* Dashboard Split Layout */
.container.dashboard-layout {
    grid-template-columns: minmax(330px, 24vw) 1fr minmax(280px, 20vw);
    grid-template-rows: auto;
    height: calc(100vh - 70px);
    align-items: stretch;
}

.dashboard-layout .left-column,
.dashboard-layout .center-column,
.dashboard-layout .right-column {
    align-self: stretch;
}

.dashboard-layout .left-column {
    grid-column: 1;
    grid-row: auto;
    background: #0f1425;
    padding: 16px;
    border: 1px solid #1a1f3a;
    border-radius: 12px;
    min-width: 330px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    height: calc(100vh - 90px);
}

.dashboard-layout .center-column {
    grid-column: 2;
    grid-row: auto;
    background: #0a0e27;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid #1a1f3a;
    overflow-y: auto;
    height: calc(100vh - 90px);
    display: flex;
    flex-direction: column;
}

.dashboard-layout .right-column {
    grid-column: 3;
    grid-row: auto;
    background: #0f1425;
    padding: 12px 12px 16px;
    border: 1px solid #1a1f3a;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 90px);
    height: fit-content;
}

/* Right column scrollbar styling */
.dashboard-layout .right-column::-webkit-scrollbar {
    width: 8px;
}

.dashboard-layout .right-column::-webkit-scrollbar-track {
    background: #0f1425;
    border-radius: 12px;
}

.dashboard-layout .right-column::-webkit-scrollbar-thumb {
    background: #2d3561;
    border-radius: 4px;
}

.dashboard-layout .right-column::-webkit-scrollbar-thumb:hover {
    background: #ff0080;
}

/* TABS STYLES */
.tabs-nav {
    display: flex;
    border-bottom: 2px solid #1a1f3a;
    background: #0a0e27;
    border: 1px solid #1a1f3a;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.tab-btn {
    flex: 1;
    padding: 16px;
    background: transparent;
    border: none;
    color: #8b92b0;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 1px;
}

.tab-btn:hover {
    color: #fff;
    background: #151a30;
}

.tab-btn.active {
    color: #fff;
    border-bottom-color: #ff0080;
    background: #1a1f3a;
}

.tab-content {
    flex: 1;
    overflow: hidden;
    padding: 10px;
    border: 1px solid #1a1f3a;
    border-top: none;
    border-radius: 0 0 10px 10px;
    background: #0f1425;
    width: 100%;
    display: none;
    min-height: 0;
    position: relative;
    z-index: 1;
}

.tab-content.active {
    display: block;
}

.left-column .tab-content.active {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.left-column .controls-container {
    flex: 0 0 auto;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
}

/* Removed - using flexbox gap instead to avoid conflicts */

/* Compact Missions */
.missions-compact {
    padding: 12px;
}

.mission-card {
    padding: 12px;
    margin-bottom: 10px;
}

.mission-header {
    margin-bottom: 5px;
}

.mission-title {
    font-size: 0.95em;
}

.mission-reward {
    font-size: 0.9em;
}

.mission-desc {
    font-size: 0.8em;
    margin-bottom: 8px;
}

.challenge-card {
    padding: 12px;
    margin-bottom: 10px;
}

.challenge-title {
    font-size: 0.95em;
}

.challenge-desc {
    font-size: 0.8em;
}

.leaderboard {
    padding: 0;
    border-bottom: none;
}

.leaderboard h3 {
    font-size: 1.1em;
    margin-bottom: 15px;
}

.hidden {
    display: none !important;
}

.dashboard-layout .bottom-row {
    grid-column: 1 / -1;
    grid-row: 3;
    background: #0a0e27;
    border-top: 2px solid #1a1f3a;
    z-index: 5;
    position: relative;
}

.leaderboard-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0; /* Critical for flex scrolling */
    padding-right: 4px; /* Space for scrollbar */
}

.leaderboard {
    background: transparent;
    padding: 10px;
    border-right: none;
    overflow: hidden;
    max-height: none;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure it fills parent */
}

.dashboard-layout .leaderboard {
    border-bottom: none;
    margin-bottom: 0;
    flex: 1; /* Allow it to grow */
    min-height: 0; /* Critical for flex scrolling */
}

.leaderboard h3 {
    color: #ff0080;
    margin-bottom: 8px;
    font-size: 1.15em;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #2d3561;
    padding-bottom: 8px;
}

.leaderboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.handle-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0;
}

.handle-input {
    padding: 8px 10px;
    background: #0a0e27;
    border: 1px solid #2d3561;
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    min-width: 0;
    flex: 1 1 auto;
}

.btn-ghost {
    padding: 10px 12px;
    background: #1a1f3a;
    border: 1px solid #2d3561;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
}

.handle-row .btn-ghost {
    height: 36px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-size: 0.9em;
    flex: 0 0 auto;
}

#randomHandleBtn {
    width: 36px;
    min-width: 36px;
    padding: 0;
    font-size: 1.1em;
    border-radius: 8px;
}

.handle-row .handle-input {
    height: 36px;
}

.btn-ghost:hover {
    border-color: #ff0080;
    color: #ff0080;
}

/* Weekly Challenge Banner */
.weekly-challenge-banner {
    background: linear-gradient(135deg, #1a1f3a 0%, #2a1f0f 100%);
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 15px;
    align-items: center;
    transition: all 0.3s ease;
}

.weekly-challenge-banner.urgent {
    border-color: #ff0080;
    box-shadow: 0 0 25px rgba(255, 0, 128, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.2); }
    50% { box-shadow: 0 0 30px rgba(255, 215, 0, 0.4); }
}

.weekly-challenge-banner.urgent {
    animation: pulse-glow-urgent 2s ease-in-out infinite;
}

@keyframes pulse-glow-urgent {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 0, 128, 0.3); }
    50% { box-shadow: 0 0 35px rgba(255, 0, 128, 0.5); }
}

.challenge-icon {
    font-size: 2.5em;
    line-height: 1;
}

.challenge-info {
    min-width: 0;
}

.challenge-name {
    color: #ffd700;
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 4px;
}

.challenge-description {
    color: #8b92b0;
    font-size: 0.85em;
    line-height: 1.4;
}

.challenge-timer {
    text-align: center;
    min-width: 100px;
}

.timer-label {
    color: #8b92b0;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.timer-value {
    color: #ffd700;
    font-weight: 700;
    font-size: 1.2em;
    white-space: nowrap;
}

.timer-value.urgent {
    color: #ff0080;
    animation: pulse 1s infinite;
}

.challenge-action {
    display: flex;
    align-items: center;
}

.view-leaderboard-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #0a0e27;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.view-leaderboard-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

/* Mobile responsiveness for weekly banner */
@media (max-width: 767px) {
    .weekly-challenge-banner {
        grid-template-columns: auto 1fr;
        gap: 12px;
    }

    .challenge-icon {
        font-size: 2em;
    }

    .challenge-timer {
        grid-column: 1 / -1;
        text-align: left;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .timer-label {
        margin-bottom: 0;
    }

    .challenge-action {
        grid-column: 1 / -1;
    }

    .view-leaderboard-btn {
        width: 100%;
        justify-content: center;
        display: flex;
    }
}

/* Weekly Reset Notification */
.weekly-reset-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    animation: slideDown 0.3s ease;
    opacity: 1;
    transition: opacity 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.reset-notification-content {
    background: linear-gradient(135deg, #1a1f3a 0%, #2a1f0f 100%);
    border: 2px solid #ffd700;
    border-radius: 12px;
    padding: 20px 25px;
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 350px;
}

.reset-icon {
    font-size: 2.5em;
    line-height: 1;
}

.reset-text {
    flex: 1;
}

.reset-title {
    color: #ffd700;
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 4px;
}

.reset-challenge {
    color: #8b92b0;
    font-size: 0.9em;
}

.reset-close {
    background: transparent;
    border: 1px solid #2d3561;
    color: #8b92b0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.reset-close:hover {
    border-color: #ff0080;
    color: #ff0080;
}

@media (max-width: 767px) {
    .reset-notification-content {
        min-width: auto;
        max-width: 90vw;
        padding: 15px 20px;
    }

    .reset-icon {
        font-size: 2em;
    }

    .reset-title {
        font-size: 1em;
    }
}

/* Leaderboard Category Tabs */
.leaderboard-tabs {
    display: flex;
    gap: 8px;
    margin: 15px 0 12px 0;
    border-bottom: 2px solid #1a1f3a;
    padding-bottom: 2px;
}

.leaderboard-mobile-select {
    display: none; /* Hidden on desktop */
}

.lb-tab {
    flex: 1;
    padding: 12px 10px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #8b92b0;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.lb-tab:hover {
    color: #fff;
    border-bottom-color: #2d3561;
}

.lb-tab.active {
    color: #ff0080;
    border-bottom-color: #ff0080;
}

.lb-tab.weekly-tab.active {
    color: #ffd700;
    border-bottom-color: #ffd700;
}

.leaderboard-content {
    min-height: 300px;
}

.leaderboard-empty {
    padding: 40px 20px;
    text-align: center;
    color: #8b92b0;
    background: #0a0e27;
    border-radius: 10px;
    border: 1px dashed #2d3561;
}

.leaderboard-empty-icon {
    font-size: 3em;
    margin-bottom: 10px;
    opacity: 0.5;
}

.leaderboard-empty-text {
    font-size: 1.1em;
    margin-bottom: 5px;
}

.leaderboard-empty-hint {
    font-size: 0.9em;
    opacity: 0.7;
}

/* Mobile: Use native select for leaderboard tabs */
@media (max-width: 767px) {
    .leaderboard-tabs {
        display: none; /* Hide button tabs on mobile */
    }

    .leaderboard-mobile-select {
        display: block;
        width: 100%;
        padding: 14px 16px;
        margin: 15px 0 12px 0;
        background: linear-gradient(135deg, #1a1f3a 0%, #0f1425 100%);
        border: 1px solid #2d3561;
        border-radius: 10px;
        color: #fff;
        font-family: inherit;
        font-weight: 700;
        font-size: 1em;
        cursor: pointer;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff0080' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 20px;
        padding-right: 40px;
        min-height: 48px;
    }

    .leaderboard-mobile-select option {
        background: #0f1425;
        color: #fff;
        padding: 10px;
    }
}

/* Full Leaderboard Modal Tabs */
.full-lb-tabs {
    display: flex;
    gap: 10px;
    padding: 20px 25px 0 25px;
    border-bottom: 2px solid #1a1f3a;
}

.full-lb-tab {
    flex: 1;
    padding: 14px 16px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #8b92b0;
    font-family: inherit;
    font-weight: 700;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    bottom: -2px;
}

.full-lb-tab:hover {
    color: #fff;
    border-bottom-color: #2d3561;
}

.full-lb-tab.active {
    color: #ff0080;
    border-bottom-color: #ff0080;
}

.full-lb-tab.weekly-tab.active {
    color: #ffd700;
    border-bottom-color: #ffd700;
}

.full-leaderboard-modal {
    background: #0a0e27;
    border-radius: 16px;
}

/* User's rank highlight in full leaderboard */
.leaderboard-entry.user-rank {
    background: linear-gradient(135deg, rgba(255, 0, 128, 0.2), rgba(121, 40, 202, 0.2));
    border: 2px solid #ff0080;
    box-shadow: 0 4px 20px rgba(255, 0, 128, 0.3);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(255, 0, 128, 0.3);
    }
    50% {
        box-shadow: 0 4px 30px rgba(255, 0, 128, 0.5);
    }
}

@media (max-width: 767px) {
    .full-lb-tabs {
        padding: 15px 15px 0 15px;
        gap: 5px;
    }

    .full-lb-tab {
        font-size: 0.9em;
        padding: 12px 10px;
    }

    .full-leaderboard-modal {
        max-width: 100% !important;
        margin: 10px;
        max-height: 95vh !important;
    }
}

.link-btn {
    background: transparent;
    border: 1px solid #2d3561;
    color: #8b92b0;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
}

.link-btn:hover {
    color: #ff0080;
    border-color: #ff0080;
}

.personal-rank {
    padding: 10px;
    border-radius: 10px;
    background: #0a0e27;
    border: 1px dashed #2d3561;
    color: #8b92b0;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.leaderboard-entry {
    background: #1a1f3a;
    padding: 14px 16px;
    margin-bottom: 10px;
    border-radius: 10px;
    border-left: 3px solid #2d3561;
    transition: all 0.3s ease;
    display: grid;
    grid-template-rows: auto auto;
    gap: 10px;
    width: 100%;
}

.leaderboard-entry.user-entry {
    background: linear-gradient(135deg, #1a1f3a 0%, #2a1030 100%);
    border-left-color: #ff0080;
    box-shadow: 0 0 15px rgba(255, 0, 128, 0.2);
}

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

/* Breakdown Toggle Button */
.breakdown-toggle {
    width: 100%;
    margin-top: 10px;
    padding: 12px 14px;
    min-height: 44px;
    background: #0f1425;
    border: 1px solid #2d3561;
    border-radius: 6px;
    color: #8b92b0;
    font-family: inherit;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.breakdown-toggle:hover {
    background: #1a1f3a;
    border-color: #ff0080;
    color: #ff0080;
}

.toggle-icon {
    font-size: 0.9em;
    transition: transform 0.3s ease;
}

/* Score Breakdown */
.score-breakdown {
    margin-top: 12px;
    padding: 12px;
    background: #0a0e27;
    border-radius: 8px;
    border: 1px solid #2d3561;
}

.breakdown-grid {
    display: grid;
    gap: 8px;
}

.breakdown-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 8px;
    background: #0f1425;
    border-radius: 6px;
    font-size: 0.85em;
}

.breakdown-item.highlight {
    background: linear-gradient(135deg, #0f1425 0%, #1a0f25 100%);
    border: 1px solid #7928ca;
}

.breakdown-item.penalty {
    background: linear-gradient(135deg, #0f1425 0%, #250f1a 100%);
}

.breakdown-label {
    color: #8b92b0;
    font-weight: 600;
}

.breakdown-value {
    color: #fff;
    font-weight: 700;
    text-align: right;
}

.breakdown-points {
    color: #00ff88;
    font-weight: 700;
    text-align: right;
    min-width: 80px;
}

.breakdown-item.penalty .breakdown-points {
    color: #ff0080;
}

.breakdown-item.highlight .breakdown-points {
    color: #7928ca;
}

.breakdown-total {
    margin-top: 12px;
    padding: 10px;
    background: #1a1f3a;
    border-radius: 6px;
    text-align: right;
    color: #8b92b0;
    font-size: 0.9em;
}

.breakdown-total strong {
    color: #00ff88;
    font-size: 1.2em;
    margin-left: 8px;
}

/* Weekly Entry Styling (Gold) */
.leaderboard-entry.weekly-entry {
    background: linear-gradient(135deg, #1a1f3a 0%, #2a1f0f 100%);
    border-left-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}

.leaderboard-entry.weekly-entry.user-entry {
    background: linear-gradient(135deg, #1a1f3a 0%, #2a1512 100%);
    border-left: 3px solid;
    border-image: linear-gradient(135deg, #ffd700 0%, #ff0080 100%) 1;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

.entry-rank {
    font-size: 1.1em;
    font-weight: 900;
    color: #ff0080;
    margin-right: 8px;
    display: inline-block;
    width: 20px;
}

.entry-name {
    font-weight: 700;
    font-size: 1.05em;
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-stats {
    font-size: 0.8em;
    color: #8b92b0;
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 4px 12px;
    align-items: center;
}

.entry-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
}

.stat-line {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: normal;
}

.strategy-label {
    color: #8b92b0;
    text-transform: lowercase;
    text-align: left;
    grid-column: 1 / -1;
}

.entry-stats .highlight {
    color: #00ff88;
    font-weight: 700;
}

.main-arena {
    background: #0a0e27;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.editor-section {
    background: #0f1425;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #1a1f3a;
}

.dashboard-layout .editor-section {
    background: #0f1425;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid #1a1f3a;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    flex-shrink: 0;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.editor-header h3 {
    color: #fff;
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.editor-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.strategy-select {
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid #2d3561;
    background: #1a1f3a;
    color: #fff;
    font-size: 0.9em;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.strategy-select:hover {
    border-color: #ff0080;
}

.code-editor {
    width: 100%;
    flex: 1;
    min-height: 300px;
    background: #0a0e27;
    border: 2px solid #1a1f3a;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.strategy-help {
    background: #0a0e27;
    border: 1px solid #2d3561;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.strategy-help .help-title {
    color: #8b92b0;
    font-weight: 700;
    margin-bottom: 6px;
}

.strategy-api {
    background: #0f1425;
    border: 1px solid #2d3561;
    border-radius: 8px;
    padding: 10px;
    color: #00ff88;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 12px;
    white-space: pre-wrap;
    margin-bottom: 8px;
}

.tip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    color: #8b92b0;
    font-size: 0.9em;
}

.tip-list li {
    background: #0f1425;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #2d3561;
}

.btn-reset {
    padding: 10px 14px;
    background: #1a1f3a;
    border: 1px solid #2d3561;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.btn-reset:hover {
    border-color: #ff0080;
    color: #ff0080;
}

.code-editor:focus {
    outline: none;
    border-color: #ff0080;
}

.controls {
    margin-top: 15px;
}

.mode-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.dashboard-layout .mode-selector {
    grid-template-columns: 1fr;
    gap: 8px;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #1a1f3a;
    border: 2px solid #2d3561;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    font-family: inherit;
}

.dashboard-layout .mode-btn {
    padding: 10px;
    gap: 8px;
}

.mode-btn:hover {
    border-color: #ff0080;
    background: #232944;
}

.mode-btn.active {
    border-color: #ff0080;
    background: linear-gradient(135deg, #1a1f3a 0%, #2a1030 100%);
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.3);
}

.mode-btn.active .mode-icon {
    transform: scale(1.2);
}

.mode-icon {
    font-size: 2em;
    transition: transform 0.3s ease;
}

.dashboard-layout .mode-icon {
    font-size: 1.5em;
}

.mode-text {
    text-align: left;
}

.mode-title {
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 3px;
}

.dashboard-layout .mode-title {
    font-size: 0.95em;
}

.mode-desc {
    font-size: 0.8em;
    color: #8b92b0;
}

.dashboard-layout .mode-desc {
    font-size: 0.75em;
}

.action-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.dashboard-layout .action-controls {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}

.btn-run {
    flex: 1;
    padding: 18px 40px;
    background: linear-gradient(135deg, #ff0080 0%, #7928ca 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 1.2em;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 128, 0.3);
}

.dashboard-layout .btn-run {
    padding: 14px 24px;
    font-size: 1em;
}

.btn-run:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 0, 128, 0.5);
}

.btn-run:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-gold {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #000;
}

.btn-gold:hover {
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5);
}

.gold-stake-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    color: #fff;
}

.simulation-speed {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #8b92b0;
    font-size: 0.9em;
}

.simulation-speed input {
    width: 120px;
}

.speed-control {
    margin: 10px 0;
    padding: 12px;
    background: #0f1425;
    border-radius: 8px;
    border: 2px solid #1a1f3a;
}

.dashboard-layout .speed-control {
    margin: 0;
    padding: 12px;
    background: #1a1f3a;
    border: 1px solid #2d3561;
}

.speed-control label {
    display: block;
    color: #8b92b0;
    font-size: 0.9em;
    margin-bottom: 12px;
    font-weight: 600;
}

.dashboard-layout .speed-control label {
    margin-bottom: 8px;
}

.speed-slider-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.speed-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #2d3561 0%, #ff0080 100%);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ff0080;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 0, 128, 0.5);
    transition: all 0.2s;
}

.speed-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(255, 0, 128, 0.8);
}

.speed-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ff0080;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(255, 0, 128, 0.5);
    transition: all 0.2s;
}

.speed-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(255, 0, 128, 0.8);
}

.speed-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 2px;
}

.speed-labels span {
    color: #8b92b0;
    font-size: 0.85em;
    cursor: pointer;
    transition: color 0.2s;
    padding: 4px 8px;
    border-radius: 4px;
}

.dashboard-layout .speed-labels span {
    font-size: 0.8em;
    padding: 2px 4px;
}

.speed-labels span:hover {
    color: #ff0080;
    background: rgba(255, 0, 128, 0.1);
}

.speed-labels span.active {
    color: #ff0080;
    font-weight: 700;
}

.share-btn {
    margin-top: 15px;
    padding: 12px 24px;
    background: transparent;
    border: 2px solid #7928ca;
    border-radius: 6px;
    color: #7928ca;
    font-family: inherit;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
}

.share-btn:hover {
    background: rgba(121, 40, 202, 0.1);
    border-color: #ff0080;
    color: #ff0080;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 0, 128, 0.2);
}

.share-btn:active {
    transform: translateY(0);
}

.share-btn svg {
    transition: transform 0.3s ease;
}

.share-btn:hover svg {
    transform: rotate(12deg);
}

.share-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #7928ca 0%, #ff0080 100%);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95em;
    box-shadow: 0 4px 20px rgba(121, 40, 202, 0.4);
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 15px;
}

.share-preview {
    background: #0a0e27;
    border: 1px solid #2d3561;
    border-radius: 10px;
    padding: 14px;
    color: #8b92b0;
    line-height: 1.5;
    min-height: 80px;
}

.share-count {
    color: #8b92b0;
    margin-top: 10px;
    font-size: 0.9em;
}

.results-panel {
    background: #0f1425;
    border-radius: 12px;
    padding: 25px;
    border: 2px solid #1a1f3a;
}

.dashboard-layout .center-column > * {
    margin-bottom: 16px;
}

.dashboard-layout .center-column > *:last-child {
    margin-bottom: 0;
}

.dashboard-layout .dice-display,
.dashboard-layout .score-display,
.dashboard-layout .chart-container,
.dashboard-layout .performance-summary {
    background: #0f1425;
    border-radius: 12px;
    padding: 14px;
    border: 2px solid #1a1f3a;
    flex-shrink: 0;
}

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

.dashboard-layout .score-display {
    margin-bottom: 14px;
}

.score-card {
    background: linear-gradient(135deg, #1a1f3a 0%, #0f1425 100%);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #2d3561;
    transition: all 0.3s ease;
}

.score-card:hover {
    border-color: #ff0080;
    transform: translateY(-3px);
}

.score-label {
    font-size: 0.7em;
    color: #8b92b0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.score-value {
    font-size: 1.6em;
    font-weight: 900;
    color: #fff;
}

.score-value.highlight {
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.score-value.danger {
    color: #ff0080;
    text-shadow: 0 0 10px rgba(255, 0, 128, 0.5);
}

.score-value.positive {
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

.score-value.neutral {
    color: #8b92b0;
    text-shadow: none;
}

.chart-container {
    position: relative;
    height: 300px;
    background: #0a0e27;
    border-radius: 8px;
    padding: 15px;
    border: 2px solid #1a1f3a;
}

.dashboard-layout .chart-container {
    height: 320px;
    background: #0a0e27;
}

.rank-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.dashboard-layout .rank-summary {
    background: #0f1425;
    border-radius: 12px;
    padding: 15px;
    border: 2px solid #1a1f3a;
    margin: 0;
}

.rank-badge,
.best-badge {
    flex: 1;
    min-width: 240px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #1a1f3a 0%, #0f1425 100%);
    border-radius: 10px;
    border: 1px solid #2d3561;
    color: #8b92b0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.rank-badge strong,
.best-badge strong {
    color: #ffd700;
}

/* Editor and Console Side by Side Wrapper */
.editor-console-wrapper {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex: 1;
    min-height: 0;
}

.editor-section {
    flex: 0 0 80%;
    display: flex;
    flex-direction: column;
}

/* Console Output Panel */
.console-panel {
    flex: 0 0 calc(20% - 12px);
    background: #0a0e27;
    border: 1px solid #1a1f3a;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #101631;
    border-bottom: 1px solid #1a1f3a;
}

.console-title {
    font-weight: 700;
    font-size: 11px;
    color: #8b92b0;
}

.console-output {
    padding: 8px;
    flex: 1;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 11px;
    line-height: 1.4;
    color: #d4d4d4;
}

.console-welcome {
    color: #5a6488;
    font-style: italic;
}

.console-log {
    margin-bottom: 4px;
    color: #d4d4d4;
}

.console-log.error {
    color: #ff5555;
}

.console-log.warn {
    color: #ffaa00;
}

.console-log.info {
    color: #55aaff;
}

.console-timestamp {
    color: #5a6488;
    margin-right: 8px;
}

.performance-summary {
    margin-top: 0;
    padding: 20px;
    background: #101631;
    border-radius: 14px;
    border: 1px solid #1a1f3a;
    flex-shrink: 1;
}

.dashboard-layout .performance-summary {
    margin-top: auto;
    background: #101631;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-shrink: 1;
}

.performance-summary h4 {
    color: #ff0080;
    margin-bottom: 12px;
    font-size: 1.05em;
    text-transform: uppercase;
}

.performance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
    font-size: 0.9em;
    align-items: center;
}



.perf-label {
    color: #8b92b0;
}

.perf-value {
    color: #00ff88;
    font-weight: 700;
}

.side-panel {
    background: #0f1425;
    padding: 25px;
    border-left: 2px solid #1a1f3a;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.side-panel h3 {
    color: #ff0080;
    margin-bottom: 20px;
    font-size: 1.3em;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #2d3561;
    padding-bottom: 10px;
}

/* Missions Compact (in left column) */
.missions-compact {
    padding: 12px;
    background: transparent;
}

.missions-compact h3 {
    color: #ff0080;
    margin-bottom: 15px;
    font-size: 1.1em;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #2d3561;
    padding-bottom: 8px;
}

/* Controls Container (in right column) */
.controls-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1 1 auto;
    overflow: visible;
}

.controls-title {
    color: #fff;
    font-size: 1.08em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    border-bottom: 1px solid #2d3561;
    padding-bottom: 8px;
}

.strategy-selector-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.strategy-selector-wrapper label {
    color: #8b92b0;
    font-size: 0.9em;
    font-weight: 600;
}

.strategy-selector-wrapper .strategy-select {
    width: 100%;
    margin-bottom: 8px;
}

.control-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.control-input-group label {
    color: #8b92b0;
    font-size: 0.9em;
    font-weight: 600;
}

.control-input-group input {
    padding: 10px;
    background: #1a1f3a;
    color: #fff;
    border: 2px solid #2d3561;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1em;
}

.control-input-group input.gold-input {
    color: #ffd700;
    border-color: #ffd700;
    font-weight: 700;
    text-align: center;
}

.input-unit {
    color: #8b92b0;
    font-size: 0.9em;
    margin-top: -8px;
}

.challenge-card {
    background: #1a1f3a;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    border: 2px solid #2d3561;
    cursor: pointer;
    transition: all 0.3s ease;
}

.challenge-card:hover {
    border-color: #7928ca;
    transform: translateX(-5px);
}

.challenge-title {
    font-size: 0.95em;
    font-weight: 700;
    margin-bottom: 2px;
    color: #fff;
}

.challenge-desc {
    font-size: 0.75em;
    color: #8b92b0;
    margin-bottom: 5px;
    line-height: 1.4;
}

.challenge-reward {
    display: inline-block;
    padding: 2px 8px;
    background: #ff0080;
    color: white;
    font-size: 0.7em;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.mission-card {
    background: #1a1f3a;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    border: 2px solid #2d3561;
    transition: all 0.3s ease;
}

.mission-card.active {
    border-color: #ff0080;
}

.mission-card.completed {
    border-color: #00ff88;
    background: linear-gradient(135deg, #1a1f3a 0%, #102a1a 100%);
    opacity: 0.7;
}

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

.mission-title {
    font-size: 0.95em;
    font-weight: 700;
    color: #fff;
}

.mission-reward {
    font-size: 0.9em;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.mission-desc {
    font-size: 0.75em;
    color: #8b92b0;
    margin-bottom: 5px;
    line-height: 1.4;
}

.mission-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #0a0e27;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff0080 0%, #7928ca 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.mission-card.completed .progress-fill {
    background: linear-gradient(90deg, #00ff88 0%, #00cc88 100%);
}

.progress-text {
    font-size: 0.8em;
    color: #8b92b0;
    min-width: 80px;
    text-align: right;
}

.challenge-title {
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fff;
}

.challenge-desc {
    font-size: 0.85em;
    color: #8b92b0;
    margin-bottom: 10px;
    line-height: 1.4;
}

.challenge-reward {
    display: inline-block;
    padding: 4px 12px;
    background: #ff0080;
    color: white;
    font-size: 0.75em;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Medium screens - adjust header for better fit */
@media (max-width: 1200px) {
    .header-ticker {
        max-width: 400px;
    }

    .btn-how-it-works {
        font-size: 13px;
        padding: 7px 12px;
    }

    .btn-tutorial {
        font-size: 13px;
        padding: 7px 12px;
    }

    .header-right {
        gap: 8px;
    }
}

@media (max-width: 1400px) {
    .container {
        grid-template-columns: 1fr;
    }

    .container.dashboard-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .dashboard-layout .left-column,
    .dashboard-layout .center-column,
    .dashboard-layout .right-column {
        grid-column: 1;
        max-height: none;
        border: 1px solid #1a1f3a;
        border-radius: 12px;
    }

    .dashboard-layout .left-column {
        grid-row: auto;
        border-bottom: 1px solid #1a1f3a;
    }

    .dashboard-layout .center-column {
        grid-row: auto;
        padding: 20px;
    }

    .dashboard-layout .right-column {
        grid-row: auto;
        border-top: 1px solid #1a1f3a;
        padding: 20px;
    }

    .dashboard-layout .bottom-row {
        grid-column: 1;
        grid-row: auto;
    }

    .leaderboard, .side-panel {
        max-height: none;
    }

    .challenge-banner-content {
        flex-direction: column;
        gap: 20px;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    body {
        padding: 0;
    }

    /* Header responsive */
    .header {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 10px;
        width: 100%;
        box-shadow: none;
    }

    .header-left {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }

    .header h1 {
        font-size: 1.8em;
        letter-spacing: 1px;
        word-break: break-word;
    }

    .header-challenge {
        border-left: none;
        padding-left: 0;
        font-size: 0.8em;
    }

    .header-right {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .btn-how-it-works {
        font-size: 13px;
        padding: 8px 12px;
    }

    /* Container and layout - stack columns vertically */
    .container {
        padding: 0;
        margin: 0;
        gap: 0;
        width: 100%;
        max-width: 100%;
        grid-template-columns: 1fr;
        overflow: hidden;
        height: auto;
    }

    .container.dashboard-layout {
        display: flex;
        flex-direction: column;
        height: auto;
    }

    /* Column ordering for mobile-first workflow:
       1. Right column (controls) - most important
       2. Center column (chart/editor) - main content
       3. Left column (leaderboard) - supplementary */
    .dashboard-layout .right-column {
        order: 1;
        padding: 15px;
        margin: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        border-bottom: 2px solid #1a1f3a;
        height: auto;
        max-height: none;
    }

    .dashboard-layout .center-column {
        order: 2;
        padding: 15px;
        margin: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        height: auto;
        max-height: none;
    }

    .dashboard-layout .left-column {
        order: 3;
        padding: 15px;
        margin: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        border-top: 2px solid #1a1f3a;
        height: auto;
        max-height: none;
        overflow-y: visible;
    }

    /* Make leaderboard compact on mobile - viewport-relative */
    .leaderboard {
        max-height: 50vh;
        min-height: 250px;
        overflow-y: auto;
    }

    /* Tab controls touch-friendly */
    .tabs-nav {
        display: flex;
        gap: 8px;
        margin-bottom: 12px;
    }

    .tab-btn {
        flex: 1;
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }

    /* Editor and Console - stack vertically on mobile */
    .editor-console-wrapper {
        flex-direction: column;
        gap: 16px;
    }

    /* Editor section */
    .editor-section {
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
        margin-top: 0;
    }

    .console-panel {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        min-height: 200px;
    }

    .console-output {
        max-height: 200px;
    }

    .editor-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }

    .editor-header > div {
        flex-direction: column;
        gap: 10px;
    }

    .editor-header h3 {
        text-align: center;
    }

    .editor-header input[type="text"] {
        width: 100% !important;
    }

    .editor-header > div > div {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .editor-header button {
        flex: 1;
        min-width: 80px;
        min-height: 44px;
    }

    #codeEditor {
        font-size: 13px;
        min-height: 250px;
        width: 100%;
        max-width: 100%;
        line-height: 1.4;
    }

    /* Prevent iOS zoom on input focus - all inputs must be 16px+ */
    input, select, textarea {
        font-size: 16px !important;
    }

    /* Make all controls touch-friendly (44px minimum) */
    .mode-selector {
        display: flex;
        gap: 8px;
        width: 100%;
        margin-bottom: 16px;
    }

    .mode-btn {
        flex: 1;
        padding: 12px 10px;
        font-size: 0.9em;
        min-height: 44px;
    }

    .strategy-selector-wrapper {
        margin-bottom: 16px;
    }

    .strategy-selector-wrapper select,
    .strategy-select {
        padding: 12px;
        min-height: 44px;
        width: 100%;
    }

    .btn-reset {
        padding: 10px 16px;
        min-height: 44px;
    }

    .action-controls {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .control-input-group {
        width: 100%;
    }

    .control-input-group input {
        padding: 12px;
        min-height: 44px;
        width: 100%;
    }

    .btn-run, .btn-gold, .btn-stop {
        padding: 16px 24px;
        font-size: 1.1em;
        width: 100%;
        min-height: 50px;
    }

    .speed-control {
        padding: 15px;
        width: 100%;
    }

    .speed-slider-container {
        width: 100%;
        margin-top: 12px;
    }

    .speed-slider {
        width: 100%;
        height: 6px;
    }

    .speed-labels {
        margin-top: 8px;
        display: flex;
        justify-content: space-between;
        font-size: 1.2em;
    }

    .speed-labels span {
        padding: 4px 8px;
        min-width: 44px;
        text-align: center;
    }

    /* Chart and scores */
    .chart-container {
        height: 280px;
        width: 100%;
        margin: 16px 0;
    }

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

    .score-card {
        padding: 10px 8px;
    }

    .score-label {
        font-size: 0.65em;
        margin-bottom: 4px;
    }

    .score-value {
        font-size: 1.1em;
    }

    /* Performance summary */
    .performance-summary {
        padding: 15px;
        width: 100%;
        margin-top: 16px;
    }

    .performance-summary h4 {
        font-size: 1em;
        margin-bottom: 12px;
    }

    .performance-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .perf-item {
        padding: 10px;
    }

    .perf-label {
        font-size: 0.7em;
    }

    .perf-value {
        font-size: 0.9em;
    }

    /* Leaderboard */
    .handle-row {
        display: grid;
        grid-template-columns: 1fr auto auto;
        gap: 8px;
        margin-bottom: 12px;
    }

    .handle-input {
        min-height: 44px;
        padding: 10px 12px;
    }

    .btn-ghost {
        padding: 10px 16px;
        min-height: 44px;
    }


    /* Gold stakes */
    .gold-balance-header {
        padding: 12px 15px;
        border-width: 1px;
        margin: 10px 0;
    }

    .gold-amount {
        font-size: 1.3em;
        word-break: break-all;
    }

    .gold-stake-selector {
        flex-direction: column;
        gap: 8px;
    }

    .gold-stake-selector input {
        width: 100%;
        min-height: 44px;
    }

    .gold-button-container {
        width: 100%;
    }

    /* Share button */
    .share-btn {
        font-size: 0.95em;
        padding: 14px 20px;
        min-height: 44px;
        margin-top: 12px;
    }

    .share-toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        font-size: 0.9em;
        padding: 14px 18px;
    }

    /* Rank badges */
    .rank-summary {
        flex-direction: column;
        gap: 8px;
    }

    .rank-badge,
    .best-badge {
        width: 100%;
    }

    /* Challenge banner */
    .challenge-banner {
        padding: 15px;
        width: 100%;
        overflow: hidden;
    }

    .challenge-banner h2 {
        font-size: 1.2em;
        letter-spacing: 0.5px;
        word-break: break-word;
    }

    .challenge-banner-content {
        width: 100%;
        max-width: 100%;
    }

    .challenge-rules {
        flex-direction: column;
        gap: 10px;
        font-size: 0.85em;
    }

    .challenge-rules span {
        white-space: normal;
    }

    /* Dice display (Gold Stakes mode) */
    .dice-display {
        margin-bottom: 16px;
    }

    /* Controls title */
    .controls-title {
        font-size: 1.1em;
        margin-bottom: 12px;
    }
}

/* Extra small phones */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5em;
    }

    .header-left h1 {
        font-size: 1.5em;
    }

    #codeEditor {
        font-size: 12px;
        min-height: 220px;
    }

    .score-display {
        grid-template-columns: 1fr;
    }

    .performance-grid {
        grid-template-columns: 1fr;
    }

    .speed-labels {
        font-size: 1em;
    }

    .score-value {
        font-size: 1em;
    }

    .chart-container {
        height: 220px;
    }

    .mode-btn {
        padding: 10px 8px;
        font-size: 0.85em;
    }

    .mode-text .mode-title {
        font-size: 0.9em;
    }

    .mode-text .mode-desc {
        font-size: 0.75em;
    }

    /* Leaderboard entry stats - stack vertically on small screens */
    .entry-stats {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    /* Tighter username on small screens */
    .entry-name {
        max-width: 120px;
    }

    /* Breakdown grid single column */
    .breakdown-item {
        grid-template-columns: 1fr;
        gap: 4px;
        text-align: left;
    }

    .breakdown-value,
    .breakdown-points {
        text-align: left;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Welcome Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #1a1f3a 0%, #0f1425 100%);
    border: 3px solid #ff0080;
    border-radius: 16px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(255, 0, 128, 0.4);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h2 {
    color: #ff0080;
    font-size: 2.2em;
    margin-bottom: 20px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 0, 128, 0.5);
}

.modal-content p {
    color: #fff;
    font-size: 1.2em;
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.6;
}

.challenge-steps {
    margin: 30px 0;
}

.step {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 15px;
    background: #0a0e27;
    border-radius: 8px;
    border-left: 3px solid #7928ca;
    transition: all 0.3s ease;
}

.step:hover {
    border-left-color: #ff0080;
    transform: translateX(5px);
}

.step-number {
    font-size: 1.8em;
    font-weight: 900;
    color: #ff0080;
    min-width: 40px;
    text-align: center;
}

.step span:last-child {
    color: #8b92b0;
    font-size: 1.05em;
}

.modal-content .btn-run {
    width: 100%;
    margin-top: 20px;
}

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

.modal-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
}

.modal-subtitle {
    color: #8b92b0;
    margin-bottom: 12px;
}

.leaderboard-modal {
    max-width: 800px;
    width: 90%;
}

.modal-leaderboard-list {
    max-height: 420px;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 30px 20px;
        max-width: 90%;
    }

    .modal-content h2 {
        font-size: 1.6em;
    }

    .modal-content p {
        font-size: 1em;
    }

    .step {
        padding: 12px;
        gap: 10px;
    }

    .step-number {
        font-size: 1.4em;
        min-width: 30px;
    }

    .step span:last-child {
        font-size: 0.9em;
    }
}

/* Dice Display Styles for Gold Stakes */
.dice-display {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #1a1f3a 0%, #0f1425 100%);
    border: 2px solid #ffd700;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.2);
}

.dice-roll-animation {
    text-align: center;
    margin-bottom: 15px;
}

.dice-number {
    font-size: 3.5em;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.dice-number.rolling {
    animation: diceRoll 0.1s infinite;
}

@keyframes diceRoll {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.dice-number.win {
    color: #00ff88;
    text-shadow: 0 0 30px rgba(0, 255, 136, 0.8);
    animation: winPulse 0.5s ease;
}

.dice-number.lose {
    color: #ff0080;
    text-shadow: 0 0 30px rgba(255, 0, 128, 0.8);
    animation: losePulse 0.5s ease;
}

@keyframes winPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@keyframes losePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(0.9); }
}

.dice-target {
    font-size: 1.1em;
    color: #8b92b0;
    margin-bottom: 8px;
}

.dice-target span {
    color: #fff;
    font-weight: 700;
}

.dice-result {
    font-size: 1.3em;
    font-weight: 700;
    margin-top: 10px;
    min-height: 1.5em;
}

.dice-result.win {
    color: #00ff88;
}

.dice-result.lose {
    color: #ff0080;
}

.current-bet-info {
    display: flex;
    justify-content: space-around;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    font-size: 1.1em;
    color: #8b92b0;
}

.current-bet-info span {
    font-weight: 600;
}

.current-bet-info span span {
    color: #ffd700;
}

/* Dice Slider Styles - Stake.us inspired */
.dice-slider-container {
    margin-bottom: 20px;
}

.dice-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.dice-result-label {
    color: #8b92b0;
    font-size: 1em;
    font-weight: 600;
}

.dice-result-value {
    font-size: 2em;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.dice-result-value.win {
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.8);
}

.dice-result-value.lose {
    color: #ff0080;
    text-shadow: 0 0 20px rgba(255, 0, 128, 0.8);
}

.dice-slider-track {
    position: relative;
    width: 100%;
    height: 40px;
    background: #1a1f3a;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid #2d3561;
    margin-bottom: 10px;
}

.dice-slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #7928ca 0%, #ff0080 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease-out;
    border-radius: 20px 0 0 20px;
    will-change: transform;
}

.dice-slider-fill.no-transition {
    transition: none;
}

.dice-slider-fill.win {
    background: linear-gradient(90deg, #00cc66 0%, #00ff88 100%);
}

.dice-slider-fill.lose {
    background: linear-gradient(90deg, #cc0066 0%, #ff0080 100%);
}

.dice-target-line {
    position: absolute;
    top: 0;
    height: 100%;
    width: 3px;
    background: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    z-index: 2;
}

.dice-target-line::before {
    content: '▼';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffd700;
    font-size: 1.2em;
}

.dice-slider-numbers {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    padding: 0 5px;
    color: #8b92b0;
    font-size: 0.85em;
}

.dice-outcome {
    text-align: center;
    font-size: 1.3em;
    font-weight: 700;
    margin-top: 10px;
    min-height: 1.5em;
}

.dice-outcome.win {
    color: #00ff88;
}

.dice-outcome.lose {
    color: #ff0080;
}

/* Gold Button Container - Fixed Layout */
.gold-button-container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    width: 100%;
    min-height: 60px;
    margin-top: 10px;
}

.gold-button-container button {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
}

.btn-stop {
    background: #ff0080;
}

.btn-stop:hover {
    background: #cc0066;
}

/* ========================================
   RESULTS MODAL (DAY 9)
   ======================================== */

/* Results Popup Notification (bottom-left corner, non-blocking) */
.results-toast-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10000;
    pointer-events: none;
}

.results-toast {
    background: linear-gradient(135deg, #1a1f3a 0%, #0a0e27 100%);
    border: 2px solid #ff0080;
    border-radius: 12px;
    max-width: 500px;
    width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(255, 0, 128, 0.6);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    pointer-events: all;
}

.results-toast.visible {
    transform: translateY(0);
    opacity: 1;
}

/* Mobile: Center on small screens */
@media (max-width: 600px) {
    .results-toast-container {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        bottom: 20px;
    }

    .results-toast {
        max-width: calc(100vw - 40px);
    }
}

.toast-header {
    background: linear-gradient(135deg, #ff0080 0%, #7928ca 100%);
    padding: 20px;
    border-radius: 10px 10px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toast-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    font-size: 1.5em;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-size: 0.85em;
    color: #8b92b0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.3em;
    font-weight: bold;
    color: #00ff88;
}

.stat-value.highlight {
    color: #ff0080;
    text-shadow: 0 0 10px rgba(255, 0, 128, 0.5);
}

.results-divider {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.results-divider h3 {
    margin: 0;
    font-size: 1.1em;
    text-align: center;
    color: #fff;
    letter-spacing: 1px;
}

.results-boards {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.result-board {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
}

.result-board.ineligible {
    opacity: 0.6;
    border-color: rgba(255, 255, 255, 0.05);
}

.result-board:hover {
    border-color: #ff0080;
    box-shadow: 0 0 15px rgba(255, 0, 128, 0.2);
}

.board-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.board-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
}

.board-rank {
    font-size: 1.2em;
    font-weight: bold;
    color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
    padding: 2px 10px;
    border-radius: 4px;
}

.board-score {
    font-size: 1em;
    color: #8b92b0;
    margin-left: auto;
}

.board-status {
    font-size: 0.9em;
    color: #8b92b0;
    margin-left: auto;
}

.board-status.ineligible {
    color: #ff6b6b;
}

.rank-change {
    font-size: 0.85em;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.rank-change.new-entry {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.rank-change.rank-one {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
}

.rank-change.podium {
    background: rgba(255, 140, 0, 0.2);
    color: #ff8c00;
}

.rank-change.rank-up {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
}

.rank-change.rank-down {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

.personal-best-badge {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    color: #000;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    animation: pulse 2s infinite;
}

.board-feedback {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
}

.board-feedback.warning {
    background: rgba(255, 107, 107, 0.1);
    border-left: 3px solid #ff6b6b;
}

.board-feedback.tip {
    background: rgba(255, 215, 0, 0.1);
    border-left: 3px solid #ffd700;
}

.board-feedback.motivation {
    background: rgba(0, 255, 136, 0.1);
    border-left: 3px solid #00ff88;
}

.board-feedback.achievement {
    background: rgba(255, 215, 0, 0.15);
    border-left: 3px solid #ffd700;
}

.board-feedback.urgency {
    background: rgba(255, 0, 128, 0.1);
    border-left: 3px solid #ff0080;
}

.feedback-icon {
    font-size: 1.2em;
}

.feedback-message {
    flex: 1;
    color: #fff;
}

.breakdown-toggle {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #8b92b0;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85em;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.breakdown-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: #ff0080;
    color: #fff;
}

.score-breakdown {
    margin-top: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.breakdown-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9em;
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item.penalty .points {
    color: #ff6b6b;
}

.breakdown-item.highlight {
    background: rgba(255, 215, 0, 0.05);
    padding: 8px;
    border-radius: 4px;
}

.breakdown-item .component {
    color: #8b92b0;
}

.breakdown-item .value {
    color: #fff;
    text-align: right;
}

.breakdown-item .points {
    color: #00ff88;
    text-align: right;
    font-weight: bold;
}

.personal-bests-summary {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 140, 0, 0.1) 100%);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pb-icon {
    font-size: 1.5em;
    animation: pulse 2s infinite;
}

.pb-text {
    font-size: 1.1em;
    font-weight: bold;
    color: #ffd700;
}

.results-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #ff0080 0%, #7928ca 100%);
    border: none;
    color: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 128, 0.3);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 12px 20px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #ff0080;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .results-summary {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .results-actions {
        grid-template-columns: 1fr;
    }

    .breakdown-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .breakdown-item .value,
    .breakdown-item .points {
        text-align: left;
    }
}

/* ========================================
   DAY 10: POLISH & ENHANCEMENTS
   ======================================== */

/* Smooth transitions for all interactive elements */
button, .lb-tab, .leaderboard-entry, .result-board, .breakdown-toggle {
    transition: all 0.2s ease;
}

/* Enhanced leaderboard tab hover effects */
.lb-tab {
    position: relative;
    overflow: hidden;
}

.lb-tab::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff0080, #7928ca);
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.lb-tab:hover::before {
    width: 80%;
}

.lb-tab.active::before {
    width: 100%;
}

/* Enhanced leaderboard entry hover */
.leaderboard-entry {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.leaderboard-entry:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid #ff0080;
}

.leaderboard-entry.user-entry {
    background: linear-gradient(90deg, rgba(255, 0, 128, 0.1), transparent);
    border-left: 3px solid #ff0080;
}

.leaderboard-entry.weekly-entry {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.1), transparent);
    border-left: 3px solid #ffd700;
}

/* Breakdown toggle enhanced */
.breakdown-toggle {
    position: relative;
    overflow: hidden;
}

.breakdown-toggle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 0, 128, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.breakdown-toggle:hover::after {
    width: 300%;
    height: 300%;
}

/* Loading state for buttons */
.btn-run.loading, .btn-gold.loading {
    position: relative;
    color: transparent;
}

.btn-run.loading::after, .btn-gold.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Weekly challenge banner polish */
.weekly-challenge-banner {
    transition: all 0.3s ease;
}

.weekly-challenge-banner:hover {
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
    transform: translateY(-2px);
}

.weekly-challenge-banner.urgent {
    animation: urgentPulse 2s ease-in-out infinite;
}

@keyframes urgentPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 0, 128, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 0, 128, 0.8);
    }
}

/* View Leaderboard button hover */
.view-leaderboard-btn {
    transition: all 0.3s ease;
}

.view-leaderboard-btn:hover {
    transform: translateX(4px);
    background: linear-gradient(135deg, #ff0080 0%, #7928ca 100%);
}

/* Rank badge animations */
.entry-rank {
    transition: all 0.3s ease;
}

.leaderboard-entry:hover .entry-rank {
    transform: scale(1.1);
}

/* Score highlight pulse for top 3 */
.leaderboard-entry:nth-child(1) .entry-score,
.leaderboard-entry:nth-child(2) .entry-score,
.leaderboard-entry:nth-child(3) .entry-score {
    animation: scorePulse 3s ease-in-out infinite;
}

@keyframes scorePulse {
    0%, 100% {
        text-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
    }
    50% {
        text-shadow: 0 0 15px rgba(0, 255, 136, 0.8);
    }
}

/* Modal overlay fade enhancement */
.modal-overlay {
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(4px);
    }
}

/* Modal content slide enhancement */
.modal-content {
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(50px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Skeleton loading state */
.skeleton {
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s ease-in-out infinite;
}

@keyframes skeletonLoading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Empty state polish */
.leaderboard-empty {
    animation: emptyStateFade 0.5s ease;
}

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

/* Tooltip enhancement (for future use) */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 6px 12px;
    background: #0a0e27;
    color: #fff;
    font-size: 0.85em;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid #ff0080;
}

.tooltip:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Focus states for accessibility */
button:focus-visible,
.lb-tab:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #ff0080;
    outline-offset: 2px;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mobile touch feedback */
@media (hover: none) and (pointer: coarse) {
    button:active,
    .lb-tab:active,
    .leaderboard-entry:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
}

/* Performance optimization - will-change for animated elements */
.modal-overlay,
.modal-content,
.weekly-challenge-banner,
.leaderboard-entry:hover {
    will-change: transform, opacity;
}

/* ========================================
   WEEKLY CHALLENGE TICKER (HEADER)
   ======================================== */

.header-ticker {
    flex: 1;
    margin-left: 20px;
    overflow: hidden;
    position: relative;
    height: 30px;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 0 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
    min-width: 0; /* Allow shrinking */
    max-width: 600px; /* Limit max width to prevent pushing header-right off screen */
}

.ticker-label {
    color: #ffd700;
    font-weight: 700;
    font-size: 0.9em;
    margin-right: 10px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.ticker-label:hover {
    color: #fff;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    transform: scale(1.05);
}

.ticker-scroll-container {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.ticker-content {
    display: inline-block;
    white-space: nowrap;
    animation: scroll-left 25s linear infinite;
    font-size: 0.9em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.ticker-content:hover {
    animation-play-state: paused;
}

@keyframes scroll-left {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.ticker-challenge-name {
    color: #ffd700;
    font-weight: bold;
    margin-right: 10px;
}

.ticker-separator {
    margin: 0 15px;
    color: #ff0080;
}

.ticker-countdown {
    color: #ff0080;
    font-weight: bold;
}

.ticker-countdown.urgent {
    animation: urgentBlink 1s ease-in-out infinite;
}

@keyframes urgentBlink {
    0%, 100% {
        color: #ff0080;
    }
    50% {
        color: #ff6b6b;
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .header-ticker {
        margin-left: 10px;
        height: 25px;
        font-size: 0.8em;
    }

    .ticker-content {
        animation: scroll-left 20s linear infinite;
    }
}

/* ========================================
   TUTORIAL BUTTON
   ======================================== */

.btn-tutorial {
    padding: 8px 16px;
    background: rgba(0, 255, 136, 0.2);
    border: 1px solid rgba(0, 255, 136, 0.5);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-tutorial:hover {
    background: rgba(0, 255, 136, 0.4);
    border-color: #00ff88;
    transform: translateY(-1px);
}

.btn-feedback {
    padding: 8px 16px;
    background: rgba(255, 0, 128, 0.2);
    border: 1px solid rgba(255, 0, 128, 0.5);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-feedback:hover {
    background: rgba(255, 0, 128, 0.4);
    border-color: #ff0080;
    transform: translateY(-1px);
}

/* ========================================
   ONBOARDING MODAL
   ======================================== */

.onboarding-modal {
    max-height: 85vh;
    overflow-y: auto;
}

.onboarding-step {
    animation: fadeIn 0.4s ease;
}

.onboarding-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 2px solid rgba(255, 0, 128, 0.3);
}

.onboarding-icon {
    font-size: 4em;
    margin-bottom: 15px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.onboarding-content {
    padding: 0 20px;
}

.onboarding-highlight {
    background: rgba(121, 40, 202, 0.15);
    border-left: 4px solid #7928ca;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.onboarding-tip {
    background: rgba(0, 255, 136, 0.1);
    border-left: 4px solid #00ff88;
    padding: 15px;
    border-radius: 6px;
    margin-top: 20px;
    color: #fff;
}

.onboarding-tip code {
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 8px;
    border-radius: 4px;
    color: #ff0080;
    font-family: monospace;
}

.onboarding-challenge {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.onboarding-challenge code {
    background: rgba(255, 0, 128, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    color: #ff0080;
    font-weight: 700;
}

.onboarding-ideas {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.onboarding-reminder {
    font-size: 0.95em;
}

.onboarding-footer {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn-onboarding-next {
    padding: 12px 30px;
    background: linear-gradient(135deg, #ff0080, #7928ca);
    border: none;
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 0, 128, 0.3);
}

.btn-onboarding-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 128, 0.5);
}

.btn-onboarding-back {
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #8b92b0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s ease;
}

.btn-onboarding-back:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.onboarding-breakdown {
    margin-top: 25px;
}

.breakdown-item-onboarding {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid #ff0080;
}

.breakdown-number {
    background: linear-gradient(135deg, #ff0080, #7928ca);
    color: #fff;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2em;
    flex-shrink: 0;
}

.breakdown-text {
    flex: 1;
    color: #fff;
}

.breakdown-text code {
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 3px;
    color: #00ff88;
    font-family: monospace;
    font-size: 0.95em;
}

/* Interactive Tutorial Elements */
.tutorial-progress-bar {
    width: 100%;
    height: 6px;
    background: #1a1f3a;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 15px;
}

.tutorial-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff0080 0%, #7928ca 100%);
    transition: width 0.5s ease;
}

.code-annotation {
    transition: all 0.2s ease;
}

.code-annotation:hover {
    background: rgba(255, 0, 128, 0.4) !important;
}

.code-annotation-detail {
    margin-top: 15px;
    animation: slideDown 0.3s ease;
}

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

.tutorial-task-card {
    background: rgba(255, 0, 128, 0.08);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #ff0080;
    margin-bottom: 20px;
}

.tutorial-task-item {
    text-align: center;
    transition: all 0.3s ease;
}

.tutorial-task-item.completed {
    opacity: 1 !important;
    animation: taskComplete 0.5s ease;
}

@keyframes taskComplete {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.unlock-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.unlock-card:hover {
    border-color: #ff0080;
    transform: translateY(-5px);
}

.celebration-icon {
    animation: celebrate 1s ease-in-out infinite !important;
}

@keyframes celebrate {
    0%, 100% {
        transform: rotate(-10deg) scale(1);
    }
    50% {
        transform: rotate(10deg) scale(1.1);
    }
}

@keyframes pulse-border {
    0%, 100% {
        box-shadow: 0 0 30px rgba(255, 0, 128, 0.6);
    }
    50% {
        box-shadow: 0 0 50px rgba(255, 0, 128, 0.9);
    }
}

@keyframes bounce-pointer {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px);
    }
}

.tutorial-instructions pre {
    position: relative;
}

.tutorial-hint code {
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 3px;
    color: #00ff88;
    font-family: monospace;
    font-size: 0.95em;
}

/* Mobile responsiveness for onboarding */
@media (max-width: 768px) {
    .onboarding-modal {
        max-height: 90vh;
        padding: 25px;
    }

    .onboarding-icon {
        font-size: 3em;
    }

    .onboarding-header h2 {
        font-size: 1.5em !important;
    }

    .onboarding-content {
        padding: 0;
    }

    .onboarding-footer {
        flex-direction: column-reverse;
    }

    .btn-onboarding-next,
    .btn-onboarding-back {
        width: 100%;
    }

    .breakdown-item-onboarding {
        flex-direction: column;
        gap: 10px;
    }

    .breakdown-number {
        width: 30px;
        height: 30px;
        font-size: 1em;
    }
}

/* Template locked state */
.strategy-select option:disabled {
    color: #555;
    font-style: italic;
}

.template-locked-notice {
    background: rgba(255, 0, 128, 0.1);
    border: 1px solid rgba(255, 0, 128, 0.3);
    border-radius: 6px;
    padding: 12px;
    margin-top: 10px;
    color: #ff0080;
    font-size: 0.9em;
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

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

/* Simple mobile code editor (replaces Monaco on mobile) */
.simple-code-editor {
    width: 100%;
    height: 100%;
    min-height: 300px;
    padding: 15px;
    background: #0a0e27;
    color: #00ff88;
    border: none;
    outline: none;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    tab-size: 4;
    -moz-tab-size: 4;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
    -webkit-text-size-adjust: 100%;
    /* Enable native copy/paste */
    -webkit-user-select: text;
    user-select: text;
}

.simple-code-editor::selection {
    background: #2d3561;
    color: #00ff88;
}

.simple-code-editor::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.simple-code-editor::-webkit-scrollbar-track {
    background: #1a1f3a;
}

.simple-code-editor::-webkit-scrollbar-thumb {
    background: #2d3561;
    border-radius: 6px;
}

.simple-code-editor::-webkit-scrollbar-thumb:hover {
    background: #ff0080;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .simple-code-editor {
        min-height: 400px;
        font-size: 15px;
        padding: 12px;
    }
}

/* Short viewport height optimization */
@media (max-height: 800px) {
    .dashboard-layout .right-column {
        gap: 6px;
        padding: 10px;
    }

    .controls-container {
        gap: 10px;
    }

    .controls-title {
        font-size: 0.95em;
        margin-bottom: 4px;
        padding-bottom: 6px;
    }

    .dashboard-layout .performance-summary {
        min-height: 100px;
        padding: 12px;
    }

    .performance-summary h4 {
        font-size: 0.95em;
        margin-bottom: 8px;
    }

    .performance-grid {
        gap: 6px 10px;
    }

    .perf-item {
        padding: 6px;
    }

    .perf-label {
        font-size: 0.75em;
    }

    .perf-value {
        font-size: 0.9em;
    }

    .mode-btn {
        padding: 8px;
    }

    .mode-title {
        font-size: 0.9em;
    }

    .mode-desc {
        font-size: 0.75em;
    }
}
