.dl-page{
    max-width:1180px;
    margin:32px auto 70px;
    padding:0 14px;
    color:#20252b;
}
.dl-screen{
    background:#fff;
    border:1px solid #dde1e5;
    border-radius:24px;
    box-shadow:0 14px 42px rgba(32,37,43,.07);
    overflow:hidden;
}
.dl-intro,.dl-end{
    min-height:600px;
    padding:44px 24px;
    display:grid;
    place-items:center;
    align-content:center;
    text-align:center;
    gap:18px;
}
.dl-kicker{
    display:inline-flex;
    align-items:center;
    padding:6px 12px;
    border:1px solid #d9dde1;
    border-radius:999px;
    background:#f5f6f4;
    color:#626971;
    font-size:13px;
    font-weight:800;
}
.dl-intro h1,.dl-end h2{
    margin:0;
    font-size:clamp(30px,5vw,46px);
    line-height:1.2;
}
.dl-intro p,.dl-end p{
    max-width:790px;
    margin:0;
    color:#66707a;
    line-height:1.95;
}
.dl-preview{
    width:min(100%,720px);
    padding:20px;
    border:1px solid #e0e3e6;
    border-radius:20px;
    background:#fafaf8;
}
.dl-preview svg{
    width:100%;
    height:auto;
    display:block;
}
.dl-preview-caption{
    margin-top:10px;
    color:#68717a;
    font-size:13px;
    font-weight:700;
}
.dl-rules{
    display:flex;
    justify-content:center;
    gap:10px;
    flex-wrap:wrap;
}
.dl-rules div{
    min-width:150px;
    padding:12px 15px;
    border:1px solid #e1e4e7;
    border-radius:14px;
    background:#fafaf8;
}
.dl-rules strong,.dl-rules span{
    display:block;
}
.dl-rules strong{font-size:20px}
.dl-rules span{
    margin-top:5px;
    color:#747c84;
    font-size:12px;
    font-weight:700;
}
.dl-btn{
    min-height:46px;
    padding:11px 19px;
    border-radius:12px;
    border:1px solid #cfd4d9;
    background:#fff;
    color:#252a2f;
    font:inherit;
    font-weight:800;
    text-decoration:none;
    display:inline-flex;
    justify-content:center;
    align-items:center;
    cursor:pointer;
    transition:transform .14s ease,background .14s ease,box-shadow .14s ease;
}
.dl-btn:hover{
    transform:translateY(-1px);
    background:#f7f8f7;
}
.dl-btn:focus-visible{outline:3px solid #9da7b1;outline-offset:2px}
.dl-primary{
    min-width:200px;
    background:#2f3439;
    color:#fff;
    border-color:#2f3439;
}
.dl-primary:hover{background:#23282d}
.dl-secondary{background:#edf0f3}
.dl-light{background:#f7f7f5}

#dlGame{padding:20px}
.dl-header{
    display:grid;
    grid-template-columns:minmax(240px,1fr) auto;
    gap:16px;
    align-items:end;
    margin-bottom:10px;
}
.dl-title-block h2{margin:7px 0 0;font-size:28px}
.dl-stats{
    display:flex;
    flex-wrap:wrap;
    justify-content:flex-end;
    gap:8px;
}
.dl-stats span{
    min-width:84px;
    padding:9px 10px;
    border:1px solid #e0e4e7;
    border-radius:12px;
    background:#fafaf8;
    text-align:center;
    color:#737a82;
    font-size:12px;
    font-weight:700;
}
.dl-stats b{
    display:block;
    margin-top:3px;
    color:#24292e;
    font-size:16px;
}
.dl-stats span:nth-child(2) b.is-warning{
    color:#a43832;
    animation:dl-pulse .7s ease-in-out infinite;
}
.dl-message{
    min-height:28px;
    margin:8px auto 12px;
    text-align:center;
    color:#555e67;
    font-weight:800;
}
.dl-message.is-good{color:#4c7d58}
.dl-message.is-bad{color:#9a3731}
.dl-progress-wrap{
    display:flex;
    align-items:center;
    gap:10px;
    margin-bottom:12px;
}
.dl-progress-track{
    flex:1;
    height:8px;
    border-radius:999px;
    background:#e8ebee;
    overflow:hidden;
}
.dl-progress{
    width:0%;
    height:100%;
    background:#65727d;
    transition:width .08s linear;
}
#dlProgressText{
    min-width:44px;
    color:#6e767e;
    font-size:12px;
    font-weight:900;
    text-align:left;
}
.dl-canvas-shell{
    width:min(100%,980px);
    margin:0 auto;
    padding:8px;
    border:1px solid #dde2e6;
    border-radius:20px;
    background:#f6f7f5;
}
.dl-canvas{
    width:100%;
    height:auto;
    display:block;
    overflow:hidden;
    touch-action:none;
    user-select:none;
    -webkit-user-select:none;
    cursor:default;
}
.dl-target{
    fill:none;
    stroke:#8d969e;
    stroke-width:20;
    stroke-linecap:round;
    stroke-linejoin:round;
    vector-effect:non-scaling-stroke;
    opacity:.78;
}
.dl-target-edge{fill:none;stroke:inherit;stroke-width:inherit;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.dl-node{fill:#aab2b9;stroke:#fff;stroke-width:4;vector-effect:non-scaling-stroke}

.dl-player{
    display:none!important;
}

.dl-target-edge{
    transition:stroke .12s ease,stroke-width .12s ease,opacity .12s ease;
}
.dl-target-edge.is-active{
    stroke:#2f3439;
    stroke-width:24;
    opacity:1;
}
.dl-target-edge.is-used{
    stroke:#587d62;
    stroke-width:24;
    opacity:1;
}
.dl-target-edge.is-used-error{
    stroke:#a43832;
    stroke-width:24;
    opacity:1;
}
.dl-node.is-current{
    fill:#2f3439;
    r:12;
}
.dl-start-point{
    fill:#587d62;
    stroke:#fff;
    stroke-width:7;
    vector-effect:non-scaling-stroke;
}
.dl-end-point{
    fill:#fff;
    stroke:#2f3439;
    stroke-width:7;
    vector-effect:non-scaling-stroke;
}
.dl-end-point.is-same{
    fill:#dfe7e0;
    stroke:#587d62;
}
.dl-canvas.is-error{animation:dl-shake .14s linear 3}
.dl-canvas.is-success{filter:drop-shadow(0 0 10px rgba(85,125,98,.18))}
.dl-hint{
    margin-top:10px;
    text-align:center;
    color:#747c84;
    font-size:12px;
    line-height:1.6;
}
.dl-actions{
    display:flex;
    justify-content:center;
    gap:9px;
    flex-wrap:wrap;
    margin-top:12px;
}
.dl-end-icon{
    width:80px;
    height:80px;
    border-radius:50%;
    display:grid;
    place-items:center;
    background:#eceee9;
    font-size:38px;
    font-weight:900;
}
.dl-result-grid{
    width:min(100%,760px);
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:10px;
    margin:8px auto;
}
.dl-result-grid div{
    border:1px solid #e0e4e7;
    border-radius:14px;
    background:#fafaf8;
    padding:14px 8px;
}
.dl-result-grid b{display:block;font-size:22px}
.dl-result-grid span{
    display:block;
    margin-top:4px;
    color:#737b83;
    font-size:12px;
}
.dl-end-actions{
    display:flex;
    justify-content:center;
    gap:9px;
    flex-wrap:wrap;
}
@keyframes dl-pulse{
    0%,100%{transform:scale(1);opacity:1}
    50%{transform:scale(1.08);opacity:.72}
}
@keyframes dl-shake{
    0%,100%{transform:translateX(0)}
    50%{transform:translateX(5px)}
}
[hidden]{display:none!important}
@media (max-width:900px){
    .dl-header{grid-template-columns:1fr;align-items:start}
    .dl-stats{justify-content:flex-start}
}
@media (max-width:620px){
    .dl-page{margin-top:20px;padding:0 8px 50px}
    .dl-screen{border-radius:18px}
    .dl-intro,.dl-end{padding:30px 15px;min-height:520px}
    #dlGame{padding:12px}
    .dl-title-block h2{font-size:23px}
    .dl-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
    .dl-stats span{min-width:0}
    .dl-canvas-shell{padding:5px;border-radius:14px}
    .dl-target{stroke-width:32}
    .dl-player{stroke-width:22}
    .dl-result-grid{grid-template-columns:repeat(2,1fr)}
}

/* لا توجد نقطة بداية أو نهاية مفروضة؛ كل عقدة صالحة كنقطة بداية. */
.dl-start-point,.dl-end-point{display:none!important}
