index.css 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. /* Donut Bingo — "fits viewport, no scrolling" layout
  2. This keeps EVERYTHING visible in the viewport by:
  3. - using a fixed, non-scrolling page (overflow:hidden)
  4. - giving the content a max height based on viewport
  5. - sizing the bingo board by the *smaller* of available width/height
  6. - making the inputs panel internally scroll-free by limiting how much it can take
  7. Drop in and replace your current CSS.
  8. */
  9. :root{
  10. --bg0:#0b1020;
  11. --bg1:#0f1730;
  12. --panel: rgba(255,255,255,.06);
  13. --panel2: rgba(255,255,255,.10);
  14. --border: rgba(255,255,255,.14);
  15. --text: rgba(255,255,255,.92);
  16. --muted: rgba(255,255,255,.70);
  17. --accent:#d4af37;
  18. --accent2:#3a5a85;
  19. --shadow: 0 14px 40px rgba(0,0,0,.35);
  20. --r: 16px;
  21. --r2: 12px;
  22. }
  23. *{margin:0;padding:0;box-sizing:border-box}
  24. /* Hard guarantee: no page scroll */
  25. html,body{
  26. height:100%;
  27. width:100%;
  28. overflow:hidden;
  29. }
  30. body{
  31. font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  32. color: var(--text);
  33. background:
  34. radial-gradient(1200px 600px at 18% 10%, rgba(212,175,55,.22), transparent 60%),
  35. radial-gradient(900px 520px at 92% 18%, rgba(58,90,133,.26), transparent 58%),
  36. linear-gradient(180deg, var(--bg0), var(--bg1));
  37. display:flex;
  38. flex-direction:column;
  39. align-items:center;
  40. justify-content:flex-start;
  41. }
  42. /* Title + start button are a fixed "header band" */
  43. h1{
  44. height: clamp(38px, 6vh, 54px);
  45. display:flex;
  46. align-items:center;
  47. justify-content:center;
  48. font-weight: 800;
  49. letter-spacing: .2px;
  50. font-size: clamp(20px, 2.6vh, 34px);
  51. line-height: 1;
  52. padding: 6px 10px 0;
  53. text-shadow: 0 6px 18px rgba(0,0,0,.35);
  54. }
  55. #start{
  56. height: clamp(34px, 5vh, 44px);
  57. margin: 6px 0 10px;
  58. padding: 0 16px;
  59. font-size: clamp(12px, 1.8vh, 16px);
  60. }
  61. /* Main area must consume the rest of the viewport */
  62. .contents{
  63. /* override your width/positioning */
  64. position: relative;
  65. width: min(1200px, 100vw);
  66. flex: 1 1 auto;
  67. /* no overflow, no scrolling */
  68. overflow:hidden;
  69. /* layout */
  70. display:grid;
  71. grid-template-columns: 300px 1fr;
  72. gap: 14px;
  73. /* padding kept small so it always fits */
  74. padding: 10px 12px 14px;
  75. /* critical: allow children to shrink */
  76. min-height: 0;
  77. min-width: 0;
  78. }
  79. /* Inputs panel */
  80. #inputs{
  81. position: static; /* override your absolute */
  82. display:flex;
  83. flex-direction:column;
  84. gap: 8px;
  85. background: var(--panel);
  86. border: 1px solid var(--border);
  87. border-radius: var(--r);
  88. padding: 12px;
  89. box-shadow: var(--shadow);
  90. backdrop-filter: blur(10px);
  91. /* key: allow panel to shrink with viewport */
  92. min-height: 0;
  93. }
  94. #inputs h2{
  95. font-size: 12px;
  96. letter-spacing: .14em;
  97. text-transform: uppercase;
  98. color: var(--muted);
  99. margin-top: 2px;
  100. }
  101. #saveInputs{
  102. height: 36px;
  103. font-size: 13px;
  104. width: 100%;
  105. }
  106. /* Inputs: compact to fit without scrolling */
  107. #inputs input{
  108. height: 30px;
  109. border-radius: 10px;
  110. border: 1px solid rgba(255,255,255,.14);
  111. background: rgba(0,0,0,.26);
  112. color: var(--text);
  113. padding: 0 10px;
  114. outline: none;
  115. transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  116. min-width: 0;
  117. }
  118. #inputs input:focus{
  119. border-color: rgba(212,175,55,.65);
  120. box-shadow: 0 0 0 3px rgba(212,175,55,.16);
  121. background: rgba(0,0,0,.20);
  122. }
  123. /* Buttons - shared */
  124. button{
  125. appearance:none;
  126. border: 1px solid rgba(255,255,255,.16);
  127. background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.06));
  128. color: var(--text);
  129. border-radius: 12px;
  130. font-weight: 800;
  131. letter-spacing: .2px;
  132. cursor: pointer;
  133. box-shadow: 0 10px 24px rgba(0,0,0,.25);
  134. transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease, filter .15s ease;
  135. }
  136. button:hover{
  137. border-color: rgba(255,255,255,.26);
  138. filter: brightness(1.04);
  139. }
  140. button:active{
  141. transform: translateY(1px);
  142. box-shadow: 0 6px 16px rgba(0,0,0,.22);
  143. }
  144. #start{
  145. border-color: rgba(212,175,55,.35);
  146. background: linear-gradient(180deg, rgba(212,175,55,.30), rgba(212,175,55,.12));
  147. }
  148. /* Bingo panel */
  149. .bingo{
  150. background: var(--panel);
  151. border: 1px solid var(--border);
  152. border-radius: var(--r);
  153. padding: 10px;
  154. box-shadow: var(--shadow);
  155. backdrop-filter: blur(10px);
  156. display:flex;
  157. align-items:center;
  158. justify-content:center;
  159. /* critical: allow the table to scale down */
  160. min-height: 0;
  161. min-width: 0;
  162. overflow:hidden;
  163. }
  164. /* Board sizing: use the available space without overflow.
  165. The table becomes a square whose side is limited by:
  166. - available width in the right column
  167. - available height inside .contents
  168. */
  169. table{
  170. border-collapse: separate;
  171. border-spacing: 8px;
  172. table-layout: fixed;
  173. /* Square that fits */
  174. width: min(100%, calc((100vh - 110px) * 0.98));
  175. height: min(100%, calc((100vh - 110px) * 0.98));
  176. }
  177. /* Cells */
  178. td{
  179. position: relative;
  180. border: 1px solid rgba(255,255,255,.14);
  181. border-radius: var(--r2);
  182. background: rgba(0,0,0,.22);
  183. overflow:hidden;
  184. text-align:center;
  185. vertical-align:middle;
  186. padding: 6px;
  187. cursor:pointer;
  188. box-shadow: 0 10px 22px rgba(0,0,0,.18);
  189. transition: transform .10s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease;
  190. }
  191. td:hover{
  192. transform: translateY(-1px);
  193. border-color: rgba(212,175,55,.35);
  194. background: rgba(0,0,0,.18);
  195. box-shadow: 0 14px 30px rgba(0,0,0,.22);
  196. }
  197. td p{
  198. display:-webkit-box;
  199. -webkit-line-clamp: 3;
  200. -webkit-box-orient: vertical;
  201. overflow:hidden;
  202. text-overflow: ellipsis;
  203. font-size: clamp(11px, 1.6vh, 18px);
  204. line-height: 1.1;
  205. font-weight: 800;
  206. letter-spacing: .15px;
  207. user-select:none;
  208. }
  209. /* Cross overlay */
  210. .cross{
  211. position:absolute;
  212. inset:0;
  213. width:100%;
  214. height:100%;
  215. pointer-events:none;
  216. opacity:.95;
  217. filter: drop-shadow(0 6px 14px rgba(0,0,0,.30));
  218. }
  219. .cross path{
  220. stroke: rgba(255, 64, 64, .85);
  221. stroke-width: 2.6;
  222. }
  223. /* Responsive: stack panels, still no scrolling */
  224. @media (max-width: 880px){
  225. .contents{
  226. grid-template-columns: 1fr;
  227. grid-template-rows: auto 1fr;
  228. }
  229. #inputs{
  230. /* keep inputs compact; still no scrolling */
  231. padding: 10px;
  232. }
  233. table{
  234. width: min(100%, calc((100vh - 140px) * 0.98));
  235. height: min(100%, calc((100vh - 140px) * 0.98));
  236. }
  237. }
  238. /* If the viewport is extremely short, tighten gaps and spacing */
  239. @media (max-height: 720px){
  240. h1{ height: 40px; font-size: 22px; padding-top: 4px; }
  241. #start{ height: 34px; margin: 4px 0 8px; }
  242. .contents{ gap: 10px; padding: 8px 10px 12px; }
  243. table{ border-spacing: 6px; }
  244. #inputs input{ height: 28px; }
  245. }