:root {
    --primary: #1DB954;
    --primary-hover: #1ed760;
    --bg-dark: #090909;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-main: #ffffff;
    --text-dim: #b3b3b3;
    --error: #ff4d4d;
    --success: #1DB954;
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 0;
    overflow-x: hidden;
}

.background-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 50% -20%, #1db95433 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, #1db9541a 0%, transparent 40%);
    z-index: -1;
}

.container {
    width: 90%;
    max-width: 520px;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

header h1 span {
    color: var(--primary);
}

header p {
    color: var(--text-dim);
    font-size: 1rem;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.search-box {
    position: relative;
}

input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid transparent;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.11);
}

.results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.result-item {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.result-item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.difficulty-selector {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.diff-btn {
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-dim);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s;
}

.diff-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.diff-btn.active {
    background: var(--primary);
    color: black;
    border-color: var(--primary);
}

.primary-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    border: none;
    border-radius: 12px;
    color: black;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

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

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

/* ====== GAME ====== */
.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 8px;
}

.question-counter {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.06);
    padding: 6px 12px;
    border-radius: 20px;
}

.playing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 14px;
    border-radius: 20px;
}

.wave-container {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
}

.wave {
    width: 3px;
    background: var(--primary);
    border-radius: 2px;
    animation: wave-anim 1s ease-in-out infinite;
}

.wave:nth-child(2) {
    animation-delay: .15s
}

.wave:nth-child(3) {
    animation-delay: .3s
}

.wave:nth-child(4) {
    animation-delay: .45s
}

.wave:nth-child(5) {
    animation-delay: .6s
}

@keyframes wave-anim {

    0%,
    100% {
        height: 4px;
    }

    50% {
        height: 16px;
    }
}

.progress-bar-container {
    width: 100%;
    height: 7px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.08s linear;
}

.time-info {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 1.4rem;
}

.options-grid {
    display: grid;
    gap: 10px;
}

.option-btn {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(4px);
}

.option-btn.correct {
    background: var(--success);
    color: black;
    border-color: var(--success);
}

.option-btn.wrong {
    background: var(--error);
    border-color: var(--error);
}

/* ====== QUESTION TRACKER ====== */
.question-tracker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 1.4rem;
}

.tracker-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.07);
    border: 2px solid rgba(255, 255, 255, 0.12);
    color: var(--text-dim);
    transition: all 0.35s;
}

.tracker-dot.active {
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.15);
}

.tracker-dot.dot-correct {
    background: var(--success);
    color: black;
    border-color: var(--success);
}

.tracker-dot.dot-wrong {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

/* ====== RESULT SCREEN ====== */
.result-hero {
    text-align: center;
    margin-bottom: 1.5rem;
}

.result-emoji {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.result-hero h2 {
    font-size: 1.75rem;
    margin-bottom: 0.3rem;
}

.result-hero p {
    color: var(--text-dim);
    font-size: 1rem;
}

.score-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.score-box {
    padding: 1.2rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--glass-border);
}

.score-box span {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
}

.score-box label {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.correct-box {
    background: rgba(29, 185, 84, 0.12);
    border-color: rgba(29, 185, 84, 0.3);
}

.correct-box span {
    color: var(--success);
}

.wrong-box {
    background: rgba(255, 77, 77, 0.12);
    border-color: rgba(255, 77, 77, 0.3);
}

.wrong-box span {
    color: var(--error);
}

.answer-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.summary-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    font-size: 0.9rem;
}

.summary-correct {
    background: rgba(29, 185, 84, 0.08);
}

.summary-wrong {
    background: rgba(255, 77, 77, 0.08);
}

.summary-num {
    width: 22px;
    text-align: center;
    font-weight: 700;
    color: var(--text-dim);
    flex-shrink: 0;
}

.summary-track {
    flex: 1;
}

.summary-icon {
    flex-shrink: 0;
}