:root {
    --bg-dark: #e0e5ec;
    --bg-secondary: #e0e5ec;
    --glass-bg: #e0e5ec;
    --glass-border: rgba(255, 255, 255, 0.8);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --text-main: #2d3748;
    --text-muted: #718096;
    --osu-color: #ff66aa;
    --border-radius: 16px;
    --spacing-unit: 1rem;
    --shadow-light: -8px -8px 16px rgba(255, 255, 255, 0.8), 8px 8px 16px rgba(163, 177, 198, 0.6);
    --shadow-inset: inset -4px -4px 8px rgba(255, 255, 255, 0.5), inset 4px 4px 8px rgba(163, 177, 198, 0.4);
    --shadow-pressed: inset -2px -2px 6px rgba(255, 255, 255, 0.7), inset 2px 2px 6px rgba(163, 177, 198, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: clip;
}

/* Background Blobs - subtle for neumorphism */
.blob {
    position: absolute;
    filter: blur(150px);
    z-index: -1;
    opacity: 0.15;
    border-radius: 50%;
    animation: float 20s ease-in-out infinite alternate;
}

.blob-1 {
    top: -20%;
    left: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary), transparent 70%);
}

.blob-2 {
    bottom: -20%;
    right: -20%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--secondary), transparent 70%);
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(30px) scale(1.03); }
}

/* Layout */
.container {
    display: flex;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    gap: 2rem;
    min-height: 100vh;
    align-content: flex-start;
}

.glass-panel {
    background: var(--glass-bg);
    border: none;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
}

.sidebar {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeInUp 0.4s ease both;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    position: relative;
    animation: fadeInUp 0.4s ease both 0.1s;
}

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

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--text-main);
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8), -2px -2px 4px rgba(163, 177, 198, 0.4);
}
.highlight {
    color: var(--primary);
    font-weight: 700;
}

label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    letter-spacing: -0.01em;
}
.control-group span {
    color: var(--primary);
    font-weight: 700;
}

/* Controls */
.slider-container {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: 0.5rem 1rem;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--bg-dark);
    cursor: pointer;
    margin-top: -9px;
    box-shadow: -4px -4px 8px rgba(255, 255, 255, 0.8), 4px 4px 8px rgba(163, 177, 198, 0.6);
    border: none;
}
input[type=range]::-webkit-slider-thumb:active {
    box-shadow: var(--shadow-pressed);
}
input[type=range]::-moz-range-thumb {
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--bg-dark);
    cursor: pointer;
    border: none;
    box-shadow: -4px -4px 8px rgba(255, 255, 255, 0.8), 4px 4px 8px rgba(163, 177, 198, 0.6);
}
input[type=range]::-moz-range-thumb:active {
    box-shadow: var(--shadow-pressed);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--bg-dark);
    border-radius: 3px;
    box-shadow: var(--shadow-inset);
}
input[type=range]::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--bg-dark);
    border-radius: 3px;
    box-shadow: var(--shadow-inset);
    border: none;
}

.section-count-group input, .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: none;
    background: var(--bg-dark);
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
    font-weight: 500;
    box-shadow: var(--shadow-inset);
}

.section-count-group input:focus, .form-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);
}

.form-input option {
    background: var(--bg-dark);
    color: var(--text-main);
}

.dropdown-check {
    position: relative;
    user-select: none;
}

.dropdown-header {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: none;
    background: var(--bg-dark);
    color: var(--text-main);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    font-weight: 500;
    box-shadow: var(--shadow-inset);
}

.dropdown-header:hover {
    box-shadow: inset -2px -2px 6px rgba(255, 255, 255, 0.7), inset 2px 2px 6px rgba(163, 177, 198, 0.5);
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-dark);
    border: none;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow-light);
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.dropdown-list.hidden {
    display: none !important;
}

.dropdown-list label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 500;
    margin: 0;
    border-radius: 8px;
    transition: all 0.2s;
}

.dropdown-list label:hover {
    background: var(--bg-dark);
    box-shadow: var(--shadow-inset);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.5rem;
}
.custom-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
}

