/* Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 24px 16px;
    color: #1a1a1a;
    line-height: 1.5;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

/* Header */
.header {
    padding: 32px 32px 24px;
    border-bottom: 1px solid #e5e5e5;
    text-align: center;
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.header p {
    color: #666;
    font-size: 0.95rem;
}

/* Controls */
.controls {
    padding: 24px 32px;
    border-bottom: 1px solid #e5e5e5;
}

.control-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    color: #333;
}

select,
input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d1d1;
    border-radius: 6px;
    font-size: 0.9375rem;
    color: #1a1a1a;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
}

select:hover,
input[type="number"]:hover {
    border-color: #999;
}

select:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
}

:focus-visible {
    outline: 2px solid #4a6cf7;
    outline-offset: 2px;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

button {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s, box-shadow 0.15s;
}

.btn-primary {
    background: #1a1a1a;
    color: #fff;
}

.btn-primary:hover {
    background: #333;
}

.btn-primary:active {
    background: #000;
}

.btn-secondary {
    background: #e8e8e8;
    color: #333;
}

.btn-secondary:hover {
    background: #ddd;
}

.btn-secondary:active {
    background: #ccc;
}

/* Results */
.results {
    padding: 24px 32px;
    min-height: 160px;
}

/* Modifier cards */
.modifier-card {
    border: 1px solid #e5e5e5;
    border-left: 4px solid #c0392b;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: #fff;
    transition: box-shadow 0.15s;
}

.modifier-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.modifier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.modifier-symbol {
    font-size: 1.25em;
}

.modifier-difficulty {
    background: #f0f0f0;
    color: #c0392b;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.modifier-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #1a1a1a;
}

.modifier-description {
    font-size: 0.875rem;
    color: #555;
    margin-bottom: 8px;
}

.modifier-rules {
    font-size: 0.8125rem;
    font-style: italic;
    color: #777;
    border-top: 1px solid #eee;
    padding-top: 8px;
}

/* Mission cards */
.mission-card {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: #fff;
    transition: box-shadow 0.15s;
    animation: fadeIn 0.25s ease-out;
}

.mission-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.mission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.mission-id {
    background: #f0f0f0;
    color: #1a1a1a;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.mission-difficulty {
    background: #f0f0f0;
    color: #c0392b;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.mission-description {
    color: #333;
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* Status and feedback */
.no-results {
    text-align: center;
    color: #999;
    padding: 48px 16px;
    font-size: 0.9375rem;
}

.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9375rem;
}

.stats {
    background: #f8f8f8;
    color: #1a1a1a;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    margin-bottom: 16px;
    text-align: center;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.loading {
    text-align: center;
    padding: 48px 16px;
    color: #666;
    font-size: 0.9375rem;
}

/* Info and warning boxes */
.info-box {
    margin-bottom: 12px;
    padding: 14px 16px;
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    color: #1e40af;
    font-size: 0.875rem;
}

.warning-box {
    margin-bottom: 12px;
    padding: 14px 16px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    color: #92400e;
    font-size: 0.875rem;
}

/* Skipped cards */
.skipped-section {
    margin-top: 16px;
    padding: 14px 16px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

.skipped-section h4 {
    margin-bottom: 8px;
    color: #666;
    font-size: 0.875rem;
    font-weight: 600;
}

.skipped-section .skipped-list {
    font-size: 0.8125rem;
    color: #555;
}

/* Copy button */
.btn-copy {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 12px;
    background: #e8e8e8;
    color: #333;
    border: 1px solid #d1d1d1;
    border-radius: 4px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background-color 0.15s;
    flex: initial;
    font-weight: 600;
}

.btn-copy:hover {
    background: #ddd;
}

.btn-copy.copied {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}

/* Mission count and difficulty range */
.mission-count,
.difficulty-range {
    display: block;
    margin-top: 4px;
    font-size: 0.8125rem;
    color: #888;
    font-weight: normal;
}

/* Loading spinner */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

/* Fade-in for cards */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Footer */
.footer {
    text-align: center;
    padding: 16px 32px;
    color: #999;
    font-size: 0.8125rem;
    border-top: 1px solid #eee;
}

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 12px 8px;
    }

    .container {
        border-radius: 8px;
    }

    .header {
        padding: 24px 20px 20px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .controls,
    .results {
        padding: 20px;
    }

    .button-group {
        flex-direction: column;
    }
}
