/* ========================================
   CHALLENGE MODE — Styles
   ======================================== */

/* --- Tab Navigation --- */
.tab-bar {
    display: flex;
    gap: 0;
    width: 100%;
    margin-bottom: 0;
    position: relative;
    z-index: 20;
}

.tab-btn {
    flex: 1;
    padding: 1rem 2rem;
    background: var(--bg-dark);
    border: none;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-light);
}

.tab-btn:first-child {
    border-radius: 16px 0 0 0;
}

.tab-btn:last-child {
    border-radius: 0 16px 0 0;
}

.tab-btn.active {
    color: var(--primary);
    box-shadow: var(--shadow-inset);
}

.tab-btn:hover:not(.active) {
    color: var(--text-main);
}

/* --- Tab Content --- */
.tab-content {
    display: none;
}

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

#roulette-tab {
    flex-direction: row;
    gap: 2rem;
    width: 100%;
}

#challenge-tab {
    flex-direction: column;
    width: 100%;
    gap: 0;
}

/* ========================================
   SETUP SCREEN
   ======================================== */
.challenge-setup {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 700px;
    margin: 2rem auto;
    width: 100%;
}

.challenge-setup .glass-panel {
    animation: fadeInUp 0.4s ease both;
}

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

/* Segmented Control (misses / accuracy) */
.segmented-control {
    display: flex;
    background: var(--bg-dark);
    border-radius: 16px;
    padding: 4px;
    border: none;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-inset);
}

.seg-option {
    flex: 1;
    padding: 0.75rem 1.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 14px;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
    user-select: none;
    letter-spacing: -0.01em;
}

.seg-option.active {
    color: var(--primary);
    background: var(--bg-dark);
    box-shadow: var(--shadow-light);
}

.seg-option:hover:not(.active) {
    color: var(--text-main);
}

.seg-option .seg-icon {
    margin-right: 0.4rem;
    font-size: 1rem;
}

/* Preset Buttons */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.preset-btn {
    padding: 0.85rem 0.5rem;
    border-radius: 14px;
    border: none;
    background: var(--bg-dark);
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.preset-btn:hover {
    color: var(--text-main);
    transform: translateY(-2px);
}

.preset-btn.active {
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-inset);
}

/* Preset color schemes */
.preset-btn[data-preset="easy"].active {
    background: #10b981;
    box-shadow: inset -3px -3px 6px rgba(16, 185, 129, 0.3), inset 3px 3px 6px rgba(0, 0, 0, 0.2);
}

.preset-btn[data-preset="medium"].active {
    background: #f59e0b;
    box-shadow: inset -3px -3px 6px rgba(245, 158, 11, 0.3), inset 3px 3px 6px rgba(0, 0, 0, 0.2);
}

.preset-btn[data-preset="hard"].active {
    background: #ef4444;
    box-shadow: inset -3px -3px 6px rgba(239, 68, 68, 0.3), inset 3px 3px 6px rgba(0, 0, 0, 0.2);
}

.preset-btn[data-preset="demon"].active {
    background: #a855f7;
    box-shadow: inset -3px -3px 6px rgba(168, 85, 247, 0.3), inset 3px 3px 6px rgba(0, 0, 0, 0.2);
}

.preset-btn .preset-label {
    display: block;
    font-size: 0.9rem;
}

.preset-btn .preset-detail {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 400;
}

.preset-btn.active .preset-detail {
    color: rgba(255, 255, 255, 0.8);
}

/* Slider groups in setup */
.setup-slider-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.setup-slider-group label {
    font-size: 1rem;
    margin-bottom: 0;
}

.setup-slider-group .slider-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.setup-slider-group input[type="range"] {
    flex: 1;
}

.setup-slider-group .slider-value {
    min-width: 40px;
    text-align: center;
    font-weight: 800;
    color: var(--primary);
    font-size: 1.2rem;
}

/* Section headings in setup */
.setup-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
}

.setup-section-title .icon {
    font-size: 1.1rem;
}

/* Info display */
.challenge-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-dark);
    border-radius: 12px;
    border: none;
    box-shadow: var(--shadow-inset);
}

