:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --discovery-color: #8b5cf6;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-elevated: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --clue-background: #ecfdf5;
    --clue-border: #10b981;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.78)), url('img/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary-color);
    animation: spin 8s linear infinite;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, var(--primary-color), var(--discovery-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.date {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
}

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

/* Game Container */
.game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Game Status */
.game-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.guess-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mystery-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--discovery-color);
    font-weight: 500;
}

/* Search Container */
.search-container {
    position: relative;
}

.search-box {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 2px solid var(--border);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.search-box input {
    flex: 1;
    padding: 1rem 1rem 1rem 3rem;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    border-radius: var(--radius-lg);
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-submit-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem;
    margin: 0.25rem;
    border-radius: calc(var(--radius-lg) - 0.25rem);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.search-submit-btn:not(:disabled):hover {
    background: var(--primary-dark);
    transform: translateX(2px);
}

/* Search Results */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.search-results.show {
    display: block;
}

.search-result {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-result:last-child {
    border-bottom: none;
}

.search-result:hover {
    background: var(--border-light);
}

.search-result.selected {
    background: var(--clue-background);
    border-color: var(--clue-border);
}

.search-result-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}
.search-result-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--border-light);
    flex-shrink: 0;
}

.search-result-thumb.placeholder {
    display: inline-block;
}

.search-result-text {
    display: flex;
    flex-direction: column;
}


.search-result-artist {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.search-result-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Clues Board */
.clues-board {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 1.5rem;
}

.clues-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.clues-header h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--discovery-color);
}

.clues-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.clues-container {
    display: grid;
    gap: 1rem;
}

.no-clues {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.no-clues i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.clue-category {
    background: var(--clue-background);
    border: 1px solid var(--clue-border);
    border-radius: var(--radius);
    padding: 1rem;
    animation: clueReveal 0.5s ease;
}

.clue-category-title {
    font-weight: 600;
    color: var(--clue-border);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clue-values {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.clue-value {
    background: white;
    color: var(--clue-border);
    padding: 0.25rem 0.75rem;
    border-radius: calc(var(--radius) / 2);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--clue-border);
}

.clue-value.clue-musician {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* Guesses History */
.guesses-history {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 1.5rem;
}

.history-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.guesses-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.guess-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--surface-elevated);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    animation: guessSlideIn 0.3s ease;
}
.guess-cover {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--border-light);
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.guess-cover.placeholder {
    display: inline-block;
}


.guess-item.victory {
    background: var(--clue-background);
    border-color: var(--clue-border);
}

.guess-info {
    flex: 1;
}

.guess-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.guess-artist {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.guess-details {
    margin-top: 0.5rem;
    display: grid;
    gap: 0.5rem;
}

.guess-attr {
    background: white;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) / 1.25);
    padding: 0.5rem;
}

.guess-attr-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

.guess-attr-values {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.guess-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.guess-chip-hit {
    background: var(--clue-background);
    color: var(--clue-border);
    border-color: var(--clue-border);
}

.guess-chip-miss {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #ef4444;
}

.guess-clues {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.guess-clues.victory {
    color: var(--clue-border);
    font-weight: 600;
}

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

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

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

/* Victory Modal */
.victory-message {
    text-align: center;
    margin-bottom: 1.5rem;
}

.victory-message p {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.mystery-album {
    text-align: center;
    padding: 1.5rem;
    background: var(--clue-background);
    border: 2px solid var(--clue-border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.mystery-album-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.mystery-album-artist {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.mystery-album-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.victory-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
}

.stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.share-button {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.share-button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.next-game {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* Instructions */
.instructions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.instruction {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.instruction i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 0.25rem;
}

.instruction h3 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.instruction p {
    color: var(--text-secondary);
}

.game-rules {
    background: var(--surface-elevated);
    padding: 1.5rem;
    border-radius: var(--radius);
}

.game-rules h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.game-rules ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.game-rules li {
    color: var(--text-secondary);
    position: relative;
    padding-left: 1.5rem;
}

.game-rules li::before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Footer */
.footer {
    margin-top: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.footer-button {
    background: none;
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-button:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.footer-text {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.footer-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-text a:hover {
    text-decoration: underline;
}

/* Loading Spinner */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 2000;
}

.loading.show {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading p {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 0.75rem;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .logo i {
        font-size: 2rem;
    }
    
    .game-status {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .search-box {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-submit-btn {
        margin: 0.25rem 0 0 0;
        border-radius: var(--radius);
    }
    
    .mystery-album-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .clue-values {
        justify-content: center;
    }

    .guess-cover {
        width: 40px;
        height: 40px;
        margin-right: 0.5rem;
    }

    .search-result-thumb {
        width: 40px;
        height: 40px;
    }
}