/* KT Serüven 0.8.1 — separate game layouts, no game-state or score rules. */
.ui-icon{width:24px;height:24px;flex:0 0 auto;display:block}
.icon-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:44px;min-height:44px;touch-action:manipulation}
#game-view{outline:none;--game-accent:#765397;--game-tint:#f4f0f8;--game-edge:#d8cee6}
body[data-game-mode="teach"] #game-view{--game-accent:#118366;--game-tint:#eff9f4;--game-edge:#c4e4d7}
body[data-game-mode="speaking"] #game-view{--game-accent:#b36a09;--game-tint:#fff8eb;--game-edge:#f0d6aa}
.game-toolbar{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:12px;margin:0 0 10px}
.game-toolbar #back-map{width:44px;height:44px;padding:10px;flex:0 0 44px;margin:0;align-self:center;background:#eef5f8;color:#235168;border-radius:13px}
.game-toolbar #district-label{font-size:22px;line-height:1.25;letter-spacing:-.02em;font-weight:760;margin:0;color:#173f54;min-width:0;overflow-wrap:anywhere;text-align:left}
.game-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:0;margin:0 0 6px;align-items:stretch}
.game-stat{display:flex;align-items:center;justify-content:center;gap:8px;background:#f0f6f9;border-radius:13px;padding:8px 7px;min-width:0;line-height:1.15}
.game-stat>.ui-icon{color:#327696;width:23px;height:23px}
.game-stat>span{min-width:0}.game-stat b{display:block;color:#173f54;font-size:21px;font-weight:780;font-variant-numeric:tabular-nums;white-space:nowrap}
.game-stat .stat-label{display:block;font-size:11px;line-height:1.25;color:#527181;margin-top:3px;font-weight:500}
.stat-stars{background:#fff7e3}.stat-stars>.ui-icon{fill:#efb127;color:#df9a08}.stat-stars b{color:#735119}
#timer-stat>.ui-icon{color:#19946c}
.stat-speaking{flex-direction:column;align-items:center;gap:3px}
.stat-speaking>span{display:flex;gap:4px;align-items:center;justify-content:center;line-height:1.1}
.stat-speaking .ui-icon{width:16px;height:16px;color:#94610d}.stat-speaking b{font-size:16px;display:inline}.stat-speaking small{font-size:12px;color:#6d6658}
#game-notices .save-status{background:transparent;border:0;margin:0 1px 8px;padding:2px 0;min-height:20px;color:#277161;text-align:right;font-size:11px;line-height:1.35}
#game-notices .save-status.saving{color:#5b6d7a}
#game-notices .save-status.problem{font-size:13px;text-align:left;background:#fff2eb;color:#8a3021;border:1px solid #e6b5a7;padding:8px;border-radius:10px}
#game-notices #retry-box{font-size:13px;margin:6px 0 12px;padding:12px}
#game-notices #retry-box button{margin-top:8px;min-height:44px;font-size:14px}
.game-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;max-width:380px;margin:0 auto 10px}
.game-actions .icon-button{width:100%;height:46px;min-height:46px;padding:6px;margin:0;border:1px solid #e0eaf0;border-radius:12px;background:#edf5f9;color:#296078}
.game-actions .icon-button:hover{background:#e2eef5}.game-actions .ui-icon{width:24px;height:24px}
.game-actions #hint{color:#88630b;background:#fff7e5;border-color:#f0e2bd}
.game-actions #hint .ui-icon{color:#d19519}
.game-actions .hint-cost{font-size:11px;line-height:1.1;font-weight:750;white-space:nowrap}
#game-view .clue{margin:12px auto;max-width:100%;border:1.5px solid var(--game-edge);border-radius:20px;box-shadow:none;aspect-ratio:auto;display:flex;align-items:center;justify-content:center;padding:10px;background:#fff}
#game-view .clue.has-image{width:230px;height:200px}
#game-view .clue.has-image img{width:100%;height:100%;object-fit:contain;display:block;max-width:100%}
#game-view .clue.has-text{width:100%;max-width:540px;height:auto;min-height:104px;padding:18px 14px;background:linear-gradient(150deg,#fff,var(--game-tint));overflow:visible}
#game-view .meaning{font-size:30px;line-height:1.25;font-weight:760;color:#214e62;min-width:0;overflow-wrap:anywhere}
#game-view .meaning small{font-size:13px;line-height:1.4;font-weight:500;margin-bottom:8px;color:#617c89}
.classic-answer{width:100%;min-width:0}
#slots{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:9px 12px;margin:12px 0;max-width:100%;min-height:44px}
#slots .slot-word{display:flex;flex-wrap:wrap;justify-content:center;gap:4px;max-width:100%;min-width:0}
#slots .slot-word:empty{display:none}
#slots button,.playing #slots button{width:var(--slot-size,38px);min-width:var(--slot-size,38px);height:44px;min-height:44px;margin:0;padding:2px;background:#f4f8fb;border:1.5px solid #cadce5;border-radius:10px;font-size:21px;color:#164356;font-weight:700;opacity:1;cursor:default;touch-action:manipulation;box-shadow:none}
#slots button:not(:disabled){border-color:#73ada5;background:#e8f5f1;cursor:pointer}
#letters{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:var(--letter-gap,6px);max-width:100%;margin:12px auto 6px}
#letters button,.playing #letters button{width:var(--letter-size,48px);min-width:var(--letter-size,48px);height:50px;min-height:50px;padding:4px;margin:0;flex:0 0 auto;border-radius:12px;background:#167e73;box-shadow:0 3px 0 #0c5c55;font-size:24px;color:white;line-height:1;font-weight:750;touch-action:manipulation;user-select:none;-webkit-user-select:none}
#letters button:disabled{opacity:.28;cursor:default;box-shadow:none}
#letters button:not(:disabled):active{transform:translateY(2px);box-shadow:0 1px 0 #0c5c55}
#game-view button:focus-visible{outline:3px solid #1b6dac;outline-offset:3px}
#game-view .word-feedback{font-size:14px;line-height:1.4;min-height:20px;margin:9px 0 4px;overflow-wrap:anywhere;color:#176558}
#game-view .auto-next-note{font-size:11px;line-height:1.35;min-height:17px;margin:5px 0 0;color:#557582}
/* Keep status readable, but never cover the answer area with a large overlay. */
.playing .celebration-message{top:clamp(94px,17vh,160px);font-size:25px;padding:10px 18px;max-width:80%;border-radius:15px}
.playing .celebration-message,.playing .confetti-layer{pointer-events:none}
#teach-question-view{display:flex;flex-direction:column}
#teach-question-view .teach-prompt{order:-1;font-size:14px;line-height:1.4;color:#536f7e;text-align:center;margin:3px 0 4px;font-weight:500}
#teach-panel .teach-options{display:grid;grid-template-columns:1fr;gap:9px;margin:12px 0 0}
#teach-panel .teach-choice{margin:0;min-height:52px;padding:11px 16px;background:#f1f7fa;color:#164253;border:1.5px solid #cbdde6;border-radius:14px;font-size:18px;line-height:1.35;box-shadow:none;overflow-wrap:anywhere;touch-action:manipulation}
#teach-panel .teach-choice:disabled{opacity:1}
#teach-panel .teach-choice.correct{border-color:#17a67a;background:#e2f7ed;color:#075c47;box-shadow:inset 0 0 0 1px #17a67a}
#teach-panel .teach-choice.wrong{border-color:#d8967e;background:#fff0e9;color:#8b3926}
#speaking-question-view{display:flex;flex-direction:column;align-items:stretch}
#speaking-panel .speaking-word{text-align:center;margin:0 0 12px;font-size:17px;line-height:1.3;color:#607e8d}
#speaking-panel .speaking-word strong{font-size:38px;line-height:1.15;color:#18475d;font-weight:780;display:block;margin-top:3px;overflow-wrap:anywhere}
#speaking-panel .speaking-actions{display:flex;justify-content:center;align-items:center;gap:20px;margin:0}
#speaking-listen{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:3px;flex:0 0 70px;width:70px;min-height:70px;padding:10px;margin:0;border:1px solid #dceaf0;border-radius:20px;background:#eef6fa;color:#286581}
#speaking-listen .listen-caption{font-size:12px;line-height:1.2}
#speaking-mic{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;flex:0 0 128px;width:128px;min-height:94px;margin:0;padding:12px 8px;border-radius:26px;background:#d48a1e;color:white;box-shadow:0 4px 0 #a9640c;touch-action:manipulation}
#speaking-mic .ui-icon{width:36px;height:36px}#speaking-mic-label{font-size:17px;line-height:1.3}
#speaking-mic.is-listening{background:#b36a09;animation:mic-breathe 1.1s ease-in-out infinite}
#speaking-panel .speaking-heard{min-height:18px;text-align:center;margin:10px 0 0;font-size:12px;line-height:1.35;color:#5d7885;overflow-wrap:anywhere}
#speaking-panel #speaking-support{font-size:12px;line-height:1.4;margin:7px 0 0;text-align:center;color:#667985}
#speaking-restart{min-height:44px}
@keyframes mic-breathe{50%{box-shadow:0 4px 0 #a9640c,0 0 0 7px #e7ab4529}}
/* The ad is the last in-flow region, outside all interaction/celebration cards. */
body:not(.playing) .ad-zone{display:none!important}
body.playing .ad-zone{position:static;float:none;clear:both;margin:28px auto 0;padding:0 0 max(10px,env(safe-area-inset-bottom));width:100%;max-width:100%;text-align:center;overflow:visible;min-height:60px}
body.playing .ad-label{display:none!important}
body.playing .ktsv-ad{display:inline-block;width:320px;height:50px;min-height:50px;max-width:none}
body.playing .ad-preview-box{margin-left:auto;margin-right:auto;width:320px;max-width:100%;height:50px;min-height:50px;box-sizing:border-box}
/* Handheld mode: the game starts at district + title, without the dashboard. */
@media(max-width:1180px),(hover:none) and (pointer:coarse){
 body.playing .brand,body.playing .lab-note,body.playing .profile-head,body.playing .card>.eyebrow,body.playing .account-actions,body.playing footer{display:none!important}
 body.playing .shell{width:100%;max-width:1000px;margin:8px auto 0;padding:max(0px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}
 body.playing .card{padding:14px;border-radius:20px;border-color:#d8e7ed;overflow:visible;min-height:0}
 body.playing .celebration{border-radius:20px;overflow:hidden}
 body.playing .game-toolbar{display:flex;flex-direction:row;align-items:center;gap:10px;margin:0 0 10px}
 body.playing .game-toolbar #district-label{font-size:19px;line-height:1.25;text-align:left}
 body.playing .game-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:0;margin:0 0 4px}
 body.playing .game-stat{padding:8px 5px;gap:6px;min-height:48px;border-radius:12px}
 body.playing .game-stat b{font-size:20px}body.playing .stat-speaking b{font-size:15px}
 body.playing .game-stat .stat-label{font-size:10px}
 body.playing .game-stat>.ui-icon{width:21px;height:21px}
 body.playing #game-notices .save-status{min-height:17px;font-size:11px;margin-bottom:7px}
 body.playing #game-notices .save-status.problem{font-size:13px}
 body.playing .game-actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin-bottom:8px;max-width:360px}
 body.playing .game-actions .icon-button{min-height:44px;height:44px;padding:5px}
 body.playing #clue.has-image{width:min(200px,100%);height:164px;margin:10px auto;padding:7px}
 body.playing #teach-clue.has-image{width:min(280px,100%);height:190px;margin:8px auto;padding:8px}
 body.playing #speaking-clue.has-image{width:min(230px,100%);height:175px;margin:8px auto;padding:8px}
 body.playing #game-view .clue.has-text{width:100%;max-width:540px;min-height:102px;margin:10px auto;padding:16px 12px}
 body.playing #game-view .meaning{font-size:29px}
 body.playing #game-view .meaning small{font-size:12px;margin-bottom:6px}
 body.playing #slots{margin:10px 0;gap:8px 12px}
 body.playing #letters{margin-top:10px}
 body.playing .complete{padding:14px 4px}body.playing .complete h2{font-size:25px}body.playing .medal{font-size:52px}
 body.playing .complete p{font-size:14px;line-height:1.45}
 body.playing .complete button{min-height:46px;font-size:15px;margin-top:10px}
 body.playing .game-stats #speaking-stat{flex-direction:column;gap:2px}
 /* Map keeps the identity/mute control, but avoids repeated labels. */
 body:not(.playing) .mode-buttons button{min-height:58px;margin-top:6px;padding:10px 12px;line-height:1.35}
 body:not(.playing) .mode-buttons small{font-size:12px;margin-top:2px}
 body:not(.playing) .mode-statuses{display:none}
}
@media(max-width:420px){
 body.playing .shell{padding-left:max(8px,env(safe-area-inset-left));padding-right:max(8px,env(safe-area-inset-right))}
 body.playing .card{padding:12px}
 body.playing .game-toolbar #district-label{font-size:18px}
 body.playing #game-view .meaning{font-size:27px}
 body.playing .game-stat>.ui-icon{width:18px;height:18px}
 body.playing .game-stat b{font-size:18px}body.playing .stat-speaking b{font-size:14px}
 body.playing .game-stat{gap:5px}
 body.playing .game-actions .hint-cost{font-size:10px}
 body.playing #teach-panel .teach-choice{min-height:50px;font-size:17px;padding:10px 12px}
 body.playing #speaking-panel .speaking-word strong{font-size:34px}
}
/* Short portrait: reduce decoration, not touch targets or scrolling/zoom. */
@media(max-width:599px) and (max-height:740px){
 body.playing .shell{margin-top:5px}
 body.playing .game-toolbar{margin-bottom:7px}
 body.playing .game-stat{min-height:45px;padding:6px 4px}
 body.playing #clue.has-image{height:130px;width:min(174px,100%);margin:7px auto}
 body.playing #teach-clue.has-image{height:144px;width:min(235px,100%);margin:5px auto}
 body.playing #speaking-clue.has-image{height:134px;width:min(188px,100%);margin:5px auto}
 body.playing #game-view .clue.has-text{min-height:88px;padding:12px;margin:7px auto}
 body.playing #speaking-panel .speaking-word{margin-bottom:9px}
 body.playing #speaking-panel .speaking-word strong{font-size:30px}
 body.playing #speaking-mic{min-height:82px;width:118px;flex-basis:118px}
 body.playing .word-feedback{font-size:13px;margin-top:7px}
}
/* Tablets and landscape phones: task left; the right-hand interaction differs by game. */
@media(min-width:700px) and (max-width:1180px), (min-width:700px) and (hover:none) and (pointer:coarse), (min-width:560px) and (orientation:landscape) and (max-height:560px){
 body.playing .card{padding:18px}
 body.playing .game-toolbar #district-label{font-size:22px}
 body.playing .game-stats{max-width:590px;margin-left:auto;margin-right:auto}
 body.playing #game-notices .save-status{max-width:590px;margin-left:auto;margin-right:auto}
 body.playing #question-view{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:12px 22px;align-items:center}
 body.playing #question-view .game-actions{grid-column:1/-1;grid-row:1;min-width:300px;margin-bottom:0}
 body.playing #clue{grid-column:1;grid-row:2}
 body.playing #classic-answer{grid-column:2;grid-row:2}
 body.playing #clue.has-image{width:100%;max-width:310px;height:220px;margin:0 auto}
 body.playing #game-view #clue.has-text{min-height:156px;margin:0}
 body.playing #teach-question-view{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:12px 22px;align-items:center}
 body.playing #teach-question-view .teach-prompt{grid-column:1/-1;grid-row:1;margin:0}
 body.playing #teach-clue{grid-column:1;grid-row:2;margin:0}
 body.playing #teach-clue.has-image{width:100%;max-width:360px;height:245px;margin:0 auto}
 body.playing #teach-options{grid-column:2;grid-row:2;margin:0}
 body.playing #teach-feedback{grid-column:1/-1;grid-row:3}
 body.playing #speaking-question-view{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:24px;row-gap:6px;align-items:center}
 body.playing #speaking-clue{grid-column:1;grid-row:1/6}
 body.playing #speaking-clue.has-image{width:100%;max-width:290px;height:260px;margin:0 auto}
 body.playing #speaking-panel .speaking-word{grid-column:2;grid-row:1;margin:0 0 6px}
 body.playing .speaking-actions{grid-column:2;grid-row:2}
 body.playing #speaking-heard{grid-column:2;grid-row:3;margin:5px 0 0}
 body.playing #speaking-feedback{grid-column:2;grid-row:4;margin:0}
 body.playing #speaking-support{grid-column:2;grid-row:5;margin-top:2px}
 body.playing #speaking-restart{grid-column:2;grid-row:6}
}
@media(orientation:landscape) and (max-height:560px){
 body.playing .shell{margin-top:4px;max-width:940px}
 body.playing .card{padding:10px 14px}
 body.playing .game-toolbar{margin-bottom:6px}
 body.playing .game-toolbar #district-label{font-size:18px}
 body.playing .game-stats{max-width:490px}
 body.playing .game-stat{min-height:40px;padding:5px}
 body.playing .game-stat b{font-size:16px}body.playing .stat-speaking b{font-size:14px}
 body.playing #game-notices .save-status{margin-bottom:3px}
 body.playing #clue.has-image{height:124px;width:164px}
 body.playing #game-view #clue.has-text{min-height:104px}
 body.playing #teach-clue.has-image{height:176px;max-width:250px}
 body.playing #speaking-clue.has-image{height:170px;max-width:215px}
 body.playing #game-view .meaning{font-size:25px}
 body.playing #teach-panel .teach-choice{min-height:46px;padding:8px 12px;font-size:16px}
 body.playing #speaking-panel .speaking-word strong{font-size:30px}
 body.playing #speaking-mic{min-height:80px;width:120px;flex-basis:120px;padding:8px}
 body.playing #letters button{height:46px;min-height:46px;font-size:22px}
 body.playing #slots{margin:6px 0}body.playing #letters{margin:6px auto}
 body.playing .celebration-message{top:90px}
}
@media(hover:hover){#teach-panel .teach-choice:not(:disabled):hover{border-color:#4a9b88;background:#e7f5ee}.icon-button:not(:disabled):hover{filter:brightness(.98)}}
@media(prefers-reduced-motion:reduce){#speaking-mic.is-listening{animation:none}#letters button:not(:disabled):active{transform:none}.playing .celebration-message{transition:none!important}}
@media(max-width:339px){body.playing .ad-live{display:none!important}}
