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

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #4caf50;
    --error-color: #f44336;
    --light-bg: #f5f5f5;
    --text-dark: #333;
    --text-light: rgba(255, 255, 255, 0.9);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-dark);
}

/* Navigation */
.navbar {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    color: white;
    font-size: 1.8em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
}

.hero-content h1 {
    font-size: 3em;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-content p {
    font-size: 1.3em;
    opacity: 0.9;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
    flex: 1;
}

h1 {
    color: white;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.tool-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    transition: all 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.tool-icon {
    font-size: 3em;
    margin-bottom: 1rem;
}

.tool-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tool-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

.btn-link {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-link:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Forms */
.calc-form {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    margin: 2rem auto;
}

.tool-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tool-form input,
.tool-form button {
    flex: 1;
}

label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

button:active {
    transform: translateY(0);
}

/* Results */
.result-container {
    margin-top: 1.5rem;
    padding: 1.2rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: none;
    animation: slideIn 0.3s ease;
}

.result-success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 2px solid var(--success-color);
}

.result-error {
    background-color: #ffebee;
    color: #c62828;
    border: 2px solid var(--error-color);
}

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

/* Tools Section */
.tools-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.tool {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.tool h2 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tool p {
    color: #666;
    margin-bottom: 1rem;
}

.tool-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tool-form input,
.tool-form button {
    width: 100%;
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: auto;
}

.footer p {
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        gap: 1rem;
    }

    .hero-content h1 {
        font-size: 2em;
    }

    .tools-grid,
    .tools-section {
        grid-template-columns: 1fr;
    }

    .tool-form {
        flex-direction: column;
    }

    .tool-form input,
    .tool-form button {
        width: 100%;
    }

    .calc-form {
        margin: 1rem auto;
        max-width: 100%;
    }
}

/* Games Styles */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.game-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    transition: all 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.game-icon {
    font-size: 4em;
    margin-bottom: 1rem;
    animation: bounce 0.6s infinite;
}

.game-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.3em;
}

.game-card p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.95em;
}

.game-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin: 2rem 0;
    min-height: 300px;
}

.game-content p {
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.game-info {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
}

.game-input {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    justify-content: center;
}

.game-input input {
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    width: 150px;
    transition: all 0.3s ease;
}

.game-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.game-input button {
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.game-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.game-feedback {
    margin: 1rem 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-info {
    background-color: #e3f2fd;
    color: #1976d2;
    border: 2px solid #1976d2;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1em;
}

.guess-history {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@media (max-width: 480px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0.5rem;
    }

    h1 {
        font-size: 1.8em;
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .game-icon {
        font-size: 3em;
    }

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

    .game-input input {
        width: 100%;
    }
}
