
body:not(.duel-playing){margin:0;padding:0;height:100dvh;overflow:hidden;background:radial-gradient(ellipse at 50% 30%,#244d69,#0a1529 75%)}
body:not(.duel-playing) .duel-shell{box-sizing:border-box;width:100%;max-width:1100px;height:100dvh;margin:auto;padding:0 18px 26px;display:grid;grid-template-rows:64px minmax(0,1fr);gap:10px}
body:not(.duel-playing) .duel-header{min-height:0;height:64px;border:0;padding-right:120px!important;justify-content:flex-start;gap:14px}.duel-header>span{font-size:12px}.duel-header #connection{font-size:10px;white-space:nowrap}
body:not(.duel-playing) #lobby{display:grid;grid-template-rows:65px minmax(0,1fr);min-height:0}#lobby[hidden],#waiting[hidden],#duel-result[hidden]{display:none!important}
#lobby .duel-intro{padding:0}#lobby .duel-intro small,#lobby .duel-intro p{display:none}#lobby .duel-intro h1{font-size:28px;margin:0}#lobby .duel-intro br{display:none}#lobby .duel-intro em{margin-left:8px;color:#90ecff}
.duel-lobby-grid{min-height:0;grid-template-columns:1fr 1fr;gap:18px}.duel-create,.duel-rooms{min-height:0;padding:18px;background:#152d4699;border:1px solid #7bb3cf44}
.duel-create{display:flex;flex-direction:column;align-items:center;overflow:hidden}.duel-create #my-portrait{flex:1;min-height:0;width:100%;display:flex;justify-content:center}.duel-create #my-portrait svg{width:100%;height:100%;max-height:360px}.duel-create h2{font-size:16px;margin:6px}.duel-create p{display:none}
#create-room{flex:none;width:100%;min-height:86px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:6px;background:linear-gradient(140deg,#29b79c,#146782);border:2px solid #7cf8df88;border-radius:20px;font-size:16px;color:white}#create-room::before{width:40px;height:40px;margin:0!important}
.duel-rooms{display:flex;flex-direction:column}.duel-section-title{flex:none}.duel-section-title h2{font-size:18px;margin:10px 0}#refresh-rooms{width:48px;height:48px;min-width:48px;padding:8px!important;font-size:0!important}#refresh-rooms::before{width:28px;height:28px;margin:0!important}#room-list{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-y}.room-entry{padding:16px 12px;margin:10px 0;font-size:14px;border-radius:18px;min-height:86px;gap:8px}.room-entry b{font-size:13px;color:#8ef3d6}.room-empty{padding:35px 8px;font-size:14px}.duel-rooms .duel-hint{font-size:11px;margin:8px 0 0}
body:not(.duel-playing) #waiting{min-height:0;display:grid;grid-template-rows:44px minmax(100px,1fr) 180px 68px;gap:10px;position:relative}#waiting>.duel-intro{grid-row:1;padding:0}#waiting .duel-intro small,#waiting-note{display:none}#waiting-title{font-size:22px;margin:4px 0}#roster{grid-row:2;min-height:0;margin:0;gap:16px}.duel-seat{min-height:0;padding:10px;display:flex;flex-direction:column;align-items:center;overflow:hidden;background:radial-gradient(ellipse,#2b526b88,#12273e)}.duel-seat>svg{width:100%;height:0;min-height:0;flex:1}.duel-seat strong{font-size:16px}.duel-seat span{font-size:10px;margin-top:3px}
#waiting .duel-hero-picker{grid-row:3;margin:0;min-height:0;display:flex;flex-direction:column}#waiting .duel-hero-picker h2{font-size:13px;margin:0 0 5px;height:34px}.hero-scroll-nav button{width:42px;height:34px;padding:3px}.duel-hero-options{flex:1;min-height:0;padding:4px 3px 6px;gap:8px}.duel-hero-options button{flex-basis:90px;display:flex;flex-direction:column;align-items:center;min-height:0;padding:4px}.duel-hero-options button>svg{height:0;min-height:0;flex:1;width:100%}.duel-hero-options button>span{font-size:9px}.hero-battle-stats,.matchup-help{display:none}.duel-hero-options .matchup-trait{font-size:8px}.matchup-trait svg{width:18px!important;height:18px!important}
#start-duel{grid-row:4;justify-self:center;width:min(100%,420px);min-height:0;height:64px;margin:0!important;gap:12px;border-radius:20px;border:2px solid #90ffcd;background:linear-gradient(145deg,#29bb88,#147252);box-shadow:0 4px 0 #052e28;font-size:20px}#start-duel svg{width:40px;height:40px}#start-duel:disabled{border-color:#779592;background:#324e58;color:#acccca;box-shadow:none}
body:not(.duel-playing) #duel-error:not(:empty){position:fixed;bottom:28px;left:15px;right:15px;background:#522632;padding:12px;border-radius:12px;z-index:70}#duel-error:empty{display:none}
body:not(.duel-playing) #duel-result{min-height:0;margin:0;padding:12px;display:flex;flex-direction:column;align-items:center;justify-content:center}#duel-result #result-art{min-height:0;flex:1}#duel-result #result-art svg{height:100%;max-height:220px}#duel-result .duel-intro{padding:8px}#duel-result #result-symbol{font-size:42px}#duel-result #result-title{font-size:clamp(44px,10vh,90px)}#duel-result #result-note{font-size:11px}#back-lobby{min-height:60px;border-radius:18px}
@media(max-width:600px) and (orientation:portrait){body:not(.duel-playing) .duel-shell{padding:0 12px 26px;gap:4px}.duel-header>span{display:none}#lobby .duel-intro h1{font-size:24px}body:not(.duel-playing) #lobby{grid-template-rows:46px minmax(0,1fr)}.duel-lobby-grid{grid-template-columns:1fr;grid-template-rows:minmax(160px,.9fr) minmax(170px,1.1fr);gap:10px}.duel-create{display:grid;grid-template-columns:1fr 1.3fr;grid-template-rows:28px minmax(0,1fr);gap:8px;padding:10px}.duel-create #my-portrait{grid-row:1/3;height:100%}.duel-create h2{grid-column:2;font-size:12px}.duel-create #create-room{grid-column:2;min-height:80px;height:100%}.duel-rooms{padding:10px}body:not(.duel-playing) #waiting{grid-template-rows:38px minmax(100px,1fr) 150px 64px;gap:8px}#waiting-title{font-size:18px}.duel-seat strong{font-size:13px}}
@media(max-height:520px) and (orientation:landscape){body:not(.duel-playing) .duel-shell{grid-template-rows:54px minmax(0,1fr);gap:4px;padding-bottom:24px}body:not(.duel-playing) #lobby{grid-template-rows:34px minmax(0,1fr)}#lobby .duel-intro h1{font-size:23px}.duel-create{display:grid;grid-template-columns:1fr 1.2fr;grid-template-rows:24px minmax(0,1fr);padding:8px}.duel-create #my-portrait{grid-row:1/3;height:100%}.duel-create h2{font-size:12px}.duel-create #create-room{grid-column:2;min-height:66px}.duel-rooms{padding:8px}body:not(.duel-playing) #waiting{grid-template-columns:1fr 1.15fr;grid-template-rows:30px minmax(0,1fr) 56px;gap:6px 14px}#waiting>.duel-intro{grid-column:1/3}#waiting-title{font-size:18px}#roster{grid-column:1;grid-row:2/4;gap:8px}#waiting .duel-hero-picker{grid-column:2;grid-row:2}#start-duel{grid-column:2;grid-row:3;height:52px}.duel-seat span{font-size:8px}.duel-seat strong{font-size:12px}.duel-hero-options button{flex-basis:80px}.duel-header{height:54px!important}.duel-seat{padding:6px}}

#create-room svg{display:block!important;width:50px;height:50px}#create-room::before{content:none!important;display:none!important}#create-room{box-shadow:0 4px 0 #062e35!important}

/* Fit immediately on entry, including browser bars on an unfolded phone. */
body:not(.duel-playing),body.duel-playing{height:var(--duel-vh,100dvh)}
body:not(.duel-playing) .duel-shell,body.duel-playing .duel-shell{height:var(--duel-vh,100dvh);min-height:0;box-sizing:border-box}
body:not(.duel-playing) #waiting{grid-template-rows:38px minmax(0,1fr) clamp(112px,24vh,180px) 64px}
.duel-compact-height body:not(.duel-playing) .duel-shell{grid-template-rows:56px minmax(0,1fr);gap:4px;padding-bottom:24px}
.duel-compact-height body:not(.duel-playing) #waiting{grid-template-columns:1fr 1.15fr;grid-template-rows:30px minmax(0,1fr) 56px;gap:6px 12px}
.duel-compact-height #waiting>.duel-intro{grid-column:1/3}
.duel-compact-height #roster{grid-column:1;grid-row:2/4;gap:8px}
.duel-compact-height #waiting .duel-hero-picker{grid-column:2;grid-row:2}
.duel-compact-height #start-duel{grid-column:2;grid-row:3;height:52px}
.duel-compact-height #waiting-title{font-size:18px}.duel-compact-height .duel-seat{padding:6px}.duel-compact-height .duel-seat strong{font-size:12px}.duel-compact-height .duel-seat span{font-size:9px}
body.duel-playing .duel-shell .aim-stick{position:absolute!important}
