.dilmar-page .topbar{max-width:1440px;padding:16px 24px}.dilmar-main{max-width:1440px;padding:24px}.dilmar-heading{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:24px}.dilmar-heading h1{font-size:42px;letter-spacing:-1.5px;margin:5px 0 8px}.dilmar-heading h1 span{font-weight:400;font-size:22px;color:var(--muted);letter-spacing:0;margin-left:12px}.dilmar-heading p{margin:0;color:var(--muted);font-size:14px}.dilmar-heading .eyebrow{font-size:10px}.d-welcome{max-width:660px;padding:45px 15px;margin:20px auto;text-align:center}.d-welcome h2{font-size:clamp(32px,4vw,48px);margin:20px 0}.d-welcome>p{line-height:1.8}.d-welcome .primary{margin:12px 0 24px;min-width:230px}.d-layout{display:grid;grid-template-columns:minmax(320px,520px) minmax(220px,1fr) minmax(270px,330px);gap:22px;align-items:start}.d-play,.d-side{min-width:0}.d-meta{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;font-size:12px;margin:0 0 12px}.d-board{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;padding:9px;border-radius:16px;background:#163e35;aspect-ratio:1;box-shadow:0 8px 24px #123e3515}.d-cell{position:relative;min-width:0;min-height:0;aspect-ratio:1;border-radius:7px;background:#e5e8d7;color:var(--ink);font-size:clamp(23px,3.8vw,38px);font-weight:750;padding:0;touch-action:manipulation}.d-cell.filled{background:#fffbeb}.d-cell.draft,.d-cell.latest{box-shadow:inset 0 0 0 3px #c89524}.d-cell.selected{background:#d7e99a;box-shadow:inset 0 0 0 2px #527042}.d-cell.selected.draft{box-shadow:inset 0 0 0 3px #b77816}.d-cell:disabled{opacity:1;color:var(--ink);cursor:default}.d-cell small{position:absolute;right:4px;bottom:4px;display:grid;place-items:center;min-width:19px;height:19px;padding:0 3px;border-radius:5px;background:#174f43;color:white;font-size:11px;font-weight:800;line-height:1}.d-cell.draft small{background:#996415}.d-cell:hover:not(:disabled){filter:brightness(.96)}.d-turn{font-weight:750;color:var(--green);font-size:16px;margin:14px 0}.d-compose{padding:16px;background:#fffefa;border:1px solid var(--line);border-radius:13px}.d-word-row{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:30px}.d-word-row span{font-size:18px;font-weight:750;overflow-wrap:anywhere}.d-word-row strong{white-space:nowrap;font-size:13px;color:var(--green)}.d-compose p{font-size:12px;line-height:1.65;margin:10px 0 14px;color:#65736a}.d-actions{display:grid;grid-template-columns:1.4fr 1fr;gap:8px;margin-top:12px}.d-actions button{padding:13px 8px;font-size:13px;min-height:44px}.d-edit-actions{display:flex;gap:8px}.d-edit-actions button{min-height:40px;font-size:11px;padding:8px 10px}.d-board-note{font-size:11px;line-height:1.6;color:var(--muted);margin:12px 2px}.d-side .side-card,.d-rules{padding:19px}.d-side p{font-size:13px;line-height:1.6;margin-bottom:9px}.d-history{max-height:520px;overflow:auto}#d-history{padding:0;margin:0;list-style:none}#d-history li{display:flex;justify-content:space-between;gap:14px;border-top:1px solid var(--line);padding:12px 0;font-size:13px}#d-history small{display:block;color:var(--muted);font-size:11px;margin-top:5px}.d-rules{position:sticky;top:16px;max-height:calc(100dvh - 32px);overflow:auto}.d-rules ol{padding-left:18px;margin:0}.d-rules li{font-size:12px;line-height:1.7;margin-bottom:12px}.d-rules li:last-child{margin-bottom:0}.d-alphabet{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;margin:18px 0}.d-alphabet button{background:#e8eddf;border:1px solid #d5dcc9;border-radius:6px;min-height:44px;font-size:20px;font-weight:700;color:var(--ink);padding:3px}.d-alphabet button:hover{background:var(--lime)}#d-meaning-dialog{width:620px}#d-cell-label{font-size:13px}.d-notice{background:#fff0cc;border:1px solid #dfc16d;border-radius:10px;padding:16px;margin-bottom:16px}.d-notice p{line-height:1.6;font-size:14px}.d-notice .quiet{margin:0 5px 4px 0}.dilmar-page footer{max-width:1392px;margin:0 24px}.dilmar-page .game-result{scroll-margin-top:12px}
@media(max-width:1100px){.d-layout{grid-template-columns:minmax(320px,520px) minmax(230px,1fr)}.d-rules{grid-column:1/-1;position:static;max-height:none}.d-rules ol{columns:2;column-gap:30px}.d-rules li{break-inside:avoid}.dilmar-main{max-width:1000px}}
@media(max-width:700px){.dilmar-page .topbar{padding:12px}.dilmar-page .brand{font-size:22px}.dilmar-main{padding:18px 10px}.dilmar-heading{margin-bottom:18px}.dilmar-heading h1{font-size:30px}.dilmar-heading h1 span{font-size:16px;margin-left:7px}.dilmar-heading p{font-size:12px}.dilmar-heading>.primary{font-size:12px;padding:12px}.d-layout{display:flex;flex-direction:column;gap:12px;max-width:520px;margin:auto}.d-play,.d-side,.d-rules{width:100%}.d-rules ol{columns:auto}.d-side .side-card{margin-bottom:12px}.d-history{max-height:350px}.d-board{gap:5px;padding:7px;border-radius:12px}.d-cell{font-size:clamp(24px,7vw,37px)}.d-cell small{font-size:10px;min-width:16px;height:16px;right:3px;bottom:3px}.dilmar-page .scoreboard{gap:7px;margin-bottom:12px}.dilmar-page .score-card{padding:8px 12px}.d-meta{font-size:11px}.d-compose{padding:12px}.d-word-row span{font-size:16px}.d-rules li{font-size:13px}.d-alphabet{gap:4px}.d-alphabet button{font-size:18px;min-height:39px}.dilmar-page dialog{padding:20px}.dilmar-page .game-result{padding:16px}.d-welcome{padding:25px 6px}.dilmar-page footer{margin:0 12px}}
/* Keep the board and move controls close together on shorter screens. */
.dilmar-page .topbar{padding-block:12px}.dilmar-main{padding-top:18px}.dilmar-heading{margin-bottom:18px}.dilmar-heading h1{font-size:36px}.dilmar-page .score-card{padding:10px 14px}.dilmar-page .score-card strong{font-size:26px}.d-board{width:min(100%,max(260px,calc(100dvh - 540px)));margin-inline:auto}.d-turn{margin:10px 0}.d-compose{padding:13px}.d-compose p{margin:7px 0 10px}.d-actions{margin-top:9px}
@media(max-width:700px){.dilmar-heading h1{font-size:30px}.dilmar-heading .eyebrow{display:none}.dilmar-heading{margin-bottom:14px}.dilmar-main{padding-top:12px}.d-board{width:min(100%,max(220px,calc(100dvh - 500px)))}.d-cell{font-size:clamp(23px,6vw,31px)}}

/* In-game guidance changes with each step of the move. */
.d-compose #d-help{padding:13px 14px;margin:12px 0;border:1px solid #bdd09f;border-left:4px solid #174f43;border-radius:9px;background:#edf3df;color:#244534;font-size:14px;font-weight:700;line-height:1.6;text-align:left}
.d-compose #d-help.ready{background:#ddecbd;border-color:#8fab65}
.d-letter-instruction{font-size:16px;font-weight:750;color:var(--green);line-height:1.5}
@media(max-width:700px){.d-compose #d-help{font-size:13px;padding:11px;margin:10px 0}}

/* Scale glyphs to the actual board, with room for Kazakh descenders. */
.d-board{container-type:inline-size}
.d-board .d-cell{display:grid;place-items:center;font-size:clamp(20px,9cqw,38px);line-height:1.2;overflow:visible}
.d-board .d-cell>span{display:block;line-height:1.2;max-width:100%;font-size:inherit}
.d-board .d-cell:has(small)>span{transform:translateY(-3px)}
.d-alphabet button{line-height:1.35;padding-block:6px;min-height:44px}

/* Notices overlay the page without moving the board or changing scroll height. */
.dilmar-page .d-notice{position:fixed;z-index:40;left:50%;bottom:calc(16px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:min(560px,calc(100% - 24px));max-height:min(320px,50dvh);overflow:auto;overscroll-behavior:contain;margin:0;padding:16px;border-radius:12px;box-shadow:0 8px 32px #102e2a33}
.dilmar-page .d-notice p{margin:0 0 12px;overflow-wrap:anywhere}
.dilmar-page .d-notice .quiet{min-height:44px}
@media(max-width:700px){.dilmar-page .d-notice{padding:13px;bottom:calc(10px + env(safe-area-inset-bottom,0px))}.dilmar-page .d-notice p{font-size:13px}}

/* Final score is a modal: opening it adds no height above the board. */
#d-result-dialog{width:600px;max-width:calc(100vw - 24px);max-height:85dvh;padding:14px;overflow:auto}
#d-result-dialog .d-result-close{display:flex;justify-content:flex-end;margin-bottom:10px}
#d-result-dialog .close-dialog{font-size:14px;min-height:40px;padding:8px 12px;color:var(--ink);border:1px solid var(--line);border-radius:8px}
#d-result-dialog .game-result{margin:0;padding:20px}
#d-result-open{margin:0 0 12px}
@media(max-width:700px){#d-result-dialog{padding:10px}#d-result-dialog .game-result{padding:16px}#d-result-dialog h2{font-size:28px}}
