/* CSS classes you can use on your table td to display the relevant tile */
* {
  margin: 0;
  padding: 0;
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none;    /* Firefox */
  -ms-user-select: none;     /* Internet Explorer/Edge */
  user-select: none;         /* Non-prefixed version, currently supported by Chrome, Opera, and Edge */
  font-family: 'Courier New', Courier, monospace;
}

body.dark {
  transition: 0.5s linear;
  background-color: #151515;
  color: #fafafa;
}

body.light {
  transition: 0.5s linear;
  background-color: #fafafa;
  color: #151515;
}

.container {
  position: relative;
  margin: 2rem auto;
  display: grid;
  justify-content: center;
  max-width: 800px;
  min-width: 340px;
}

.title {
  display: grid;
  grid-template-columns: 80px 1fr 72px;
  height: 80px;
  align-items: center;
}

.title > div {
  justify-self: center;
}

h2 {
  text-shadow: 1px 1px 0 rgba(128, 128, 128, 0.5),
  1px -1px 0 rgba(128, 128, 128, 0.5),
  -1px 1px 0 rgba(128, 128, 128, 0.5),
  -1px -1px 0 rgba(128, 128, 128, 0.5);
  text-align: center;
}

.icon {
  height: 40px;
  width: 80px;
  position: relative;
}

.icon input {
  display: none;
}

.icon label {
  transition: 0.5s linear;
  position: absolute;
  width: 80px;
  height: 40px;
  border-radius: 20px;
  background-color: #333;
  border: 1px solid white;
  display: block;
  box-shadow: inset 0 0 8px #ff4757, 0 0 12px #ff4757;
}

.icon label::before {
  transition: 0.5s linear;
  position: absolute;
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4757;
  left: 56px;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px #ff4757, 0 0 16px #ff4757;
}

.icon i {
  transition: 0.5s linear;
  font-size: 28px;
  position: absolute;
  left: 16px;
  top: 8px;
  color: #333;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2),
  1px -1px 0 rgba(0, 0, 0, 0.2),
  -1px 1px 0 rgba(0, 0, 0, 0.2),
  -1px -1px 0 rgba(0, 0, 0, 0.2);
}

.icon input:checked ~ i {
  color: #add6ff;
  color: white;
  text-shadow: 0 0 2px #add6ff, 0 0 4px #add6ff, 0 0 8px #add6ff;
}

.icon input:checked ~ label {
  background-color: #ccc;
  box-shadow: inset 0 0 8px #add6ff, 0 0 16px #add6ff;
}

.icon input:checked ~ label::before {
  background: white;
  box-shadow: 0 0 8px #add6ff, 0 0 16px #add6ff;
}

#emoji {
  cursor: pointer;
  font-size: 36px;
  border: 3px solid #424242;
  padding: 8px;
  width: 50px;
  height: 50px;
  border-radius: 4px;
}

#indice {
  padding: 8px;
  text-align: center;
}

td.unopened {
  background: url('img/unopened.svg');
  cursor: pointer;
}
td.opened {
  background: url('img/opened.svg');
}
td.flagged {
  background: url('img/flag.svg');
}
td.question {
  background: url('img/question.svg');
}
td.mine {
  background: url('img/mine.png'), white;
}
td.mine-neighbour-1 {
  background: url('img/1.svg');
}
td.mine-neighbour-2 {
  background: url('img/2.svg');
}
td.mine-neighbour-3 {
  background: url('img/3.svg');
}
td.mine-neighbour-4 {
  background: url('img/4.svg');
}
td.mine-neighbour-5 {
  background: url('img/5.svg');
}
td.mine-neighbour-6 {
  background: url('img/6.svg');
}
td.mine-neighbour-7 {
  background: url('img/7.svg');
}
td.mine-neighbour-8 {
  background: url('img/8.svg');
}

table #minesweeper {
  margin: auto;
  margin-top: 3em;
  width: 320px;
  height: 320px;
  border: 1px solid #999;
  border-collapse: collapse;
}
table #minesweeper td {
  width: 32px;
  height: 32px;
  background-size: cover;
}

#result {
  position: absolute;
  top: 105%;
  left: 30%;
  display: none;
  grid-template-columns: 1fr 16px 96px;
}
@media (min-width: 1024px) {
  .title {
    margin-bottom: 8px;
  }
  #indice {
    display:none;
  }
  #result {
    position: absolute;
    top: 25%;
    left: 75%;
  }
}
