:root {
  --colorGray: #777;
  --colorGreen: limegreen;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  text-align: center;
}

.home {
  background-color: #f9f9f9;
  opacity: 1;
  background-size: 12px 12px;
  background-image: repeating-linear-gradient(45deg,
      #efefef 0,
      #efefef 1.2000000000000002px,
      #f9f9f9 0,
      #f9f9f9 50%);
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-family: "Bungee Shade", cursive;
}

h2 {
  font-size: 35px;
}

.home-header {
  font-size: 87px;
  font-weight: normal;
  width: 290px;
  padding: 20px 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: auto;
  margin-top: 40px;
  /* margin-bottom: 80px; */
}

header * {
  font-weight: normal;
}

.canvas-wrapper {
  position: relative;
}

.victory {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 415px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid black;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: monospace;
  font-weight: bold;
  font-size: 16px;
}

.hidden {
  display: none;
}

.victory h3 {
  font-size: 30px;
  animation: vibrate 0.5s linear infinite;
}

.victory-info {
  display: flex;
  gap: 30px;
  font-size: 22px;
  justify-content: space-between;
  margin-top: 10px;
  margin-bottom: 25px;
}

.victory button,
.victory .button {
  text-decoration: none;
  color: #333;
  border: 3px solid #333;
  border-radius: 5px;
  box-shadow: -2px 2px;
  font-family: monospace;
  font-size: 14px;
  padding: 5px 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: white;
  cursor: pointer;
  font-weight: bold;
  flex-grow: 1;
  margin: auto;
  flex-grow: 1;
}

.victory-buttons {
  margin-bottom: 10px;
  display: flex;
  width: 100%;
  gap: 10px;
}

#victory-share {
  position: relative;
}

#victory-reup {
  width: 100%;
  font-size: 18px;
}

canvas {
  box-sizing: content-box;
}

.buttons {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
  font-family: monospace;
  font-weight: bold;
}

.buttons a {
  display: inline-flex;
  padding: 10px 14px;
  text-decoration: none;
  color: #333;
  border: 3px solid #333;
  border-radius: 5px;
  box-shadow: -2px 2px;
  flex-grow: 1;
  background: white;
  font-size: 15px;
  height: 44px;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.yes {
  color: limegreen;
  font-size: 20px;
}

.maze-page {
  display: flex;
  width: 100%;
  height: 100vh;
  flex-direction: column;
}

.lower {
  display: flex;
  flex-grow: 1;
  position: relative;
}

#share-maze {
  position: relative;
}

.share-text {
  opacity: 1;
}

.shared-text {
  position: absolute;
  left: 0;
  width: 100%;
  text-align: center;
  pointer-events: none;
  opacity: 0;
}

.sidebar {
  min-width: 383px;
  width: 383px;
  display: flex;
  flex-direction: column;
  margin-left: 4px;
  box-shadow: 0px 0px 0px 2px black;
  height: calc(100vh - 8px);
  margin-top: 4px;
  background: white;
}

.sidebar-info {
  display: flex;
  font-family: monospace;
  border-bottom: 2px solid;
}

