body {
    font-family: Arial, sans-serif;
    background: #14161b;
    color: #f0f0f0;
    text-align: center;
    padding: 40px 15px 0;
}

.contenedor {
    max-width: 600px;
    margin: auto;
    padding: 30px;
    border-radius: 10px;
    background: #1d2027;
    border-top: 5px solid #e10600;
}

h1 {
    font-style: italic;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(225, 6, 0, 0.5);
}

.consigna {
    color: #aab0bd;
    font-size: 0.95em;
}

button {
    margin-top: 12px;
    padding: 10px 16px;
    cursor: pointer;
    color: #fff;
    background: #2c313c;
    border: 1px solid #4a5160;
    border-radius: 6px;
}

button:hover:not(:disabled) {
    background: #3a4150;
}

.botones button {
    margin: 12px 4px 0;
}

.estadisticas p {
    display: inline-block;
    margin: 4px 9px;
    font-weight: bold;
    color: #c4c9d4;
}

/* ---------- Garaje ---------- */

.garage {
    margin: 18px 0 8px;
    padding: 10px;
    background: #15171c;
    border-radius: 8px;
}

#nombreAuto {
    margin: 0 0 4px;
    font-weight: bold;
}

button.color {
    width: 32px;
    height: 32px;
    margin: 3px;
    padding: 0;
    border: 2px solid #555;
    border-radius: 50%;
}

button.color:hover:not(:disabled) {
    transform: scale(1.12);
}

button.color.elegido {
    border-color: #fff;
    box-shadow: 0 0 10px #fff;
}

.propio {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.9em;
    color: #aab0bd;
}

.propio input {
    vertical-align: middle;
    width: 38px;
    height: 28px;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

/* ---------- Marcadores de números ---------- */

.marcadores {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 12px 0 16px;
}

.caja {
    min-width: 110px;
    padding: 8px 14px;
    border-radius: 8px;
    background: #101217;
    border: 2px solid #4a5160;
}

.caja span {
    display: block;
    font-size: 0.75em;
    color: #aab0bd;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.caja b {
    font-size: 2em;
    font-family: "Courier New", monospace;
}

.caja.objetivo {
    border-color: #e10600;
}

.caja.objetivo b {
    color: #ff6b5e;
}

.flecha {
    font-size: 1.6em;
    color: #777f90;
}

/* ---------- Pista ---------- */

#pista {
    position: relative;
    max-width: 440px;
    margin: 0 auto;
    padding: 0 14px;
    background: #2b2e36;
}

/* Pianos rojos y blancos a los costados */
#pista::before,
#pista::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 12px;
    background: repeating-linear-gradient(180deg, #e10600 0 16px, #fff 16px 32px);
}

#pista::before { left: 0; }
#pista::after  { right: 0; }

.meta {
    padding: 8px;
    background: conic-gradient(#fff 25%, #111 0 50%, #fff 0 75%, #111 0) 0 0 / 20px 20px;
}

.meta span {
    padding: 3px 12px;
    border-radius: 4px;
    background: #111;
    color: #fff;
    font-weight: bold;
    font-size: 0.9em;
}

.linea {
    display: grid;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.linea.salida {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: none;
}

.celda {
    position: relative;
    aspect-ratio: 1 / 1.1;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-right: 2px dashed rgba(255, 255, 255, 0.28);
    border-radius: 0;
    cursor: default;
}

.celda:last-child {
    border-right: none;
}

.celda:disabled {
    color: inherit;
}

/* Casillas a las que podés avanzar */
.celda.alcanzable {
    cursor: pointer;
    background: rgba(76, 217, 100, 0.16);
    outline: 2px solid #4cd964;
    outline-offset: -3px;
    animation: pulso 1s ease-in-out infinite alternate;
}

.celda.alcanzable:hover {
    background: rgba(76, 217, 100, 0.35);
}

@keyframes pulso {
    from { outline-color: rgba(76, 217, 100, 0.4); }
    to   { outline-color: rgba(76, 217, 100, 1); }
}

.celda.pasada .op {
    opacity: 0.4;
}

.celda.huella {
    background: rgba(255, 255, 255, 0.1);
}

.celda.invalida .op {
    opacity: 0.35;
    text-decoration: line-through;
}

.etiqueta-salida {
    font-size: 0.7em;
    letter-spacing: 1px;
    color: #777f90;
}

/* Operaciones */
.op {
    padding: 4px 9px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid;
    font-weight: bold;
    font-size: clamp(14px, 4vw, 20px);
}

.op.mas   { border-color: #4cd964; color: #c4ffd0; }
.op.menos { border-color: #ff6b6b; color: #ffd0d0; }
.op.por   { border-color: #5ac8fa; color: #d0f0ff; }
.op.div   { border-color: #c792ea; color: #f0dcff; }

/* Autos */
.auto {
    display: flex;
    justify-content: center;
    height: 84%;
}

.auto svg {
    height: 100%;
    width: auto;
}

.auto.jugador svg {
    filter: drop-shadow(0 0 5px #fff);
}

.auto.jugador.recien {
    animation: avanza 0.3s ease-out;
}

@keyframes avanza {
    from { transform: translateY(40%); opacity: 0.6; }
    to   { transform: translateY(0);   opacity: 1; }
}

.badge {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1px 8px;
    border-radius: 10px;
    background: #fff;
    color: #111;
    font-weight: bold;
    font-size: 0.8em;
}

.codigo {
    position: absolute;
    bottom: 1px;
    left: 0;
    right: 0;
    font-size: 9px;
    letter-spacing: 1px;
    color: #ccd;
}

#mensaje {
    min-height: 3em;
    margin-top: 16px;
    font-weight: bold;
}

@media (max-width: 480px) {
    .contenedor {
        padding: 20px 12px;
    }
    .caja {
        min-width: 90px;
    }
}
