/* Modern, minimalistic styling for the demo application */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    height: 100vh;
}

/* Screen Management */
.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
.title {
    font-size: 2.5rem;
    font-weight: 200;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    color: #888;
}


/* File Selection Screen */
.file-list {
    flex: 1;
    padding: 20px 0;
}

.file-list.scrollable {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Custom Scrollbar */
.file-list.scrollable::-webkit-scrollbar,
.episode-grid::-webkit-scrollbar {
    width: 8px;
}

.file-list.scrollable::-webkit-scrollbar-track,
.episode-grid::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 4px;
}

.file-list.scrollable::-webkit-scrollbar-thumb,
.episode-grid::-webkit-scrollbar-thumb {
    background: #4A4A4A;
    border-radius: 4px;
}

.file-list.scrollable::-webkit-scrollbar-thumb:hover,
.episode-grid::-webkit-scrollbar-thumb:hover {
    background: #8E75DF;
}

.file-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(10px);
}

.file-name {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.file-meta {
    font-size: 0.9rem;
    color: #666;
}

/* Sample Step Selection Screen */
.section-header {
    margin-bottom: 30px;
    text-align: center;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 300;
    margin-bottom: 10px;
}

.section-description {
    font-size: 1rem;
    color: #666;
}

.sample-step-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    padding-right: 10px;
}

.sample-step-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sample-step-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.sample-step-number {
    font-size: 1.5rem;
    font-weight: 300;
    color: #8E75DF;
    margin-bottom: 5px;
}

.sample-step-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.step-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.step-stat-label {
    color: #888;
}

.step-stat-value {
    color: #fff;
    font-weight: 500;
}

.step-stat-value.success {
    color: #4CAF50;
}

.sample-step-size {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Episode Selection Screen */
.header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.back-button {
    background: none;
    border: 1px solid #333;
    color: #888;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-button:hover {
    border-color: #666;
    color: #fff;
}

.statistics {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.stat-item {
    flex: 1;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.filter-btn {
    background: none;
    border: 1px solid #333;
    color: #666;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #666;
    color: #fff;
}

.filter-btn.active {
    background: #8E75DF;
    color: #fff;
    border-color: #8E75DF;
}

/* Episode Grid */
.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(100vh - 400px);
    padding-right: 10px;
}

.episode-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    height: fit-content;
    max-height: 150px;
}

.episode-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.episode-card.success {
    border-color: #4CAF50;
}

.episode-card.failed {
    border-color: #f44336;
}

.episode-number {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.episode-meta {
    font-size: 0.8rem;
    color: #666;
}

/* Playback Screen */
.playback-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Reward Indicator */
.reward-indicator {
    position: absolute;
    top: 30px;
    right: 30px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 25px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.reward-value {
    font-size: 2rem;
    font-weight: 300;
    transition: all 0.3s ease;
}

.reward-value.positive {
    color: #4CAF50;
}

.reward-value.negative {
    color: #f44336;
}

.reward-label {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

/* Progress Bar Container */
.progress-container {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 8px;
}

.progress-bar.interactive:hover {
    background: rgba(255, 255, 255, 0.15);
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #8E75DF, #AFA9EF);
    border-radius: 12px;
    transition: width 0.3s ease;
    pointer-events: none;
}

.progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: #fff;
    border: 3px solid #8E75DF;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s;
}

.progress-handle:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

.progress-handle.dragging {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.2);
}

.progress-text {
    font-size: 0.9rem;
    color: #888;
}

/* Episode Metadata */
.episode-metadata {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px 30px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: max-content;
    max-width: calc(100vw - 60px);
    min-width: 400px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 5;
}

.episode-metadata:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.08));
    border-color: rgba(255, 255, 255, 0.12);
    transform: translate(-50%, calc(-50% - 2px));
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.metadata-label {
    font-size: 0.75rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}

.user-goal-text {
    font-size: 1.1rem;
    color: #fff;
    line-height: 1.5;
    font-weight: 300;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
    max-width: calc(100vw - 120px);
}

/* Allow wrapping only when the text is very long */
@media (max-width: 1200px) {
    .user-goal-text {
        white-space: normal;
        word-wrap: break-word;
        text-overflow: unset;
        overflow: visible;
    }
}

.metadata-footer {
    font-size: 0.85rem;
    color: #555;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    white-space: nowrap;
}