.mute-btn-inline {
    width: 100%;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    text-align: left;
}
.mute-btn-inline:hover {
    background: rgba(255, 255, 255, 0.15);
}
.mute-btn-inline.muted {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.advanced-settings {
    margin-top: 0.5rem;
}

.advanced-settings summary {
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
    outline: none;
    color: var(--text-main);
    transition: color 0.2s;
}

.advanced-settings summary:hover {
    color: var(--primary);
}

.advanced-settings .settings-content {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.btn-primary {
    background: var(--bg-dark);
    color: var(--primary);
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: auto;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-light);
}
.btn-primary:active {
    box-shadow: var(--shadow-pressed);
    transform: scale(0.98);
}
.btn-primary:hover {
    box-shadow: -10px -10px 20px rgba(255, 255, 255, 0.9), 10px 10px 20px rgba(163, 177, 198, 0.7);
}

/* Wheel */
.wheel-container {
    position: relative;
    width: 650px;
    height: 650px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    padding: 0;
    overflow: hidden;
    box-shadow: -12px -12px 24px rgba(255, 255, 255, 0.8), 12px 12px 24px rgba(163, 177, 198, 0.6);
    border: none;
}

canvas#roulette-wheel {
    border-radius: 50%;
    transform: rotate(0deg);
}

.spin-indicator {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; 
    height: 0; 
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid white;
    z-index: 10;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5));
}

.btn-spin {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: none;
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    z-index: 10;
    box-shadow: -6px -6px 12px rgba(255, 255, 255, 0.8), 6px 6px 12px rgba(163, 177, 198, 0.6);
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}
.btn-spin:active:not(:disabled) {
    box-shadow: var(--shadow-pressed);
    transform: translate(-50%, -50%) scale(0.95);
}
.btn-spin:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(1);
}
.btn-spin:hover:not(:disabled) {
    box-shadow: -8px -8px 16px rgba(255, 255, 255, 0.9), 8px 8px 16px rgba(163, 177, 198, 0.7);
}

/* Winner Panel */
.winner-panel {
    width: 100%;
    max-width: 650px;
    animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.winner-panel h2 {
    text-align: center;
    color: var(--primary);
    font-size: 2rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(236,72,153,0.5);
}

.winner-details {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.winner-img {
    width: 250px;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--glass-border);
}

.winner-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.winner-info h3 {
    font-size: 1.5rem;
    margin: 0;
}
.winner-info p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0;
}

.badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}
.badge {
    padding: 0.4rem 0.9rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-light);
}
.diff-badge { background: var(--bg-dark); color: var(--primary); }
.version-badge { background: var(--bg-dark); color: var(--secondary); }
.ar-badge, .cs-badge { background: var(--bg-dark); color: var(--text-main); }

.btn-osu {
    display: inline-block;
    background: var(--osu-color);
    color: white;
    text-decoration: none;
    text-align: center;
    padding: 0.8rem;
    border-radius: 8px;
    font-weight: bold;
    margin-top: 0.5rem;
    transition: background 0.2s;
}
.btn-osu:hover {
    background: #e55c99;
}

/* Inline "Open on osu!" link (MP result card etc.) - styled as a small
   osu-pink pill so it stays readable on every theme, incl. dark ones. */
.osu-link {
    display: inline-block;
    color: var(--osu-color);
    font-weight: 600;
    font-size: 0.8rem;
    text-decoration: none;
    padding: 0.25rem 0.65rem;
    border: 1px solid var(--osu-color);
    border-radius: 999px;
    background: rgba(255, 102, 170, 0.12);
    transition: background 0.2s, color 0.2s, transform 0.1s;
}
.osu-link:hover {
    background: var(--osu-color);
    color: #fff;
}
.osu-link:active {
    transform: scale(0.97);
}

/* Ambient beatmap-cover background for result cards (set by coverbg.js).
   The dark gradient keeps text readable; the CSS variables force light
   text even on light themes. */
.has-cover-bg {
    /* !important: theme blocks (e.g. Lazer's .glass-panel) set the `background:`
       shorthand with higher specificity, which would silently reset
       background-image and hide the cover. */
    background-image: linear-gradient(rgba(15, 23, 42, 0.78), rgba(15, 23, 42, 0.9)), var(--cover-url) !important;
    background-size: cover !important;
    background-position: center !important;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    color: var(--text-main);
}

.hidden {
    display: none !important;
}
.error-msg {
    color: #ef4444;
    text-align: center;
    font-weight: bold;
}

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 250;
}

/* Audio Controls */
.mute-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    z-index: 20;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

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

.mute-btn.muted {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    text-decoration: line-through;
    opacity: 0.7;
}

