/* Layout responds to the usable CSS viewport, independent of device pixels. */
:root{--page-gutter:clamp(16px,3vw,48px);--desktop-rail:216px}
#desktop-shell{display:none}
html,body{min-width:0}
#shell,#main,.content,.home,.tiles,.row,.club-actions,.club-action-grid{min-width:0}
img,video{max-width:100%;height:auto}
.tile>span{overflow-wrap:anywhere}
.row{flex-wrap:wrap}
.row>.field{min-width:min(100%,200px)}
dialog{max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain}
dialog.daily-dialog{max-height:calc(100dvh - 24px);overflow-y:auto}
.daily-gift{min-height:44px}.daily-gift>.icon{max-width:100%}
.tasks-months{min-height:44px;height:auto;align-items:center}
.tasks-months button{min-height:44px}
.super-task-row{grid-template-columns:minmax(54px,70px) minmax(0,1fr) minmax(26px,30px) minmax(66px,86px)}
.task-label{overflow-wrap:anywhere}
.club-profile-field{min-width:0}
.club-profile-field select,.club-profile-field input,.club-profile-field textarea{max-width:100%}
.club-profile-top{gap:12px}
.profile-tools{flex-shrink:0}
.wheel-wrap{max-width:540px}
.wheel-svg{max-width:100%;height:auto}
.prize-card>div{min-width:0;overflow-wrap:anywhere}
#main table{table-layout:fixed;overflow-wrap:anywhere}
.field textarea{max-width:100%}
@media(max-width:359px){
 .home .identity{padding-top:20px}.identity h1{font-size:17px}
 .home-search{margin-top:20px}.home-search>label{font-size:11px}
 .searchline{gap:8px}.searchline input{font-size:16px}
 .tiles{gap:10px}.tile{height:124px;padding-inline:12px}.tile>span{font-size:10px;line-height:14px;min-height:48px}
 #bottom button>span{font-size:12px}
 .toolbar h1{font-size:16px}
 .club-actions{margin-inline:24px}.club-action>strong{font-size:14px}
 .month-carousel>.month-card{flex-basis:calc(100% - 44px);padding:12px}
 .month-card h2{font-size:24px}.month-card h2 .icon{width:28px;height:28px}
 .month-card .score{font-size:18px}.month-card .row{font-size:18px}
 .wheel-tiers{gap:6px}.wheel-tiers b{font-size:16px}.wheel-tiers small{font-size:12px}
 .super-task-row{grid-template-columns:56px minmax(0,1fr) 28px 64px;gap:5px;margin-inline:10px}
 .task-label,.task-progress{font-size:11px;line-height:15px}.task-collect{font-size:11px}.task-reward{font-size:11px;padding-inline:2px}
 .tasks-months{margin-inline:10px}.tasks-months button{padding-inline:12px;font-size:15px}
 .task-header{font-size:13px;margin-inline:10px;padding-inline:8px}
 .club-profile-field{gap:8px;font-size:14px}.club-profile-field>span{width:64px}
 .club-profile-top .avatar{width:68px;height:68px}.region-rank{font-size:12px}
 .numbers button{font-size:9px}
}
/* Tablets, wide phones and smaller laptop windows. */
@media(min-width:600px){
 body{background:var(--paper)}
 #shell{max-width:none;box-shadow:none;width:100%;margin:0}
 #main,.root-page #main{padding:28px var(--page-gutter) 88px;max-width:1440px;margin-inline:auto}
 body[data-route=home] #main{padding:28px var(--page-gutter) 88px}
 .home .identity{padding:0;min-height:58px}.identity h1{font-size:24px;line-height:1.25}.identity p{font-size:14px;line-height:20px}
 .identity>.icon-btn{margin:0;width:44px;height:44px;padding:6px}
 .home-search{margin:26px 0 30px;max-width:760px}.home-search>label{font-size:14px;line-height:22px}
 .searchline{height:52px}.searchline input{font-size:20px;height:48px}.phone-entry{height:48px}
 .home>.tiles{margin:0}.tiles{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
 .tile{height:154px;padding:20px 18px 12px;border-radius:8px}.tile>.icon{width:44px;height:44px}.tile>span{font-size:13px;line-height:18px;min-height:50px}
 .tile>.no-entry{right:8px;bottom:8px;width:18px;height:18px}
 #bottom{max-width:none;--nav:64px;height:calc(64px + env(safe-area-inset-bottom));padding-inline:max(12px,calc((100vw - 900px)/2));align-items:center}
 #bottom button{height:56px;padding:6px 10px}.root-page #main{padding-bottom:88px}
 .toolbar{height:64px;grid-template-columns:64px minmax(0,1fr) 64px}.toolbar .icon-btn{width:64px;height:64px;padding:20px}.toolbar h1{font-size:22px}
 .content{max-width:840px}
 .field>span{font-size:16px;line-height:22px}.field input,.field select{height:50px}.compact-field input,.compact-field select{height:48px;font-size:17px}
 body[data-route=rent] #main{padding-top:28px}
 .primary,.secondary{height:46px;font-size:16px}
 .bottom-action{position:static;left:auto;bottom:auto;transform:none;max-width:none;width:100%;background:transparent;padding:0;margin-top:36px}
 .bottom-action .primary{background:var(--brand);border-color:transparent;min-width:200px;max-width:420px;margin-left:auto}
 .bottom-action .primary:disabled{background:#e3e1e5;border-color:transparent;color:#a28daf}
 body:has(.bottom-action) #main{padding-bottom:40px}
 body[data-route=menu] #main{padding:16px var(--page-gutter) 88px}.menu-row{height:72px;font-size:16px}.menu-row>.icon{width:36px;height:36px}
 .version{position:static;transform:none;width:100%;margin-top:32px;padding:0;font-size:12px}
 body[data-route=settings] #main{padding-top:16px}.switch-row{height:68px}
 .hint,.notice{font-size:14px;line-height:1.6}.empty{font-size:18px;min-height:260px}
 body[data-route=club] #main{padding:28px var(--page-gutter) 88px}
 .club-user{margin-inline:0;width:100%}.xp-row{margin:28px 0 24px}
 .month-carousel{padding-inline:max(20px,calc((100% - 340px)/2));margin-inline:0}
 .month-carousel>.month-card{flex:0 0 340px;max-width:none;height:202px;padding:20px}
 .month-card h2{font-size:32px}.month-card .row{font-size:23px}.month-card .score{font-size:23px}
 .club-actions{max-width:520px;margin:30px auto 0}.club-action-grid{gap:24px}.club-action-box{max-height:150px}.club-action>strong{font-size:18px}
 .club-actions>.primary,.club-actions>.secondary{height:46px;font-size:16px}
 .wheel-tiers{gap:16px}.wheel-tiers button b{font-size:20px;padding-block:18px}.wheel-tiers small{height:32px;font-size:16px;padding-inline:12px}
 .wheel-balance{font-size:24px}.wheel-balance .score{font-size:24px}.wheel-wrap{width:min(100%,500px)}
 .wheel-spin{max-width:460px;width:100%;margin:0 auto 20px;height:46px}.attempts{font-size:20px;margin-bottom:24px}
 body[data-route=tasks] #main{padding:24px var(--page-gutter) 40px}.tasks-months{margin-inline:0;gap:12px}.tasks-months button{font-size:20px;padding-inline:20px}
 .task-header{display:grid;grid-template-columns:88px minmax(0,1fr) 194px;gap:16px;padding:0;margin:28px 0 8px;font-size:16px}
 .task-header>span:nth-child(2){position:static;transform:none}
 .super-task-row{grid-template-columns:88px minmax(0,1fr) 58px 120px;gap:16px;margin-inline:0;padding-block:12px;min-height:72px}
 .task-label,.task-progress{font-size:14px;line-height:21px}.task-label{padding-block:4px}.task-reward{font-size:16px;padding-block:12px}.task-collect{height:44px;font-size:15px}
 body[data-route=news] #main{padding:24px var(--page-gutter) 88px}
 .story-strip{border-radius:12px;height:190px;padding:18px;gap:16px}.story{flex-basis:120px;font-size:16px;padding:12px}.story .icon{width:48px;height:48px}
 .news-events{margin:24px auto;width:100%;max-width:440px}.news-tiles{margin:24px 0 0}.news-tiles .tile{height:154px}.news-tiles .tile span{font-size:13px}
 .number-search{margin:0 0 24px;padding:18px 24px;border-radius:12px}.number-search>p{font-size:14px;line-height:20px}.number-line input{font-size:20px}.check{font-size:14px;margin-top:12px}
 .numbers{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px 16px}.numbers button{height:44px;font-size:13px}.category{font-size:12px;line-height:18px;margin-top:0}
 .profile-identity{min-height:120px}.profile-identity h2{font-size:24px}.balance-row{gap:24px;margin-bottom:28px}.balance{height:140px;padding:20px}.balance span{font-size:14px;line-height:20px}.balance b{font-size:20px;line-height:26px}
 .profile-section-title{font-size:18px}.resource-row{font-size:16px;line-height:22px}.resource-row strong{font-size:16px}.profile-tiles .tiles{margin:0}
 .club-profile-top{margin-bottom:28px}.club-profile-field{font-size:18px;gap:24px}.club-profile-field>span{width:100px}.club-profile-field input,.club-profile-field select,.club-profile-field textarea{font-size:16px;padding:12px 0}
 .club-profile-buttons{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin:28px 0}.club-profile-buttons .secondary{margin:0;font-size:14px}.club-profile-submit{max-width:420px;margin-left:auto}
 #main table th,#main table td{font-size:16px;padding:18px 12px}.prize-card h3{font-size:18px}.prize-card p,.prize-card time{font-size:14px}
 .daily-gift>.icon{width:64px;height:64px}.daily-gifts.is-revealed .daily-gift>.icon{width:76px;height:76px}
 #toast{bottom:86px}
}
/* Wide windows: persistent navigation and layouts that use horizontal space. */
@media(min-width:1024px){
 #desktop-shell{display:flex;position:fixed;inset:0 auto 0 0;width:var(--desktop-rail);padding:32px 16px 20px;background:var(--brand);color:white;z-index:30;flex-direction:column;gap:32px;overflow-y:auto}
 .desktop-brand{font:700 26px/1.25 YaDiler;text-decoration:none;padding:0 12px;white-space:nowrap}
 .desktop-brand span{color:#ffd0e5}
 #desktop-nav{display:grid;gap:8px}
 #desktop-nav button,.desktop-settings{display:flex;align-items:center;gap:12px;min-height:52px;width:100%;padding:12px;border:0;border-radius:10px;background:none;color:white;text-align:left;font:15px/20px YaDiler}
 #desktop-nav button .icon,.desktop-settings .icon{width:24px;height:24px}
 #desktop-nav button.active{background:#ffffff24;box-shadow:inset 3px 0 #ffd0e5}
 #desktop-nav button:hover,.desktop-settings:hover{background:#ffffff18}
 .desktop-settings{margin-top:auto}
 #shell{margin-left:var(--desktop-rail);width:calc(100% - var(--desktop-rail));max-width:none}
 #bottom{display:none!important}
 .toolbar{height:72px;grid-template-columns:72px minmax(0,1fr) 72px}.toolbar .icon-btn{width:72px;height:72px;padding:24px}.toolbar h1{font-size:24px}
 #main,.root-page #main,body[data-route=home] #main,body[data-route=club] #main,body[data-route=news] #main,body[data-route=tasks] #main,body[data-route=menu] #main{padding:32px var(--page-gutter) 40px;min-height:calc(100dvh - 72px)}
 body[data-route=home] #main{min-height:100dvh}
 .home{display:grid;grid-template-columns:minmax(260px,1fr) minmax(280px,1.2fr);gap:28px 36px;align-items:center}
 .home .identity{min-height:72px}.identity h1{font-size:28px}.identity p{font-size:15px}
 .home-search{margin:0;max-width:none}.home>.tiles{grid-column:1/-1}
 .tiles{gap:20px}.tile{height:164px;padding:22px 20px 14px}.tile>span{font-size:14px;line-height:20px}.tile>.icon{width:46px;height:46px}
 .content{max-width:960px}
 body[data-route=club] .content{max-width:none;display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:24px 28px;align-items:start}
 .club-user{grid-column:1;grid-row:1;margin:0;width:100%;height:72px}
 .xp-row{grid-column:1;grid-row:2;margin:0;height:32px;align-items:center}.progress{height:26px}.progress>span{height:26px;line-height:26px;font-size:16px}
 .month-carousel{grid-column:1;grid-row:3;min-width:0;padding-inline:max(20px,calc((100% - 320px)/2));padding-block:10px 16px}
 .month-carousel>.month-card{flex-basis:320px;height:202px}
 .club-actions{grid-column:2;grid-row:1/4;max-width:none;margin:0;padding:20px 16px;border:1px solid var(--line);border-radius:14px;background:var(--paper)}
 .club-action-grid{gap:14px}.club-action-box{aspect-ratio:1.15}.club-action-box .icon{width:50px;height:50px}.club-action>strong{font-size:13px;line-height:19px}.club-action-box b{font-size:16px;line-height:24px}
 .club-actions>.primary{margin-top:24px}.club-actions>.secondary:last-child{margin-bottom:0}
 body[data-route=wheel] .content{max-width:1160px;display:grid;grid-template-columns:minmax(320px,1fr) minmax(320px,500px);column-gap:clamp(24px,4vw,64px);row-gap:20px;align-items:start}
 .wheel-balance{grid-column:1;grid-row:1;margin-top:12px}
 .wheel-tiers{grid-column:1;grid-row:2;margin:0;gap:10px}.wheel-tiers button b{font-size:17px}.wheel-tiers small{padding-inline:6px;font-size:14px}
 .wheel-wrap{grid-column:2;grid-row:1/5;width:100%;max-width:500px;margin:8px auto 0}
 .attempts{grid-column:1;grid-row:3;margin:0;text-align:left;font-size:18px}.wheel-spin{grid-column:1;grid-row:4;max-width:none;margin:0;width:100%}
 body[data-route=tasks] .content,body[data-route=prizes] .content{max-width:1160px}
 .super-task-row{grid-template-columns:100px minmax(0,1fr) 80px 140px;gap:24px;min-height:80px}
 .task-header{grid-template-columns:100px minmax(0,1fr) 244px;gap:24px}.task-label,.task-progress{font-size:16px;line-height:24px}.task-collect{height:46px;font-size:16px}
 .prizes-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}.prize-card{border:1px solid var(--line);border-radius:12px;padding:24px}
 body[data-route=profile] .content{max-width:1100px}.profile-tiles .tiles{grid-template-columns:repeat(3,minmax(0,1fr))}
 .numbers{grid-template-columns:repeat(5,minmax(0,1fr))}.numbers button{font-size:14px}
 #toast{bottom:24px;left:calc(50% + var(--desktop-rail)/2);max-width:min(600px,calc(100vw - var(--desktop-rail) - 48px))}
}
@media(min-width:1440px){
 :root{--desktop-rail:240px}
 .home>.tiles,.news-tiles{grid-template-columns:repeat(4,minmax(0,1fr))}
 body[data-route=club] .content{grid-template-columns:minmax(0,1fr) 320px;gap:28px 36px}
 .club-actions{padding:24px}.club-action>strong{font-size:14px}
 .tile{height:176px}
}
/* Short landscape windows keep important actions reachable without clipping. */
@media(orientation:landscape) and (max-height:540px){
 dialog,dialog.daily-dialog{max-height:calc(100dvh - 16px)}
 .daily-gifts{margin-top:32px}.daily-gift{height:62px}
 .bottom-action{position:static;transform:none;left:auto;max-width:none;margin-top:24px}
 body:has(.bottom-action) #main{padding-bottom:24px}
 .wheel-wrap{max-width:340px}.attempts{margin:14px 0}
}
@media(max-width:299px){
 .home>.tiles{grid-template-columns:1fr}.tile{height:120px}
 #bottom button>span{font-size:10px}.toolbar{grid-template-columns:44px minmax(0,1fr) 44px}.toolbar .icon-btn{width:44px;padding:10px}
 .club-actions{margin-inline:16px}.club-action-grid{gap:8px}.club-action>strong{font-size:11px}
 .month-card h2{font-size:20px}.month-card h2 .icon{width:22px;height:22px}.month-card .row,.month-card .score{font-size:16px}
 .wheel-tiers{flex-wrap:wrap}.wheel-tiers button{flex:1 1 88px}
 .task-header{display:none}.super-task-row{grid-template-columns:1fr 1fr;gap:8px;margin-top:12px}
 .task-label{grid-column:1/-1;grid-row:1;font-size:12px}.task-reward{grid-column:1;grid-row:2}.task-progress{grid-column:2;grid-row:2}
 .task-collect{grid-column:1/-1;grid-row:3;width:100%;font-size:13px;height:40px}
 .tasks-months button{font-size:14px;padding-inline:8px}.club-profile-field{flex-wrap:wrap}.club-profile-field>span{width:100%}
 .profile-identity,.club-profile-top{flex-wrap:wrap;height:auto;gap:12px}.profile-tools{padding-top:0}
}