/* Display Area */
.display-area {
    width: 100%;
    height: 250px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.display-track {
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.5s ease;
    padding: 0 50%;
}

/* Reward Animations Container */
.reward-animations {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    pointer-events: none;
}

.reward-bubble {
    position: absolute;
    bottom: 10px;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1rem;
    animation: floatUp 2s ease-out forwards;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.reward-bubble.positive {
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    color: white;
}

.reward-bubble.negative {
    background: linear-gradient(135deg, #f44336, #ff6b6b);
    color: white;
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    20% {
        opacity: 1;
        transform: translateY(0);
    }
    80% {
        opacity: 1;
        transform: translateY(-30px);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px);
    }
}

/* Content Boxes */
.content-box {
    min-width: 300px;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.5s ease;
    animation: slideIn 0.5s ease;
    position: relative;
}

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

.content-box.observation {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.content-box.action-wait {
    background: rgba(142, 117, 223, 0.1);
    border-color: #8E75DF;
}

.content-box.action-press {
    background: rgba(175, 169, 239, 0.1);
    border-color: #AFA9EF;
}

.content-box.action-press-positive {
    background: rgba(76, 175, 80, 0.1);
    border-color: #4CAF50;
}

.content-box.action-press-negative {
    background: rgba(244, 67, 54, 0.1);
    border-color: #f44336;
}

.content-box.fading {
    opacity: 0.3;
    filter: blur(2px);
    transform: scale(0.95);
}

.content-box.hidden {
    opacity: 0;
    transform: translateX(-100px);
}

.content-type {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.content-text {
    font-size: 1.1rem;
    line-height: 1.4;
}

/* Tooltip for content boxes */
.content-box {
    cursor: help;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
}

.content-box:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
}

.tooltip-row {
    margin: 4px 0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.tooltip-row strong {
    color: #AFA9EF;
    font-weight: 600;
    min-width: 80px;
}

/* Arrow for tooltip */
.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.95);
}

/* Playback Controls */
.playback-controls {
    position: absolute;
    bottom: 30px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.control-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.control-btn.primary {
    background: #8E75DF;
    border-color: #8E75DF;
    font-weight: 600;
}

.control-btn.primary:hover {
    background: #AFA9EF;
}

.control-btn .icon {
    font-size: 1.2rem;
}

.back-btn {
    background: transparent;
    color: #888;
    border: 1px solid #333;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

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

/* Back button in top-left corner */
.back-btn-top {
    position: absolute;
    top: 30px;
    left: 30px;
    background: transparent;
    color: #888;
    border: 1px solid #333;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    z-index: 10;
}

.back-btn-top:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-color: #555;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* Spinner animation */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #8E75DF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner.small {
    width: 30px;
    height: 30px;
    border-width: 3px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading overlay for transitions */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.loading-content {
    background: rgba(30, 30, 30, 0.95);
    padding: 30px 40px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.loading-text {
    color: #fff;
    font-size: 1.1rem;
    margin: 0;
}

/* Inline loading indicator */
.inline-loader {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #8E75DF;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

/* Reward Flash Animation */
@keyframes rewardFlash {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.reward-flash {
    animation: rewardFlash 0.5s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .episode-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    /* Playback Screen Mobile Optimizations */
    
    /* Hide progress bar on mobile */
    .progress-container {
        display: none;
    }
    
    /* Hide statistics section on mobile for cleaner interface */
    .statistics {
        display: none;
    }
    
    /* Episode grid uses more height when stats are hidden */
    .episode-grid {
        max-height: calc(100vh - 200px);  /* Less space needed without stats */
    }
    
    /* Smaller reward indicator - moved to avoid overlap */
    .reward-indicator {
        top: 15px;
        right: 15px;
        padding: 8px 12px;
        z-index: 15;  /* Ensure it's above other elements */
    }
    
    .reward-value {
        font-size: 1.2rem;
    }
    
    .reward-label {
        font-size: 0.7rem;
    }
    
    /* Episode metadata - positioned to avoid overlaps */
    .episode-metadata {
        position: fixed;  /* Changed from absolute to fixed */
        top: 120px;  /* Moved down to avoid overlap with back button and reward */
        left: 50%;
        transform: translateX(-50%);
        padding: 12px 16px;
        min-width: 280px;
        max-width: calc(100vw - 30px);
        z-index: 5;  /* Below back button and reward indicator */
    }
    
    .metadata-footer {
        display: none;
    }
    
    .user-goal-text {
        font-size: 0.95rem;
        white-space: normal;
        word-wrap: break-word;
    }
    
    /* Much smaller content boxes for obs/actions */
    .content-box {
        min-width: 110px;
        max-width: 140px;
        min-height: 100px;  /* Ensure minimum height for content */
        padding: 6px;
        border-radius: 6px;
        flex-shrink: 0;  /* Prevent content boxes from shrinking */
        flex: 1;  /* Allow boxes to grow to fill available space */
    }
    
    .content-type {
        font-size: 0.6rem;
        margin-bottom: 2px;
    }
    
    .content-text {
        font-size: 0.75rem;
        line-height: 1.15;
        /* Removed truncation - show full observations */
        overflow: visible;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
    
    /* Adjust display area for smaller content */
    .display-area {
        height: 250px;  /* Increased from 150px to show more content */
        margin-top: 60px;  /* Add margin to avoid overlap with metadata */
        overflow-x: hidden;  /* Prevent horizontal scroll */
        overflow-y: auto;  /* Allow vertical scroll if needed */
        width: 100%;  /* Use full width */
        padding: 0 10px;  /* Small padding on sides */
    }
    
    .display-track {
        gap: 10px;
        padding: 0;  /* No padding on mobile - content stays centered */
        justify-content: center;  /* Center the content boxes */
        transform: translateX(0) !important;  /* Override any JS transforms */
        width: 100%;  /* Use full width */
    }
    
    /* Hide reward animations on mobile */
    .reward-animations {
        display: none;
    }
    
    /* Smaller playback controls - properly centered */
    .playback-controls {
        bottom: 20px;
        gap: 8px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .control-btn {
        padding: 10px 15px;
        font-size: 0.85rem;
    }
    
    .control-btn .icon {
        font-size: 1rem;
    }
    
    /* Smaller back button with higher z-index */
    .back-btn-top {
        top: 15px;
        left: 15px;
        padding: 8px 12px;
        font-size: 0.8rem;
        z-index: 20;  /* Ensure it's above everything */
    }
    
    /* Hide tooltip on mobile (touch devices) */
    .tooltip-content {
        display: none;
    }
    
    /* Adjust animations for mobile */
    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translateX(20px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
    
    @keyframes floatUp {
        0% {
            opacity: 0;
            transform: translateY(10px);
        }
        20% {
            opacity: 1;
            transform: translateY(0);
        }
        80% {
            opacity: 1;
            transform: translateY(-20px);
        }
        100% {
            opacity: 0;
            transform: translateY(-30px);
        }
    }
}

/* Landscape mode adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    /* Hide metadata completely in landscape for more space */
    .episode-metadata {
        display: none !important;
    }
    
    .metadata-label {
        font-size: 0.6rem;
    }
    
    .user-goal-text {
        font-size: 0.8rem;
    }
    
    /* Larger display area in landscape since metadata is hidden */
    .display-area {
        height: calc(100vh - 120px);  /* Use most of available height */
        margin-top: 10px;  /* Less margin needed without metadata */
        overflow-y: auto;  /* Allow scrolling if needed */
    }
    
    /* Even smaller controls in landscape */
    .playback-controls {
        bottom: 10px;
    }
    
    .control-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    /* Hide reward animations in landscape too */
    .reward-animations {
        display: none;
    }
    
    /* Smaller back button and reward indicator */
    .back-btn-top {
        top: 10px;
        left: 10px;
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .reward-indicator {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
    }
    
    .reward-value {
        font-size: 1rem;
    }
    
    .reward-label {
        font-size: 0.6rem;
    }
}

/* Even smaller screens (phones in portrait) */
@media (max-width: 480px) {
    /* Even more compact for very small screens */
    .episode-metadata {
        top: 100px;  /* Keep it below back button and reward */
        padding: 10px 14px;
        min-width: 240px;
        max-width: calc(100vw - 20px);
    }
    
    .metadata-label {
        font-size: 0.65rem;
    }
    
    .user-goal-text {
        font-size: 0.85rem;
    }
    
    .content-box {
        min-width: 90px;
        max-width: 110px;
        min-height: 80px;  /* Ensure minimum height for content */
        padding: 5px;
        flex-shrink: 0;  /* Prevent shrinking on very small screens */
        flex: 1;  /* Allow boxes to grow */
    }
    
    .content-text {
        font-size: 0.7rem;
        /* Removed truncation - show full observations */
        overflow: visible;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
    
    .display-area {
        height: 200px;  /* Increased from 120px for more content */
        margin-top: 50px;  /* Space for metadata */
        overflow-x: hidden;  /* Prevent horizontal scroll */
        overflow-y: auto;  /* Allow vertical scroll if needed */
        width: 100%;  /* Use full width */
        padding: 0 8px;  /* Small padding */
    }
    
    .display-track {
        gap: 8px;
        padding: 0;  /* No padding - keep content centered */
        justify-content: center;  /* Center the content boxes */
        transform: translateX(0) !important;  /* Override any JS transforms */
        width: 100%;  /* Use full width */
    }
    
    /* Even smaller controls for very small screens */
    .control-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    /* Ensure playback controls stay centered */
    .playback-controls {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .reward-indicator {
        padding: 6px 10px;
    }
    
    .reward-value {
        font-size: 1rem;
    }
    
    .reward-label {
        font-size: 0.65rem;
    }
}
