/* ===================== */
/* ✅ ピラミッドソリティア 完全版 CSS */
/* ===================== */

body {
  font-family: sans-serif;
  background: #60997f;
  text-align: center;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  max-width: 100vw;
}

h1 {
  margin-top: 12px;
}

#instructions {
  margin-bottom: 10px;
  font-weight: bold;
}

#reset-count,
#score {
  margin: 8px;
  font-size: 18px;
}

#game-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 165px;
}

#pyramid {
  flex: 1;
  padding-top: 27px;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 600px;
  overflow-y: auto;
  overflow-x: hidden;
}

#pyramid::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.pyramid-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: -40px;
}

.card {
  position: relative;
  width: 100px;
  height: 140px;
  background-size: cover;
  background-position: center 10px;
  margin: 4px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.pyramid-row .card {
  width: 35px;
  height: 68px;
}

.card.back {
  background-image: url("card_game_ura.jpg");
  background-position: center 45%;
}

.value {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  font-weight: bold;
  color: black;
  text-shadow: 0 0 2px white;
}

#deck-area {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 100;
}

.card.selected {
  outline: 4px solid yellow;
}

.card.fadeout {
  opacity: 0.5;
}

.card.disabled {
  filter: grayscale(100%) brightness(0.7);
  pointer-events: none;
}

#reset-button {
  padding: 8px 16px;
  font-size: 17px;
  background: #e23030;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  height: 40px;
  box-shadow: 0 4px 8px rgb(96, 14, 14);
}

#win-message {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  color: gold;
  text-align: center;
  background: rgba(0, 0, 0, 0.8);
  padding: 40px;
  border-radius: 20px;
  z-index: 1000;
  animation: fadeIn 1s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

.hidden {
  display: none;
}

#history-list {
  list-style: none;
  padding-left: 0;
}

#clear-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #fff8dc, #ffe4b5);
  color: #8b0000;
  padding: 40px 50px;
  border: 5px solid gold;
  border-radius: 30px;
  font-size: 30px;
  font-weight: bold;
  text-align: center;
  z-index: 9999;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
  animation: popIn 0.6s ease-out;
}

@keyframes popIn {
  0% {
    transform: translate(-50%, -60%) scale(0.5);
    opacity: 0;
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}



html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  box-sizing: border-box;
}

* {
  box-sizing: border-box !important;
}

#game-container {
  width: 100%;
  max-width: 100vw;
  padding-left: 0;
  padding-right: 0;
  overflow-x: hidden;
}

.card .value {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  font-weight: bold;
  color: black;
  text-shadow:
    -2px -2px 0 white,
    2px -2px 0 white,
    -2px 2px 0 white,
    2px 2px 0 white;
  z-index: 2;
  pointer-events: none;
}

.message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  text-align: center;
  z-index: 9999;
  font-size: 1.5em;
}

.message button {
  margin-top: 12px;
  padding: 8px 16px;
  font-size: 1em;
  cursor: pointer;
}