.challenge-info-row .info-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.challenge-info-row .info-value {
    font-weight: 700;
    color: var(--primary);
    font-size: 1rem;
}

/* Start button */
.btn-start-challenge {
    background: var(--bg-dark);
    color: var(--primary);
    border: none;
    padding: 1rem 2rem;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.btn-start-challenge:hover {
    transform: translateY(-2px);
    box-shadow: -10px -10px 20px rgba(255, 255, 255, 0.9), 10px 10px 20px rgba(163, 177, 198, 0.7);
}

.btn-start-challenge:active {
    transform: translateY(0) scale(0.98);
    box-shadow: var(--shadow-pressed);
}

/* Divider between the regular challenge config and its spin-off modes */
.setup-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0.4rem 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    user-select: none;
}

.setup-divider::before,
.setup-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: 0.35;
}

/* ========================================
   ACTIVE CHALLENGE SCREEN
   ======================================== */
.challenge-active {
    display: none;
    gap: 1.5rem;
    width: 100%;
    padding: 1.5rem 0;
    animation: fadeInUp 0.4s ease both;
}

.challenge-active.visible {
    display: flex;
    flex-wrap: wrap;
}

/* Top bar with cancel button */
.challenge-top-bar {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
    position: sticky;
    top: 1rem;
    z-index: 160;
}

/* Settings button wrapper for relative positioning */
.challenge-top-bar {
    position: relative;
}

.btn-settings-challenge {
    padding: 0.6rem 1rem;
    border-radius: 12px;
    border: none;
    background: var(--bg-dark);
    color: var(--secondary);
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-light);
}

.btn-settings-challenge:hover {
    transform: translateY(-1px);
    box-shadow: -8px -8px 16px rgba(255, 255, 255, 0.9), 8px 8px 16px rgba(163, 177, 198, 0.7);
}

.btn-settings-challenge:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-pressed);
}

.btn-cancel-challenge {
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    border: none;
    background: var(--bg-dark);
    color: #ef4444;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-light);
}

.btn-cancel-challenge:hover {
    transform: translateY(-1px);
}

.btn-cancel-challenge:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-pressed);
}

/* Settings Dropdown */
.challenge-settings-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 220px;
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    z-index: 170;
    display: none;
    animation: dropdownSlideIn 0.2s ease both;
}

.challenge-settings-dropdown.visible {
    display: block;
}

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

.settings-dropdown-header {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.6rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.settings-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
    font-weight: 600;
}

.settings-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.settings-dropdown-item input[type="checkbox"] {
    cursor: pointer;
}

.settings-dropdown-item span {
    flex: 1;
    user-select: none;
}

/* Left column: wheel + map + input */
.challenge-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    min-width: 0;
}

/* Challenge Wheel Container */
.challenge-wheel-wrap {
    position: relative;
    width: 500px;
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.challenge-wheel-wrap .wheel-container {
    width: 500px;
    height: 500px;
}

.challenge-wheel-wrap canvas {
    width: 480px;
    height: 480px;
}

/* Status bar above wheel */
.challenge-status-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    flex-wrap: wrap;
}

.status-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--bg-dark);
    border: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-light);
}

.status-chip .chip-icon {
    font-size: 1rem;
}

.status-chip .chip-value {
    color: var(--primary);
}

/* Current Map Card */
.challenge-current-map {
    width: 100%;
    max-width: 520px;
}

.map-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    animation: fadeInUp 0.3s ease both;
}

.map-card-cover {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--glass-border);
    flex-shrink: 0;
}

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

.map-card-info h3 {
    font-size: 1.1rem;
    margin: 0 0 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-card-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.map-card-info .badge-group {
    margin-top: 0.4rem;
}

/* Result input */
.result-input-wrap {
    width: 100%;
    max-width: 520px;
    display: flex;
    gap: 0.8rem;
}

.result-input {
    flex: 1;
    padding: 0.9rem 1.2rem;
    border-radius: 14px;
    border: none;
    background: var(--bg-dark);
    color: var(--text-main);
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    outline: none;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-inset);
}

.result-input:focus {
    box-shadow: inset -2px -2px 6px rgba(255, 255, 255, 0.7), inset 2px 2px 6px rgba(163, 177, 198, 0.5), 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.result-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.btn-submit-result {
    padding: 0.9rem 1.8rem;
    border-radius: 14px;
    border: none;
    background: var(--bg-dark);
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-light);
}