/* Tooltip for mute */
.tooltip {
    position: relative;
}
.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #0f172a;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    top: 120%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
    pointer-events: none;
    border: 1px solid var(--glass-border);
}
.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* ==================== My Presets ==================== */
.preset-manager {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.preset-manager-btns {
    display: flex;
    gap: 0.5rem;
}

.btn-mini {
    flex: 1;
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main, #fff);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-mini:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.16);
}

.btn-mini:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-mini:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==================== Blacklist button ==================== */
.btn-blacklist {
    display: block;
    width: 100%;
    margin-top: 0.6rem;
    padding: 0.55rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-blacklist:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.25);
}

.btn-blacklist:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-blacklist:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ==================== Wheel stop shake ==================== */
@keyframes wheelShake {
    0%   { transform: translate(0, 0) rotate(0deg); }
    15%  { transform: translate(-4px, 2px) rotate(-0.6deg); }
    30%  { transform: translate(4px, -2px) rotate(0.6deg); }
    45%  { transform: translate(-3px, -2px) rotate(-0.4deg); }
    60%  { transform: translate(3px, 2px) rotate(0.4deg); }
    75%  { transform: translate(-2px, 1px) rotate(-0.2deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.wheel-container.wheel-shake {
    animation: wheelShake 0.55s ease-out;
}


/* ==================== Blacklist Manager ==================== */
.blacklist-summary {
    gap: 1rem;
}

.blacklist-summary .btn-mini {
    flex: 0 0 auto;
}

.blacklist-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 250px;
    margin-top: 0.65rem;
    overflow-y: auto;
}

.blacklist-empty {
    padding: 0.8rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
}

.blacklist-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

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

.blacklist-item-title,
.blacklist-item-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.blacklist-item-title {
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 700;
}

.blacklist-item-meta {
    margin-top: 0.15rem;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.blacklist-remove {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    cursor: pointer;
}

.blacklist-remove:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* ==================== In-app Confirmation ==================== */
.app-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.app-confirm-modal.visible {
    display: flex;
}

.app-confirm-card {
    width: min(420px, 100%);
    padding: 1.4rem;
    color: var(--text-main);
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.app-confirm-card h3 {
    margin: 0 0 0.65rem;
}

.app-confirm-card p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.5;
}

.app-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 1.2rem;
}

.app-confirm-actions .btn-mini {
    flex: 0 0 auto;
    min-width: 90px;
}

.btn-confirm-danger {
    min-width: 90px;
    padding: 0.5rem 0.8rem;
    color: #fff;
    font-weight: 700;
    background: #ef4444;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.btn-confirm-danger:hover {
    background: #dc2626;
}

/* ---------------- Audio Preview ---------------- */
.btn-preview {
    display: inline-block;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text-main, #fff);
    text-align: center;
    padding: 0.8rem;
    border-radius: 8px;
    font-family: inherit;
    font-weight: bold;
    font-size: 1rem;
    margin-top: 0.5rem;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.1s;
}

.btn-preview:hover {
    background: rgba(255, 255, 255, 0.16);
}

.btn-preview:active {
    transform: scale(0.97);
}

.btn-preview[data-preview-state="playing"] {
    background: rgba(236, 72, 153, 0.25);
    border-color: rgba(236, 72, 153, 0.65);
}

.btn-preview[data-preview-state="loading"] {
    opacity: 0.75;
}

.btn-preview[data-preview-state="error"] {
    opacity: 0.55;
}

/* ---------------- Stats Tab ---------------- */
#stats-tab {
    /* .container is a flex parent; #roulette-tab and #challenge-tab set
       width: 100% explicitly. Without it #stats-tab shrinks to content,
       so the achievements grid had fewer columns with empty history. */
    width: 100%;
}

.stats-wrap {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 1rem;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.stats-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.stats-card-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-main, #fff);
}

.stats-card-label {
    font-size: 0.8rem;
    color: var(--text-muted, #aaa);
    margin-top: 0.3rem;
}

.stats-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.8rem;
}

.stats-history-header h3 {
    margin: 0;
}

#clear-stats:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.stats-empty {
    color: var(--text-muted, #aaa);
    text-align: center;
    padding: 2rem 1rem;
}

.stats-run {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
    margin-bottom: 0.5rem;
}

.stats-run-main {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.stats-run-meta {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-size: 0.8rem;
    color: var(--text-muted, #aaa);
    flex-wrap: wrap;
}

.stats-result {
    font-weight: bold;
    padding: 0.15rem 0.55rem;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.stats-win {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
}

.stats-loss {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
}

.stats-abort {
    background: rgba(148, 163, 184, 0.18);
    color: #94a3b8;
}

.stats-run-preset,
.stats-run-mode {
    font-size: 0.85rem;
    color: var(--text-main, #fff);
}

/* ---------------- Share (PNG export) buttons ---------------- */
.btn-share {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.45);
    color: #c4b5fd;
    padding: 0.55rem 1.1rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-share:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.3);
}

.btn-share:active:not(:disabled) {
    transform: scale(0.97);
}

.btn-share:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ---------------- Backup (JSON export/import) ---------------- */
.backup-hint {
    font-size: 0.8rem;
    color: var(--text-muted, #aaa);
    margin: 0 0 0.6rem;
}

.backup-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* ---------------- Custom Challenge ---------------- */
.cc-hint {
    font-size: 0.8rem;
    color: var(--text-muted, #aaa);
    margin: 0 0 0.6rem;
}

.cc-textarea,
.cc-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: inherit;
    padding: 0.5rem 0.6rem;
    font-family: inherit;
    font-size: 0.85rem;
}

.cc-textarea { resize: vertical; }

.cc-btn-row {
    display: flex;
    gap: 0.6rem;
    margin: 0.6rem 0;
    flex-wrap: wrap;
}

.cc-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted, #aaa);
    margin: 0.6rem 0 0.3rem;
    text-align: left;
}

.cc-maps-list {
    max-height: 180px;
    overflow-y: auto;
    margin: 0.6rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.cc-empty {
    color: var(--text-muted, #aaa);
    font-size: 0.8rem;
    text-align: center;
    margin: 0.4rem 0;
}

.cc-map-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.35rem 0.6rem;
    font-size: 0.82rem;
    text-align: left;
}

.cc-map-num {
    color: var(--text-muted, #aaa);
    min-width: 1.6em;
    text-align: right;
}

.cc-map-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-map-stars { white-space: nowrap; }

.cc-status {
    font-size: 0.8rem;
    margin: 0.4rem 0 0;
    min-height: 1em;
    color: var(--text-muted, #aaa);
}

.cc-status.cc-error { color: #ef4444; }

.cc-start {
    margin-top: 0.8rem;
    width: 100%;
}

/* ==================== ACHIEVEMENTS ==================== */
#ach-toasts {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.ach-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    max-width: 340px;
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(24, 24, 38, 0.96);
    border: 1px solid rgba(255, 205, 60, 0.45);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.ach-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.ach-toast-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.ach-toast-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #ffcd3c;
}

.ach-toast-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    margin-top: 2px;
}

.ach-header {
    margin-top: 28px;
}

.ach-count {
    font-size: 0.85rem;
    opacity: 0.75;
    font-weight: 600;
}

#ach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.ach-card {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0.55;
    filter: grayscale(0.65);
}

.ach-card.unlocked {
    opacity: 1;
    filter: none;
    border-color: rgba(255, 205, 60, 0.35);
    background: rgba(255, 205, 60, 0.06);
}

.ach-icon {
    font-size: 1.5rem;
    line-height: 1.2;
}

.ach-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.ach-desc {
    font-size: 0.78rem;
    opacity: 0.75;
    margin-top: 2px;
}

.ach-date {
    font-size: 0.7rem;
    color: #ffcd3c;
    margin-top: 4px;
}

/* ---------------- Streak Mode (setup card) ---------------- */
.st-target-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.st-target-row .cc-input {
    max-width: 110px;
}

.st-unit {
    color: var(--text-muted, #aaa);
    font-size: 0.85rem;
}

/* ---- Language selector (settings modal) ---- */
.lang-row {
    display: flex;
    gap: 0.5rem;
}

.lang-btn {
    opacity: 0.75;
}

.lang-btn.active {
    opacity: 1;
    font-weight: 700;
    box-shadow: inset 0 0 0 2px #ec4899;
}

/* ========================================
   MULTIPLAYER
   ======================================== */
.mp-mode-row { display: flex; gap: 0.6rem; margin: 0.8rem 0; }
.mp-mode-card {
    flex: 1; background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12); border-radius: 12px;
    padding: 0.7rem 0.8rem; cursor: pointer; text-align: left;
    color: inherit; font: inherit; transition: border-color 0.15s ease;
}
.mp-mode-card:hover { border-color: rgba(236,72,153,0.5); }
.mp-mode-card.active { border-color: #ec4899; box-shadow: inset 0 0 0 1px #ec4899; }
.mp-mode-name { display: block; font-weight: 700; margin-bottom: 0.25rem; }
.mp-mode-desc { display: block; font-size: 0.78rem; opacity: 0.75; line-height: 1.35; }
.mp-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 0.4rem 0; }
.mp-num { width: 7rem; }
.mp-join-row { display: flex; gap: 0.6rem; margin-top: 0.7rem; align-items: center; }
.mp-code-input { width: 8.5rem; text-transform: uppercase; letter-spacing: 0.15em; }
.mp-panel { display: flex; flex-direction: column; gap: 1rem; max-width: 760px; margin: 0 auto; }
.mp-title { text-align: center; margin: 0.2rem 0 0.6rem; }
.mp-code-box { display: flex; align-items: center; justify-content: center; gap: 0.8rem; margin: 0.6rem 0; }
.mp-room-code {
    font-size: 1.6rem; font-weight: 800; letter-spacing: 0.25em;
    padding: 0.35rem 0.9rem; border-radius: 10px;
    border: 1px dashed rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.05); color: inherit; cursor: pointer;
}
.mp-players { list-style: none; padding: 0; margin: 0.6rem 0; display: flex; flex-direction: column; gap: 0.35rem; }
.mp-players li { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.7rem; border-radius: 8px; background: rgba(255,255,255,0.05); }
.mp-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: #22c55e; flex-shrink: 0; }
.mp-dot.off { background: #71717a; }
.mp-btn-row { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; margin-top: 0.8rem; }
.mp-play-info { text-align: center; font-weight: 700; margin-bottom: 0.5rem; font-size: 1.05rem; }
.mp-opponents { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.6rem; font-size: 0.85rem; opacity: 0.85; }
.mp-map-card { background: rgba(255,255,255,0.05); border-radius: 12px; padding: 1.1rem 1.2rem; margin: 0.5rem 0; text-align: left; }
.mp-map-card:empty { display: none; }
.mp-map-title { font-weight: 700; font-size: 1.05rem; }
/* Multiplayer roulette wheel (reuses the challenge wheel layout classes) */
#mp-wheel-wrap { margin: 0.5rem 0; }
.mp-map-meta { font-size: 0.8rem; opacity: 0.85; margin-top: 0.35rem; display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; }
.mp-submit-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 0.6rem 0; }
.mp-target { font-weight: 700; }
.mp-table table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 0.6rem; }
.mp-table th, .mp-table td { padding: 0.35rem 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.08); text-align: left; }
.mp-win { color: #22c55e; font-weight: 700; }
.mp-tie { color: #eab308; font-weight: 700; }

/* ===== Streak mode: no upper star cap (min - infinity) ===== */
body[data-ch-setup-mode="streak"] #ch-max-stars-label,
body[data-ch-setup-mode="streak"] #ch-max-stars-row {
    display: none;
}

/* ===== Card micro-animations (stats & achievements) ===== */
@media (prefers-reduced-motion: no-preference) {
    @keyframes card-fade-in-up {
        from { opacity: 0; transform: translateY(10px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .stats-card, .ach-card {
        animation: card-fade-in-up 0.35s ease backwards;
        transition: transform 0.18s ease, box-shadow 0.18s ease;
    }
    .stats-card:hover, .ach-card:hover { transform: translateY(-3px); }
    .stats-card:nth-child(2), .ach-card:nth-child(2) { animation-delay: 0.05s; }
    .stats-card:nth-child(3), .ach-card:nth-child(3) { animation-delay: 0.1s; }
    .stats-card:nth-child(4), .ach-card:nth-child(4) { animation-delay: 0.15s; }
    .stats-card:nth-child(5), .ach-card:nth-child(5) { animation-delay: 0.2s; }
    .stats-card:nth-child(6), .ach-card:nth-child(6) { animation-delay: 0.25s; }
    .stats-card:nth-child(7), .ach-card:nth-child(7) { animation-delay: 0.3s; }
    .stats-card:nth-child(8), .ach-card:nth-child(8) { animation-delay: 0.35s; }
    .ach-card:nth-child(n+9) { animation-delay: 0.4s; }
    .mp-mode-card { transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.2s ease, background 0.2s ease; }
    .mp-mode-card:hover { transform: translateY(-3px); }
}

/* ===== Multiplayer finish screen (win / lose / draw) ===== */
.mp-finish { text-align: center; position: relative; overflow: hidden; }
.mp-finish::before {
    content: '';
    position: absolute; inset: 0 0 auto 0; height: 150px;
    pointer-events: none;
    background: radial-gradient(ellipse at top, var(--mp-finish-glow, transparent), transparent 70%);
}
.mp-finish-won { --mp-finish-glow: rgba(34, 197, 94, 0.22); --mp-finish-ring: rgba(34, 197, 94, 0.55); }
.mp-finish-lost { --mp-finish-glow: rgba(239, 68, 68, 0.20); --mp-finish-ring: rgba(239, 68, 68, 0.55); }
.mp-finish-draw { --mp-finish-glow: rgba(234, 179, 8, 0.20); --mp-finish-ring: rgba(234, 179, 8, 0.55); }
.mp-finish-hero { position: relative; padding: 1.4rem 0 0.4rem; }
.mp-finish-icon {
    width: 92px; height: 92px; margin: 0 auto 0.9rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.9rem; border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02));
    box-shadow: 0 0 45px var(--mp-finish-glow, transparent), inset 0 0 0 2px var(--mp-finish-ring, rgba(255, 255, 255, 0.2));
}
.mp-finish-title { margin: 0 0 0.35rem; font-size: 2.3rem; font-weight: 800; letter-spacing: -0.02em; }
.mp-finish-won .mp-finish-title { background: linear-gradient(120deg, #4ade80, #fbbf24); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mp-finish-lost .mp-finish-title { background: linear-gradient(120deg, #f87171, #94a3b8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mp-finish-draw .mp-finish-title { background: linear-gradient(120deg, #facc15, #fb923c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mp-finish-detail { margin: 0 auto 1.1rem; max-width: 460px; opacity: 0.8; font-size: 0.95rem; }
.mp-finish-table { max-width: 500px; margin: 0 auto 1rem; padding: 0.4rem 0.9rem 0.6rem; border-radius: 12px; background: rgba(255, 255, 255, 0.04); }
.mp-finish-table table { margin: 0.2rem auto 0.2rem; }
.mp-finish-actions { justify-content: center; }
@media (prefers-reduced-motion: no-preference) {
    @keyframes mp-finish-pop {
        0% { transform: scale(0.3); opacity: 0; }
        70% { transform: scale(1.08); }
        100% { transform: scale(1); opacity: 1; }
    }
    @keyframes mp-finish-rise {
        from { transform: translateY(10px); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
    .mp-finish-icon { animation: mp-finish-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
    .mp-finish-title { animation: mp-finish-rise 0.4s ease 0.1s backwards; }
    .mp-finish-detail { animation: mp-finish-rise 0.4s ease 0.18s backwards; }
    .mp-finish-table { animation: mp-finish-rise 0.4s ease 0.26s backwards; }
}

/* ---- Streak mod wheel & active-mods reminder ---- */
.st-mods-bar {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
    gap: 0.45rem; margin: 0.6rem 0; padding: 0.55rem 0.9rem;
    border-radius: 12px; font-weight: 700; font-size: 0.9rem;
    background: linear-gradient(90deg, rgba(139,92,246,0.16), rgba(236,72,153,0.16));
    border: 1px solid rgba(236,72,153,0.35);
}
.st-mods-next { font-weight: 500; opacity: 0.75; font-size: 0.8rem; }
.badge.mod-badge {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: #fff; font-weight: 800; letter-spacing: 0.5px;
}
.st-mod-card { max-width: 420px; text-align: center; }
#st-mod-canvas { display: block; margin: 0.8rem auto; max-width: 100%; }
.st-mod-result { min-height: 1.2em; font-weight: 700; color: var(--primary); }
.st-mod-card .app-confirm-actions { justify-content: center; }

/* ---- OBS overlay settings (gear modal) ---- */
.obs-url-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.obs-url-row input {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    font-size: 12px;
}

.obs-copy-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: #fff;
}

.obs-copy-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.settings-hint {
    font-size: 12px;
    opacity: 0.65;
    margin: 6px 0 0;
}

/* ---- osu! account: avatar button + dropdown menu ---- */
.osu-account-btn {
    position: fixed;
    top: 20px;
    right: 84px;
    z-index: 900;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 27, 46, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.35rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.osu-account-btn:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.acc-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.acc-avatar-placeholder { line-height: 1; opacity: 0.85; }
.osu-account-menu {
    position: fixed;
    top: 78px;
    right: 20px;
    z-index: 950;
    width: 264px;
    padding: 14px;
    background: rgba(30, 27, 46, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 14px;
}
.acc-menu-hint { margin: 0 0 10px; font-size: 12.5px; opacity: 0.7; line-height: 1.4; }
.acc-profile-text { display: flex; flex-direction: column; gap: 2px; font-weight: 600; }
.osu-account-menu .acc-signin-btn { width: 100%; }
.osu-account-menu .acc-profile-row { margin-bottom: 10px; }
.osu-account-menu .acc-profile-row:last-child { margin-bottom: 0; }
.cc-input:disabled { opacity: 0.6; cursor: not-allowed; }
.acc-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.1);
}
.acc-profile-row { display: flex; align-items: center; gap: 10px; }
.acc-rank { opacity: 0.7; font-size: 13px; }
.acc-signin-btn, .acc-signout-btn, .acc-myprofile-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    background: linear-gradient(135deg, #ff66aa, #cc5288);
    color: #fff;
}
.acc-myprofile-btn { width: 100%; }
.acc-signout-btn { background: rgba(255, 255, 255, 0.12); }
.acc-signin-btn:hover, .acc-signout-btn:hover, .acc-myprofile-btn:hover { filter: brightness(1.1); }
.acc-sync-status { font-size: 12px; opacity: 0.65; }

/* --- Multiplayer lobby: players column left, live settings panel right --- */
.mp-lobby-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; margin-top: 0.4rem; }
.mp-lobby-left, .mp-lobby-right { min-width: 0; }
.mp-ls-panel { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.55rem; }
.mp-ls-title { margin: 0 0 0.2rem; font-size: 1.05rem; text-align: center; }
.mp-ls-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.mp-ls-row .cc-label { margin: 0; min-width: 6.5rem; }
.mp-ls-seg { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.mp-ls-seg button { padding: 0.35rem 0.7rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.05); color: inherit; cursor: pointer; font: inherit; font-size: 0.9rem; }
.mp-ls-seg button.active { border-color: #ec4899; background: rgba(236,72,153,0.18); }
.mp-ls-seg button:disabled { opacity: 0.55; cursor: default; }
.mp-ls-inherited { font-size: 0.85rem; opacity: 0.65; }
.mp-ls-note { display: none; font-size: 0.9rem; color: #fbbf24; }
.mp-ls-apply-row { display: flex; justify-content: center; margin-top: 0.3rem; }
@media (max-width: 760px) {
    .mp-lobby-grid { grid-template-columns: 1fr; }
}

/* MP lobby: star range as setup-style sliders with a value readout */
.mp-ls-stars { margin: 0; }
.mp-ls-stars-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.mp-ls-stars-head .cc-label { margin: 0; }
.mp-ls-stars-val { font-weight: 800; color: var(--primary); font-size: 1rem; white-space: nowrap; }

/* MP lobby: auto-verify opt-in checkbox */
.mp-ls-check { display: flex; align-items: center; gap: 0.55rem; cursor: pointer; font-size: 0.95rem; margin-top: 0.2rem; }
.mp-ls-check input[type="checkbox"] { width: 1.05rem; height: 1.05rem; accent-color: var(--primary); flex: none; }
.mp-ls-check input[type="checkbox"]:disabled { cursor: not-allowed; }

/* Daily: two-column layout - maps and submit left, leaderboards right */
.daily-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.2rem; align-items: start; margin-top: 0.4rem; }
.daily-left, .daily-right { min-width: 0; }
.daily-right { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 0.9rem 1rem; }
.daily-lb-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.daily-lb-tab { padding: 0.35rem 0.7rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.05); color: inherit; cursor: pointer; font: inherit; font-size: 0.9rem; }
.daily-lb-tab.active { border-color: #ec4899; background: rgba(236,72,153,0.18); }
.daily-lb-scroll { max-height: 24rem; overflow-y: auto; padding-right: 0.25rem; }
.daily-lb-pin { margin-top: 0.4rem; border-top: 1px dashed rgba(255,255,255,0.2); padding-top: 0.4rem; }
.daily-lb-sub { font-size: 0.8rem; opacity: 0.65; font-weight: 400; }
@media (max-width: 760px) {
    .daily-grid { grid-template-columns: 1fr; }
}

/* ==== OBS overlay link popup (reveal-protected) ==== */
.obs-open-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.obs-open-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.obs-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
}

.obs-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.obs-modal-card {
    position: relative;
    width: min(460px, calc(100vw - 40px));
    background: #1c1c26;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

.obs-modal-card h3 {
    margin: 0 0 12px;
}

.obs-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: none;
    color: inherit;
    opacity: 0.6;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.obs-modal-close:hover {
    opacity: 1;
}

.obs-url-row {
    position: relative;
}

.obs-blurred input {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

.obs-reveal {
    display: none;
}

.obs-blurred .obs-reveal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    inset: 0;
    border: 1px dashed rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.obs-blurred .obs-reveal:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* ==== MP lobby avatars ==== */
.mp-ava {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.08);
    flex: 0 0 24px;
}

.mp-ava-link {
    cursor: pointer;
    transition: box-shadow 0.15s ease;
}

.mp-ava-link:hover {
    box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.6);
}

/* ---- OBS overlay: link rotation button ---- */
.obs-regen-row { display: flex; justify-content: flex-start; }
.obs-regen-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.obs-regen-btn:hover:not(:disabled) {
    border-color: rgba(236, 72, 153, 0.6);
    background: rgba(236, 72, 153, 0.08);
}
.obs-regen-btn:disabled { opacity: 0.6; cursor: default; }

/* --- Streak endable finale: victory modal --- */
.st-victory-card {
    max-width: 460px;
    text-align: center;
    border: 1px solid rgba(251, 191, 36, 0.55);
    box-shadow: 0 0 60px rgba(251, 191, 36, 0.35), 0 0 120px rgba(236, 72, 153, 0.25);
    background: linear-gradient(160deg, rgba(40, 24, 60, 0.97), rgba(24, 18, 43, 0.97));
}
.st-victory-trophy {
    font-size: 64px;
    line-height: 1;
    animation: stVictoryBounce 1.6s ease-in-out infinite;
    filter: drop-shadow(0 0 18px rgba(251, 191, 36, 0.8));
}
.st-victory-title {
    margin: 0.4rem 0 0.2rem;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    background: linear-gradient(90deg, #fbbf24, #ec4899, #8b5cf6, #3b82f6, #fbbf24);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: stVictoryShine 3s linear infinite;
}
.st-victory-head { margin: 0 0 0.6rem; font-weight: 600; opacity: 0.9; }
.st-victory-mods { margin-bottom: 0.8rem; }
.st-victory-count-wrap {
    margin: 0.2rem auto 0.8rem;
    padding: 0.6rem 1rem;
    max-width: 280px;
    border-radius: 12px;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.3);
}
.st-victory-count {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    color: #fbbf24;
    text-shadow: 0 0 24px rgba(251, 191, 36, 0.6);
}
.st-victory-count-label { font-size: 0.85rem; opacity: 0.75; }
.st-victory-body { margin: 0 0 0.5rem; }
.st-victory-flavor { font-style: italic; opacity: 0.85; margin: 0 0 0.4rem; }
.st-victory-card .app-confirm-actions { justify-content: center; }
.st-victory-btn {
    background: linear-gradient(135deg, #fbbf24, #ec4899);
    color: #1b1230;
    font-weight: 800;
    padding: 10px 18px;
}
@keyframes stVictoryBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.08); }
}
@keyframes stVictoryShine {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* --- MP lobby: dual-thumb star range on a single shared track --- */
.dual-slider {
    position: relative;
    height: 26px;
    margin: 0.2rem 0;
}
.dual-slider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 6px;
    border-radius: 3px;
    background: var(--bg-dark);
    box-shadow: var(--shadow-inset);
}
.dual-slider-fill {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, #ff66aa, #cc5288);
    pointer-events: none;
}
.dual-slider input[type=range] {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 26px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    pointer-events: none; /* only the thumbs are interactive */
}
.dual-slider input[type=range]::-webkit-slider-runnable-track {
    background: transparent;
    box-shadow: none;
    height: 26px;
}
.dual-slider input[type=range]::-moz-range-track {
    background: transparent;
    box-shadow: none;
}
.dual-slider input[type=range]::-webkit-slider-thumb {
    pointer-events: auto;
    margin-top: 3px;
    height: 20px;
    width: 20px;
    background: #ff66aa;
    border: 2px solid rgba(255, 255, 255, 0.25);
}
.dual-slider input[type=range]::-moz-range-thumb {
    pointer-events: auto;
    height: 20px;
    width: 20px;
    background: #ff66aa;
    border: 2px solid rgba(255, 255, 255, 0.25);
}
.dual-slider input[type=range]:disabled::-webkit-slider-thumb { opacity: 0.5; cursor: default; }
.dual-slider input[type=range]:disabled::-moz-range-thumb { opacity: 0.5; cursor: default; }
