/* general  */

body {
  position: fixed;
  width: 100%;
  margin: 0;
  font-family: 'iosevka ss05', Menlo, 'Andale Mono', monospace;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  font-size: 13px;
}
@media (min-width: 400px) {
  body {
    font-size: 14px;
  }
}
@media (min-width: 768px) {
  body {
    font-size: 16px;
  }
}
@media (min-width: 1200px) {
  body {
    font-size: 18px;
  }
}
#app {
  height: 100vh;
}
.main {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 1.6s ease-in-out;
}
.main.has-initially-loaded {
  opacity: 1;
}

/* board  */

.board-container {
  width: 90vw;
  margin: -2em auto 0; /* offset .above-board padding-bottom */
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (min-width: 768px) {
  .board-container {
    padding: 1em 0;
  }
}
.above-board {
  display: flex;
  justify-content: space-between;
  padding-bottom: 1em; /* offset by .board-container top margin */
  color: #333;
}
.above-board .left,
.above-board .right {
  min-width: 100px;
}
.above-board .center {
  flex: 1;
  text-align: center;
}
.above-board .right {
  text-align: right;
}
.board {
  position: relative;
  width: 100%;
  margin: 0 auto;
  font-weight: bold;
  text-shadow: 1px 1px 0px #ededed, 0 0 20px #fff;
  text-align: center;
  border: 3px solid #f1f1f1;
}
.board:before {
  content: '';
  position: absolute;
  left: -2px;
  right: -2px;
  top: -2px;
  bottom: -2px;
  background: linear-gradient(to bottom left, #f3f3f3, #eee);
  transition: opacity 1.6s ease-in-out;
}
.board.lose:before {
  background: linear-gradient(to bottom left, #ffcfdf, #ff8c94);
}
.board.win:before {
  background: linear-gradient(to bottom left, #e3f1db, #9cc985);
}
.board-inner {
  position: relative;
  left: 0;
  top: 0;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-gap: 1px;
  background: #ddd;
  text-align: center;
}
.constrain-width {
  width: 100%;
  margin: 0 auto;
}
@media (min-width: 480px) {
  .constrain-width {
    width: 80%;
  }
}
@media (min-width: 768px) {
  .constrain-width {
    width: 70%;
  }
}
@media (min-width: 768px) {
  .constrain-width {
    width: 62vh;
  }
}

/* square  */

.square {
  display: block;
  position: relative;
  height: 0;
  padding-bottom: 100%;
  background: #eee;
  overflow: hidden;
}
.square.is-revealed {
  background: #fcfcfc;
}
.square.is-flag.is-mistake:before,
.square.is-flag.is-mistake:after {
  content: '';
  position: absolute;
  width: 160%;
  height: 2px;
  background: #999;
  top: 50%;
  left: 50%;
  transform-origin: 0%;
  z-index: 2;
}
.square.is-flag.is-mistake:before {
  transform: rotate(45deg) translateX(-50%) translateY(-50%);
}
.square.is-flag.is-mistake:after {
  transform: rotate(-45deg) translateX(-50%) translateY(-50%);
}
.square.is-mine.is-final {
  background: #ff8c94; /* red */
}

.square-inner {
  position: absolute;
  line-height: 0;
  top: 50%;
  left: 50%;
  transform: translateY(-50%) translateX(-50%);
  z-index: 1;
}
.square-inner svg {
  transform: scale(1.4);
}

.is-revealed .square-3d-cover {
  display: none;
}
.square-3d-cover {
  pointer-events: none;
}
/* triangle in the top left */
.square-3d-cover:before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(to bottom left, #f5f5f5, #f2f2f2);
  clip-path: polygon(0 100%, 0 0, 100% 0);
}
/* triangle in the bottom right */
.square-3d-cover:after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(to bottom left, #dadada, #ddd);
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
}
/* square in the middle that partially covers the triangles, */
/* leaving the triangle edges showing to look like a bezeled corners */
.square-3d-top {
  position: absolute;
  left: 11%;
  right: 11%;
  top: 11%;
  bottom: 11%;
  background: linear-gradient(to bottom right, #e1e1e1, #e3e3e3);
  z-index: 1;
}
.square:hover .square-3d-top {
  background: linear-gradient(to bottom right, #e9e9e9, #eaeaea);
}

/* utils */

.is-dimmed {
  opacity: 0.5;
}
.is-disabled {
  opacity: 0.3;
  pointer-events: none;
  cursor: default;
}
.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.pointer-events-none {
  pointer-events: none;
}
