@charset "UTF-8";
*, *:before, *:after {
  box-sizing: inherit;
}

html {
  box-sizing: border-box;
}

body {
  text-align: center;
  color: #333;
  padding: 20px 20px 100px;
  background-color: #efefef;
  font-family: "Space Mono", monospace;
}

h1 {
  margin: 0 0 32px;
}

p {
  font-size: 1em;
  line-height: 1.25em;
}

a {
  color: inherit;
}

img {
  height: auto;
  max-width: 100%;
}

.wrap {
  text-align: center;
  position: relative;
  display: inline-block;
}

.legend {
  font-size: 14px;
  margin: 0 auto 32px;
}
.legend h4,
.legend p {
  margin: 0 0 6px;
}
.legend code {
  background: #e3e3e3;
}
.legend code .key {
  color: #ec433c;
}
.legend code .click {
  color: #2a48ec;
}

.top {
  border: 6px solid #e3e3e3;
  background-color: #e3e3e3;
}

#scoreboard {
  display: flex;
  padding-bottom: 12px;
  justify-content: space-between;
}
#scoreboard .select-wrap {
  font-weight: 700;
  vertical-align: top;
  display: inline-block;
}
#scoreboard .select-wrap select {
  margin: 0;
  height: 36px;
  border-radius: 0;
  border-width: 3px;
  border-style: solid;
  background-color: #d1d1d1;
  border-color: white #9e9e9e #9e9e9e white;
}
#scoreboard .select-wrap select:hover, #scoreboard .select-wrap select:focus {
  backgroudn-color: #ebebeb;
}
#scoreboard .reset {
  padding: 0 4px;
  font-size: 24px;
  cursor: pointer;
  font-weight: 700;
  line-height: 30px;
  border-width: 3px;
  border-style: solid;
  background-color: #d1d1d1;
  border-color: white #9e9e9e #9e9e9e white;
}
#scoreboard .reset:hover, #scoreboard .reset:focus {
  outline: none;
  background-color: #ebebeb;
}
#scoreboard .counter {
  padding: 0 4px;
  color: #ec433c;
  border: 3px inset;
  line-height: 30px;
  letter-spacing: 0.08em;
  display: inline-block;
  background: #333;
  text-shadow: 0 0 2px #ec433c;
}
#scoreboard .counter:first-of-type {
  margin-right: 20px;
}
#scoreboard .counter:last-of-type {
  margin-left: 20px;
}

#grid {
  margin: 0 auto;
  position: relative;
  display: inline-block;
}
#grid ::-moz-selection {
  background-color: transparent;
}
#grid ::selection {
  background-color: transparent;
}
#grid.disabled .cell {
  pointer-events: none;
}
#grid.disabled .status-indicator {
  top: 50%;
  left: 50%;
  z-index: 11;
  width: 8vw;
  height: 8vw;
  font-size: 4vw;
  cursor: pointer;
  line-height: 8vw;
  position: absolute;
  border-radius: 50%;
  pointer-events: auto;
  background-color: #d1d1d1;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(51, 51, 51, 0.25);
}
#grid.disabled .status-indicator::after {
  content: "";
}
#grid.disabled.win .status-indicator::after {
  content: "😎";
}
#grid.disabled.lose .status-indicator::after {
  content: "☹️";
}
#grid .row {
  display: flex;
}
#grid .cell {
  cursor: pointer;
  width: 24px;
  height: 24px;
  position: relative;
  background-color: #d1d1d1;
  border-width: 3px;
  border-style: solid;
  border-color: white #9e9e9e #9e9e9e white;
}
#grid .cell i {
  left: 0;
  bottom: 0;
  margin: 0;
  width: 100%;
  font-size: 14px;
  font-weight: 700;
  font-style: normal;
  position: absolute;
  line-height: 24px;
}
#grid .cell::before {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  content: "";
  position: absolute;
  background-color: #d1d1d1;
}
#grid .cell::after {
  top: 50%;
  left: 50%;
  content: "";
  position: absolute;
  transform: translate(-50%, -50%);
}
#grid .cell:hover::before {
  background-color: #ebebeb;
}
#grid .cell.revealed {
  border: 1px solid #b8b8b8;
}
#grid .cell.revealed::before {
  display: none;
}
#grid .cell.revealed .flag {
  display: none;
}
#grid .cell .flag {
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 10px;
  height: 4px;
  position: absolute;
  border-style: solid;
  border-width: 4px 0 4px 10px;
  transform: translate(-50%, -50%);
  border-color: transparent transparent transparent #ec433c;
}
#grid .cell.maybe .flag {
  border-color: transparent transparent transparent #d7af42;
}
#grid .cell.mine {
  background-color: #ec433c;
}
#grid .cell.mine::after {
  border-radius: 50%;
  width: 12px;
  height: 12px;
  background-color: #333;
}
#grid .cell.incorrect .flag::before, #grid .cell.incorrect .flag::after {
  top: 50%;
  z-index: 1;
  left: -13px;
  height: 2px;
  width: 16px;
  content: "";
  position: absolute;
  background-color: black;
}
#grid .cell.incorrect .flag::before {
  transform: rotate(-45deg);
}
#grid .cell.incorrect .flag::after {
  transform: rotate(45deg);
}
#grid .cell.mousedown {
  border: none;
}

