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

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --success-color: #16a34a;
    --success-hover: #15803d;
    --warn-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 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);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}

main {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.topbar-left,
.topbar-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    background: #eef2ff;
    color: #1e293b;
    border: 1px solid rgba(0,0,0,0.06);
}

.pill-muted {
    background: #f1f5f9;
    color: #0f172a;
}

.pill-success {
    background: #dcfce7;
    color: #14532d;
}

.pill-warn {
    background: #fef3c7;
    color: #7c2d12;
}

.card {
    position: relative;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 16px;
    margin-bottom: 30px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-type {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-content {
    text-align: center;
}

.card-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.4;
}

.card-content p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

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

.btn-success {
    background: var(--success-color);
    color: white;
}

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

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

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

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

.info {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.link-btn {
    border: none;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    padding: 6px 8px;
}

.link-btn:hover {
    text-decoration: underline;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 50;
}

.modal-backdrop.open {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 560px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 22px;
}

.modal h2 {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.modal-subtitle {
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.modal-section {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 16px;
}

.modal-section h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.input {
    flex: 1;
    min-width: 180px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
}

.input:focus {
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.help {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.help code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.85em;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    main {
        padding: 25px 20px;
    }

    .card {
        min-height: 250px;
        padding: 25px 20px;
        margin-bottom: 25px;
    }

    .card-content h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }

    .card-content p {
        font-size: 1.1rem;
    }

    .controls {
        gap: 10px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }

    .btn span {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.75rem;
    }

    main {
        padding: 20px 15px;
    }

    .card {
        min-height: 200px;
        padding: 20px 15px;
    }

    .card-content h2 {
        font-size: 1.3rem;
    }

    .card-content p {
        font-size: 1rem;
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Animation for card transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-content {
    animation: fadeIn 0.4s ease;
}

