/* Genesis Emulator - Retro Interface */

:root {
    --primary: #4a90e2;
    --accent: #7c3aed;
    --bg: #0a0e27;
    --surface: #121829;
    --surface-light: #1a2236;
    --text: #e4e4e7;
    --text-dim: #94a3b8;
    --border: #2a3347;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --glow: rgba(74, 144, 226, 0.3);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-feature-settings: 'liga' 1, 'calt' 1;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@supports (font-variation-settings: normal) {
    body { font-family: 'InterVariable', sans-serif; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 60px;
}

.logo {
    display: inline-block;
}

.logo-text {
    display: block;
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.logo-subtitle {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-dim);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Main Content */
main {
    background: var(--surface);
    border-radius: 24px;
    padding: 40px;
    border: 1px solid var(--border);
}

/* Emulator Container */
.emulator-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto 40px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 80px var(--glow);
}

.screen-wrapper {
    position: relative;
    aspect-ratio: 4/3;
    background: #000;
}

#screen {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    position: relative;
    z-index: 1;
}

/* CRT Effect */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 2;
    opacity: 0.5;
}

.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
    z-index: 3;
}

/* Fullscreen mode */
.emulator-container:fullscreen {
    max-width: 100vw;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.emulator-container:fullscreen .screen-wrapper {
    width: 100%;
    max-width: 90vh;
    max-height: 90vh;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

/* Drop Zone */
.drop-zone {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
}

.drop-zone.hidden {
    display: none;
}

.drop-zone.drag-over {
    background: rgba(74, 144, 226, 0.2);
    border: 3px dashed var(--primary);
}

.drop-content {
    text-align: center;
    padding: 60px 40px;
}

.drop-content svg {
    margin-bottom: 24px;
    color: var(--primary);
    opacity: 0.8;
}

.drop-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.drop-content p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* Controls */
.controls {
    margin-bottom: 32px;
    padding: 24px;
    background: var(--surface-light);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.control-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--surface);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn svg {
    opacity: 0.7;
}

.btn:hover:not(:disabled) {
    background: var(--surface-light);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--surface-light);
    color: var(--text-dim);
    border-color: var(--border);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #3b7bc9;
    border-color: #3b7bc9;
    box-shadow: 0 4px 12px var(--glow);
}

/* Audio Controls */
.audio-controls {
    gap: 16px;
}

.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.slider-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
}

.slider-label span {
    color: var(--text-dim);
}

.volume-value {
    min-width: 40px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text) !important;
}

input[type="range"] {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    cursor: pointer;
}

/* Info Panel */
/* Status bar with controls button */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-link:hover {
    background: var(--surface-light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-link svg {
    flex-shrink: 0;
}

/* Controls grid in modal */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.control-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
    gap: 12px;
}

.control-item span {
    font-size: 0.875rem;
    color: var(--text-dim);
}

kbd {
    font-family: 'Inter', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    display: inline-block;
}

kbd + kbd {
    margin-left: 4px;
}

/* Status */
.status {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 500;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.2);
}

.status.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border-color: rgba(245, 158, 11, 0.2);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 60px;
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.tech-stack {
    color: var(--text-dim);
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.copyright {
    color: var(--text-dim);
    font-size: 0.8125rem;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    main {
        padding: 24px;
    }

    .logo-text {
        font-size: 2.5rem;
    }

    .control-row {
        flex-direction: column;
    }

    .control-group {
        width: 100%;
        justify-content: center;
    }

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

.btn-secondary {
    background: var(--surface-light);
    border-color: var(--accent);
    color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* ROM Browser Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal.hidden {
    display: none;
}

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

.modal-content {
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.modal-small {
    max-width: 500px;
}

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

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

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--surface-light);
    color: var(--text);
}

.modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 24px 32px;
}

.catalog-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--surface-light);
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.catalog-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.catalog-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-size: 0.9rem;
}

.catalog-status svg {
    flex-shrink: 0;
}

.catalog-actions {
    display: flex;
    gap: 12px;
}

.catalog-actions .btn {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.download-progress {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--surface-light);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--surface);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-dim);
    text-align: center;
    margin: 0;
}

.search-container {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
}

.search-container svg {
    color: var(--text-dim);
    flex-shrink: 0;
}

#rom-search {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
}

#rom-search::placeholder {
    color: var(--text-dim);
}

/* 2P Filter Toggle */
.filter-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.filter-toggle:hover {
    border-color: var(--primary);
}

.filter-toggle input {
    display: none;
}

.filter-toggle input:checked + .filter-label {
    color: var(--success);
}

.filter-toggle:has(input:checked) {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
}

.filter-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-dim);
    transition: color 0.2s ease;
    white-space: nowrap;
}

.rom-count {
    color: var(--text-dim);
    font-size: 0.875rem;
    white-space: nowrap;
}

