files
Juegos/buscaminas/styles.css
2025-08-21 23:42:55 +02:00

149 lines
3.0 KiB
CSS

/* ===== Diseño base ===== */
html {
box-sizing: border-box;
font-size: 16px;
}
*, *:before, *:after {
box-sizing: inherit;
}
body {
background: #f2f2f2;
font-family: Arial, sans-serif;
color: #222;
text-align: center;
margin: 0;
min-height: 100vh;
}
/* ===== Encabezado ===== */
h1 {
color: #d7263d;
margin-top: 2rem;
font-size: clamp(2rem, 4vw, 2.5rem);
}
/* ===== Tablero ===== */
#board {
display: grid;
grid-template-columns: repeat(10, 1fr);
gap: 0.7vw;
margin: 2.5rem auto 1.7rem auto;
background: #1565c0;
padding: 2vw;
border-radius: 1rem;
width: 100%;
max-width: 98vw;
}
/* Una celda */
.cell {
aspect-ratio: 1 / 1;
width: 100%;
background: #fff;
border-radius: 0.7rem;
box-shadow: 0 2px 8px #bbb;
font-size: clamp(1rem, 2.5vw, 1.4rem);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.15s;
user-select: none;
}
.cell.revealed { background: #bbdefb; cursor: default; }
.cell.mine { background: #d7263d; color: #fff; }
.cell.flag { background: #ffe082; color: #d7263d; }
/* ===== Estado y botón ===== */
#status {
font-size: 1.1rem;
min-height: 2em;
margin: 0.5em 0 0.7em 0;
}
#restart-btn {
background: #d7263d;
color: #fff;
font-size: clamp(1rem, 2vw, 1.3rem);
border: none;
border-radius: 0.7rem;
padding: 0.5em 2em;
cursor: pointer;
transition: background 0.2s;
margin-bottom: 1.2em;
margin-top: 1em;
}
#restart-btn:hover { background: #920c22; }
/* ========================================
===== Pantallas pequeñas (<720px) ====
======================================== */
@media (max-width: 720px) {
h1 {
margin-top: 3vw;
font-size: clamp(1.3rem, 6vw, 2.1rem);
}
#board {
/* Cambia columnas si el tablero lo permite */
grid-template-columns: repeat(6, 1fr);
padding: 4vw;
border-radius: 4vw;
gap: 2.8vw;
margin-top: 4vw;
margin-bottom: 6vw;
max-width: 99vw;
}
.cell {
font-size: clamp(1.2rem, 8vw, 2.5rem);
border-radius: 3vw;
}
#restart-btn {
font-size: clamp(1rem, 8vw, 2rem);
padding: 3vw 12vw;
border-radius: 3vw;
margin-bottom: 6vw;
margin-top: 3vw;
}
#status {
font-size: clamp(1rem, 7vw, 1.7rem);
}
}
/* ========================================
===== Pantallas muy pequeñas (<400px) ==
======================================== */
@media (max-width: 400px) {
#board {
grid-template-columns: repeat(4, 1fr);
padding: 2vw;
gap: 2vw;
border-radius: 5vw;
}
.cell { font-size: clamp(1rem, 10vw, 2.2rem); }
#restart-btn {
padding: 3vw 4vw;
font-size: clamp(0.9rem, 7vw, 1.5rem);
border-radius: 5vw;
}
}
/* ========================================
===== Pantallas grandes (>1200px) ====
======================================== */
@media (min-width: 1200px) {
#board {
max-width: 700px;
padding: 2rem;
gap: 0.7rem;
}
h1 {
font-size: clamp(2.5rem, 3vw, 3.5rem);
}
.cell {
font-size: clamp(1.3rem, 2vw, 2rem);
}
}
/* :::::::::::::::::::::::::::::: */