.sidebar-info span {
  border-right: 2px solid;
  padding: 15px;
  font-weight: bold;
  font-size: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.maze-info {
  font-weight: bold;
  text-align: center;
  font-size: 12px;
  padding: 5px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar-mon {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  padding-top: 5px;
}

.sidebar-footer {
  font-family: monospace;
  color: black !important;
  border-bottom: 2px solid;
  padding: 10px;
  letter-spacing: 0.5px;
  font-weight: bold;
  background: white;
}

.sidebar-footer a {
  color: inherit;
  text-decoration: none;
}

.maze-page {
  background-color: #f9f9f9;
  opacity: 1;
  background-size: 12px 12px;
  background-image: repeating-linear-gradient(45deg,
      #efefef 0,
      #efefef 1.2000000000000002px,
      #f9f9f9 0,
      #f9f9f9 50%);
}

.sidebar-header {
  text-decoration: none;
  color: black;
  padding: 5px;
  display: block;
  border-bottom: 2px solid;
  letter-spacing: 2px;
  background: white;
}

.game-area {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  min-width: 450px;

}

[data-name="mighty"] .game-area {
  min-width: 500px;
}

[data-name="mega"] .game-area {
  min-width: 525px;
}

[data-name="monolithic"] .game-area {
  min-width: 580px;
}

.game-area canvas {
  background: white;
  padding: 30px;
  border: 2px solid #f9f9f9;
  max-height: calc(100vh - 150px);
  max-width: calc(100% - 100px);
}

.game {
  display: flex;
  margin: auto;
  margin-bottom: 50px;
  width: 800px;
  gap: 50px;
  justify-content: center;
  font-family: monospace;
  font-size: 20px;
}

.game>div {
  flex-grow: 1;
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-footer {
  padding: 10px 14px;
  text-decoration: none;
  border: 3px solid #333;
  border-radius: 5px;
  box-shadow: -2px 2px;
  font-family: monospace;
  color: black;
  font-weight: bold;
  gap: 10px;
  display: flex;
  width: 280px;
  margin: auto;
  justify-content: center;
  /* margin-bottom: 100px; */
  margin-top: 100px;
  background: white;
}

.maze-settings {
  display: flex;
  padding: 6px;
  gap: 6px;
  border-bottom: 2px solid;
}

.maze-settings button {
  text-decoration: none;
  color: #333;
  border: 3px solid #333;
  border-radius: 5px;
  box-shadow: -2px 2px;
  font-family: monospace;
  font-size: 14px;
  padding: 5px 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: white;
  cursor: pointer;
  font-weight: bold;
  flex-grow: 1;
}

.setting {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: monospace;
  font-weight: bold;
  padding: 8px;
  width: 50%;
  gap: 5px;
  font-size: 18px;
}

.variable-settings {
  display: flex;
  border-bottom: 2px solid;
}

.variable-vertical .setting {
  width: 100%;
  border-bottom: 2px solid;
  padding: 5px;
}

a.button-daily {
  max-width: 160px;
  min-width: 160px;
  color: var(--colorGray);
  border-color: var(--colorGray);
}

a.button-daily.complete {
  color: var(--colorGreen);
  border-color: var(--colorGreen);
}

#streak-today-span {
  font-size: 28px;
  margin-left: 2px;
}

.time {
  border-right: 1px solid;
}

.moves {
  border-left: 1px solid;
}

.home-footer a {
  text-decoration: none;
  color: inherit;
}

.right-sidebar {
  display: flex;
  justify-content: space-between;
  flex-direction: row;
  position: absolute;
  bottom: 10px;
}

.right-sidebar button {
  text-decoration: none;
  color: #333;
  border: 3px solid #333;
  border-radius: 5px;
  box-shadow: -2px 2px;
  flex-grow: 1;
  font-family: monospace;
  background: white;
  font-size: 14px;
  position: absolute;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: white;
  cursor: pointer;
}

.controls {
  position: relative;
  width: 102px;
  height: 65px;
}

.top,
.bottom {
  left: 50%;
  transform: translateX(-50%);
}

.bottom,
.left,
.right {
  bottom: 0px;
}

.left {
  left: 0;
}

.right {
  right: 0;
}

button.right {
  transform: scale(-1, -1);
  box-shadow: 2px -2px;
}

.legal {
  background-color: #f9f9f9;
  background-size: 12px 12px;
  background-image: repeating-linear-gradient(45deg,
      #efefef 0,
      #efefef 1.2000000000000002px,
      #f9f9f9 0,
      #f9f9f9 50%);
}

.legal article {
  max-width: 700px;
  margin: auto;
  font-family: monospace;
  padding: 50px;
  padding-top: 20px;
  text-align: left;
}

.legal article h1,
.legal article h2,
.legal article h3 {
  font-size: 24px;
  margin-top: 30px;
}

.damn {
  margin-top: 10px;
}


.float-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  text-align: center;
}

.button-link {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 50px;
  /* background-color: #0F40F4; */
  border-radius: 50%;
  border: 1.5px solid #333333;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.button-icon {
  width: 30px;
  height: 30px;
  transition: transform 0.3s ease;
}

.tooltip {
  position: absolute;
  top: -50px;
  left: 5%;
  transform: translateX(-50%) scale(0);
  /* background-color: rgba(0, 0, 0, 0.8); */
  color: red;
  border: 1.5px solid #333333;
  padding: 8px;
  border-radius: 15px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  animation: bubble-animation 5s ease-in-out infinite;
}

/* 创建气泡下方的小三角 */
.tooltip::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 53%;
  transform: translateX(-50%);
  border-left: 10px solid transparent;
  border-right: 5px solid transparent;
  border-top: 10px solid #333333;
}

.button-link:hover .button-icon {
  transform: scale(0.9);
}

/* 弹出气泡动画 */
@keyframes bubble-animation {
  10% {
    transform: translateX(-50%) translateY(20px) scale(0);
    opacity: 0;
  }

  25% {
    transform: translateX(-50%) translateY(-10px) scale(1.1);
    opacity: 1;
  }

  75% {
    transform: translateX(-50%) translateY(-10px) scale(1.1);
    opacity: 1;
  }

  90% {
    transform: translateX(-50%) translateY(20px) scale(0);
    opacity: 0;
  }
}

@keyframes vibrate {
  0% {
    transform: translate(1px, 1px) rotate(0deg);
  }

  10% {
    transform: translate(-1px, -1px) rotate(-0.5deg);
  }

  20% {
    transform: translate(-1px, 0px) rotate(0.5deg);
  }

  30% {
    transform: translate(1px, 1px) rotate(0deg);
  }

  40% {
    transform: translate(1px, -1px) rotate(0.5deg);
  }

  50% {
    transform: translate(-1px, 1px) rotate(-0.5deg);
  }

  60% {
    transform: translate(-1px, 1px) rotate(0deg);
  }

  70% {
    transform: translate(1px, 1px) rotate(-0.5deg);
  }

  80% {
    transform: translate(-1px, -1px) rotate(0.5deg);
  }

  90% {
    transform: translate(1px, 1px) rotate(0deg);
  }

  100% {
    transform: translate(1px, -1px) rotate(-0.5deg);
  }
}

.sidebar-footer {
  display: none;
}


@media screen and (min-height: 750px) {
  .sidebar-footer {
    display: block;

  }
}


@media screen and (max-width: 768px) {
  .home-header {
    font-size: 30px;
    width: 250px;
    padding: 10px 20px;
    margin-top: 30px;
    margin-bottom: 60px;
  }

  .victory {
    width: 80%;
    padding: 15px;
    font-size: 14px;
  }

  .victory h3 {
    font-size: 20px;
  }

  .victory-info {
    font-size: 18px;
    flex-direction: column;
    gap: 15px;
  }

  .victory button,
  .victory .button {
    font-size: 12px;
    padding: 5px 8px;
  }

  .maze-page {
    height: auto;
    padding-bottom: 100px;
  }

  .lower {
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    justify-self: center;
    align-self: center;
    width: 96%;
    position: relative;
  }

  .sidebar {
    width: 96%;
    min-width: 350px;
    height: calc(250px + 260px);
  }

  .sidebar-info span {
    padding: 10px;
    font-size: 14px;
  }

  .game-area {
    padding: 15px 0;
    transform: scale(0.7);
    height: 350px;
  }

  .game {
    flex-direction: column;
    gap: 30px;
    margin-bottom: 30px;
    width: 90%;
  }

  .game>div {
    width: 100%;
  }

  .home-footer {
    width: 100%;
    padding: 10px;
    margin: 20px auto;
    /* margin-bottom: 80px; */
    margin-top: 80px;
  }

  .sidebar-footer {
    /* display: block; */
    display: none;
  }

  .right-sidebar {
    bottom: -140px;
    transform: scale(2);
  }

  .lower_ad {
    bottom: -340px;
  }

  .float-button {
    bottom: 20px;
    right: 20px;
  }

  .button-link {
    width: 30px;
    height: 30px;
  }

  .button-icon {
    width: 20px;
    height: 20px;
  }

  .tooltip {
    position: absolute;
    top: -42px;
    left: 5%;
    color: red;
    border: 1.5px solid #333333;
    padding: 3px;
    border-radius: 5px;
    font-size: 12px;
  }

  .tooltip::after {
    bottom: -5px;
    border-left: 5px solid transparent;
    border-right: 2px solid transparent;
    border-top: 5px solid #333333;
  }
}

@media (min-width: 768px) {
  .lower_ad {
    bottom: 300px !important;
    left: 43.5px !important;
    transform: none !important;
  }


  .tooltip {
    top: -50px;
    left: 5%;
  }

}