body.didatica-puzzle-standalone-body {
    margin: 0;
    min-height: 100vh;
    background: #edf1f7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1f2937;
}

.didatica-puzzle-app,
.didatica-puzzle-app * {
    box-sizing: border-box;
}

.didatica-puzzle-app {
    --dp-bg: #f7f8fb;
    --dp-card: #ffffff;
    --dp-text: #1f2937;
    --dp-muted: #5f6b7a;
    --dp-border: #d9e0ea;
    --dp-primary: #0f62fe;
    --dp-primary-dark: #0b4acb;
    --dp-success-bg: #e9f7ee;
    --dp-success-text: #14532d;
    --dp-query-bg: #fff7e8;
    --dp-query-border: #f4be5c;
    --dp-board-light: #f0d9b5;
    --dp-board-dark: #b58863;
    color: var(--dp-text);
}

.dp-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.dp-hero,
.dp-card,
.dp-stage-header {
    background: var(--dp-card);
    border: 1px solid var(--dp-border);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
}

.dp-hero {
    padding: 28px;
}

.dp-intro-copy p {
    margin: 0 0 14px;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--dp-muted);
}

.dp-intro-copy p:last-child {
    margin-bottom: 0;
}

.dp-good-luck {
    font-weight: 700;
    color: var(--dp-text);
}

.dp-hero--done {
    max-width: 760px;
    margin: 0 auto;
}

.dp-hero h1,
.dp-stage-title {
    margin: 0 0 12px;
    font-size: clamp(1.7rem, 2vw, 2.2rem);
    line-height: 1.2;
}

.dp-lead,
.dp-stage-copy {
    margin: 0 0 16px;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--dp-muted);
}

.dp-rules {
    margin: 0 0 18px 18px;
    padding: 0;
    line-height: 1.7;
}

.dp-rules li + li {
    margin-top: 6px;
}

.dp-captcha-block {
    margin: 18px 0 12px;
}

.dp-start-actions,
.dp-inline-actions,
.dp-submit-wrap {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.dp-button {
    appearance: none;
    border: 1px solid var(--dp-border);
    background: #fff;
    color: var(--dp-text);
    border-radius: 12px;
    padding: 11px 16px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.dp-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
}

.dp-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dp-button--primary {
    background: var(--dp-primary);
    border-color: var(--dp-primary);
    color: #fff;
}

.dp-button--primary:hover:not(:disabled) {
    background: var(--dp-primary-dark);
    border-color: var(--dp-primary-dark);
}

.dp-button--large {
    padding: 14px 22px;
    font-size: 1.05rem;
}

.dp-stage-header {
    padding: 20px 22px;
    margin-bottom: 18px;
}

.dp-stage-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eef4ff;
    color: #1849a9;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.dp-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 18px;
}

.dp-card {
    padding: 16px;
}

.dp-card--query {
    border-color: var(--dp-query-border);
    background: linear-gradient(180deg, #fffdf8, #ffffff);
}

.dp-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

.dp-card-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.dp-badge {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.dp-badge--solved {
    background: #eefaf2;
    color: #1f7a44;
}

.dp-badge--query {
    background: #fff2d7;
    color: #9a5c00;
}

.dp-card-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.dp-board-wrap {
    width: 100%;
    overflow-x: auto;
}

.dp-board-table {
    border-collapse: collapse;
    margin: 0 auto;
}

.dp-board-label {
    width: 20px;
    text-align: center;
    font-size: 0.76rem;
    color: var(--dp-muted);
    font-weight: 600;
}

.dp-board-label--file {
    padding-top: 5px;
}

.dp-square {
    width: 42px;
    height: 42px;
    text-align: center;
    vertical-align: middle;
}

.dp-square--light {
    background: var(--dp-board-light);
}

.dp-square--dark {
    background: var(--dp-board-dark);
}

.dp-piece {
    display: inline-block;
    line-height: 1;
    font-size: 1.85rem;
    filter: drop-shadow(0 1px 0 rgba(255,255,255,0.18));
}

.dp-meta {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dp-turn-pill {
    display: inline-flex;
    align-self: flex-start;
    border-radius: 999px;
    padding: 7px 12px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 700;
    font-size: 0.9rem;
}

.dp-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.dp-chip-list,
.dp-answer-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dp-answer-grid {
    align-items: stretch;
}

.dp-chip,
.dp-answer-option {
    border-radius: 999px;
    border: 1px solid var(--dp-border);
    background: #fff;
    padding: 8px 12px;
    font-size: 0.95rem;
    line-height: 1.1;
}

.dp-chip {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
}

.dp-chip--correct {
    background: var(--dp-success-bg);
    color: var(--dp-success-text);
    border-color: #9ad7b0;
}

.dp-answer-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    cursor: pointer;
    font-weight: 700;
    color: var(--dp-text) !important;
    background: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    -webkit-text-fill-color: currentColor;
    transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.dp-answer-option:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(16, 24, 40, 0.06);
}

.dp-answer-option--active {
    background: #eef4ff !important;
    border-color: var(--dp-primary);
    color: var(--dp-primary-dark) !important;
}

.dp-answer-note {
    margin: 10px 0 0;
    color: var(--dp-success-text);
}

.dp-piece-list {
    border-top: 1px dashed var(--dp-border);
    padding-top: 10px;
}

.dp-piece-list summary {
    cursor: pointer;
    font-weight: 700;
}

.dp-piece-list ul {
    margin: 10px 0 0 18px;
    padding: 0;
    color: var(--dp-muted);
    line-height: 1.6;
}

.dp-alert {
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

.dp-alert--error {
    background: #fff1f3;
    color: #9f1239;
    border-color: #fecdd3;
}

.dp-alert--info {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.dp-proof-block {
    margin: 18px 0;
}

.dp-copy-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.dp-copy-input {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--dp-border);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    background: #fff;
}

.dp-muted {
    color: var(--dp-muted);
}

.dp-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

.dp-loading-box {
    background: #fff;
    border-radius: 14px;
    padding: 18px 22px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    font-weight: 700;
}

@media (max-width: 768px) {
    .dp-shell {
        padding: 16px 12px 30px;
    }

    .dp-card-grid {
        grid-template-columns: 1fr;
    }

    .dp-hero,
    .dp-card,
    .dp-stage-header {
        border-radius: 14px;
    }

    .dp-square {
        width: 36px;
        height: 36px;
    }

    .dp-piece {
        font-size: 1.55rem;
    }

    .dp-copy-row {
        flex-direction: column;
        align-items: stretch;
    }
}


.dp-shell--narrow {
    max-width: 820px;
}

.dp-survey-block {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 8px;
}

.dp-survey-question {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dp-survey-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dp-text);
}

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

.dp-radio-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--dp-border);
    border-radius: 999px;
    padding: 10px 14px;
    background: #fff;
    font-weight: 600;
}

.dp-radio-pill input {
    margin: 0;
}

.dp-select {
    width: 220px;
    max-width: 100%;
    border: 1px solid var(--dp-border);
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    background: #fff;
}

@media (max-width: 768px) {
    .dp-select {
        width: 100%;
    }
}
