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

:root {
    --bg: #ffffff;
    --text: #000000;
    --text-muted: #525252;
    --card-bg: #f5f5f5;
    --border: #e5e5e5;
    --accent: #000000;
    --shadow: rgba(0, 0, 0, 0.1);
    --particle-color: #000000;
    --correct: #6aaa64;
    --present: #c9b458;
    --absent: #787c7e;
}

[data-theme="dark"] {
    --bg: #000000;
    --text: #ffffff;
    --text-muted: #a3a3a3;
    --card-bg: #0a0a0a;
    --border: rgba(255, 255, 255, 0.1);
    --accent: #ffffff;
    --shadow: rgba(0, 0, 0, 0.9);
    --particle-color: #ffffff;
    --correct: #6aaa64;
    --present: #c9b458;
    --absent: #3a3a3c;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.7;
    letter-spacing: 0.01em;
    font-weight: 200;
    transition: background 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

.cursor {
    display: none;
}

.cursor-follower {
    display: none;
}

.animated-bg,
.iso-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.03;
    pointer-events: none;
}

.iso-grid {
    background-image:
        linear-gradient(30deg, transparent 49%, var(--text) 49%, var(--text) 51%, transparent 51%),
        linear-gradient(150deg, transparent 49%, var(--text) 49%, var(--text) 51%, transparent 51%);
    background-size: 60px 60px;
    animation: isoMove 20s linear infinite;
}

@keyframes isoMove {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 60px 60px;
    }
}

.particle {
    position: fixed;
    background: var(--particle-color);
    border-radius: 50%;
    opacity: 0.05;
    pointer-events: none;
    z-index: 1;
    transition: background 0.3s ease;
}

.theme-toggle {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 1000;
    cursor: pointer;
}

.toggle-container {
    width: 60px;
    height: 30px;
    background: var(--border);
    border-radius: 30px;
    position: relative;
    transition: background 0.3s ease;
    border: 2px solid var(--text);
}

.toggle-slider {
    width: 22px;
    height: 22px;
    background: var(--text);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .toggle-slider {
    transform: translateX(30px);
}

.back-home {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 200;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--text);
    border-radius: 50px;
    transition: all 0.3s ease;
    text-transform: lowercase;
    background: transparent;
}

.back-home:hover {
    background: var(--text);
    color: var(--bg);
}

/* Artist Selection Screen */
.artist-selection {
    position: relative;
    z-index: 2;
    max-width: 600px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.artist-search-container {
    width: 100%;
    position: relative;
}

.artist-input {
    width: 100%;
    padding: 1.25rem 1.75rem;
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 50px;
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 200;
    text-transform: lowercase;
    transition: all 0.3s ease;
    text-align: center;
}

.artist-input:focus {
    outline: none;
    border-color: var(--text);
}

.artist-input::placeholder {
    color: var(--text-muted);
    text-transform: lowercase;
}

/* Game Container */
.game-container {
    position: relative;
    z-index: 2;
    max-width: 900px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.game-header {
    text-align: center;
}

.game-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 300;
    letter-spacing: 0.05em;
    text-transform: lowercase;
    margin-bottom: 0.5rem;
    position: relative;
}

.game-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--text);
}

.artist-selection .game-title {
    margin-bottom: 1.5rem;
}

.artist-selection .game-title::after {
    bottom: -12px;
}