#leaderboard {
  margin-top: 20px;
  text-align: center;
}
#leaderboard h4 {
  margin: 0 0 10px;
}
#leaderboard ul {
  margin: 0;
  padding: 10px;
  display: inline-block;
  background-color: rgba(209, 209, 209, 0.5);
}
#leaderboard ul li {
  padding: 2px;
  list-style: none;
}
#leaderboard ul li span {
  font-weight: 900;
  text-transform: capitalize;
}
#leaderboard ul li.highlight {
  background-color: #fef178;
}
#leaderboard button {
  border: none;
  outline: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  background: none;
  text-decoration: underline;
}

.cell.white {
  color: #fff;
}

.cell.gray-light {
  color: #efefef;
}

.cell.gray-mid {
  color: #e3e3e3;
}

.cell.gray {
  color: #d1d1d1;
}

.cell.gray-dark {
  color: #808080;
}

.cell.black {
  color: #333;
}

.cell.red {
  color: #ec433c;
}

.cell.maroon {
  color: #a6070f;
}

.cell.purple {
  color: #a42887;
}

.cell.yellow {
  color: #d7af42;
}

.cell.yellow-light {
  color: #fef178;
}

.cell.blue {
  color: #2a48ec;
}

.cell.blue-dark {
  color: #233db7;
}

.cell.green {
  color: #2bb13d;
}

.cell.turquoise {
  color: #28907d;
}

#devbox {
  top: 10px;
  right: 10px;
  position: fixed;
  text-align: left;
  max-width: 300px;
  color: #fff;
  background-color: #333;
}
#devbox p {
  margin: 0;
  font-size: 12px;
  padding: 10px 20px;
}
#devbox p + p {
  padding-top: 5px;
}

/* Timed mines styles */
.bomb-sign {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 30px;
  border-radius: 10px;
  z-index: 10000;
  text-align: center;
  font-size: 18px;
}

.bomb-sign h2 {
  margin: 0 0 15px;
  color: #ff4444;
}

.bomb-sign button {
  margin-top: 20px;
  padding: 10px 20px;
  background: #ff4444;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
}

.bomb-sign button:hover {
  background: #cc3333;
}

.bomb-indicator {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.bomb-warning {
  animation: shake 0.5s infinite;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes fadeOutUp {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px);
  }
}

@keyframes explode {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.5);
  }
  100% {
    opacity: 0;
    transform: scale(2);
  }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

/* Score submission styles */
.score-submission {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.95);
  color: white;
  padding: 30px;
  border-radius: 15px;
  z-index: 10000;
  text-align: center;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.score-submission h3 {
  margin: 0 0 15px;
  color: #4CAF50;
  font-size: 24px;
}

.score-submission p {
  margin: 10px 0;
  font-size: 16px;
}

.score-submission strong {
  color: #FFD700;
  font-size: 20px;
}

.score-form {
  margin-top: 20px;
}

.score-form input[type="text"] {
  width: 100%;
  padding: 10px;
  margin: 10px 0;
  border: 2px solid #555;
  border-radius: 5px;
  background: #333;
  color: white;
  font-size: 16px;
  box-sizing: border-box;
}

.score-form input[type="text"]:focus {
  outline: none;
  border-color: #4CAF50;
}

.score-form label {
  display: block;
  margin: 15px 0;
  font-size: 14px;
  text-align: left;
}

.score-form label input[type="checkbox"] {
  margin-right: 8px;
}

.score-form label a {
  color: #4CAF50;
  text-decoration: none;
}

.score-form label a:hover {
  text-decoration: underline;
}

.score-form button {
  padding: 12px 24px;
  background: #4CAF50;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  margin-top: 10px;
  transition: background 0.3s;
}

.score-form button:hover:not(:disabled) {
  background: #45a049;
}

.score-form button:disabled {
  background: #666;
  cursor: not-allowed;
}

.success-message {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #4CAF50;
  color: white;
  padding: 15px 20px;
  border-radius: 5px;
  z-index: 10001;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}