html {
  height: 100%;
}

body {
  height: 100%;
  margin: 0;
  background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 30%, #4a2a6a 70%, #2d1b4e 100%);
  color: white;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.container {
  display: grid;
  width: 100%;
  height: 100%;
  gap: 6px;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto 1fr auto;
}

.title-area {
  grid-column: 1 / -1;
  text-align: center;
  padding: 12px 0 4px 0;
}

.game-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(180, 120, 255, 0.5);
}

.game-subtitle {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 2px;
}

.item:nth-child(2) {
  align-self: end;
}

.item:nth-child(5) {
  place-self: end center;
  text-align: center;
  line-height: 10px;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", sans-serif;
  font-size: 13px;
  padding-bottom: 10px;
}

.item:nth-child(5) p {
  color: rgba(255, 255, 255, 0.5);
  margin: 6px 0;
}

input,
button,
button * {
  font-family: -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", sans-serif;
}

#game {
  line-height: 0px;
  position: relative;
}

#canvas {
  border-radius: 25px 25px 0 0;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

#floor {
  width: 480px;
  background: linear-gradient(180deg, #6a3093 0%, #a044ff 100%);
  border-radius: 0 0 25px 25px;
}

#overlay {
  width: 480px;
  height: 700px;
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 15px;
  transform: translateY(40px);
  z-index: 10;
}

#overlay .game-over-title {
  font-size: 36px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 20px rgba(160, 68, 255, 0.8);
}

#overlay .final-score {
  font-size: 24px;
  color: rgba(255, 255, 255, 0.8);
}

#playAgainButton {
  padding: 12px 30px;
  font-size: 20px;
  border-radius: 25px;
  color: #fff;
  background: linear-gradient(135deg, #6a3093, #a044ff);
  outline: none;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 15px rgba(160, 68, 255, 0.4);
  transition: transform 0.2s;
}

#playAgainButton:hover {
  transform: scale(1.05);
}

button {
  border-radius: 10px;
  color: #fafafa;
  background: #6a3093;
  outline: none;
  cursor: pointer;
  border: none;
}

.container button {
  width: 225px;
  height: 50px;
}

a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #fff;
}

#links {
  display: flex;
  gap: 16px;
  width: 100%;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

/* Cat badge in game */
.cat-badge {
  display: inline-block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 2px;
}

@media (max-aspect-ratio: 100/149) {
  body {
    font-size: xx-large;
  }

  #game {
    height: 100%;
  }

  #canvas {
    border-radius: 0;
  }

  #floor {
    border-radius: 0;
  }

  .container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;

    gap: 8px;
  }

  .item:nth-child(1) {
    order: 2;
    text-align: center;
  }

  .item:nth-child(2) {
    order: 1;
  }

  .item:nth-child(5) {
    order: 3;
    grid-column: 1;
  }

  .empty {
    display: none;
  }

  .game-title {
    font-size: 22px;
  }

  .game-subtitle {
    font-size: 11px;
  }
}
