* { box-sizing: border-box; }

html {
  font-family: 'Avenir Next', Avenir, sans-serif;
  font-size: 3.0vmin;
  font-weight: 500;
  color: #555;
  height: 100%;
}

@media (max-width: 560px) {
  html {
    font-size: 4.5vmin;
  }
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  height: 100%;
}

.content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.play-surface {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  cursor: move;
  touch-action: none;
}

.content__center-frame {
  max-width: 100vh;
  pointer-events: none;
  touch-action: none;
}

.is-cub-hovered .play-surface {
  cursor: -webkit-grab;
  cursor: grab;
}

.is-cub-dragging .play-surface {
  cursor: -webkit-grabbing;
  cursor: grabbing;
}

canvas {
  display: block;
  margin: 0 auto;
  touch-action: none;
}

.instruction {
  padding: 1.0rem;
  margin: 0;
  text-align: center;
  width: 100%;
  pointer-events: none;
}

.button {
  font-family: 'Avenir Next', Avenir, sans-serif;
  font-weight: 500;
  font-size: 1.0rem;
  padding: 0.5rem 1.0rem;
  background: #BBB;
  color: white;
  border-radius: 1vh;
  border: none;
  cursor: pointer;
}

.button:hover {
  background: #09F;
}

.level-select-button {
  position: relative;
  z-index: 2; /* above canvas */
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
}

.content__button-row {
  text-align: center;
}

.next-level-button {
  padding: 0.75rem 2.0rem;
  background: #09F;
  opacity: 0;
  transform: scale(0.5);
  transition: transform 0.2s, opacity 0.2s;
}

.next-level-button:hover {
  background: #2BF;
}

.next-level-button.is-open {
  pointer-events: auto;
  opacity: 1;
  transform: scale(1);
}

/* ---- level list ---- */

.level-menu {
  position: absolute;
  background: #EEE;
  width: 100%;
  min-height: 100%;
  left: 0;
  top: 0;
  z-index: 3; /* above canvas, level select button */
  left: -100%;
  transition: left 0.2s;
}

.level-menu.is-open {
  left: 0;
}

.level-list {
  padding: 0.25rem;
  list-style: none;
  margin: 0;
  text-align: center;
}

.level-list__item {
  display: inline-block;
  background: #DDD;
  margin: 0.25rem;
  padding: 0.25rem;
  width: 3.5rem;
  height: 3.5rem;
  text-align: center;
  border-radius: 0.25rem;
  position: relative;
  opacity: 0.5;
  cursor: default;
}

.level-list__item.is-enabled {
  opacity: 1;
  cursor: pointer;
}

.level-list__item.is-enabled:hover {
  color: #09F;
  background: white;
}

.level-list__item.is-playing {
  background: #09F;
  color: white;
}

.level-list__item__number {
  display: block;
  font-size: 1.2rem;
  line-height: 1.3;
}

.level-list__item__blurb {
  display: block;
  font-size: 0.75rem;
}

.level-list__item__check {
  position: absolute;
  right: -0.3rem;
  top: -0.3rem;
  width: 1.0rem;
  height: 1.0rem;
  background: #6B6;
  border-radius: 0.5rem;
  display: none;
  align-items: center;
  justify-content: center;
}

.level-list__item__check svg {
  fill: none;
  stroke: white;
  stroke-width: 0.125rem;
}

.level-list__item.did-complete .level-list__item__check {
  display: flex;
}

/* ---- level pres ---- */

.levels { display: none; }

.level-menu__close-button {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 15px;
  border: none;
  background: #555;
  color: white;
  font-size: 24px;
  cursor: pointer;
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 0;
}

.level-menu__close-button:hover {
  background: #09F;
}

.level-menu__close-button svg {
  fill: none;
  stroke: white;
  stroke-width: 3;
}

/* ---- splash-screen ---- */

.splash-screen {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: #242424 url('CoolmathGames-800x600.png') center center no-repeat;
  background-size: contain;
  z-index: 10;
  transition: opacity 0.5s;
}
