* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  --blue-border-color: #0000C0;
  --translucent-white-color: rgba(255, 255, 255, 0.33);
  --table-border-color: #000;
  --table-header-color: #9040E7;
  --table-header-hover-color: #CE0CFF;
  --table-cell-color: var(--translucent-white-color);
  --table-cell-hover-color: rgba(240, 144, 240, 0.5);
  
  
  --table-unknown-color: #444;
  --table-prime-color: #7627ca;
  --table-strong-prime-color: #00F;
  --table-weak-prime-color: #070;
  --table-composite-color: #F00;
  
  --scrollbar-width: 17px; /* todo: calculate in JS */
  --viewport-width: calc(100vw - var(--scrollbar-width));
  
  width: 100%;
  height: 100%;
}
body {
  background: #8598BD url(/assets/img/background.png) repeat;
  display: inline-flex;
  flex-direction: column;
  min-width: 100%;
  min-height: 100%;
  text-align: center;
}

section, header, footer {
  background: inherit;
  position: sticky;
  left: 0;
  width: var(--viewport-width);
}
section {
  padding: 20px;
  padding-top: 10px;
}
section > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}
footer {
  padding-top: 20px;
  flex: 1 0 auto;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}



p,h1,h2,ol,ul{
  text-indent: 25px;
  padding-left: 10px;
  font: bold 16px arial, sans-serif;
  border-left: 5px solid var(--blue-border-color);
  background-color: var(--translucent-white-color);
}
p{
  padding-right: 40px; /* for mathjax formula number at right */
}
ol,ul{
  text-indent: 6px;
  padding-left: 29px;
}
ol{
  text-indent: 6px;
  padding-left: 50px;
}
p:empty{
  height: 20px;
  border: none;
}
/* headers */
h2{
  color: #000078;
  font-size: 32px;
  text-transform: capitalize;
  text-shadow: 1px 1px 1px #505050;
  margin-bottom: 20px;
  margin-top: 20px;
}
h2>a{
  color: #000078;
  display: none;
  margin-left: 7px;
  text-decoration: none;
}
h2:hover>a{
  display: inline;
}

/* big header */
header {
  text-align: left;
  padding-top: 20px;
}
h1{
  text-indent: 0;
  padding-left: 30px;
  font-size: 72px; /* for small screens, for bigger - in the end*/
  border-left-width: 15px; color: #000078;
  text-shadow: 3px 3px 3px #505050;
  margin-left: 20px;
  margin-bottom: 20px;
}
@media (max-width: 1024px) {
  h1{
    font-size: 7vw; /* 7% of screen width */
  }
}
@media (max-width: 685px) {
  h1{
    font-size: 48px;
  }
}







/* Button & Checkbox & Submit button */
input[type="checkbox"]{
  display: none;
}
input[type="checkbox"]+label,button{
  cursor: pointer;
  user-select: none; /* do not select on dbl-click */
}
label img, label svg, a.image * {
  pointer-events: none; /* make image in label clickable in IE11 */
}
a.figure {
  display: block;
  overflow: hidden;
}

nav>form>input[type="checkbox"]+label{
  width: 120px;
}
.poly-container {
  display: flex;
  flex-flow: row wrap;
  padding-bottom: 5px;
}
.poly-container input[type="checkbox"] + label {
  margin-bottom: 5px;
}
.poly-container input[type="checkbox"].set-button + label {
  width: 120px;
  margin-right: 5px;
}