.game-subtitle {
    font-size: 0.9rem;
    font-weight: 200;
    letter-spacing: 0.1em;
    text-transform: lowercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.change-artist-btn {
    margin-top: 0.75rem;
    padding: 0.5rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 200;
    text-transform: lowercase;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.change-artist-btn:hover {
    border-color: var(--text);
    color: var(--text);
}

.input-section {
    display: flex;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
}

.song-input-container {
    flex: 1;
    position: relative;
}

.song-input {
    width: 100%;
    padding: 1rem 1.5rem;
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 50px;
    color: var(--text);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 200;
    text-transform: lowercase;
    transition: all 0.3s ease;
}

.song-input:focus {
    outline: none;
    border-color: var(--text);
}

.song-input::placeholder {
    color: var(--text-muted);
    text-transform: lowercase;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 15px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px var(--shadow);
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 200;
    text-transform: lowercase;
    border-bottom: 1px solid var(--border);
}

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

.autocomplete-item:hover {
    background: var(--border);
}

.autocomplete-item.highlighted {
    background: var(--border);
}

.submit-btn {
    padding: 1rem 2.5rem;
    background: var(--text);
    color: var(--bg);
    border: 2px solid var(--text);
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    text-transform: lowercase;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.submit-btn:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.guess-counter {
    font-size: 0.9rem;
    font-weight: 200;
    color: var(--text-muted);
    text-transform: lowercase;
}

.guess-counter span {
    font-weight: 300;
    color: var(--text);
}

.attribute-headers {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 0;
    border-bottom: 2px solid var(--border);
}

.header-cell {
    font-size: 0.75rem;
    font-weight: 300;
    text-transform: lowercase;
    text-align: center;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.guesses-board {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 400px;
}

.guess-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 1fr 1fr;
    gap: 0.5rem;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.guess-cell {
    padding: 1rem;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 200;
    text-transform: lowercase;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    word-break: break-word;
}

.guess-cell.correct {
    background: var(--correct);
    border-color: var(--correct);
    color: white;
    animation: pop 0.3s ease;
}

.guess-cell.present {
    background: var(--present);
    border-color: var(--present);
    color: white;
    animation: pop 0.3s ease;
}

.guess-cell.absent {
    background: var(--absent);
    border-color: var(--absent);
    color: white;
    opacity: 0.7;
    animation: pop 0.3s ease;
}

@keyframes pop {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--text);
    color: var(--bg);
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 2000;
    text-transform: lowercase;
    max-width: 90%;
    text-align: center;
}

.message.show {
    opacity: 1;
}

.help-btn {
    margin-top: 1rem;
    padding: 0.75rem 2rem;
    background: transparent;
    border: 2px solid var(--text);
    border-radius: 50px;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 200;
    text-transform: lowercase;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.help-btn:hover {
    background: var(--text);
    color: var(--bg);
}

.search-btn {
    padding: 1rem 3rem;
    background: var(--text);
    color: var(--bg);
    border: 2px solid var(--text);
    border-radius: 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    text-transform: lowercase;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.search-btn:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg);
    padding: 2rem;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    position: relative;
    border: 2px solid var(--border);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    font-size: 1.5rem;
    font-weight: 300;
    text-transform: lowercase;
    margin-bottom: 1rem;
}

.modal-content p {
    font-size: 0.9rem;
    font-weight: 200;
    line-height: 1.6;
    margin-bottom: 1rem;
    text-transform: lowercase;
}

.modal-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.modal-content li {
    font-size: 0.85rem;
    font-weight: 200;
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: 200;
    cursor: pointer;
    color: var(--text);
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 0.7;
}

.color-guide {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.guide-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.guide-box {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    flex-shrink: 0;
}

.guide-box.correct {
    background: var(--correct);
}

.guide-box.present {
    background: var(--present);
}

.guide-box.absent {
    background: var(--absent);
}

.play-btn {
    width: 100%;
    padding: 1rem;
    background: var(--text);
    color: var(--bg);
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 300;
    text-transform: lowercase;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    margin-top: 1rem;
}

.play-btn:hover {
    opacity: 0.8;
}

@media (max-width: 768px) {

    .theme-toggle,
    .back-home {
        top: 1rem;
    }

    .theme-toggle {
        left: 1rem;
    }

    .back-home {
        right: 1rem;
        font-size: 0.8rem;
        padding: 0.6rem 1.2rem;
    }

    .game-container,
    .artist-selection {
        gap: 1.25rem;
    }

    .input-section {
        flex-direction: column;
    }

    .attribute-headers {
        font-size: 0.65rem;
    }

    .guess-cell {
        font-size: 0.75rem;
        padding: 0.75rem 0.5rem;
        min-height: 50px;
    }

    .header-cell {
        font-size: 0.65rem;
    }
}