1212
1313 --chess-panel-padding : 4rem ; /* total horizontal padding within chess panel (2 × 1rem + margins) */
1414
15- /* Board size: fills the 70 % chess panel minus padding, capped at 760 px */
16- --board-sz : clamp (320px , calc (70vw - var (--chess-panel-padding ) * 2 ), 760px );
15+ /* Board size: fills the 70 % chess panel minus padding, capped at 720 px.
16+ Also constrained by viewport height (subtracting ~280px for header 56px +
17+ player bars ~80px + controls ~40px + move history ~100px + gaps ~4px). */
18+ --board-sz : clamp (300px , min (calc (70vw - var (--chess-panel-padding ) * 2 ), calc (100vh - 280px )), 720px );
1719
1820 --text-primary : # e6edf3 ;
1921 --text-secondary : # 8b949e ;
5961 background : var (--bg-base );
6062 color : var (--text-primary );
6163 line-height : 1.5 ;
62- overflow-x : hidden;
64+ overflow : hidden;
6365}
6466
6567button { cursor : pointer; font-family : inherit; }
@@ -70,7 +72,8 @@ a { color: var(--accent-blue); }
7072# app {
7173 display : flex;
7274 flex-direction : column;
73- min-height : 100vh ;
75+ height : 100vh ;
76+ overflow : hidden;
7477}
7578
7679/* ── Header ────────────────────────────────────────────────── */
@@ -167,7 +170,7 @@ a { color: var(--accent-blue); }
167170 width : 70% ;
168171 min-width : 0 ;
169172 overflow-y : auto;
170- justify-content : center ;
173+ scrollbar-width : thin ;
171174}
172175
173176/* When SQL panel is hidden, chess panel fills the available space */
@@ -377,10 +380,11 @@ a { color: var(--accent-blue); }
377380 gap : .25rem ;
378381 padding : .5rem .6rem ;
379382 min-height : 2.5rem ;
380- max-height : 120 px ;
383+ max-height : 160 px ;
381384 overflow-y : auto;
382385 font-family : var (--font-mono );
383386 font-size : .8rem ;
387+ scrollbar-width : thin;
384388}
385389.move-pair {
386390 display : flex;
@@ -401,8 +405,8 @@ a { color: var(--accent-blue); }
401405
402406/* ── SQL Panel ──────────────────────────────────────────────── */
403407.sql-panel {
404- flex : 0 0 25 % ;
405- width : 25 % ;
408+ flex : 0 0 30 % ;
409+ width : 30 % ;
406410 display : flex;
407411 flex-direction : column;
408412 border-left : 1px solid var (--bg-border );
@@ -461,6 +465,7 @@ a { color: var(--accent-blue); }
461465 flex-direction : column;
462466 gap : .75rem ;
463467 scroll-behavior : smooth;
468+ scrollbar-width : thin;
464469}
465470
466471.sql-placeholder {
@@ -738,7 +743,7 @@ input:checked + .slider::before { transform: translateX(18px); }
738743/* ── SQL Input Section ──────────────────────────────────────── */
739744.sql-input-section {
740745 flex-shrink : 0 ;
741- border-top : 1px solid var (--bg-border );
746+ border-bottom : 1px solid var (--bg-border );
742747 background : var (--bg-surface );
743748 display : flex;
744749 flex-direction : column;
@@ -749,8 +754,9 @@ input:checked + .slider::before { transform: translateX(18px); }
749754 display : flex;
750755 align-items : center;
751756 justify-content : space-between;
752- padding : .4 rem .75 rem ;
757+ padding : .6 rem 1 rem ;
753758 border-bottom : 1px solid var (--bg-border );
759+ min-height : 44px ;
754760}
755761
756762.sql-input-title {
@@ -840,27 +846,31 @@ input:checked + .slider::before { transform: translateX(18px); }
840846}
841847
842848@media (max-width : 900px ) {
843- .app-main { flex-direction : column; }
849+ .app-main { flex-direction : column; overflow-y : auto; overflow-x : hidden; }
844850
845851 .chess-panel {
846852 flex : none;
847853 width : 100% ;
848- justify-content : flex-start;
854+ min-height : auto;
855+ overflow-y : visible;
849856 }
850857
851858 .sql-panel {
852859 flex : none;
853860 width : 100% ;
854861 border-left : none;
855862 border-top : 1px solid var (--bg-border );
856- max-height : 40vh ;
863+ height : 45vh ;
864+ min-height : 260px ;
857865 }
858866 .sql-panel .hidden-panel {
859- max-height : 0 ;
867+ height : 0 ;
868+ min-height : 0 ;
860869 border-top : none;
861870 }
862871
863- : root { --board-sz : min (90vw , 420px ); }
872+ /* Mobile: limit by both viewport width and height to handle short screens */
873+ : root { --board-sz : min (90vw , 440px , calc (55vh )); }
864874}
865875
866876@media (max-width : 480px ) {
0 commit comments