@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 200%;
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
  color: #3a2a2a;
}

.page {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 720px;
  background-image: url("../assets/bg/background.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.page__content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.page__message {
  margin-top: 24px;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.55);
  padding: 10px 28px;
  border-radius: 6px;
  display: inline-block;
}

.page__nav {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  gap: 12px;
}

.page__nav a {
  text-decoration: none;
  color: #fff;
  background: rgba(60, 40, 40, 0.55);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  transition: background 0.2s ease;
}

.page__nav a:hover {
  background: rgba(60, 40, 40, 0.8);
}

/* --- photo slideshow (polaroid style, centered over the corkboard) --- */
.slideshow {
  position: relative;
  width: min(62vh, 72vw);
  aspect-ratio: 4 / 5;
  background: #fffdf8;
  padding: 18px 18px 60px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  border-radius: 2px;
}

.slideshow__frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #111;
}

.slideshow__counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: #6b5a4a;
}

.slideshow__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation-duration: 4s;
  animation-timing-function: ease-in-out;
  animation-name: slideshowFade;
}

@keyframes slideshowFade {
  0% { opacity: 0; transform: scale(1); }
  10% { opacity: 1; }
  90% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 0; transform: scale(1.06); }
}

/* tilted variants: photos alternate +-10deg, scaled up so rotated corners stay covered */
@keyframes slideshowFadeRight {
  0% { opacity: 0; transform: scale(1.22) rotate(10deg); }
  10% { opacity: 1; }
  90% { opacity: 1; transform: scale(1.28) rotate(10deg); }
  100% { opacity: 0; transform: scale(1.28) rotate(10deg); }
}

@keyframes slideshowFadeLeft {
  0% { opacity: 0; transform: scale(1.22) rotate(-10deg); }
  10% { opacity: 1; }
  90% { opacity: 1; transform: scale(1.28) rotate(-10deg); }
  100% { opacity: 0; transform: scale(1.28) rotate(-10deg); }
}

/* --- big transition button (appears in place of the photo when a slideshow finishes) --- */
.big-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0.4em;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #e8a3c0, #f4c98a);
  font-size: clamp(0.9rem, 3.2vw, 1.5rem);
  line-height: 1.4;
  font-weight: bold;
  letter-spacing: 0.04em;
  text-align: center;
  animation: bigButtonIn 0.5s ease-out;
  cursor: pointer;
}

.big-button:hover {
  filter: brightness(1.08);
}

@keyframes bigButtonIn {
  0% { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

/* --- background music control --- */
.music-toggle {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 3;
  border: none;
  cursor: pointer;
  background: rgba(60, 40, 40, 0.55);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  transition: background 0.2s ease;
}

.music-toggle:hover {
  background: rgba(60, 40, 40, 0.8);
}

/* --- roulette game (page 3) --- */
.roulette-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.roulette {
  position: relative;
  width: min(48vh, 60vw);
  aspect-ratio: 1 / 1;
}

.roulette__pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.4rem;
  line-height: 1;
  z-index: 2;
  color: #b8342f;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.4);
}

.roulette__wheel {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 8px solid #cda75d;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 0 2px rgba(255, 255, 255, 0.5);
  background: conic-gradient(
    #fff200 0deg 45deg,
    #ff4d4d 45deg 90deg,
    #3d8bff 90deg 135deg,
    #3ddc84 135deg 180deg,
    #ff4d4d 180deg 225deg,
    #3d8bff 225deg 270deg,
    #3ddc84 270deg 315deg,
    #ff4d4d 315deg 360deg
  );
  transition: transform 5s cubic-bezier(0.17, 0.67, 0.16, 0.99);
}

.roulette__hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18%;
  height: 18%;
  transform: translate(-50%, -50%);
  background: #fffdf8;
  border-radius: 50%;
  border: 3px solid #cda75d;
  z-index: 2;
}

.roulette__label {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 0;
  transform-origin: left center;
  transform: rotate(calc(var(--i) * 45deg - 67.5deg));
  text-align: right;
  padding-right: 12px;
  font-size: clamp(0.75rem, 2vw, 1rem);
  font-weight: bold;
  white-space: nowrap;
}

.roulette__label--lose {
  color: #fdf3e6;
}

.roulette__label--win {
  color: #7a2f33;
}

.roulette__icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 0;
  transform-origin: left center;
  transform: rotate(calc(var(--i) * 45deg - 67.5deg));
}

.roulette__icon img {
  position: absolute;
  right: 14%;
  top: 50%;
  transform: translateY(-50%);
  width: 17%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
}

.spin-button {
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #e8a3c0, #f4c98a);
  color: #fff;
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: 0.1em;
  padding: 14px 42px;
  border-radius: 30px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
  transition: filter 0.2s ease, transform 0.1s ease;
}

.spin-button:hover:not(:disabled) {
  filter: brightness(1.08);
}

.spin-button:active:not(:disabled) {
  transform: scale(0.97);
}

.spin-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.attempts-left {
  color: #fff;
  background: rgba(60, 40, 40, 0.55);
  padding: 6px 20px;
  border-radius: 16px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

/* --- result overlays --- */
.result-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 20, 20, 0.6);
  animation: overlayIn 0.4s ease-out;
}

.result-overlay[hidden] {
  display: none;
}