a.b,input[type="checkbox"]+label,button{
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 40px;
  max-width: 400px;
  min-height: 33px;
  max-height: 100px;
  box-sizing: border-box;
  
  font: bold 12px arial, sans-serif;
  text-decoration: none;
  text-transform: capitalize;
  padding: 0 7px 0 7px; /* top right bottom left */
  border-style: solid;
  border-width: 6px;
  color: #000;
  background-color: #5A67F1;
  border-top-color: rgba(255, 255, 255, 0.4);
  border-left-color: rgba(255, 255, 255, 0.2);
  border-right-color: rgba(0, 0, 0, 0.2);
  border-bottom-color: rgba(0, 0, 0, 0.4);
}
a.b:hover, input[type="checkbox"] + label:hover, button:hover {
  filter: brightness(1.2);
}
a.b:active, input[type="checkbox"] + label:active, button:active {
  border-width: 4px;
  line-height: 25px;
  padding: 0 9px 0 9px; /* top right bottom left */
}
a.b>img,input[type="checkbox"]+label>img, a.b>svg,input[type="checkbox"]+label>svg{
  padding: 0; margin: 0; border: none;
  vertical-align: middle;
}
a.h, input[type="checkbox"]:checked + label {
  background-color: #9D47D6;
}
input[type="checkbox"].gg + label {
  filter: grayscale(60%);
}
input[type="checkbox"]:disabled + label, button:disabled, input[type="checkbox"].g + label {
  filter: grayscale(100%);
}
input[type="checkbox"].gg + label:hover {
  filter: grayscale(60%) brightness(1.2);
}
input[type="checkbox"]:disabled + label:hover, button:disabled:hover, input[type="checkbox"].g + label:hover {
  filter: grayscale(100%) brightness(1.2);
}

/* <proof> */
.proofcontainer{
  background-color: var(--translucent-white-color);
  padding: 5px;
  overflow: hidden;
  text-align: center;
}
.proofcontainer>input[type="checkbox"]+label{
  float: none;
}
.proofcontainer>div.proof{
  display: none;
  text-align: left;
  border: 1px solid blue;
  padding: 5px;
  margin-top: 5px;
}
.proofcontainer>div.proof>*{
  background: none;
  border: none;
}
.proofcontainer>input[type="checkbox"]:checked +label+div.proof{
  display: block;
}
/* </proof> */

input[type="email"]{
  height: 20px;
}
textarea{
  vertical-align: top; /* remove strange space under*/
}

div.w{
  background-color: var(--translucent-white-color);
  padding: 0 0 5px 40px; /* top right bottom left */
  overflow: hidden;
}
/* menu container */
div.white,nav,figure{
  background-color: var(--translucent-white-color);
  padding: 5px;
  overflow: hidden;
  text-align: center;
}

div.white>img,figure>img,div.white>svg,figure>svg{
  margin: 15px;
  max-width: 1160px;
  vertical-align: middle;
}
body>header>nav>a+b{
  display: none;
}
body>header>nav>a.b{
  width: 160px;
}






#game{
  background-color: var(--translucent-white-color);
  background-image: url(/assets/img/grid.png);
  display: block;
  margin: 20px auto;
  position: relative;
}
#game div{
  display: block;
  position: absolute;
  -webkit-user-select: none; /* do not select on dbl-click */
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* TABLE */

.grid-table {
  --col-cnt: 2;
  display: inline-grid;
  justify-content: center;
  width: auto;
  grid-template-rows: auto;
  grid-template-columns: repeat(var(--col-cnt), auto);
  grid-auto-rows: auto;
  grid-auto-flow: row;
}

.grid-table > * {
  text-align: center;
  font-size: 18px;
  /* font-family: monospace, monospace; */
  vertical-align: middle;
  padding: 0 2px; /* top&bottom left&right */
  border-right: 1px solid var(--table-border-color);
  border-bottom: 1px solid var(--table-border-color);
  white-space: nowrap;
  background-color: var(--table-cell-color);
  color: var(--table-unknown-color);
  
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: stretch;
}

.column-1, .row-1 {
  background-color: var(--table-header-color);
  color: #000;
  font-weight: bold;
  position: sticky;
  z-index: 1;
}
.column-1 {
  left: 0;
  border-left: 1px solid var(--table-border-color);
}
.row-1 {
  top: 0;
  border-top: 1px solid var(--table-border-color);
}
.column-1.row-1 {
  z-index: 2;
}

.grid-table > .bold {
  font-weight: bold;
}

.grid-table > * a, .grid-table > * a:visited {
  cursor: pointer;
  color: inherit;
  text-decoration: underline;
}

span.gray {
  color: var(--table-unknown-color);
}
.grid-table > .red, span.red {
  color: var(--table-composite-color);
}
.grid-table > .blue, span.blue {
  color: var(--table-strong-prime-color);
}
.grid-table > .green, span.green {
  color: var(--table-weak-prime-color);
}
.grid-table > .purple, span.purple {
  color: var(--table-prime-color);
}