.btn-submit-result:hover {
    transform: translateY(-2px);
    box-shadow: -10px -10px 20px rgba(255, 255, 255, 0.9), 10px 10px 20px rgba(163, 177, 198, 0.7);
}

.btn-submit-result:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-pressed);
}

/* Reroll button */
.btn-reroll {
    padding: 0.7rem 1.4rem;
    border-radius: 14px;
    border: none;
    background: var(--bg-dark);
    color: var(--secondary);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-light);
}

.btn-reroll:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn-reroll:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    color: var(--text-muted);
}

.btn-reroll:active:not(:disabled) {
    transform: scale(0.95);
    box-shadow: var(--shadow-pressed);
}

.challenge-actions-row {
    display: flex;
    gap: 0.8rem;
    width: 100%;
    max-width: 520px;
    justify-content: center;
}

/* ========================================
   LOG PANEL (Right Column)
   ======================================== */
.challenge-log-panel {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
    position: sticky;
    top: 80px;
}

.log-header {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.log-scroll {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-right: 0.5rem;
}

/* Custom scrollbar */
.log-scroll::-webkit-scrollbar {
    width: 6px;
}

.log-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.log-scroll::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* Log Entry */
.log-entry {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.9rem;
    background: var(--bg-dark);
    border-radius: 12px;
    border: none;
    animation: logSlideIn 0.3s ease both;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-light);
}

.log-entry:hover {
    /* Theme-specific hover effects defined in themes.css */
}

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

.log-entry-cover {
    width: 44px;
    height: 32px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

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

.log-entry-title {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-entry-result {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.log-entry-round {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
    background: var(--bg-dark);
    padding: 4px 10px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: var(--shadow-inset);
}

.log-entry.rerolled {
    opacity: 0.5;
    border-style: dashed;
}

.log-empty {
    color: var(--text-muted);
    text-align: center;
    font-size: 0.9rem;
    padding: 2rem 0;
}

/* ========================================
   VICTORY / FAIL OVERLAYS
   ======================================== */
.challenge-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.challenge-overlay.visible {
    display: flex;
    animation: overlayFadeIn 0.5s ease both;
}

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

.overlay-content {
    text-align: center;
    max-width: 600px;
    width: 90%;
    animation: overlayScaleIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    position: relative;
}

/* Victory overlay gets cleaner shadow */
#challenge-victory .overlay-content {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    animation: overlayScaleIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes overlayScaleIn {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1); }
}

/* Victory */
.victory-big-text {
    font-size: 5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.victory-subtitle {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

/* Fail */
.fail-big-text {
    font-size: 4rem;
    font-weight: 800;
    color: #ef4444;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
}

.fail-subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

/* Overlay history scroll */
.overlay-history {
    max-height: 300px;
    overflow-y: auto;
    margin: 1.5rem auto;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 0.5rem;
}

.overlay-history::-webkit-scrollbar {
    width: 5px;
}

.overlay-history::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.overlay-history::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

/* Overlay buttons */
.overlay-btn-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn-restart {
    padding: 0.9rem 2.5rem;
    border-radius: 14px;
    border: none;
    background: var(--bg-dark);
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-light);
}

.btn-restart:hover {
    transform: translateY(-2px);
    box-shadow: -10px -10px 20px rgba(255, 255, 255, 0.9), 10px 10px 20px rgba(163, 177, 198, 0.7);
}

.btn-restart:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-pressed);
}

.btn-back-setup {
    padding: 0.9rem 2.5rem;
    border-radius: 14px;
    border: none;
    background: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-inset);
}

.btn-back-setup:hover {
    box-shadow: inset -3px -3px 8px rgba(255, 255, 255, 0.6), inset 3px 3px 8px rgba(163, 177, 198, 0.5);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1000px) {
    .challenge-active {
        flex-direction: column;
    }

    .challenge-log-panel {
        width: 100%;
        max-height: 300px;
        position: static;
    }

    .challenge-wheel-wrap,
    .challenge-wheel-wrap .wheel-container {
        width: 400px;
        height: 400px;
    }

    .challenge-wheel-wrap canvas {
        width: 380px;
        height: 380px;
    }
}