.rom-list {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-light);
}

.loading-roms {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

.loading-roms .spinner {
    margin-bottom: 20px;
}

.rom-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

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

.rom-item:hover {
    background: var(--surface);
}

.rom-item.loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

.rom-item.loading .rom-download-btn {
    opacity: 0.6;
    cursor: wait;
    position: relative;
}

.rom-item.loading .rom-download-btn::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.rom-info {
    flex: 1;
    min-width: 0;
}

.rom-name {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rom-name > span:first-child,
.rom-name:not(:has(.rom-tag)) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ROM Tags */
.rom-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.rom-tag-2p {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.rom-meta {
    font-size: 0.8125rem;
    color: var(--text-dim);
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.rom-size {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rom-region {
    padding: 2px 8px;
    background: var(--surface);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.rom-actions {
    display: flex;
    gap: 8px;
}

.rom-download-btn {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.rom-download-btn:hover {
    background: #3b7bc9;
    transform: translateY(-1px);
}

.rom-download-btn svg {
    width: 14px;
    height: 14px;
}

.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-dim);
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.modal-footer {
    padding: 20px 32px;
    border-top: 1px solid var(--border);
}

.source-info {
    font-size: 0.8125rem;
    color: var(--text-dim);
    text-align: center;
    margin: 0;
}

.source-info a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.source-info a:hover {
    color: var(--accent);
}

/* Scrollbar styling */
.rom-list::-webkit-scrollbar {
    width: 8px;
}

.rom-list::-webkit-scrollbar-track {
    background: var(--surface-light);
}

.rom-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.rom-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* Dark mode refinements */
@media (prefers-color-scheme: dark) {
    body {
        color-scheme: dark;
    }
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        max-height: 95vh;
        margin: 10px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px 20px;
    }
    
    .status-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-link {
        justify-content: center;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .catalog-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .catalog-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .catalog-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .rom-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .rom-actions {
        width: 100%;
    }
    
    .rom-download-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Save States Modal */
.saves-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.save-name-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.save-name-input input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-light);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
}

.save-name-input input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.btn-success {
    background: var(--success);
    color: var(--bg-dark);
}

.btn-success:hover {
    background: #00ffaa;
}

.saves-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-light);
}

.save-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all 0.2s;
}

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

.save-item:hover {
    background: rgba(0, 255, 136, 0.05);
}

.save-info {
    flex: 1;
    min-width: 0;
}

.save-name {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.save-meta {
    display: flex;
    gap: 12px;
    font-size: 0.875rem;
    color: var(--text-dim);
}

.save-rom {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.save-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.save-actions .btn {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #ff3366;
}

.modal-medium {
    max-width: 700px;
}

@media (max-width: 768px) {
    .save-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .save-actions {
        width: 100%;
    }
    
    .save-actions .btn {
        flex: 1;
    }
    
    .save-name-input {
        flex-direction: column;
    }
    
    .save-name-input input,
    .save-name-input .btn {
        width: 100%;
    }
}

/* Share Modal Styles */
.share-status {
    text-align: center;
}

.share-info {
    margin-bottom: 32px;
}

.share-info svg {
    margin: 0 auto 16px;
    color: var(--primary);
}

.share-info h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--text);
}

.share-info p {
    color: var(--text-dim);
    font-size: 0.95rem;
}

.share-section {
    margin-top: 24px;
}

/* Share Mode Selector */
.share-mode-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.share-mode-option {
    flex: 1;
    cursor: pointer;
}

.share-mode-option input {
    display: none;
}

.mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--surface-light);
    border: 2px solid var(--border);
    border-radius: 12px;
    transition: all 0.2s ease;
    text-align: center;
}

.mode-card:hover {
    border-color: var(--primary);
    background: rgba(74, 144, 226, 0.1);
}

.share-mode-option input:checked + .mode-card {
    border-color: var(--primary);
    background: rgba(74, 144, 226, 0.15);
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.2);
}

.mode-card svg {
    color: var(--primary);
}

.mode-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}

.mode-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Share Mode Badge */
.share-mode-badge {
    text-align: center;
    margin-bottom: 16px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-spectator {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.badge-multiplayer {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.share-url-container {
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.share-url-container label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-dim);
    margin-bottom: 8px;
    font-weight: 500;
}

.share-url-box {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.share-url-box input {
    flex: 1;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

.share-url-box input:focus {
    outline: none;
    border-color: var(--primary);
}

.share-hint {
    font-size: 0.875rem;
    color: var(--text-dim);
    margin: 0;
}

.share-hint span {
    color: var(--success);
    font-weight: 600;
}

@media (max-width: 768px) {
    .share-url-box {
        flex-direction: column;
    }
    
    .share-url-box button {
        width: 100%;
    }
}
