/* ========================================
   GENERAL
======================================== */

* {
    box-sizing: border-box;
}


html,
body {

    margin: 0;
    padding: 0;

    width: 100%;
    height: 100%;

}


body {

    font-family: sans-serif;

}


/* ========================================
   CONTAINER
======================================== */

.container {

    height: 100%;

    position: fixed;

    inset: 8px;

    border: double;

    min-width: 230px;

    overflow-y: auto;
    overflow-x: clip;

}


/* ========================================
   MOSAICO
======================================== */

#mosaic {

    width: 100%;

    overflow: hidden;

    border-bottom: double;

}


.mosaic-state {

    display: grid;

    width: 100%;

    overflow: hidden;

    /*
     * Estado base:
     *
     * 8 columnas
     * 2 filas
     */

    grid-template-columns:
        repeat(8, 1fr);

    --cell-size:
        calc(100vw / 8);

}


/* ========================================
   CELDAS
======================================== */

.cell {

    width: 100%;

    aspect-ratio: 1 / 1;

    min-width: 0;
    min-height: 0;

    overflow: hidden;

    display: flex;

    align-items: center;
    justify-content: center;

    border-right: 1px solid black;

    border-bottom: 1px solid black;

}


/* ========================================
   IMÁGENES
======================================== */

.image-cell img {

    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

}


/* ========================================
   LETRAS
======================================== */

.letter {

    font-family:
        Tahoma,
        sans-serif;

    font-size:
        calc(
            var(--cell-size) * 0.50
        );

    line-height: 1;

    color: black;

}


/* ========================================
   LOIS
======================================== */

.letter.lois {

    background: #e8e8e8;

}


/* ========================================
   COSTAS
======================================== */

.letter.costas {

    background: #d2d2d2;

}


/* ========================================
   DOS FILAS — 8 COLUMNAS
======================================== */

@media (max-width: 499px) {
	
#videoContainer {

	width: 90vw;
}
	
.footer h5 {font-size: x-small;
	}

    .mosaic-state {

        grid-template-columns:
            repeat(8, 1fr);

        --cell-size:
            calc(100vw / 8);

    }
 

    /*
     * Solo mostramos 16 celdas.
     */

    .mosaic-state .cell:nth-child(n + 17) {

        display: none;

    }

}

/* ========================================
   UNA FILA — 16 COLUMNAS
======================================== */

@media
(min-width: 500px)
and
(max-width: 999px) {
	
#videoContainer {

	width: 70vw;
}
	
.footer h5 {font-size: x-small;
	}
	
    .mosaic-state {

        grid-template-columns:
            repeat(16, 1fr);

        --cell-size:
            calc(100vw / 16);

    }


    /*
     * Solo mostramos 16 celdas.
     */

    .mosaic-state .cell:nth-child(n + 17) {

        display: none;

    }

}


/* ========================================
   FOOTER
======================================== */

footer {

    position: fixed;

    bottom: 0;

    inset-inline: 0;

    margin: 8px;

    border: double;

    background: white;

    min-width: 230px;

}


.footer {

    display: flex;

    justify-content: space-around;

    padding: 5px;

    margin: 0;

}


.footer h5 {

    margin: 0;

}


.footer a {

    text-decoration: none;

    color: black;

}


/* ========================================
   BLANK
======================================== */

.blank {

    position: fixed;

    bottom: 0;

    left: 0;
    right: 0;

    height: 8px;

    width: 100%;

    background: white;

}

/* ========================================
   VIDEO
======================================== */
#videoContainer {
	margin-top: 20px;
	position: relative;
	display: block;

	border: 1px solid #000;
	margin-left: 50%;
	transform: translate(-50%);
	
}

#videoContainer video {
	width: 100%;
	height: auto;
	display: block;
}

#overlay {
	position: absolute;
	top: 0; left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.6);
	color: white;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	font-size: calc(12px + 0.5vw);
}

#overlay input {
	padding: 5px;
	font-size: calc(14px + 0.3vw);
	margin-top: 5px;
	cursor: text;
}

#overlay button {
	padding: 5px;
	font-size: calc(14px + 0.3vw);
	margin-top: 5px;
	cursor: pointer;
}