-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
394 lines (359 loc) · 12.8 KB
/
style.css
File metadata and controls
394 lines (359 loc) · 12.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
/* --- CSS Variables (Theme Definitions) --- */
:root {
--board-bg: #f0f0f0;
--cell-border: #ccc;
--player1-color: #4CAF50; /* Green */
--player1-light: #a5d6a7;
--player1-gloss: #c8e6c9;
--player2-color: #F44336; /* Red */
--player2-light: #ef9a9a;
--player2-gloss: #ffcdd2;
--empty-cell-bg: #ffffff;
--text-color: #333; /* Default text color (Dark for light theme) */
--text-light: #555;
--accent-color: #007bff;
--accent-dark: #0056b3;
--body-bg: #e9e9e9;
--popup-bg: rgba(255, 255, 255, 0.95);
--popup-shadow: rgba(0, 0, 0, 0.2);
--button-text: #fff;
--dominance-bg: #e0e0e0;
--font-stack: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
/* --cell-size will be set by JS */
--cell-size: 50px; /* Default/fallback size */
/* Orb count text color variables */
--orb-text-light-mode: #222; /* Dark text for light mode */
--orb-text-shadow-light-mode: 1px 1px 1px rgba(255,255,255,0.5); /* Lighter shadow */
--orb-text-dark-mode: rgba(255, 255, 255, 0.9); /* Whiteish text for dark mode */
--orb-text-shadow-dark-mode: 1px 1px 2px rgba(0,0,0,0.8); /* Darker shadow */
}
/* --- Dark Theme --- */
body.dark-theme {
--board-bg: #2c2c2c;
--cell-border: #555;
--player1-color: #66bb6a;
--player1-light: #4a5c4b;
--player1-gloss: #a5d6a7;
--player2-color: #ef5350;
--player2-light: #614444;
--player2-gloss: #ef9a9a;
--empty-cell-bg: #424242;
--text-color: #e0e0e0; /* Light text for dark theme */
--text-light: #bdbdbd;
--accent-color: #4dabf5;
--accent-dark: #007bff;
--body-bg: #1f1f1f;
--popup-bg: rgba(40, 40, 40, 0.95);
--popup-shadow: rgba(0, 0, 0, 0.5);
--button-text: #fff;
--dominance-bg: #555;
}
/* --- Global Styles --- */
* {
box-sizing: border-box;
}
html {
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
text-size-adjust: 100%;
height: 100%;
}
body {
font-family: var(--font-stack);
display: flex;
justify-content: center;
align-items: center;
min-height: 100%;
background-color: var(--body-bg);
color: var(--text-color);
margin: 0;
padding: 10px;
transition: background-color 0.3s ease, color 0.3s ease;
overflow-x: hidden;
}
h1 {
margin-top: 0;
margin-bottom: 15px;
color: var(--text-color);
font-size: 1.8em;
text-align: center; /* Center H1 text globally */
}
h2 {
margin-top: 0;
margin-bottom: 10px;
font-size: 1.2em;
text-align: center; /* Center H2 text globally */
}
/* --- Theme Toggle Button --- */
.theme-toggle {
position: fixed;
top: 10px;
right: 10px;
background: var(--empty-cell-bg);
color: var(--text-color);
border: 1px solid var(--cell-border);
border-radius: 50%;
width: 35px;
height: 35px;
font-size: 1.2em;
cursor: pointer;
z-index: 1001;
box-shadow: 0 1px 4px rgba(0,0,0,0.15);
transition: background-color 0.3s ease, color 0.3s ease, transform 0.1s ease, border-color 0.3s ease;
line-height: 35px;
text-align: center;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
}
.theme-toggle:hover { background-color: var(--board-bg); }
.theme-toggle:active { transform: scale(0.95); }
/* --- Setup Screen Styles --- */
.setup-screen {
background-color: var(--board-bg);
padding: 20px 25px;
border-radius: 8px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 450px;
display: block; /* Keep as block */
text-align: center; /* Center inline/inline-block/text children */
transition: background-color 0.3s ease;
margin: auto; /* Center the block itself */
}
.setup-options {
margin-bottom: 20px;
width: 100%;
text-align: center; /* Center H2 and difficulty buttons container */
}
/* General Button Styling */
.setup-button, .start-button, .reset-button {
padding: 10px 18px;
font-size: 0.95em;
font-weight: bold;
color: var(--button-text);
background-color: var(--accent-color);
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.1s ease;
margin: 5px;
-webkit-tap-highlight-color: transparent;
display: inline-block; /* Ensure buttons flow correctly */
vertical-align: middle;
}
.setup-button:hover, .start-button:hover, .reset-button:hover { background-color: var(--accent-dark); }
.setup-button:active, .start-button:active, .reset-button:active { transform: scale(0.98); }
/* Specific Button Overrides */
.start-button {
background-color: var(--player1-color);
/* margin-top is handled by the wrapper now */
/* align-self: center; Removed */
/* No specific display needed, uses general button rule */
}
.start-button:hover { background-color: #388E3C; }
body.dark-theme .start-button { background-color: var(--player1-color); }
body.dark-theme .start-button:hover { background-color: #81c784; }
/* *** Style the new wrapper *** */
.start-button-wrapper {
margin-top: 15px; /* Add space above the wrapper */
/* The wrapper itself is centered by text-align:center on .setup-screen */
/* No explicit width needed, it will shrink-wrap the button */
display: block; /* Make sure it takes up its own line if needed */
}
.difficulty-buttons {
display: flex; /* Keep flex here for the row layout */
justify-content: center;
gap: 8px;
flex-wrap: wrap;
}
.difficulty-button.selected { background-color: var(--accent-dark); box-shadow: inset 0 0 5px rgba(0,0,0,0.3); }
/* --- Game Container & Elements --- */
.game-container {
background-color: var(--board-bg);
padding: 15px;
border-radius: 8px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
text-align: center;
transition: background-color 0.3s ease;
width: 100%;
max-width: 95vmin;
max-height: 95vh;
display: flex;
flex-direction: column;
margin: auto;
}
/* --- Dominance Bar Styling --- */
.dominance-bar-container {
padding: 0 5px;
margin-bottom: 12px;
width: 100%;
max-width: 400px;
margin-left: auto;
margin-right: auto;
}
.dominance-bar {
display: flex; height: 8px;
background-color: var(--dominance-bg);
border-radius: 4px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}
.dominance-fill { height: 100%; transition: width 0.5s ease-out; width: 50%; }
.dominance-fill.p1 { background-color: var(--player1-color); border-radius: 4px 0 0 4px; }
.dominance-fill.p2 { background-color: var(--player2-color); border-radius: 0 4px 4px 0; }
.dominance-fill.p1:only-child, .dominance-fill.p2:only-child { border-radius: 4px; }
.dominance-fill.p1:last-child:not(:first-child) { border-radius: 0 4px 4px 0;}
.dominance-fill.p2:first-child:not(:last-child) { border-radius: 4px 0 0 4px;}
/* --- Status Bar & Player Info --- */
.status-bar {
display: flex; justify-content: space-between; align-items: center;
padding: 8px; background-color: var(--empty-cell-bg);
border-radius: 5px; transition: background-color 0.3s ease;
width: 100%;
max-width: 500px;
font-size: 0.9em;
margin: 0 auto 12px auto; /* top, auto, bottom, auto */
}
.player-info {
padding: 4px 10px;
border-radius: 15px; font-weight: bold;
transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
border: 2px solid transparent;
white-space: nowrap;
}
.player-info.player1 { background-color: var(--player1-light); color: var(--player1-color); }
.player-info.player2 { background-color: var(--player2-light); color: var(--player2-color); }
.player-info.active { border-color: var(--text-color); }
.orb-count { display: inline-block; margin-left: 5px; background-color: rgba(0,0,0,0.1); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.status-message { font-weight: bold; flex-grow: 1; text-align: center; padding: 0 8px; color: var(--text-light); transition: color 0.3s ease; }
/* --- Game Board & Cells --- */
.board-outer-container {
width: 100%;
display: flex;
justify-content: center;
margin-bottom: 15px;
overflow: hidden;
}
.board-container {
display: inline-block;
border: 1px solid var(--cell-border);
transition: border-color 0.3s ease;
line-height: 0;
}
.game-board {
display: grid;
background-color: var(--board-bg);
transition: background-color 0.3s ease;
}
.cell {
width: var(--cell-size); height: var(--cell-size);
background-color: var(--empty-cell-bg);
border: 1px solid var(--cell-border);
position: relative; cursor: pointer;
transition: background-color 0.2s ease, border-color 0.3s ease;
overflow: visible;
display: flex;
justify-content: center;
align-items: center;
-webkit-tap-highlight-color: rgba(0,0,0,0.1);
}
.cell:hover:not(.game-over):not(.ai-thinking) { background-color: var(--cell-border); }
.game-board.game-over .cell,
.game-board.ai-thinking .cell {
cursor: not-allowed;
opacity: 0.8;
}
.game-board.game-over .cell.p1,
.game-board.game-over .cell.p2 {
opacity: 0.9;
}
/* --- Orb Styles (Multiple Visual Orbs) --- */
.orb {
border-radius: 50%;
position: absolute;
transition: transform 0.15s ease-out, background 0.2s ease;
background: var(--empty-cell-bg);
box-shadow: inset 0 -2px 3px rgba(0,0,0,0.2), 0 2px 3px rgba(0,0,0,0.25);
transform-origin: center center;
}
.orb.p1 { background: radial-gradient(circle at 35% 35%, var(--player1-gloss), var(--player1-color) 70%); }
.orb.p2 { background: radial-gradient(circle at 35% 35%, var(--player2-gloss), var(--player2-color) 70%); }
/* Positioning for Multiple Visual Orbs */
.cell .orb:nth-child(1):is(.orb-visual-count-1) { width: 65%; height: 65%; top: 17.5%; left: 17.5%; }
.cell .orb:is(.orb-visual-count-2) { width: 50%; height: 50%; }
.cell .orb:nth-child(1):is(.orb-visual-count-2) { top: 15%; left: 15%; }
.cell .orb:nth-child(2):is(.orb-visual-count-2) { top: 35%; left: 35%; }
.cell .orb:is(.orb-visual-count-3) { width: 45%; height: 45%; }
.cell .orb:nth-child(1):is(.orb-visual-count-3) { top: 12%; left: 27.5%; }
.cell .orb:nth-child(2):is(.orb-visual-count-3) { top: 43%; left: 10%; }
.cell .orb:nth-child(3):is(.orb-visual-count-3) { top: 43%; left: 45%; }
/* Orb count text - Bottom Right */
.orb-count-text {
position: absolute;
bottom: 2px;
right: 4px;
font-size: calc(max(8px, var(--cell-size) * 0.28));
font-weight: bold;
color: var(--orb-text-light-mode);
text-shadow: var(--orb-text-shadow-light-mode);
pointer-events: none;
line-height: 1;
z-index: 2;
transition: color 0.3s ease, text-shadow 0.3s ease;
}
/* Dark theme override for orb count text */
body.dark-theme .orb-count-text {
color: var(--orb-text-dark-mode);
text-shadow: var(--orb-text-shadow-dark-mode);
}
/* --- Orb Animations --- */
@keyframes orb-appear {
0% { transform: scale(0); opacity: 0; }
60% { transform: scale(1.15); opacity: 1; }
80% { transform: scale(0.98); }
100% { transform: scale(1); opacity: 1; }
}
/* --- Win Popup Styles --- */
.win-popup-overlay {
position: fixed; inset: 0; background-color: rgba(0, 0, 0, 0.5);
display: flex; justify-content: center; align-items: center;
z-index: 1000; opacity: 0;
transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
pointer-events: none;
padding: 15px;
backdrop-filter: blur(3px);
-webkit-backdrop-filter: blur(3px);
}
.win-popup-overlay.visible {
opacity: 1; pointer-events: auto;
}
.win-popup-content {
background-color: var(--popup-bg); color: var(--text-color);
padding: 25px 30px; border-radius: 8px; text-align: center;
box-shadow: 0 5px 20px var(--popup-shadow); transform: scale(0.9);
transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
max-width: 90%;
}
.win-popup-overlay.visible .win-popup-content { transform: scale(1); }
.win-popup-content h2 { margin-top: 0; margin-bottom: 20px; color: var(--text-color); font-size: 1.4em; }
/* --- Media Queries for Responsiveness --- */
@media (max-width: 600px) {
body { padding: 5px; }
h1 { font-size: 1.5em; margin-bottom: 10px; }
.setup-screen { padding: 15px 20px; }
.game-container { padding: 10px; max-width: 100%; }
.status-bar { padding: 6px; font-size: 0.8em; }
.player-info { padding: 3px 8px; }
.orb-count { margin-left: 4px; padding: 1px 4px; }
.reset-button { padding: 8px 15px; font-size: 0.9em; }
.win-popup-content { padding: 20px 25px; }
.win-popup-content h2 { font-size: 1.2em; }
.theme-toggle { width: 32px; height: 32px; font-size: 1.1em; line-height: 32px; top: 8px; right: 8px; }
}
@media (max-width: 360px) {
h1 { font-size: 1.3em; }
.status-bar { font-size: 0.75em; }
.setup-button, .start-button, .reset-button { font-size: 0.85em; padding: 8px 12px; margin: 3px;}
.difficulty-buttons { gap: 5px; }
.orb-count-text { font-size: calc(max(7px, var(--cell-size) * 0.26)); }
}