.pjgame-play .pjordp-wrap {
    max-width: none;
    margin: 0;
    padding: 0 0 24px;
}

.pjordp-wrap {
    max-width: 1180px;
    margin: 0 auto 36px;
    padding: 0 16px 24px;
    color: #0f172a;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pjordp-wrap .pjui-back-track {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px;
    margin: 0 0 16px;
}

.pjordp-wrap .pjui-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 2px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
}

.pjordp-wrap .pjui-back-link:hover,
.pjordp-wrap .pjui-back-link:focus,
.pjordp-wrap .pjui-back-link:focus-visible {
    background: #dbeafe;
    border-color: #93c5fd;
    outline: none;
}

.pjordp-app {
    display: grid;
    gap: 16px;
}

.pjordp-setup,
.pjordp-game,
.pjordp-results {
    display: grid;
    gap: 16px;
}

.pjordp-setup-head {
    display: grid;
    gap: 6px;
}

.pjordp-setup-title,
.pjordp-results-title {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 1.8rem);
    line-height: 1.15;
    font-weight: 900;
    color: #0f172a;
}

.pjordp-setup-subtitle,
.pjordp-swap-help,
.pjordp-turn {
    margin: 0;
    color: #475569;
    font-size: .97rem;
    line-height: 1.45;
}

.pjordp-fieldset {
    margin: 0;
    padding: 18px;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(23, 32, 51, .06);
}

.pjordp-fieldset-legend {
    padding: 0 6px;
    font-size: 1.05rem;
    font-weight: 900;
    color: #0f172a;
}

.pjordp-show-hints-fieldset {
    padding: 14px 16px 16px;
}

.pjordp-show-hints-fieldset .pjordp-fieldset-legend {
    margin-bottom: 0;
}

.pjordp-show-hints-fieldset .pjui-choice-grid {
    margin-top: 10px;
    align-items: stretch;
}

.pjordp-wrap .pjui-choice-card.pjordp-help-card {
    position: relative;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 40px 14px 14px;
    border: 2px solid #dbe4f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: none;
}

.pjordp-help-card .pjordp-hint-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin: 0 0 2px;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
}

.pjordp-help-card .pjordp-hint-icon svg {
    display: block;
    width: 26px;
    height: 26px;
}

.pjordp-help-card strong {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.25;
    color: #1d4ed8;
}

.pjordp-help-card small {
    margin: 0;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.4;
    color: #475569;
}

.pjordp-hint-check {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    opacity: 0;
    transform: scale(.85);
    pointer-events: none;
}

.pjordp-hint-check svg {
    width: 12px;
    height: 12px;
}

.pjordp-wrap .pjordp-help-card:hover,
.pjordp-wrap .pjordp-help-card:focus-visible {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .12);
    transform: translateY(-1px);
}

.pjordp-wrap .pjordp-help-card:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

.pjordp-show-hints-fieldset .pjordp-help-card.is-selected {
    border-color: #16a34a;
    background: #f0fdf4;
    box-shadow: 0 6px 16px rgba(22, 163, 74, .14);
    transform: none;
}

.pjordp-show-hints-fieldset .pjordp-help-card.is-selected .pjordp-hint-icon {
    background: #dcfce7;
    color: #15803d;
}

.pjordp-show-hints-fieldset .pjordp-help-card.is-selected strong {
    color: #166534;
}

.pjordp-show-hints-fieldset .pjordp-help-card.is-selected small {
    color: #334155;
}

.pjordp-show-hints-fieldset .pjordp-help-card.is-selected .pjordp-hint-check {
    opacity: 1;
    transform: scale(1);
}

.pjordp-show-hints-fieldset .pjordp-help-card.is-selected:hover,
.pjordp-show-hints-fieldset .pjordp-help-card.is-selected:focus-visible {
    border-color: #15803d;
    background: #ecfdf5;
    box-shadow: 0 8px 18px rgba(22, 163, 74, .16);
    transform: translateY(-1px);
}