@media (max-width: 700px) {
    .preset-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .challenge-wheel-wrap,
    .challenge-wheel-wrap .wheel-container {
        width: 300px;
        height: 300px;
    }

    .challenge-wheel-wrap canvas {
        width: 280px;
        height: 280px;
    }

    .victory-big-text {
        font-size: 3rem;
    }

    .fail-big-text {
        font-size: 2.5rem;
    }
}

/* ==================== Challenge Progress Bar ==================== */
.challenge-progress {
    position: relative;
    height: 26px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.challenge-progress-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: 13px;
    background: linear-gradient(90deg, #ec4899, #8b5cf6, #3b82f6, #10b981);
    transition: width 0.5s ease;
}

.challenge-progress-label {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* ---- Challenge setup mode sub-tabs ---- */
.ch-mode-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.6rem;
}

.ch-mode-btn {
    flex: 1 1 110px;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.ch-mode-btn.active {
    background: rgba(236, 72, 153, 0.18);
    border-color: #ec4899;
    color: #fff;
}

/* ---- Read-only filter summary chip ---- */
.ch-filter-chip {
    margin: 0.5rem 0 0.7rem;
    padding: 0.45rem 0.7rem;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.ch-filter-chip:empty {
    display: none;
}

/* Challenge status/mode dropdown groups */
.ch-dd-group {
    margin-bottom: 0.9rem;
}

/* ---- Daily challenge ---- */
.daily-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}
.daily-date {
    font-weight: 700;
    font-size: 1.05rem;
}
.daily-reset {
    font-size: 0.85rem;
    opacity: 0.75;
}
#daily-countdown {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.daily-maps {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin: 0.8rem 0;
}
.daily-map {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.7rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
}
.daily-map-num {
    font-weight: 700;
    opacity: 0.6;
    min-width: 1.2rem;
}
.daily-map-stars {
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0.85;
}
.daily-map-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}
.daily-map-info a {
    color: inherit;
}
.daily-map-meta {
    opacity: 0.65;
    font-size: 0.8rem;
}
.daily-acc {
    width: 5.5rem;
    padding: 0.3rem 0.4rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    text-align: right;
}
.daily-acc:disabled {
    opacity: 0.6;
}
.daily-submit-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin: 0.6rem 0 1rem;
}
#daily-total {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
#daily-submit {
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #ff66aa, #cc5288);
}
#daily-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.daily-status {
    margin: 0.6rem 0 1rem;
    opacity: 0.85;
}
.daily-status-done {
    margin: 0.6rem 0 1rem;
    font-weight: 600;
    color: #7ee787;
}
.daily-lb-title {
    font-weight: 700;
    margin: 0.8rem 0 0.4rem;
}
.daily-lb {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.daily-lb-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.9rem;
}
.daily-lb-row.daily-lb-me {
    background: rgba(255, 102, 170, 0.18);
    outline: 1px solid rgba(255, 102, 170, 0.45);
}
.daily-lb-rank {
    min-width: 2rem;
    text-align: center;
}
.daily-lb-ava {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}
.daily-lb-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.daily-lb-total {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}
.daily-lb-empty {
    opacity: 0.7;
    font-size: 0.9rem;
}

.daily-acc-empty {
    width: 5.5rem;
    text-align: center;
    opacity: 0.4;
}

.daily-lb-verified {
    font-size: 0.8rem;
}

/* Submitted accuracies: plain read-only values instead of disabled inputs. */
.daily-acc-val {
    width: 5.5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: #7ee787;
}

/* "Improve result" + "Cancel" buttons under a submitted daily. */
#daily-retry {
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #ff66aa, #cc5288);
    transition: filter 0.15s, transform 0.15s;
}
#daily-retry:hover {
    filter: brightness(1.12);
    transform: translateY(-1px);
}
#daily-retry-cancel {
    padding: 0.5rem 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    color: inherit;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.15s;
}
#daily-retry-cancel:hover {
    background: rgba(255, 255, 255, 0.16);
}
.daily-kept {
    color: #ffd27a;
}
