html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  padding: 0;
}

body {
  align-items: stretch;
  box-sizing: border-box;
  display: block;
  min-height: 100%;
}

.rdrc-2048-layout {
  align-items: center;
  box-sizing: border-box;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(250px, 1fr) 240px;
  height: 100vh;
  justify-content: center;
  max-height: 100vh;
  overflow: hidden;
  padding: 10px 14px;
  width: 100%;
}

.rdrc-2048-board-area {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.rdrc-2048-board-area .game-container {
  flex: 0 0 auto;
  margin: 0;
  transform: scale(var(--rdrc-2048-scale, 1));
  transform-origin: center center;
}

.rdrc-2048-side {
  align-items: stretch;
  background: rgba(250, 248, 239, 0.94);
  border: 1px solid rgba(119, 110, 101, 0.14);
  border-radius: 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  min-width: 0;
  padding: 10px;
}

.rdrc-2048-side .title {
  color: #776e65;
  float: none;
  font-size: 34px;
  line-height: 1;
  margin: 0;
}

#save2048ScoreBtn {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  height: 32px;
  line-height: 1;
  padding: 0 10px;
  white-space: nowrap;
}

#save2048ScoreBtn {
  background: #f2b179;
  color: #fff;
}

.score-save-message {
  color: #8f5f00;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
  min-height: 16px;
}

.score-save-message.error {
  color: #b53a2c;
}

.score-row {
  display: grid;
  gap: 6px;
  grid-template-columns: 1fr 1fr;
}

.score-box {
  background: #bbada0;
  border-radius: 8px;
  color: #f9f6f2;
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 6px 7px;
  text-align: center;
}

.score-box span {
  color: #eee4da;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.score-container,
.best-container {
  background: transparent;
  border-radius: 0;
  color: #fff;
  display: block;
  font-size: 19px;
  height: auto;
  line-height: 1.1;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.score-container::after,
.best-container::after {
  content: "";
  display: none;
}

.restart-button {
  background: #8f7a66;
  border-radius: 8px;
  box-sizing: border-box;
  color: #f9f6f2;
  display: block;
  float: none;
  font-size: 15px;
  font-weight: 700;
  height: auto;
  line-height: 1.2;
  min-height: 34px;
  padding: 9px 10px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  width: 100%;
}

.save-score-button {
  box-sizing: border-box;
  width: 100%;
}

.game-guide {
  color: #776e65;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
}

.game-explanation,
hr,
.game-explanation + hr + p,
.game-explanation + hr + p + hr,
.game-explanation + hr + p + hr + p {
  display: none !important;
}

@media screen and (max-width: 900px) {
  .rdrc-2048-layout {
    gap: 8px;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    padding: 8px;
  }

  .rdrc-2048-side {
    align-items: stretch;
    display: grid;
    gap: 6px;
    grid-template-columns: auto minmax(150px, 1fr) auto auto;
    order: -1;
    padding: 6px;
  }

  .rdrc-2048-side .title {
    font-size: 26px;
    margin: auto 0;
  }

  #save2048ScoreBtn {
    height: 32px;
  }

  .score-row {
    min-width: 150px;
  }

  .score-box {
    padding: 6px 5px;
  }

  .score-container,
  .best-container {
    font-size: 17px;
  }

  .restart-button {
    font-size: 14px;
    min-height: 30px;
    padding: 7px 8px;
    width: auto;
  }

  .game-guide {
    display: none;
  }

  .score-save-message {
    grid-column: 1 / -1;
    min-height: 0;
    text-align: center;
  }
}

@media screen and (max-width: 520px) {
  .rdrc-2048-layout {
    padding: 8px;
  }

  .rdrc-2048-side {
    display: grid;
    grid-template-columns: 1fr;
  }

  .restart-button {
    width: 100%;
  }

}