@keyframes overlayIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.result-card {
  position: relative;
  z-index: 1;
  background: #fffdf8;
  border-radius: 10px;
  padding: 40px 36px;
  max-width: 90vw;
  width: 420px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: cardPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cardPop {
  0% { opacity: 0; transform: scale(0.7); }
  100% { opacity: 1; transform: scale(1); }
}

.result-card__emoji {
  font-size: 4rem;
  margin-bottom: 12px;
}

.result-card__emoji img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.result-card__title {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 10px;
}

.result-card__text {
  font-size: 1rem;
  line-height: 1.7;
  color: #5a4636;
}

.result-card__close {
  margin-top: 24px;
  border: none;
  cursor: pointer;
  background: #7a2f33;
  color: #fff;
  padding: 10px 30px;
  border-radius: 20px;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

/* win ticket card */
.ticket-card {
  border: 3px solid #cda75d;
  background: linear-gradient(155deg, #fff8ea, #ffe9c7);
  width: 560px;
  padding: 28px;
}

.ticket-card__image {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

/* confetti */
.confetti {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  overflow: hidden;
}

.confetti span {
  position: absolute;
  top: -10px;
  width: 10px;
  height: 16px;
  opacity: 0.9;
  animation: confettiFall linear infinite;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(540deg); opacity: 0.9; }
}

/* --- top / gate page --- */
.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 12, 12, 0.75);
}

.gate-overlay[hidden] {
  display: none;
}

.gate-card {
  background: #fffdf8;
  border-radius: 10px;
  padding: 36px 34px;
  width: 340px;
  max-width: 88vw;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.gate-card__title {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 22px;
  letter-spacing: 0.08em;
}

.gate-card__field {
  text-align: left;
  margin-bottom: 16px;
}

.gate-card__field label {
  display: block;
  font-size: 0.8rem;
  color: #8a7565;
  margin-bottom: 4px;
  letter-spacing: 0.05em;
}

.gate-card__field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d8c9b5;
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
}

.gate-card__field input[readonly] {
  background: #f1ece2;
  color: #6b5a4a;
}

.gate-card__error {
  color: #b8342f;
  font-size: 0.85rem;
  min-height: 1.2em;
  margin-bottom: 8px;
}

.gate-card__submit {
  width: 100%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #e8a3c0, #f4c98a);
  color: #fff;
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  padding: 12px 0;
  border-radius: 24px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
  margin-top: 6px;
}

.gate-card.shake {
  animation: gateShake 0.4s ease;
}

@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.top-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.top-content__message {
  font-size: 1.6rem;
  font-weight: bold;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.6);
  padding: 16px 40px;
  border-radius: 10px;
}

.top-content__sub {
  font-size: 1rem;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.5);
  padding: 8px 24px;
  border-radius: 20px;
}

.start-button {
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  background: linear-gradient(135deg, #e8a3c0, #f4c98a);
  color: #fff;
  font-size: 1.2rem;
  font-weight: bold;
  letter-spacing: 0.12em;
  padding: 16px 48px;
  border-radius: 30px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
  transition: filter 0.2s ease;
}

.start-button:hover {
  filter: brightness(1.08);
}

/* --- page 3: pop / recreation background --- */
.page--pop-bg {
  background-image: url("../assets/game/background-roulette.avif");
}

.game-title {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  max-width: min(92vw, 960px);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.ticket-card__qr {
  display: block;
  width: 110px;
  height: 110px;
  margin: 16px auto 0;
  border-radius: 6px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.ticket-card__qr-label {
  font-size: 0.75rem;
  color: #8a7565;
  margin-top: 6px;
}

/* --- retry confirmation (lose popup) --- */
.result-card__question {
  margin-top: 14px;
  font-size: 1.05rem;
  font-weight: bold;
}

.result-card__warning {
  margin-top: 10px;
  font-size: 0.9rem;
  color: #b8342f;
  font-weight: bold;
}

.result-card__choices {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 20px;
}

.choice-button {
  border: none;
  cursor: pointer;
  padding: 10px 30px;
  border-radius: 20px;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.choice-button--yes {
  background: #7a2f33;
  color: #fff;
}

.choice-button--no {
  background: #e8ddd0;
  color: #5a4636;
}

/* --- win celebration: kusudama + streamers + crackers --- */
.kusudama-burst {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  overflow: hidden;
}

.kusudama-half {
  position: absolute;
  top: 8%;
  left: 50%;
  width: 90px;
  height: 45px;
  background: linear-gradient(135deg, #e8a3c0, #f4c98a);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.kusudama-half--left {
  border-radius: 90px 0 0 0;
  transform: translateX(-90px);
  transform-origin: bottom right;
  animation: kusudamaLeft 0.7s ease-out forwards;
}

.kusudama-half--right {
  border-radius: 0 90px 0 0;
  transform-origin: bottom left;
  animation: kusudamaRight 0.7s ease-out forwards;
}

@keyframes kusudamaLeft {
  0% { transform: translateX(-90px) rotate(0deg); opacity: 1; }
  100% { transform: translateX(-160px) translateY(-40px) rotate(-60deg); opacity: 0; }
}

@keyframes kusudamaRight {
  0% { transform: translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateX(70px) translateY(-40px) rotate(60deg); opacity: 0; }
}

.streamer {
  position: absolute;
  bottom: -20px;
  width: 7px;
  height: 200px;
  border-radius: 4px;
  opacity: 0.95;
  animation: streamerFly 1.5s ease-out forwards;
}

@keyframes streamerFly {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) rotate(var(--tr)); opacity: 0; }
}

.cracker {
  position: fixed;
  bottom: 24px;
  font-size: 3rem;
  z-index: 9;
  pointer-events: none;
  animation: crackerPop 0.5s ease-out;
}

.cracker--left {
  left: 24px;
}

.cracker--right {
  right: 24px;
  transform: scaleX(-1);
}

@keyframes crackerPop {
  0% { transform: scale(0.3) rotate(-20deg); opacity: 0; }
  60% { transform: scale(1.3) rotate(0deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

