/* Puzzle Corner - Main Stylesheet */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    padding: 30px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    margin-bottom: 30px;
}

header h1 {
    color: #fff;
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.welcome-msg {
    color: #ffd700;
    font-size: 1.2rem;
    margin-right: 15px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 5px;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
}

.btn-login {
    background: #2196F3;
    color: white;
}

.btn-signup {
    background: #ff9800;
    color: white;
}

.btn-logout {
    background: #f44336;
    color: white;
}

.btn-back, .btn-home {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

main {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Puzzle Thumbnails */
.puzzle-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

.puzzle-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex: 1;
    min-width: 280px;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.puzzle-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.puzzle-image {
    width: 100%;
    height: 200px;
    background: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    overflow: hidden;
}

.puzzle-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.puzzle-card h2 {
    font-size: 1.8rem;
    text-align: center;
    margin: 0;
}

/* Auth Forms */
.auth-form {
    max-width: 450px;
    margin: 0 auto;
}

.auth-form h2 {
    text-align: center;
    color: #667eea;
    margin-bottom: 20px;
    font-size: 2rem;
}

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-block {
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.form-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

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

/* Puzzle Pages */
.puzzle-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #667eea;
}

.puzzle-header h1 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.puzzle-header p {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
}

.puzzle-content {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.sudoku-board, .crossword-grid {
    margin: 20px auto;
    border: 3px solid #333;
    background: white;
}

.sudoku-board table, .crossword-grid table {
    border-collapse: collapse;
    width: 100%;
    max-width: 400px;
}

.sudoku-board td, .crossword-grid td {
    width: 45px;
    height: 45px;
    text-align: center;
    border: 1px solid #ccc;
    font-size: 1.2rem;
}

/* Sudoku 3x3 box borders */
.sudoku-board td:nth-child(3n) {
    border-right: 3px solid #333;
}

.sudoku-board tr:nth-child(3n) td {
    border-bottom: 3px solid #333;
}

.puzzle-note {
    color: #888;
    font-style: italic;
    margin-top: 20px;
}

footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .puzzle-thumbs {
        flex-direction: column;
        align-items: center;
    }
    
    .puzzle-card {
        max-width: 100%;
    }
}
