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

body {
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    background: linear-gradient(145deg, #f0f7ff 0%, #e8f5ed 100%);
    color: #1f2933;
    min-height: 100vh;
    padding: 20px;
}

.container {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(31, 41, 51, 0.12);
    margin: 0 auto;
    max-width: 980px;
    padding: 28px;
}

header {
    margin-bottom: 24px;
    text-align: center;
}

h1 {
    color: #12324a;
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.subtitle {
    color: #4c6578;
    font-size: 1rem;
}

.controls {
    background: #f7fafc;
    border: 1px solid #dbe5ee;
    border-radius: 14px;
    margin-bottom: 22px;
    padding: 18px;
}

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

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    color: #23425a;
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.control-group select,
.control-group input[type="number"] {
    background: #ffffff;
    border: 2px solid #c8d7e6;
    border-radius: 8px;
    font-size: 1rem;
    padding: 10px 12px;
    width: 100%;
}

.control-group select:focus,
.control-group input[type="number"]:focus,
.flower-input:focus {
    border-color: #2a7ed6;
    outline: none;
}

.config-container {
    border-top: 1px solid #dbe5ee;
    margin-top: 16px;
    padding-top: 16px;
}

.checkbox-group {
    display: grid;
    gap: 8px;
}

.operation-settings {
    margin-bottom: 20px;
}

.advanced-settings {
    border-top: 1px dashed #c8d7e6;
    margin-top: 6px;
    padding-top: 14px;
}

.checkbox-group label,
.config-group > label {
    align-items: center;
    color: #2f4a60;
    display: flex;
    font-weight: 500;
    gap: 8px;
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"],
.config-group input[type="checkbox"] {
    accent-color: #2a7ed6;
    height: 16px;
    width: 16px;
}

.config-note {
    background: #e9f4ff;
    border-left: 4px solid #2a7ed6;
    border-radius: 8px;
    margin: 14px 0;
    padding: 10px 12px;
}

.config-note em {
    color: #184f80;
    font-style: normal;
}

.config-help {
    color: #5a7185;
    font-size: 0.9rem;
    margin-top: 6px;
}

.button-group {
    display: flex;
    gap: 10px;
}

.controls-actions {
    margin-top: 16px;
}

button {
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    padding: 11px 18px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

button:hover {
    transform: translateY(-1px);
}

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

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, #1478d4, #0f62aa);
    color: #ffffff;
    flex: 1;
}

.btn-secondary {
    background: #2d9d5f;
    color: #ffffff;
    flex: 1;
}

.btn-tertiary {
    background: #4e6477;
    color: #ffffff;
    flex: 1;
}

.puzzle-container {
    margin-bottom: 20px;
}

.empty-state {
    background: #f7fafc;
    border: 2px dashed #c8d7e6;
    border-radius: 12px;
    color: #5a7185;
    padding: 26px;
    text-align: center;
}

.pollinator-puzzle {
    background: #ffffff;
    border: 1px solid #dbe5ee;
    border-radius: 12px;
    padding: 16px;
}

.puzzle-title {
    color: #13456a;
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.puzzle-instructions {
    color: #516b7d;
    margin-bottom: 14px;
}

.flower-svg-container {
    background: #f8fbfd;
    border: 1px solid #d4e2ee;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    margin: 8px 0;
    overflow: auto;
    padding: 10px;
}

.flower-svg {
    height: auto;
    max-width: 100%;
}

.flower-input {
    border: none;
    outline: none;
}

.flower-input.correct {
    background: #d7f4df !important;
    color: #1f7a3f;
}

.flower-input.incorrect {
    background: #fde1e1 !important;
    color: #a62f2f;
}

.flower-input.solution-shown {
    background: #fff7d1 !important;
    color: #8a6a00;
}

.results-section {
    background: #f7fafc;
    border: 1px solid #dbe5ee;
    border-radius: 12px;
    padding: 16px;
}

.results-section h2 {
    color: #12324a;
    margin-bottom: 12px;
}

.feedback {
    border-radius: 8px;
    line-height: 1.45;
    margin-top: 14px;
    padding: 12px;
}

.feedback-correct {
    background: #dff6e8;
    border-left: 4px solid #2d9d5f;
    color: #1e5f3a;
}

.feedback-incorrect {
    background: #fde7e7;
    border-left: 4px solid #d64545;
    color: #8f2626;
}

.solution-reveal {
    background: #fff6d8;
    border-left: 4px solid #d49b00;
    border-radius: 8px;
    padding: 12px;
}

.solution-reveal h3 {
    color: #7a5b00;
    margin-bottom: 6px;
}

.solution-reveal p {
    color: #7a5b00;
    font-weight: 700;
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .container {
        border-radius: 12px;
        padding: 16px;
    }

    h1 {
        font-size: 1.7rem;
    }

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

@media print {
    body {
        background: #ffffff;
        color: #000000;
        padding: 0;
    }

    .container {
        border-radius: 0;
        box-shadow: none;
        max-width: 100%;
        padding: 0;
    }

    header,
    .controls,
    .results-section,
    .empty-state {
        display: none !important;
    }

    .pollinator-puzzle,
    .flower-svg-container {
        border: none;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .flower-svg {
        max-width: 100%;
    }
}
