:root {
    --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    --text-color: #ffffff;
    --text-secondary: #a0a0a0;

    --accent-color: #d946ef;
    /* Fuchsia */
    --accent-glow: 0 0 20px rgba(217, 70, 239, 0.5);

    --success-color: #10b981;
    /* Emerald */
    --partial-color: #f59e0b;
    /* Amber */
    --error-color: rgba(255, 255, 255, 0.05);
    /* Subtle for wrong */

    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding-bottom: 50px;
}

/* Background Mesh/Orb check for cool effect */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(123, 44, 191, 0.2) 0%, transparent 60%);
    z-index: -1;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.container {
    width: 90%;
    max-width: 1000px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

h1 {
    font-size: 4rem;
    font-weight: 900;
    margin: 2rem 0;
    letter-spacing: -2px;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

h1 span {
    color: var(--accent-color);
    -webkit-text-fill-color: var(--accent-color);
    text-shadow: var(--accent-glow);
}

/* Search Bar */
.search-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin-bottom: 3rem;
    z-index: 100;
}

#search-input {
    width: 100%;
    padding: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: var(--glass-border);
    border-radius: 16px;
    color: white;
    font-size: 1.2rem;
    font-family: var(--font-family);
    box-shadow: var(--glass-shadow);
    transition: all 0.3s ease;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 30px rgba(217, 70, 239, 0.2);
    transform: translateY(-2px);
}

#suggestions-list {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: rgba(20, 20, 30, 0.95);
    backdrop-filter: blur(20px);
    border: var(--glass-border);
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
    list-style: none;
    padding: 5px;
    margin: 0;
    display: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

#suggestions-list li {
    padding: 12px 20px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    color: #ddd;
}

#suggestions-list li:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Game Board */
.game-board {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.header-row {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    text-align: center;
    margin-bottom: 10px;
}

.header-row div {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

.guess-row {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.guess-row div {
    padding: 15px 5px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    background: var(--glass-bg);
    border: var(--glass-border);
    backdrop-filter: blur(4px);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    opacity: 0;
    transform: scale(0.8);
}

/* Status Colors */
.guess-row div.correct {
    background: var(--success-color);
    border-color: transparent;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.guess-row div.partial {
    background: var(--partial-color);
    border-color: transparent;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.guess-row div.incorrect {
    /* Keep default glass style but maybe slightly darker */
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.5);
}

@keyframes popIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.guess-row div:nth-child(1) {
    animation-delay: 0ms;
}

.guess-row div:nth-child(2) {
    animation-delay: 100ms;
}

.guess-row div:nth-child(3) {
    animation-delay: 200ms;
}

.guess-row div:nth-child(4) {
    animation-delay: 300ms;
}

.guess-row div:nth-child(5) {
    animation-delay: 400ms;
}

.guess-row div:nth-child(6) {
    animation-delay: 500ms;
}

.guess-row div:nth-child(7) {
    animation-delay: 600ms;
}

/* Links */
.links {
    margin-top: 4rem;
    display: flex;
    gap: 20px;
}

.links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 20px;
    background: var(--glass-bg);
    border: var(--glass-border);
    font-size: 0.9rem;
    transition: all 0.3s;
}

.links a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-2px);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(30, 30, 40, 0.9);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease-out;
}

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

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

.close-btn {
    margin-top: 25px;
    padding: 12px 30px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 5px 20px rgba(217, 70, 239, 0.4);
    transition: transform 0.2s;
}

.close-btn:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 10px;
    }

    h1 {
        font-size: 2.5rem;
    }

    .header-row,
    .guess-row {
        gap: 4px;
    }

    .header-row div {
        font-size: 0.6rem;
    }

    .guess-row div {
        font-size: 0.75rem;
        padding: 8px 2px;
        min-height: 40px;
    }
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 300px;
    height: 100%;
    background: rgba(15, 12, 41, 0.95);
    backdrop-filter: blur(10px);
    border-left: var(--glass-border);
    transition: right 0.3s ease;
    z-index: 1000;
    padding: 20px;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--accent-color);
}

.close-btn-small {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

#directory-content {
    flex: 1;
    overflow-y: auto;
}

.directory-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

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

.directory-item strong {
    color: var(--accent-color);
    display: block;
}

.directory-item span {
    font-size: 0.85rem;
    color: #ccc;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.overlay.active {
    display: block;
    opacity: 1;
}