/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}

/***** DEBUT DE LA FEUILLE DE STYLE *****/

body {
    font-family: 'Black Ops One', Verdana;
    font-size: 12px;
    --cell-width: 5vh;
    
    --colorFG: black;
    --colorBG: white;

    color: var(--colorFG);
    background-color: var(--colorBG);
}

* { 
    transition-property: color, background-color;
    transition-duration: 0.5s;
    transition-timing-function: ease;
}

body.dark {
    --colorFG: white;
    --colorBG: #000022;
}
body.dark:after {
    position: absolute; 
    top: 10px;
    right: 10px;
    content: '\01F319';
    font-size: 20px;
}


h1 {
    font-size: 72px;
    margin: 40px;
    text-align: center;
}

h2 {
    font-size: 30px;
    font-weight: bold;
    text-align: center;
    margin: 20px;
    position: relative;
}

/** Blocs de contenus, initialement cachés **/
main, nav {
    display: none;
}

/** Zone d'affichage de la liste des puzzles **/
#bcPuzzles {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 90%;
    margin: 10px auto;
}

#bcPuzzles > div {
    box-sizing: border-box;
    font-size: 32px;
    width: 150px;
    height: 180px;
    border: solid 2px var(--colorFG);
    margin: 20px;
    cursor: pointer;
    text-align: center;
    position: relative;
}
#bcPuzzles > div:before, #bcPuzzles > div:after {
    display: block;
    font-family: sans-serif;
    font-size: 16px;
    padding: 5px;
}
#bcPuzzles > div:before {
    content: 'Grille ' attr(data-size) 'x' attr(data-size) ' / ' attr(data-atoms);
    padding: 10px 0px 50px 0px;
}
#bcPuzzles > div[data-highscore]:after {
    content: '\01F3C6  ' attr(data-highscore);
    position: absolute; 
    bottom: 0;
    left: 0;
    width: 95%;
    text-align: center; 
}


/*** Ecran de jeu ***/

main > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#tabPlateau {
    display: block;
    margin: 20px;
    border-spacing: 5px;
    border-collapse: initial;
}

#tabPlateau td {
    cursor: pointer;
    vertical-align: middle;
    text-align: center;
    width: var(--cell-width);
    height: var(--cell-width); 
    background-color: var(--colorFG);    
    color: var(--colorBG);
    position: relative;
    font-size: 20px;
}

/** Cases périphériques **/
#tabPlateau tr:first-child > td, 
#tabPlateau tr:last-child > td, 
#tabPlateau td:first-child, 
#tabPlateau td:last-child {
    background-color: crimson;
    color: white;
}

/** Coins du tableau **/
#tabPlateau tr:first-child td:first-child,
#tabPlateau tr:first-child td:last-child,
#tabPlateau tr:last-child td:first-child,
#tabPlateau tr:last-child td:last-child {
    background-color: transparent;
    cursor: default;
}

/** Atomes possibles sur les cases intérieures **/
#tabPlateau tr:not(:first-child):not(:last-child) td:not(:first-child):not(last-child).atom:before {
    content: '';
    border-radius: 50%;
    width: calc(var(--cell-width) - 1vh);
    height: calc(var(--cell-width) - 1vh);
    position: absolute;
    top: 0.5vh;
    left: 0.5vh;
    display: block;
    background-color: green;
}

/** Cases périphériques : H, R ou numéro du rayon **/
#tabPlateau td[data-hit]:before {
    content: 'H';
}
#tabPlateau td[data-ray]:before {
    content: attr(data-ray);
}
#tabPlateau td[data-reflection]:before {
    content: 'R';
}


/** Bouton Retour et Valider **/
button {
    border: none;
    font-size: 16px;
    background-color: #3333FF;
    border-radius: 4px;
    color: white;
    padding: 5px 10px;
    width: 100px;
    cursor: pointer;
    display: inline-block;
    margin: 0 50px;
}
button:disabled {
    font-style: italic;
    background-color: #9999FF;
}