/* Touch layout, safe areas and iPad Split View. */
html{min-height:100%;-webkit-text-size-adjust:100%}body{min-height:100dvh;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}button,select{min-height:48px;touch-action:manipulation}.app-actions{display:flex;gap:14px;align-items:center}.connection{font-size:12px;color:#a1c89c}.connection.offline{color:var(--yellow)}.board-tools{padding:12px 24px 0;display:flex;justify-content:space-between;align-items:center;gap:8px}.mode-switch{display:flex;gap:5px}.mode{padding:8px 12px;font-size:12px;min-height:44px}.mode.active{background:#3c3930;color:var(--yellow);border-color:#796b40}.board-tip{font-size:11px;color:var(--muted)}.face-tabs{display:flex;gap:8px;justify-content:center;margin:14px 16px 0}.face{padding:10px 14px;font-size:12px;flex:1;max-width:155px}.face.active{border-color:var(--face-color,var(--yellow));color:var(--face-color,var(--yellow))}#board{max-height:465px;user-select:none;-webkit-user-select:none}#board.flat{max-height:420px}.cell{-webkit-tap-highlight-color:transparent}.flat-cell{stroke-width:1.2}.legend{padding-bottom:16px}.toolbar .btn{flex:1;white-space:nowrap}.toolbar .next{margin-left:0}.message{min-height:60px}dialog{background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:20px;max-width:430px;width:calc(100% - 40px);padding:26px}dialog::backdrop{background:#0009}dialog h2{font-size:22px;margin-top:0}dialog p{color:var(--muted);font-size:15px;line-height:1.8}dialog button{width:100%;margin-top:10px}.update-notice{max-width:1176px;margin:14px auto 0;background:#393428;border:1px solid #796b40;border-radius:12px;padding:10px 16px;display:flex;align-items:center;justify-content:space-between;font-size:13px;gap:12px}[hidden]{display:none!important}
@media(hover:none){.cell:hover{stroke:#444b4e;stroke-width:1.5}.btn:hover{background:#292f33}.primary:hover{background:var(--yellow)}}
@media(min-width:1001px){.layout{grid-template-columns:minmax(0,.78fr) minmax(0,1.22fr)}.card h2{font-size:18px}.question-card{align-self:start}main{padding-top:28px}.intro{margin-bottom:22px}#target{min-height:230px;max-height:290px}.help{margin-top:15px;padding-top:12px}}
@media(min-width:761px) and (max-width:1000px){header{padding:20px 24px}main{padding:26px 24px}.intro{align-items:center;gap:16px}h1{font-size:32px}.layout{grid-template-columns:1fr;gap:18px}.question-card{display:grid;grid-template-columns:1fr 1fr;align-items:center}.question-card .cardhead{grid-column:1/-1;padding-top:18px}.question-card #target{grid-column:1;grid-row:2/4;min-height:210px;max-height:245px}.question-card .layers-area{grid-column:2;padding:10px 20px!important}.question-card .targetfoot{grid-column:2;font-size:12px;margin:0 20px 18px;padding:12px}.cardhead{padding-top:18px}#board{max-height:590px}#board.flat{max-height:520px}.help{gap:16px;margin-top:15px}.toolbar .btn{min-height:52px;font-size:15px}}
@media(max-width:760px){header{padding:16px;flex-wrap:wrap;gap:12px}.brand{font-size:16px}.app-actions{gap:10px}.app-actions .btn{font-size:11px;padding:8px 10px;min-height:44px}.connection{font-size:11px}main{padding:20px 14px}.intro{margin-bottom:18px;gap:12px}.difficulty{width:100%;justify-content:space-between}.difficulty select{flex:1;max-width:240px;font-size:15px}.board-tools{padding:12px 16px 0}.board-tip{display:none}.card h2{font-size:16px}.cardhead{gap:8px;padding:16px 16px 0}.badge{white-space:nowrap;font-size:11px}.toolbar{display:grid;grid-template-columns:1fr 1fr}.toolbar .btn{font-size:14px;min-height:48px}#target{min-height:180px;max-height:240px}#board{max-height:540px}#board.flat{max-height:430px}.face-tabs{gap:5px;margin:12px 12px 0}.face{padding:8px;font-size:11px}.legend{font-size:11px;gap:10px}.question-card .targetfoot{font-size:12px}.help{padding-top:5px}.update-notice{margin:10px 14px 0}}
@media(min-width:1001px) and (max-height:850px){header{padding:16px 28px}main{padding:18px 28px}.intro{margin-bottom:16px}h1{font-size:30px}.eyebrow{font-size:11px}.layout{gap:18px}.cardhead{padding:16px 20px 0}.card h2{font-size:17px}#target{min-height:200px;max-height:240px}#board{max-height:350px}#board.flat{max-height:340px}.board-tools{padding-top:6px}.face-tabs{margin-top:8px}.legend{padding-bottom:10px}.toolbar{padding:12px 16px}.message{padding-bottom:12px;min-height:50px}.help{margin-top:10px;padding-top:8px}.question-card .targetfoot{margin-bottom:18px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
/* Keep the active puzzle and its controls together on typical iPad screens. */
#board.flat + .legend{display:none}
@media(min-width:761px) and (max-width:1000px){header{padding:12px 24px}.intro{margin-bottom:18px}#board.flat{max-height:380px}.question-card #target{min-height:180px;max-height:190px}.board-tools{padding-top:6px}.face-tabs{margin-top:8px}.toolbar{padding:12px 20px}}
@media(min-width:1001px) and (max-height:850px){header{padding:8px 28px}main{padding-top:14px}.intro{margin-bottom:12px}.cardhead{padding-top:12px}.board-tools{padding-top:4px}.face-tabs{margin-top:4px}.face{min-height:44px}#board.flat{max-height:325px}.message{min-height:44px}.help{margin-top:8px}}