.pjordp-show-hints-fieldset .pjordp-help-card.is-selected:focus-visible {
    outline-color: #16a34a;
}

@media (max-width: 1100px) and (min-width: 761px) {
    .pjordp-wrap .pjui-choice-grid:not(.is-two) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .pjordp-wrap .pjui-choice-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.pjordp-wrap .pjui-choice-card.is-selected {
    border-color: #0d9488;
    background: #f0fdfa;
    color: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(13, 148, 136, .16);
}

.pjordp-wrap .pjui-choice-card.is-selected strong {
    color: #0f766e;
}

.pjordp-wrap .pjui-choice-card.is-selected small {
    color: #334155;
}

.pjordp-label {
    display: block;
    margin-bottom: 6px;
    font-size: .95rem;
    font-weight: 800;
    color: #0f172a;
}

.pjordp-help-text {
    margin: 0 0 8px;
    color: #64748b;
    font-size: .9rem;
    line-height: 1.4;
}

.pjordp-select,
.pjordp-textarea,
.pjordp-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    line-height: 1.4;
}

.pjordp-select:focus,
.pjordp-textarea:focus,
.pjordp-input:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, .15);
}

.pjordp-textarea {
    min-height: 140px;
    resize: vertical;
}

.pjordp-panel {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(23, 32, 51, .06);
}

.pjordp-grid-2 {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pjordp-library {
    display: grid;
    gap: 12px;
}

.pjordp-library[hidden] {
    display: none;
}

.pjordp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pjordp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid #0d9488;
    border-radius: 8px;
    background: #0d9488;
    color: #fff;
    font-size: .96rem;
    font-weight: 800;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
    box-shadow: 0 10px 26px rgba(13, 148, 136, .18);
}

.pjordp-btn:hover,
.pjordp-btn:focus-visible {
    background: #0f766e;
    border-color: #0f766e;
    outline: none;
}

.pjordp-btn.is-light {
    background: #fff;
    color: #0f766e;
    box-shadow: none;
}

.pjordp-btn.is-light:hover,
.pjordp-btn.is-light:focus-visible {
    background: #f0fdfa;
}

.pjordp-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pjordp-status {
    min-height: 1.2em;
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
}

.pjordp-feedback {
    min-height: 1.2em;
    margin: 10px 0 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.4;
    border: 1px solid transparent;
}

.pjordp-feedback:empty {
    display: none;
}

.pjordp-status.is-error {
    color: #b91c1c;
}

.pjordp-status.is-ok {
    color: #15803d;
}

.pjordp-feedback--success,
.pjordp-feedback.is-ok {
    color: #14532d;
    background: #ecfdf5;
    border-color: #6ee7b7;
}

.pjordp-feedback--error,
.pjordp-feedback.is-error {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fca5a5;
}

.pjordp-game-head {
    display: grid;
    gap: 6px;
}

.pjordp-progress,
.pjordp-score,
.pjordp-results-score {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #334155;
}

