:root {
  --board-width: 1075px;
  --board-height: 717px;
  --ui-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  --text-dark: #4b1f06;
  --text-light: #fff8ea;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f6d6a6;
  color: var(--text-light);
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  overflow: auto;
  cursor: none;
}

button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.game-shell {
  width: var(--board-width);
}

.game-board {
  position: relative;
  width: var(--board-width);
  height: var(--board-height);
  background: url('./background.png') center center / auto no-repeat;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--ui-shadow);
  user-select: none;
}

.hud {
  position: absolute;
  inset: 20px 24px auto 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 4;
}

.time-board {
  position: relative;
  width: 260px;
  flex: 0 0 auto;
}

.time-board__bg,
.score-board__bg {
  display: block;
  width: 100%;
  height: auto;
}

.time-board__content {
  position: absolute;
  left: 49%;
  top: 57%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44%;
  height: 40%;
}

.time-board__content strong {
  color: #ffffff;
  font-size: 21px;
  letter-spacing: 0.03em;
  line-height: 1;
}

.exit-button {
  width: 182px;
  flex: 0 0 auto;
  transition: transform 0.18s ease;
}

.exit-button img,
.difficulty-button img {
  display: block;
  width: 100%;
  height: auto;
}

.exit-button:hover,
.difficulty-button:hover {
  transform: scale(1.03);
}

.play-area {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 78px 36px 14px;
}

.holes-grid {
  width: 860px;
  display: grid;
  justify-content: center;
  justify-items: center;
  align-items: end;
  gap: 18px 22px;
  padding-top: 18px;
}

.holes-grid--easy {
  grid-template-columns: repeat(3, minmax(0, 229px));
}

.holes-grid--normal {
  grid-template-columns: repeat(3, minmax(0, 224px));
}

.holes-grid--challenge {
  grid-template-columns: repeat(3, minmax(0, 200px));
}

.hole {
  position: relative;
  width: 100%;
  max-width: 229px;
  aspect-ratio: 229 / 134;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.hole.is-disabled {
  pointer-events: none;
}

.hole-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  transition: transform 0.14s ease;
  transform-origin: center bottom;
  will-change: transform;
  -webkit-user-drag: none;
  user-drag: none;
}

.hole:hover .hole-image {
  transform: scale(1.04);
}

.hole.is-hit {
  animation: hole-thump-hit 0.16s ease;
}

.hole.is-miss {
  animation: hole-thump-miss 0.16s ease;
}

.hole.is-hit .hole-image {
  animation: pop-hit 0.18s ease;
}

.hole.is-miss .hole-image {
  animation: pop-miss 0.18s ease;
}

.round-banner {
  position: absolute;
  left: 50%;
  top: 24%;
  transform: translate(-50%, -50%);
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(68, 24, 3, 0.78);
  color: #fff7ea;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
  z-index: 6;
}

.round-banner.hidden {
  display: none;
}

.hammer {
  position: absolute;
  width: 126px;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-18deg);
  transform-origin: 50% 50%;
  z-index: 5;
  transition: transform 0.08s ease;
  will-change: transform;
}

.hammer.is-swinging {
  transform: translate(-50%, -50%) rotate(28deg) scale(0.92);
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(33, 10, 0, 0.52);
  z-index: 8;
}

.overlay.hidden {
  display: none;
}

.rule-panel {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-8px);
}

.rule-panel__image {
  display: block;
  width: 773px;
  height: auto;
}

.difficulty-buttons {
  margin-top: -96px;
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.difficulty-button {
  transition: transform 0.2s ease;
}

#startEasyButton {
  width: 235px;
  transform: translateX(-20px);
}

#startNormalButton {
  width: 235px;
}

#startChallengeButton {
  width: 223px;
  transform: translateX(20px);
}

#startEasyButton:hover {
  transform: translateX(-20px) scale(1.03);
}

#startChallengeButton:hover {
  transform: translateX(20px) scale(1.03);
}

.score-dialog {
  width: 460px;
  padding: 22px 20px 28px;
}

.score-board {
  position: relative;
}

.score-board--result {
  width: 250px;
  margin: 0 auto 12px;
}

.score-board__content--result {
  position: absolute;
  inset: 10% 12% 14%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  transform: translateY(40px);
}

.score-board__content--result strong {
  font-size: 44px;
  line-height: 1;
}

.dialog {
  border-radius: 24px;
  background: linear-gradient(180deg, #fff7e8 0%, #ffd9a1 100%);
  color: var(--text-dark);
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.dialog p {
  margin: 10px 0;
  font-size: 20px;
  line-height: 1.6;
}

.primary-btn {
  margin-top: 18px;
  padding: 12px 24px;
  border-radius: 999px;
  background: #ff8c29;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(255, 140, 41, 0.35);
}

.primary-btn:hover {
  filter: brightness(1.05);
}

@keyframes pop-hit {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes pop-miss {
  0% { transform: scale(1); }
  40% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

@keyframes hole-thump-hit {
  0% { transform: translateY(0); }
  35% { transform: translateY(4px); }
  100% { transform: translateY(0); }
}

@keyframes hole-thump-miss {
  0% { transform: translateY(0); }
  35% { transform: translateY(3px); }
  100% { transform: translateY(0); }
}
