173 lines
3.1 KiB
CSS
173 lines
3.1 KiB
CSS
body {
|
|
background: #eef2f3;
|
|
font-family: Arial, sans-serif;
|
|
text-align: center;
|
|
color: #222;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
h1 {
|
|
margin-top: 2rem;
|
|
color: #3498db;
|
|
font-size: 2.5rem;
|
|
line-height: 1.2;
|
|
}
|
|
|
|
/* Board responsive styles */
|
|
#board {
|
|
display: grid;
|
|
grid-template-columns: repeat(3, minmax(60px, 22vw));
|
|
grid-template-rows: repeat(3, minmax(60px, 22vw));
|
|
gap: 0.8em;
|
|
justify-content: center;
|
|
margin: 2rem auto 1.5rem auto;
|
|
max-width: 95vw;
|
|
}
|
|
|
|
/* Cell responsive styles */
|
|
.cell {
|
|
width: 100%;
|
|
height: 100%;
|
|
background: #fff;
|
|
border-radius: 0.5em;
|
|
box-shadow: 0 2px 8px #bbb;
|
|
font-size: 8em;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
transition: background 0.2s;
|
|
}
|
|
|
|
.cell:hover, .cell:focus {
|
|
background: #f1fafe;
|
|
}
|
|
|
|
#status {
|
|
font-size: 1.15em;
|
|
min-height: 2em;
|
|
margin-bottom: 1em;
|
|
word-break: break-word;
|
|
}
|
|
|
|
#restart-btn {
|
|
background: #3498db;
|
|
color: #fff;
|
|
font-size: 1em;
|
|
border: none;
|
|
border-radius: 0.7em;
|
|
padding: 0.7em 2em;
|
|
cursor: pointer;
|
|
transition: background 0.2s;
|
|
}
|
|
|
|
#restart-btn:hover,
|
|
#restart-btn:focus {
|
|
background: #297fb8;
|
|
}
|
|
|
|
/* SMALL DEVICES (phones) */
|
|
@media (max-width: 480px) {
|
|
h1 {
|
|
font-size: 1.5rem;
|
|
margin-top: 1rem;
|
|
}
|
|
#board {
|
|
grid-template-columns: repeat(3, minmax(40px, 28vw));
|
|
grid-template-rows: repeat(3, minmax(40px, 28vw));
|
|
gap: 0.5em;
|
|
margin: 1rem auto;
|
|
}
|
|
.cell {
|
|
font-size: 10em;
|
|
border-radius: 0.35em;
|
|
}
|
|
#status {
|
|
font-size: 1em;
|
|
min-height: 1.2em;
|
|
margin-bottom: 0.7em;
|
|
}
|
|
#restart-btn {
|
|
font-size: 0.95em;
|
|
padding: 0.6em 1.2em;
|
|
}
|
|
}
|
|
|
|
/* TABLETS */
|
|
@media (max-width: 768px) {
|
|
h1 {
|
|
font-size: 2rem;
|
|
}
|
|
#board {
|
|
grid-template-columns: repeat(3, minmax(50px, 22vw));
|
|
grid-template-rows: repeat(3, minmax(50px, 22vw));
|
|
}
|
|
.cell {
|
|
font-size: 10em;
|
|
}
|
|
}
|
|
|
|
/* BIG SCREENS */
|
|
@media (min-width: 1200px) {
|
|
#board {
|
|
grid-template-columns: repeat(3, 110px);
|
|
grid-template-rows: repeat(3, 110px);
|
|
gap: 1em;
|
|
}
|
|
.cell {
|
|
font-size: 3em;
|
|
}
|
|
}
|
|
/* Controles de partida y marcador */
|
|
#controls {
|
|
margin: 1rem auto 0.5rem auto;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 8px;
|
|
}
|
|
#controls select#first-player {
|
|
font-size: 1em;
|
|
padding: 6px 10px;
|
|
border-radius: 8px;
|
|
border: 1px solid #ddd;
|
|
}
|
|
#score {
|
|
margin: 0.6rem auto 0.4rem auto;
|
|
font-size: 1em;
|
|
color: #444;
|
|
}
|
|
|
|
/* Ajustes para botones-celda (accesibilidad) */
|
|
.cell {
|
|
border: none;
|
|
outline: none;
|
|
}
|
|
.cell:focus-visible {
|
|
box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.35);
|
|
}
|
|
|
|
/* Resaltado de combinación ganadora */
|
|
.win {
|
|
background: #eaf7ff;
|
|
box-shadow: 0 0 0 2px rgba(61, 90, 254, 0.25), 0 2px 10px rgba(61, 90, 254, 0.16);
|
|
}
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
#controls select#first-player {
|
|
background: #20233a;
|
|
color: #eaeaf0;
|
|
border-color: #2c3252;
|
|
}
|
|
#score {
|
|
color: #a0a3b0;
|
|
}
|
|
.cell:focus-visible {
|
|
box-shadow: 0 0 0 4px rgba(61, 90, 254, 0.35);
|
|
}
|
|
.win {
|
|
background: #172441;
|
|
box-shadow: 0 0 0 2px rgba(61, 90, 254, 0.35), 0 2px 12px rgba(61, 90, 254, 0.22);
|
|
}
|
|
} |