.pjordp-word-target {
    padding: 18px 22px;
    border: 2px solid #0d9488;
    border-radius: 12px;
    background: linear-gradient(180deg, #f0fdfa 0%, #ccfbf1 100%);
    box-shadow: 0 12px 32px rgba(13, 148, 136, .14);
    text-align: center;
}

.pjordp-word-label {
    margin: 0 0 8px;
    font-size: clamp(1rem, 2.2vw, 1.15rem);
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #0f766e;
}

.pjordp-word-value {
    margin: 0;
    font-size: clamp(1.75rem, 5vw, 2.6rem);
    font-weight: 900;
    line-height: 1.15;
    color: #0f172a;
}

.pjordp-help {
    padding: 22px 28px;
    border: 2px solid #0d9488;
    border-radius: 12px;
    background: linear-gradient(180deg, #f0fdfa 0%, #ccfbf1 100%);
    box-shadow: 0 12px 32px rgba(13, 148, 136, .14);
    text-align: center;
}

.pjordp-help-label {
    margin: 0 0 10px;
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #0f766e;
}

.pjordp-hint-value {
    margin: 0;
    font-size: clamp(1.55rem, 4.5vw, 2.35rem);
    font-weight: 900;
    line-height: 1.2;
    color: #0f172a;
}

.pjordp-tokens {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    align-content: center;
    gap: 10px;
    padding: 18px 12px;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(23, 32, 51, .06);
}

.pjordp-tokens.pjordp-sortable {
    min-height: 88px;
}

.pjordp-token {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    flex: 0 0 auto;
    align-self: center;
    min-height: 48px;
    padding: 10px 14px;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font-size: clamp(.95rem, 2.5vw, 1.15rem);
    font-weight: 800;
    line-height: 1.25;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.pjordp-token:hover,
.pjordp-token:focus-visible {
    border-color: #0d9488;
    outline: none;
}

.pjordp-token.is-selected {
    border-color: #0d9488;
    background: #ccfbf1;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 148, 136, .2);
}

.pjordp-token.pjordp-token--pressed {
    transform: translateY(-1px);
}

.pjordp-token.pjordp-token--dragging {
    cursor: grabbing;
    border-color: #0d9488;
    background: #99f6e4;
    opacity: .88;
    width: var(--pjordp-drag-w);
    height: var(--pjordp-drag-h);
    max-width: var(--pjordp-drag-w);
    max-height: var(--pjordp-drag-h);
    flex: 0 0 var(--pjordp-drag-w);
    align-self: center;
    transform: translateY(-4px);
    box-shadow: 0 12px 26px rgba(13, 148, 136, .32);
    z-index: 3;
}

.pjordp-drop-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    box-sizing: border-box;
    width: var(--pjordp-drag-w, 56px);
    height: var(--pjordp-drag-h, 48px);
    max-width: var(--pjordp-drag-w, 56px);
    max-height: var(--pjordp-drag-h, 48px);
    min-width: 0;
    min-height: 0;
    flex: 0 0 var(--pjordp-drag-w, 56px);
    overflow: hidden;
    border: 2px dashed #0f766e;
    border-radius: 10px;
    background: repeating-linear-gradient(135deg, #ccfbf1 0 8px, #f0fdfa 8px 16px);
    box-shadow: inset 0 0 0 2px rgba(15, 118, 110, .18);
    pointer-events: none;
}

.pjordp-drop-slot::before {
    content: "";
    flex: 0 0 auto;
    align-self: center;
    width: 5px;
    height: 70%;
    max-height: 100%;
    min-height: 0;
    border-radius: 999px;
    background: #0f766e;
}

@media (prefers-reduced-motion: reduce) {
    .pjordp-token {
        transition: none;
    }

    .pjordp-token.pjordp-token--dragging,
    .pjordp-token.pjordp-token--pressed,
    .pjordp-token.is-selected {
        transform: none;
    }
}

@media (max-width: 720px) {
    .pjordp-grid-2 {
        grid-template-columns: 1fr;
    }

    .pjordp-help,
    .pjordp-word-target {
        padding: 18px 16px;
    }

    .pjordp-hint-value {
        font-size: clamp(1.35rem, 7vw, 1.9rem);
    }

    .pjordp-word-value {
        font-size: clamp(1.5rem, 7vw, 2rem);
    }
}

@media print {
    .pjordp-wrap *,
    .pjordp-wrap *::before,
    .pjordp-wrap *::after {
        box-shadow: none !important;
        text-shadow: none !important;
    }

    .pjordp-actions,
    .pjordp-btn {
        display: none !important;
    }
}

.pjordp-wrap select,
.pjordp-wrap select option {
  font-weight: 400;
}

.pjordp-wrap.pjordp-demo-play {
    max-width: 920px;
    margin: 0 auto 24px;
    padding: 8px 16px 28px;
}

@media (max-width: 760px) {
    .pjordp-wrap.pjordp-demo-play {
        padding: 4px 12px 24px;
    }

    .pjordp-demo-play .pjordp-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .pjordp-demo-play .pjordp-btn {
        min-height: 44px;
        flex: 1 1 auto;
    }
}
