/* Phone screens use the available viewport, including browser bars and the keyboard. */
.mobile-only{display:none}
#mobile-name-dialog{max-width:360px;padding:28px 22px 22px}
#mobile-name-dialog h2{font-size:27px;text-align:left;line-height:1.2}
#mobile-name-dialog #initials-form{border:0;margin-top:20px;padding:0}
#mobile-name-dialog label{color:#e3f1e9}
#mobile-name-dialog .small-note{color:#d1e1d6}

@media(max-width:760px),(max-width:1100px) and (max-height:600px),(pointer:coarse) and (max-width:1200px){
 html{height:100%;overflow:hidden}
 body[data-mw-app='name-the-country']{height:var(--app-height,100dvh);min-height:0;overflow:hidden;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
 .mobile-only{display:block}
 .top-nav{display:none;position:fixed;top:calc(46px + env(safe-area-inset-top));right:calc(8px + env(safe-area-inset-right));left:auto;z-index:30;width:215px;height:auto;padding:9px;gap:5px;flex-direction:column;align-items:stretch;background:#fffef6;border:1px solid #b9ccbf;border-radius:11px;box-shadow:0 6px 25px #153d3b33}
 .top-nav.mobile-open{display:flex}
 .top-nav a{padding:9px 10px;min-height:38px;border-radius:6px;font-size:12px}
 .top-nav a:hover{background:#e3f1e9}
 .top-nav .site-name{font-size:11px;letter-spacing:0}
 .app-shell{height:100%;min-height:0;display:grid;grid-template-rows:44px minmax(0,1fr)}
 body[data-mw-app='name-the-country'] header.mw-app-header{min-height:0!important;height:44px!important;padding:4px 8px!important;gap:5px!important;flex-wrap:nowrap!important}
 body[data-mw-app='name-the-country'] header.mw-app-header .mw-app-brand{gap:6px!important;min-width:0!important}
 body[data-mw-app='name-the-country'] header.mw-app-header .mw-app-brand>.mw-app-icon{width:30px!important;height:30px!important;min-width:30px!important;flex-basis:30px!important}
 body[data-mw-app='name-the-country'] header.mw-app-header .mw-app-copy{min-width:0!important}
 body[data-mw-app='name-the-country'] header.mw-app-header .mw-app-kicker{font-size:7px!important;letter-spacing:1px!important;margin-bottom:2px!important}
 body[data-mw-app='name-the-country'] header.mw-app-header h1.mw-app-title{font-size:19px!important;letter-spacing:-.6px!important;white-space:nowrap!important;line-height:1.05!important}
 header.mw-app-header .header-actions{flex-wrap:nowrap!important;gap:4px!important;flex-shrink:0!important}
 .header-actions .quiet-button{display:flex;width:31px;min-height:31px;height:31px;padding:0;align-items:center;justify-content:center;font-size:17px}
 .header-actions .quiet-button span{display:none}
 #mobile-menu{font-size:22px;order:3}
 main{min-height:0;display:grid;grid-template-rows:40px minmax(0,1fr);gap:6px;margin:0;padding:6px 8px 8px;overflow:hidden}
 .game-toolbar{min-width:0;min-height:0;display:flex;flex-direction:row;justify-content:space-between;gap:6px;margin:0}
 .mode-picker{width:auto;min-width:0;flex:1;max-width:230px;gap:2px;padding:3px;border-radius:9px;height:40px}
 .mode-picker button{min-width:0;min-height:0;padding:3px 5px;flex:1;font-size:11px;border-radius:6px}
 .mode-picker button span{font-size:8px;line-height:1.1;margin-top:2px}
 .records{width:auto;gap:8px;justify-content:flex-end;flex-shrink:0}
 .records>div{display:flex;flex-direction:column;gap:1px;min-width:29px;align-items:center}
 .records>div>span{max-width:none;white-space:nowrap;font-size:6px;letter-spacing:.2px;line-height:1.2}
 .records strong{font-size:19px;line-height:1.1}
 .records .board-button{width:34px;height:34px;min-height:0;justify-content:center;padding:0;font-size:0;border-radius:7px}
 .records .board-button>span{font-size:21px;line-height:1}
 .workspace{min-height:0;min-width:0;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) 158px;gap:6px;align-items:stretch}
 body[data-screen='ready'] .workspace{grid-template-rows:minmax(0,1fr) 88px}
 body[data-screen='play'][data-mode='beast'] .workspace{grid-template-rows:minmax(0,1fr) 192px}
 body[data-screen='result'] .workspace{grid-template-rows:minmax(0,1fr) 158px}
 .atlas-card{min-width:0;min-height:0;display:grid;grid-template-rows:64px minmax(0,1fr) 40px 18px;border-radius:11px;box-shadow:none}
 .clue-row{min-height:0;height:auto;padding:4px 8px;gap:6px;overflow:hidden}
 .clue-copy{min-width:0;width:55%}
 .clue-copy .eyebrow{font-size:7px;letter-spacing:.5px;line-height:1.3}
 .clue-copy h2{font-size:17px;line-height:1.05;letter-spacing:-.4px;margin:3px 0 0;overflow-wrap:anywhere}
 .clue-copy>p:last-child{display:none}
 .outline-clue{width:43%;height:100%;min-height:0;align-self:stretch;padding:0}
 .outline-clue svg{height:100%;min-height:0;max-height:58px;width:100%}
 .outline-clue>span{display:none!important}
 .map-area{min-height:0;height:auto}
 .map-area>svg{position:absolute;inset:0;width:100%;height:100%;min-height:0;aspect-ratio:auto}
 .map-key{bottom:3px;left:4px;padding:2px 3px;font-size:6px;gap:7px}
 .map-key i{width:6px;height:6px}
 .map-north{top:5px;right:7px;font-size:8px}
 .map-controls{min-height:0;padding:3px 5px;gap:4px}
 .map-controls button{height:100%;min-height:0;padding:2px 3px;font-size:9px;gap:3px;border-radius:6px;box-shadow:none}
 .map-controls b{font-size:20px}
 .map-controls svg{width:14px;height:14px}
 .map-footer{min-height:0;padding:1px 7px;gap:9px}
 .progress-label strong{font-size:9px;line-height:1}
 .progress-label>span,#journey-label{display:none}
 .progress-track{height:4px}
 .answer-card{min-height:0;min-width:0;display:grid;grid-template-rows:22px minmax(0,1fr) 16px;gap:4px;padding:6px 8px;border-radius:11px;box-shadow:none;overflow:hidden}
 .scoreline{min-height:0;margin:0;padding:0;border:0;align-items:center}
 .scoreline>div{display:flex;gap:8px;align-items:center}
 .scoreline .eyebrow{font-size:7px;letter-spacing:.7px;max-width:none}
 .streak{font-size:23px;line-height:1;letter-spacing:-1px;gap:0;margin:0}
 .score-star{display:none}
 .level-badge{font-size:7px;line-height:1.2;padding:3px 7px}
 #ready-panel{min-height:0;padding:0;display:flex;align-items:center}
 #ready-panel .primary-button{min-height:0;height:40px;padding:6px;font-size:13px}
 #play-panel{min-height:0;display:flex;flex-direction:column;justify-content:center}
 #answer-heading,.answer-note,#spelling-help,#guess-form>label{display:none}
 .choices{height:100%;min-height:0;margin:0;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:minmax(0,1fr);gap:5px}
 .choices button{min-height:0;height:100%;padding:5px 7px;gap:0;font-size:12px;line-height:1.15;border-width:1px;border-radius:7px;box-shadow:0 2px 0 #c4d8ca;overflow-wrap:anywhere}
 .choices button>span:first-child{display:none}
 #guess-form{min-height:0;margin:0}
 .guess-row{gap:5px}
 .guess-row input{min-height:0;height:40px;padding:6px 8px;font-size:16px}
 .guess-row button{min-width:40px;height:40px;font-size:21px}
 #suggestions{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:4px;gap:4px}
 #suggestions button{min-width:0;min-height:32px;padding:4px 6px;font-size:10px;line-height:1.2;overflow-wrap:anywhere}
 .feedback{min-height:0;margin:0;font-size:10px;line-height:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #retry-answer{font-size:11px;margin:0;min-height:30px}
 .answer-card:has(#retry-answer:not([hidden])){grid-template-rows:22px minmax(0,1fr) 16px 30px}
 .answer-card:has(#retry-answer:not([hidden])) #play-panel{display:none}
 #result-panel{min-height:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto 38px 28px;gap:5px;align-content:center}
 #result-title,#result-kicker,#result-detail,#result-board,#initials-home{display:none}
 #result-panel #short-result{grid-column:1/-1;grid-row:1;display:block;font-size:11px;line-height:1.2;margin:0;color:var(--dark);font-weight:700}
 #replay{grid-column:1/-1;grid-row:2;min-height:0;height:38px;margin:0;padding:5px;font-size:12px;box-shadow:0 2px 0 #c4b73c}
 #open-name{grid-column:1;grid-row:3;min-height:0;margin:0;font-size:10px;align-self:stretch}
 #show-song{grid-column:1/-1;grid-row:3;min-height:0;margin:0;font-size:10px;align-self:stretch;text-align:center}
 body[data-qualifies='true'] #show-song{grid-column:2}
 .connection-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;margin:0;padding:0}
 main>footer{display:none}
 .practice-overlay{padding:6px;min-height:0;grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,1fr)}
 .practice-card{min-height:0;grid-template-rows:minmax(0,1fr);max-height:100%;height:100%;gap:10px;padding:12px 10px;box-shadow:0 3px 15px #153d3b38;border-radius:9px}
 .practice-card .song-thumb{min-height:0;height:100%;max-height:100%;aspect-ratio:auto;border:0;background:transparent}
 .practice-card .song-thumb img{object-fit:contain}
 .practice-copy h2{font-size:18px;line-height:1.05}
 .practice-copy p{font-size:11px;line-height:1.25;margin-top:5px}
 .practice-copy .song-link{font-size:9px;line-height:1.2;margin-top:6px}
 .practice-card.is-playing{display:flex;flex-direction:column;height:100%;min-height:0;padding:29px 6px 6px}
 .practice-player{flex:1;min-height:0;aspect-ratio:auto}
 dialog{max-height:calc(var(--app-height,100dvh) - 20px);padding:18px 22px}
}

/* A phone turned sideways, or the shorter view above an on-screen keyboard. */
@media(max-width:760px),(max-width:1100px) and (max-height:600px),(pointer:coarse) and (max-width:1200px){
 body[data-mw-app='name-the-country'][data-compact-wide='true'] .workspace{grid-template-columns:minmax(0,1.7fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
 body[data-compact-wide='true'] .atlas-card{grid-template-rows:56px minmax(0,1fr) 36px 18px}
 body[data-compact-wide='true'] .clue-copy{width:55%}
 body[data-compact-wide='true'] .outline-clue svg{max-height:50px}
 body[data-compact-wide='true'] .answer-card{padding:6px;grid-template-rows:22px minmax(0,1fr) 16px}
 body[data-compact-wide='true'] .choices button{font-size:12px;padding:5px}
 body[data-compact-wide='true'] #result-panel{grid-template-rows:auto 40px 36px}
 body[data-compact-wide='true'] .practice-copy h2{font-size:15px}
 body[data-compact-wide='true'] .practice-copy p{font-size:10px}
 body[data-compact-wide='true'] .practice-copy .song-link{font-size:8px;margin-top:4px}
 body[data-keyboard='true'] .app-shell{grid-template-rows:34px minmax(0,1fr)}
 body[data-keyboard='true'] header.mw-app-header{height:34px!important}
 body[data-keyboard='true'] main{grid-template-rows:minmax(0,1fr);padding:4px 6px;gap:0}
 body[data-keyboard='true'] .game-toolbar{display:none}
 body[data-keyboard='true'] .atlas-card{grid-template-rows:44px minmax(0,1fr) 32px 14px}
 body[data-keyboard='true'] .clue-copy h2{font-size:13px}
 body[data-keyboard='true'] .outline-clue svg{max-height:38px}
 body[data-keyboard='true'] .answer-card{grid-template-rows:18px minmax(0,1fr) 14px;padding:4px;gap:3px}
 body[data-keyboard='true'] .streak{font-size:20px}
 body[data-keyboard='true'] .level-badge{display:none}
 body[data-keyboard='true'] .guess-row input,body[data-keyboard='true'] .guess-row button{height:36px}
 body[data-keyboard='true'] #suggestions{grid-template-columns:minmax(0,1fr)}
 body[data-keyboard='true'] #suggestions button{min-height:28px;font-size:10px;padding:3px 5px}
 body[data-keyboard='true'] .feedback{font-size:9px;line-height:14px}
}

@media(max-width:360px){
 body[data-mw-app='name-the-country'] header.mw-app-header h1.mw-app-title{font-size:17px!important}
 .records{gap:5px}
 .mode-picker{max-width:177px}
 .mode-picker button{font-size:10px;padding:3px}
 .map-controls button{font-size:8px}
}
