/* One complete phone play surface; help opens separately without resizing it. */
@media(max-width:699px) {
 .kryptogramm-page .site-header { height:48px; }
 .kryptogramm-page .site-shell { min-height:0; }
 .crypto-main { padding:4px; }
 .crypto-desk { display:flex; flex-direction:column; width:100%; height:calc(100svh - 58px); height:calc(100dvh - 58px); min-height:0; gap:4px; padding:5px; }
 .crypto-desk:has(.crypto-mobile-info[open]) { height:calc(100dvh - 58px); min-height:0; }
 .crypto-heading { flex:none; height:clamp(40px,7dvh,64px); padding:0; }
 .crypto-heading .crypto-logo { position:static; display:block; width:auto; height:100%; max-width:100%; max-height:100%; transform:none; margin:auto; }
 .crypto-levels { flex:none; gap:5px; }
 .crypto-levels button, .crypto-actions button, .crypto-secondary button { height:34px; min-height:34px; padding:2px 3px; font-size:12px; line-height:1.15; }
 .crypto-levels button { font-size:13px; }
 .crypto-mobile-info { flex:none; padding:0 8px; font-size:12px; background:#fff0d1; border:1px solid #c89b60; border-radius:4px; }
 .crypto-mobile-info::before { content:none; }
 .crypto-mobile-info summary { min-height:24px; height:24px; padding:2px 0; line-height:20px; }
 .crypto-workspace { flex:1 1 0; min-height:0; gap:4px; }
 .crypto-playfield { flex:1 1 0; min-height:0; padding:4px; }
 .crypto-category { flex:none; min-height:26px; gap:3px; }
 .crypto-category h2 { min-width:0; font-size:11px; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
 .crypto-category-label { display:none; }
 .crypto-category h2 strong { font-size:15px; }
 .crypto-category button { flex:0 0 28px; min-height:26px; height:26px; width:28px; padding:3px; }
 .crypto-category .icon { width:19px; height:19px; }
 #crypto-board { display:grid; grid-template-rows:repeat(var(--word-count,5),minmax(0,1fr)); flex:1 1 0; min-height:0; gap:3px; margin:4px 0; padding:2px; overflow:visible; }
 .crypto-word { display:grid; grid-template-columns:minmax(0,1fr) 18px; min-height:0; align-items:center; gap:3px; }
 .crypto-tiles { display:grid; grid-template-columns:repeat(var(--letter-count),minmax(0,1fr)); width:100%; height:100%; max-height:38px; max-width:calc(var(--letter-count) * 34px + (var(--letter-count) - 1) * 1px); min-height:0; gap:1px; container-type:size; }
 .crypto-tiles .crypto-tile { width:100%; min-width:0; height:100%; min-height:0; padding:0; container-type:normal; border-radius:3px; }
 .crypto-tile small { flex:none; font-size:clamp(7px,min(calc(44cqw / var(--letter-count)),28cqh),10px); line-height:1; }
 .crypto-tile b { flex:none; font-size:clamp(10px,min(calc(72cqw / var(--letter-count)),48cqh),20px); line-height:1; min-height:1em; }
 .crypto-tile em { display:none; }
 .crypto-tile[aria-pressed="true"], .crypto-tile:focus-visible { outline:2px solid #124875; outline-offset:-2px; box-shadow:inset 0 0 0 3px #fff8; }
 .crypto-length { font-size:10px; line-height:1; text-align:right; }
 .crypto-space { width:auto; height:100%; min-width:0; display:flex; align-items:center; justify-content:center; }
 #crypto-selection { display:flex; align-items:center; justify-content:center; gap:8px; flex:none; height:34px; min-height:34px; margin:0; padding:2px 6px; font-size:11px; line-height:14px; white-space:normal; overflow:visible; color:var(--crypto-ink); background:#f8e5bd url('/assets/games/kryptogramm/parchment-v2.webp') center / 100% 100%; border-radius:5px; }
 #crypto-selection .crypto-selection-pair { flex:none; min-width:64px; font-size:19px; font-weight:700; line-height:1.2; }
 #crypto-selection .crypto-selection-caption { font-size:11px; line-height:13px; }
 #crypto-status { flex:none; height:16px; min-height:16px; margin:2px 0 0; transform:translateY(-4px); font-size:10px; line-height:16px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
 .crypto-tools { flex:none; padding:0 2px; }
 .crypto-console, .crypto-console:has(.crypto-keyboard.is-selected) { position:static; flex:none; min-height:0; gap:4px; padding:0; background:none; border-radius:0; box-shadow:none; }
 .crypto-keyboard { grid-template-columns:repeat(var(--keyboard-columns,11),minmax(0,1fr)); gap:3px 2px; }
 .crypto-keyboard button { height:34px; min-height:34px; min-width:0; padding:0; font-size:19px; line-height:1; touch-action:manipulation; }
 .crypto-console .crypto-metrics { min-height:23px; margin:0; padding:1px 4px; }
 .crypto-metrics dt { font-size:10px; }
 .crypto-metrics dd { font-size:14px; }
 .crypto-secondary { gap:4px; }
 .crypto-secondary button { font-size:11px; }
 .crypto-tile, .crypto-levels button, .crypto-actions button, .crypto-secondary button { touch-action:manipulation; }
 .crypto-support-line { padding-top:3px; }
}
@media(max-width:340px) {
 .crypto-keyboard button { font-size:18px; }
 .crypto-secondary button { font-size:10px; }
 .crypto-category h2 strong { font-size:14px; }
}
@media(max-width:699px) and (max-height:700px) and (orientation:portrait) {
 .kryptogramm-page .site-header { height:44px; }
 .crypto-desk { height:calc(100dvh - 54px); gap:3px; }
 .crypto-heading { height:20px; }
 .crypto-heading .crypto-logo { display:none; }
 .crypto-heading h1 { position:static; width:auto; height:20px; padding:0; margin:0; overflow:visible; clip:auto; clip-path:none; white-space:normal; font:bold 16px/20px Georgia,serif; color:#fff1cf; text-shadow:0 1px 2px #412712; }
 .crypto-levels button, .crypto-actions button, .crypto-secondary button { height:32px; min-height:32px; }
 .crypto-mobile-info summary { height:20px; min-height:20px; line-height:18px; padding:1px 0; }
 .crypto-console { gap:3px; }
 #crypto-selection { height:28px; min-height:28px; font-size:10px; line-height:12px; }
 #crypto-selection .crypto-selection-pair { font-size:18px; }
 #crypto-selection .crypto-selection-caption { font-size:10px; line-height:11px; }
 .crypto-keyboard button { height:30px; min-height:30px; font-size:18px; }
 .crypto-console .crypto-metrics { min-height:20px; }
 .crypto-metrics dd { font-size:12px; line-height:16px; }
 .crypto-metrics dt { font-size:9px; line-height:16px; }
}
/* In landscape, the word field and keyboard share the width instead of height. */
@media(max-width:699px) and (max-height:480px) and (orientation:landscape) {
 .crypto-desk { display:grid; grid-template-columns:minmax(0,1fr) minmax(240px,.95fr); grid-template-rows:34px minmax(0,1fr); gap:4px 8px; }
 .crypto-heading { display:none; }
 .crypto-levels { grid-column:1; grid-row:1; }
 .crypto-mobile-info { grid-column:2; grid-row:1; align-self:center; }
 .crypto-workspace { grid-column:1; grid-row:2; }
 .crypto-console { grid-column:2; grid-row:2; align-self:stretch; justify-content:center; }
}
@media(max-width:699px) and (max-height:350px) and (orientation:landscape) {
 .crypto-console { gap:3px; }
 .crypto-keyboard button { height:28px; min-height:28px; font-size:17px; }
 #crypto-selection { height:28px; min-height:28px; font-size:10px; line-height:12px; }
 #crypto-selection .crypto-selection-pair { font-size:17px; }
 #crypto-selection .crypto-selection-caption { font-size:10px; line-height:11px; }
 .crypto-console .crypto-metrics { min-height:20px; }
 .crypto-metrics dd { font-size:12px; line-height:16px; }
 .crypto-metrics dt { font-size:9px; line-height:16px; }
 .crypto-secondary button { height:30px; min-height:30px; font-size:10px; }
}
.crypto-dialog .crypto-legend { display:grid; gap:10px; margin-top:20px; color:#412712; font-size:13px; }
.crypto-dialog .crypto-legend>span { display:grid; grid-template-columns:20px minmax(0,1fr); gap:8px; align-items:center; }
.crypto-dialog .crypto-legend small { display:block; }
.crypto-dialog .crypto-swatch { display:inline-block; width:18px; height:22px; border:1px solid #9a6737; border-radius:3px; background:#f7dfb1; }
.crypto-dialog .crypto-swatch-given { background:#b0ed9c; border-color:#659247; }
.crypto-dialog .crypto-swatch-player { background:#d9edff; }
.crypto-dialog .crypto-swatch-hint { background:#ffcf75; border-color:#bd842c; }
