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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #1a1a1a;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid #f1f1f1;
    margin-bottom: 3rem;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.02em;
}

.auth-section {
    display: flex;
    align-items: center;
}

.google-signin-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #4285f4;
    border: none;
    border-radius: 24px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.google-signin-btn:hover {
    background: #3367d6;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f9fa;
    border-radius: 24px;
    padding: 6px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #e9ecef;
}

.user-details {
    display: flex;
    flex-direction: column;
    margin: 0 8px;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1a1a1a;
    line-height: 1.2;
}

.user-email {
    font-size: 0.75rem;
    color: #6c757d;
    line-height: 1.2;
}

.signout-btn {
    background: #dc3545;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.signout-btn:hover {
    background: #c82333;
}

.login-cta {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    text-align: center;
    background: #ffffff;
    border: 1px solid #f1f1f1;
    border-radius: 20px;
    padding: 4rem 3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-width: 400px;
    width: 100%;
}

.login-card h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.login-card p {
    color: #6c757d;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.primary-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #4285f4;
    border: none;
    border-radius: 50px;
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(66, 133, 244, 0.3);
}

.primary-login-btn:hover {
    background: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(66, 133, 244, 0.4);
}

.status-message {
    display: none;
}

.main-content {
    display: flex;
    gap: 3rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.grid-container {
    flex: 1;
    min-width: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.crossword-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1px;
    background: #1a1a1a;
    padding: 1px;
    width: 350px;
    height: 350px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.current-clue-display {
    margin-top: 0.75rem;
    background: #f8f9fa;
    color: #6c757d;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e9ecef;
    max-width: 350px;
    width: 100%;
    font-size: 0.8rem;
    text-align: center;
}

.current-clue-number {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4285f4;
    display: inline;
    margin-right: 0.5rem;
}

.current-clue-text {
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.3;
    display: inline;
    color: #495057;
}

.grid-cell-container {
    position: relative;
    background: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
}

.grid-cell-container.black {
    background: #1a1a1a;
}

.grid-cell-container.highlighted {
    background: #e3f2fd;
}

.grid-cell-container.highlighted .grid-cell {
    background: transparent;
}

.cell-number {
    position: absolute;
    top: 3px;
    left: 3px;
    font-size: 9px;
    font-weight: 700;
    color: #4285f4;
    z-index: 1;
    line-height: 1;
}

.grid-cell {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    text-transform: uppercase;
    outline: none;
    border-radius: 0;
}

.grid-cell:focus {
    background: #bbdefb;
    outline: 2px solid #4285f4;
    outline-offset: -2px;
}

.grid-cell.correct {
    background: #e8f5e8;
    color: #2e7d32;
}

.grid-cell.incorrect {
    background: #ffebee;
    color: #c62828;
}

.clues-container {
    flex: 1;
    min-width: 350px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.clue-section {
    background: #ffffff;
    border: 1px solid #f1f1f1;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.clue-section h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1a1a1a;
    text-align: center;
    letter-spacing: -0.01em;
}

.clue-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
    border: 1px solid transparent;
}

.clue-item:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    transform: translateX(4px);
}

.clue-item.active {
    background: #e3f2fd;
    border-color: #4285f4;
    transform: translateX(8px);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.2);
}

.clue-number {
    font-weight: 700;
    margin-right: 8px;
    color: #4285f4;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.btn {
    background: #4285f4;
    border: none;
    border-radius: 50px;
    padding: 14px 28px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3);
}

.btn:hover:not(:disabled) {
    background: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
}

.btn:disabled {
    background: #9e9e9e;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 16px 0;
        margin-bottom: 1.5rem;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
    
    .user-profile {
        padding: 4px;
        gap: 8px;
        background: transparent;
    }
    
    .user-details {
        display: none;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
    }
    
    .signout-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
        border-radius: 12px;
    }
    
    .main-content {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .clues-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 240px;
    }
    
    .crossword-grid {
        width: 320px;
        height: 320px;
    }
    
    .current-clue-display {
        max-width: 320px;
        margin-top: 0.6rem;
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .current-clue-number {
        font-size: 0.7rem;
    }
    
    .current-clue-text {
        font-size: 0.75rem;
    }
    
    .login-card {
        padding: 3rem 2rem;
        margin: 0 1rem;
    }
    
    .login-card h2 {
        font-size: 1.6rem;
    }
    
    .login-card p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 12px 0;
        margin-bottom: 1rem;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .user-avatar {
        width: 24px;
        height: 24px;
    }
    
    .signout-btn {
        padding: 3px 6px;
        font-size: 0.65rem;
    }
    
    .main-content {
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .crossword-grid {
        width: 280px;
        height: 280px;
    }
    
    .current-clue-display {
        max-width: 280px;
        margin-top: 0.5rem;
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
    }
    
    .current-clue-number {
        font-size: 0.65rem;
    }
    
    .current-clue-text {
        font-size: 0.7rem;
    }
    
    .grid-cell {
        font-size: 1.2rem;
    }
    
    .cell-number {
        font-size: 8px;
    }
    
    .clues-container {
        gap: 1rem;
    }
    
    .clue-section {
        padding: 1rem;
    }
    
    .controls {
        margin-top: 1rem;
        gap: 1rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
    }
}