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

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-tertiary: #718096;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.025em;
}

.header-stats {
    display: flex;
    gap: 1rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    line-height: 1;
    transition: transform 0.2s ease;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.main {
    flex: 1;
    background: var(--bg-primary);
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    box-shadow: var(--shadow-xl);
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.title {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.category-btn svg {
    width: 28px;
    height: 28px;
    transition: transform 0.2s ease;
}

.category-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-btn:hover svg {
    transform: scale(1.1);
}

.category-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-lg);
}

.category-btn.active svg {
    stroke: white;
}

.excuse-container {
    margin-bottom: 3rem;
}

.excuse-box {
    background: var(--bg-secondary);
    border-radius: 1.25rem;
    padding: 2.5rem 2rem;
    margin-bottom: 1.5rem;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    position: relative;
    overflow: hidden;
}

.excuse-placeholder {
    text-align: center;
    color: var(--text-tertiary);
}

.excuse-placeholder svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.excuse-placeholder p {
    font-size: 1rem;
    font-weight: 500;
}

.excuse-content {
    width: 100%;
    position: relative;
    animation: slideIn 0.4s ease;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.quote-icon {
    position: absolute;
    top: -20px;
    left: -10px;
    font-size: 4rem;
    color: var(--primary);
    opacity: 0.2;
    font-family: Georgia, serif;
    line-height: 1;
}

.excuse-text {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

.excuse-text::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--primary);
    margin-left: 4px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hidden {
    display: none !important;
}

.actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    min-width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(102, 126, 234, 0.3), 0 10px 10px -5px rgba(102, 126, 234, 0.2);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary.loading svg {
    animation: spin 1s linear infinite;
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border);
}

.feature {
    text-align: center;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.feature h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer {
    text-align: center;
    padding: 1.5rem 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

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

@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }

    .main {
        padding: 3rem 3rem;
    }

    .title {
        font-size: 2.5rem;
    }

    .categories {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .excuse-box {
        padding: 3rem 2.5rem;
        min-height: 250px;
    }

    .excuse-text {
        font-size: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .title {
        font-size: 3rem;
    }

    .subtitle {
        font-size: 1.25rem;
    }
}
