html, body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: #000;
  font-family: "Clear Sans", "Helvetica Neue", Arial, sans-serif;
  background: url('/img/megabg.jpg');
  background-attachment: fixed;
  background-position: top center;
  background-repeat: no-repeat;
}

body {
  margin: 30px 0;
}

.container {
  width: 500px;
  margin: 0 auto;
}

header:after, .heading:after {
  content: "";
  display: block;
  clear: both;
}
h1, h1.title {
  color: #333;
  font-size: 36px;
  font-weight: bold;
  margin: 0;
  display: block;
  float: left;
  letter-spacing: 1px;
}

.scores {
  float: right;
  text-align: right;
  margin-top: 0;
}
.scores div {
  background: none;
  color: #222;
  border: none;
  border-radius: 0;
  font-weight: bold;
  padding: 0 0 0 10px;
  font-size: 1.13em;
  min-width: 80px;
  display: inline-block;
  text-decoration: underline;
  line-height: 36px;
  vertical-align: top;
}

main {
  clear: both;
}

#game-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 15px;
  background: rgba(0,0,0,0.10);
  border-radius: 6px;
  width: 500px;
  height: 500px;
  margin: 24px auto 0 auto;
  box-sizing: border-box;
  padding: 15px;
}

.tile {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  background: #eee4da;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px #8f7a6611;
  transition: background 0.15s;
}
.tile img {
  max-width: 90%;
  max-height: 90%;
  display: block;
  margin: auto;
  image-rendering: crisp-edges;
}

#game-controls {
  text-align: center;
  margin: 18px 0 10px 0;
}
#restart-btn,
#purge-btn {
  background: none;
  color: #222;
  border: none;
  border-radius: 0;
  padding: 0 10px;
  font-size: 1em;
  margin-right: 18px;
  cursor: pointer;
  font-weight: bold;
  text-decoration: underline;
  transition: color 0.1s;
  line-height: 24px;
}
#restart-btn:hover,
#purge-btn:hover {
  color: #000;
  background: none;
}
#leaderboard-link {
  background: none;
  color: #222;
  border-radius: 0;
  padding: 0 10px;
  text-decoration: underline;
  font-size: 1em;
  font-weight: bold;
  box-shadow: none;
  border: none;
  margin-left: 0;
  line-height: 24px;
}
#leaderboard-link:hover {
  color: #000;
  background: none;
}

#game-message {
  color: #333;
  text-align: center;
  font-size: 1.13em;
  margin-top: 14px;
  min-height: 1.5em;
  letter-spacing: 0.5px;
}

footer, .footer {
  width: 100%;
  margin: 24px auto 0 auto;
  text-align: center;
  color: #333;
  font-size: 1.05em;
  letter-spacing: 0.03em;
}
.footer > div{
  display:inline-block !important;
  width: auto !important;
  overflow:hidden;
}

a {
  color: #333;
  font-weight: bold;
  text-decoration: underline;
  cursor: pointer;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  transition: color 0.12s;
}
a:hover {
  color: #000 !important;
}

p {
  margin-top: 0;
  margin-bottom: 10px;
  line-height: 1.65;
}

hr {
  border: none;
  border-bottom: 1px solid #d8d4d0;
  margin-top: 20px;
  margin-bottom: 30px;
}

@media (max-width: 600px) {
  .container {
    width: 98vw;
    padding: 0 1vw;
  }
  #game-board {
    width: 98vw;
    height: 98vw;
    min-width: 1px;
    min-height: 1px;
    padding: 2vw;
    gap: 2vw;
  }
  .tile {
    font-size: 0.8em;
  }
  .scores div {
    padding: 0 0 0 3vw;
    font-size: 1em;
  }
  #restart-btn,
  #purge-btn,
  #leaderboard-link {
    padding: 0 3vw;
    font-size: 1em;
    margin-right: 2vw;
  }
}