|
12 | 12 |
|
13 | 13 | --chess-panel-padding: 4rem; /* total horizontal padding within chess panel (2 × 1rem + margins) */ |
14 | 14 |
|
15 | | - /* Board size: fills the 70 % chess panel minus padding, capped at 720 px. |
| 15 | + /* Board size: fills the 68 % chess panel minus padding, capped at 720 px. |
16 | 16 | Also constrained by viewport height (subtracting ~280px for header 56px + |
17 | 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); |
| 18 | + --board-sz: clamp(300px, min(calc(68vw - var(--chess-panel-padding) * 2), calc(100vh - 280px)), 720px); |
19 | 19 |
|
20 | 20 | --text-primary: #e6edf3; |
21 | 21 | --text-secondary: #8b949e; |
@@ -166,8 +166,8 @@ a { color: var(--accent-blue); } |
166 | 166 | align-items: center; |
167 | 167 | padding: 1rem; |
168 | 168 | gap: .6rem; |
169 | | - flex: 0 0 70%; |
170 | | - width: 70%; |
| 169 | + flex: 0 0 68%; |
| 170 | + width: 68%; |
171 | 171 | min-width: 0; |
172 | 172 | overflow-y: auto; |
173 | 173 | scrollbar-width: thin; |
@@ -405,22 +405,25 @@ a { color: var(--accent-blue); } |
405 | 405 |
|
406 | 406 | /* ── SQL Panel ──────────────────────────────────────────────── */ |
407 | 407 | .sql-panel { |
408 | | - flex: 0 0 30%; |
409 | | - width: 30%; |
| 408 | + flex: 0 0 32%; |
| 409 | + width: 32%; |
| 410 | + min-width: 300px; |
410 | 411 | display: flex; |
411 | 412 | flex-direction: column; |
412 | 413 | border-left: 1px solid var(--bg-border); |
413 | 414 | background: var(--sql-bg); |
414 | 415 | overflow: hidden; |
415 | | - min-width: 0; |
416 | 416 | transition: width .25s ease, flex .25s ease, opacity .2s; |
417 | 417 | } |
418 | 418 | .sql-panel.hidden-panel { |
419 | 419 | flex: 0 0 0; |
420 | 420 | width: 0; |
| 421 | + /* Override the base min-width (300 px) so the panel collapses fully */ |
| 422 | + min-width: 0; |
421 | 423 | opacity: 0; |
422 | 424 | pointer-events: none; |
423 | 425 | border-left: none; |
| 426 | + overflow: hidden; |
424 | 427 | } |
425 | 428 |
|
426 | 429 | .sql-panel-header { |
@@ -459,13 +462,16 @@ a { color: var(--accent-blue); } |
459 | 462 | /* SQL content area */ |
460 | 463 | .sql-content { |
461 | 464 | flex: 1; |
| 465 | + min-height: 0; |
462 | 466 | overflow-y: auto; |
| 467 | + overflow-x: hidden; |
463 | 468 | padding: .75rem 1rem; |
464 | 469 | display: flex; |
465 | 470 | flex-direction: column; |
466 | 471 | gap: .75rem; |
467 | 472 | scroll-behavior: smooth; |
468 | 473 | scrollbar-width: thin; |
| 474 | + scrollbar-color: var(--bg-border) transparent; |
469 | 475 | } |
470 | 476 |
|
471 | 477 | .sql-placeholder { |
@@ -782,7 +788,9 @@ input:checked + .slider::before { transform: translateX(18px); } |
782 | 788 | font-size: .78rem; |
783 | 789 | line-height: 1.6; |
784 | 790 | padding: .6rem .75rem; |
785 | | - resize: none; |
| 791 | + resize: vertical; |
| 792 | + min-height: 7.5rem; |
| 793 | + max-height: 20rem; |
786 | 794 | outline: none; |
787 | 795 | transition: background .15s; |
788 | 796 | } |
@@ -845,41 +853,164 @@ input:checked + .slider::before { transform: translateX(18px); } |
845 | 853 | .sql-input-section { display: flex; } |
846 | 854 | } |
847 | 855 |
|
| 856 | +/* ── Responsive: Tablet (≤ 1024 px) ────────────────────────── */ |
| 857 | +@media (max-width: 1024px) { |
| 858 | + .sql-panel { |
| 859 | + flex: 0 0 36%; |
| 860 | + width: 36%; |
| 861 | + min-width: 260px; |
| 862 | + } |
| 863 | + .chess-panel { |
| 864 | + flex: 0 0 64%; |
| 865 | + width: 64%; |
| 866 | + } |
| 867 | + :root { |
| 868 | + --board-sz: clamp(280px, |
| 869 | + min(calc(64vw - var(--chess-panel-padding) * 2), calc(100vh - 280px)), |
| 870 | + 640px); |
| 871 | + } |
| 872 | +} |
| 873 | + |
| 874 | +/* ── Responsive: Mobile landscape / narrow (≤ 900 px) ──────── */ |
848 | 875 | @media (max-width: 900px) { |
849 | | - .app-main { flex-direction: column; overflow-y: auto; overflow-x: hidden; } |
| 876 | + .app-main { |
| 877 | + flex-direction: column; |
| 878 | + overflow: hidden; |
| 879 | + } |
850 | 880 |
|
851 | 881 | .chess-panel { |
852 | | - flex: none; |
| 882 | + flex: 0 0 auto; |
853 | 883 | width: 100%; |
| 884 | + max-height: 58vh; |
854 | 885 | min-height: auto; |
855 | | - overflow-y: visible; |
| 886 | + overflow-y: auto; |
| 887 | + scrollbar-width: thin; |
856 | 888 | } |
857 | 889 |
|
858 | 890 | .sql-panel { |
859 | | - flex: none; |
| 891 | + flex: 1 1 auto; |
860 | 892 | width: 100%; |
| 893 | + min-width: 0; |
| 894 | + min-height: 40vh; |
861 | 895 | border-left: none; |
862 | 896 | border-top: 1px solid var(--bg-border); |
863 | | - height: 45vh; |
864 | | - min-height: 260px; |
| 897 | + overflow: hidden; |
865 | 898 | } |
866 | 899 | .sql-panel.hidden-panel { |
867 | | - height: 0; |
| 900 | + flex: 0 0 0; |
868 | 901 | min-height: 0; |
| 902 | + height: 0; |
869 | 903 | border-top: none; |
| 904 | + overflow: hidden; |
| 905 | + } |
| 906 | + |
| 907 | + .sql-move-input { |
| 908 | + min-height: 5.5rem; |
870 | 909 | } |
871 | 910 |
|
872 | 911 | /* Mobile: limit by both viewport width and height to handle short screens */ |
873 | 912 | :root { --board-sz: min(90vw, 440px, calc(55vh)); } |
874 | 913 | } |
875 | 914 |
|
| 915 | +/* ── Responsive: Mobile portrait (≤ 600 px) ────────────────── */ |
| 916 | +@media (max-width: 600px) { |
| 917 | + .chess-panel { |
| 918 | + max-height: 54vh; |
| 919 | + padding: .6rem; |
| 920 | + } |
| 921 | + |
| 922 | + .sql-panel { |
| 923 | + min-height: 44vh; |
| 924 | + } |
| 925 | + |
| 926 | + .sql-move-input { |
| 927 | + min-height: 5rem; |
| 928 | + font-size: .75rem; |
| 929 | + } |
| 930 | + |
| 931 | + .sql-panel-header { |
| 932 | + padding: .4rem .75rem; |
| 933 | + } |
| 934 | + |
| 935 | + .sql-input-bar { |
| 936 | + padding: .45rem .75rem; |
| 937 | + } |
| 938 | + |
| 939 | + :root { --board-sz: min(90vw, 380px, calc(50vh)); } |
| 940 | +} |
| 941 | + |
| 942 | +/* ── Responsive: Small phone (≤ 480 px) ────────────────────── */ |
876 | 943 | @media (max-width: 480px) { |
877 | 944 | .app-header { padding: 0 .75rem; } |
878 | 945 | .header-logo .logo-text { display: none; } |
879 | | - .chess-panel { padding: .5rem; } |
| 946 | + .chess-panel { padding: .5rem; gap: .4rem; max-height: 52vh; } |
880 | 947 | .header-controls { gap: .3rem; } |
881 | 948 |
|
882 | | - :root { --board-sz: min(92vw, 360px); } |
| 949 | + .sql-panel { min-height: 46vh; } |
| 950 | + |
| 951 | + .sql-move-input { min-height: 4.5rem; } |
| 952 | + |
| 953 | + :root { --board-sz: min(92vw, 340px, calc(48vh)); } |
883 | 954 |
|
884 | 955 | #btnToggleSQL #sqlToggleLabel { display: none; } |
885 | 956 | } |
| 957 | + |
| 958 | +/* ── Responsive: Wide screens (≥ 1440 px) ──────────────────── */ |
| 959 | +@media (min-width: 1440px) { |
| 960 | + .sql-panel { |
| 961 | + flex: 0 0 28%; |
| 962 | + width: 28%; |
| 963 | + min-width: 340px; |
| 964 | + } |
| 965 | + .chess-panel { |
| 966 | + flex: 0 0 72%; |
| 967 | + width: 72%; |
| 968 | + } |
| 969 | + :root { |
| 970 | + --board-sz: clamp(400px, |
| 971 | + min(calc(72vw - var(--chess-panel-padding) * 2), calc(100vh - 280px)), |
| 972 | + 760px); |
| 973 | + } |
| 974 | +} |
| 975 | + |
| 976 | +/* ── Responsive: Very wide screens (≥ 1920 px) ─────────────── */ |
| 977 | +@media (min-width: 1920px) { |
| 978 | + .sql-panel { |
| 979 | + flex: 0 0 26%; |
| 980 | + width: 26%; |
| 981 | + min-width: 400px; |
| 982 | + } |
| 983 | + .chess-panel { |
| 984 | + flex: 0 0 74%; |
| 985 | + width: 74%; |
| 986 | + } |
| 987 | + .sql-move-input { |
| 988 | + min-height: 9rem; |
| 989 | + } |
| 990 | +} |
| 991 | + |
| 992 | +/* ── Responsive: Short landscape (height < 500 px) ─────────── */ |
| 993 | +/* e.g. phones in landscape orientation */ |
| 994 | +@media (max-height: 500px) { |
| 995 | + .chess-panel { |
| 996 | + max-height: 50vh; |
| 997 | + } |
| 998 | + .sql-panel { |
| 999 | + min-height: 48vh; |
| 1000 | + } |
| 1001 | + .sql-move-input { |
| 1002 | + min-height: 3rem; |
| 1003 | + max-height: 6rem; |
| 1004 | + } |
| 1005 | + .sql-input-bar { |
| 1006 | + min-height: 36px; |
| 1007 | + padding: .25rem .75rem; |
| 1008 | + } |
| 1009 | + .sql-input-actions { |
| 1010 | + padding: .25rem .5rem; |
| 1011 | + } |
| 1012 | + .sql-panel-header { |
| 1013 | + padding: .35rem .75rem; |
| 1014 | + } |
| 1015 | +} |
| 1016 | + |
0 commit comments