/* ========== Reset & Base ========== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --olive: #ada074;
  --cream: #f5f0eb;
  --brown: #bc876d;
  --wine: #823c2d;
  --text-dark: #1a1a1a;
  --text-gray: #444;
  --correct-green: #2d6a4f;
  --wrong-red: #9b2226;
}

html, body { width: 100%; height: 100%; overflow: hidden; font-family: 'Noto Serif JP', serif; background: var(--cream); }
#quiz-app { width: 100%; height: 100%; position: relative; }

/* ========== Screen Management ========== */
.screen { width: 100%; height: 100%; display: none; flex-direction: column; position: absolute; top: 0; left: 0; }
.screen.active { display: flex; }
.screen.fade-in { animation: fadeIn 0.6s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ========== Start Screen ========== */
.start-slideshow { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 1; }
.start-slideshow img {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity 1s ease;
}
.start-slideshow img.active { opacity: 1; }
.start-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.15); z-index: 2; }
.start-content {
  position: relative; z-index: 3; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 40px;
  text-shadow: 0 2px 40px rgba(0, 0, 0, 8);
}
.start-label {
  color: #fff; font-size: 20px; font-weight: 500; letter-spacing: 0.2em;
  /* text-shadow: 0 2px 12px rgba(0,0,0,1), 0 4px 24px rgba(0,0,0,0.8), 0 8px 50px rgba(0,0,0,0.6); */
}
.start-title {
  color: #fff; font-size: 78px; font-weight: 600; letter-spacing: 0.15em;
  /* text-shadow: 0 3px 16px rgba(0,0,0,1), 0 6px 30px rgba(0,0,0,0.8); */
}
.start-sub {
  color: rgba(255,255,255,1); font-size: 20px; font-weight: 600; letter-spacing: 0.1em; margin-bottom: 20px;
  /* text-shadow: 0 2px 12px rgba(0,0,0,1), 0 4px 24px rgba(0,0,0,0.8), 0 8px 50px rgba(0,0,0,0.6); */
}
.start-btn {
  padding: 16px 48px; background: rgba(255,255,255,0.85); border: 1.5px solid rgba(255,255,255,0.9);
  color: var(--wine); font-family: 'Noto Serif JP', serif; font-size: 16px; font-weight: 600;
  letter-spacing: 0.15em; cursor: pointer; transition: all 0.3s ease;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.start-btn:active { background: rgba(255,255,255,0.95); }

/* ========== Title Screen ========== */
.title-bg { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(160deg, var(--cream) 0%, #e8e0d8 100%); }
.title-content {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
}
.title-text { color: var(--text-dark); font-size: 36px; font-weight: 500; letter-spacing: 0.2em; }
.title-deco-line { width: 200px; height: 1px; background: var(--brown); }
.title-desc { color: var(--text-gray); font-size: 16px; font-weight: 400; letter-spacing: 0.1em; line-height: 1.8; text-align: center; margin-top: 8px; }

/* ========== Photo Area ========== */
.photo-area { position: relative; width: 100%; height: 60%; flex-shrink: 0; overflow: hidden; }
.photo-img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; display: block; }
.photo-vignette { position: absolute; top: 0; left: 0; right: 0; bottom: 0; box-shadow: inset 0 0 80px 20px rgba(0,0,0,0.15); pointer-events: none; }
.photo-fade { position: absolute; bottom: 0; left: 0; right: 0; height: 60px; background: linear-gradient(to bottom, transparent, var(--cream)); pointer-events: none; }
.photo-fade--correct { background: linear-gradient(to bottom, transparent, #e8f0e8); }
.photo-fade--wrong { background: linear-gradient(to bottom, transparent, #f0e8e8); }

/* ========== Timer ========== */
.timer-clock {
  position: absolute; top: 28px; right: 32px; width: 100px; height: 100px;
  background: rgba(255,255,255,0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.timer-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
#timer-progress { transition: stroke-dashoffset 1s linear; }
.timer-text { display: flex; flex-direction: column; align-items: center; z-index: 1; }
.timer-number { color: var(--wine); font-size: 22px; font-weight: 300; line-height: 1; }
.timer-label { color: var(--olive); font-size: 7px; font-weight: 500; letter-spacing: 0.2em; margin-top: 2px; }

/* ========== Content Area ========== */
.content-area {
  flex: 1; padding: 6px 40px 20px;
  display: flex; flex-direction: column; justify-content: center; gap: 10px; background: var(--cream);
}
.question-header { display: flex; align-items: center; gap: 14px; }
.question-number-circle {
  width: 60px; height: 60px; border-radius: 50%; border: 1.5px solid var(--brown);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.question-number-circle span { color: var(--wine); font-size: 18px; font-weight: 600; }
.question-label-group { display: flex; flex-direction: column; gap: 3px; }
.question-label { color: var(--olive); font-size: 10px; font-weight: 500; letter-spacing: 0.35em; }
.question-count { color: var(--text-gray); font-size: 10px; font-weight: 400; letter-spacing: 0.1em; }
.question-line { flex: 1; height: 0.5px; background: var(--brown); opacity: 0.3; }
.question-text { color: var(--text-dark); font-size: 18px; font-weight: 500; line-height: 1.8; letter-spacing: 0.1em; word-break: keep-all; overflow-wrap: break-word; }

/* ========== Choices ========== */
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice-btn {
  display: flex; align-items: center; gap: 18px; padding: 18px 20px;
  background: rgba(255,255,255,0.5); border: 1.5px solid rgba(0,0,0,0.05); border-left: 3px solid transparent;
  border-radius: 0; cursor: pointer; text-align: left; width: 100%; transition: all 0.3s ease; font-family: 'Noto Serif JP', serif;
}
.choice-btn:active { transform: scale(0.98); }
.choice-btn.selected { background: rgba(188,135,109,0.1); border: 1.5px solid var(--brown); border-left: 3px solid var(--brown); }
.choice-btn.correct-highlight { background: rgba(45,106,79,0.1); border: 1.5px solid var(--correct-green); border-left: 3px solid var(--correct-green); }
.choice-btn.wrong-highlight { background: rgba(155,34,38,0.1); border: 1.5px solid var(--wrong-red); border-left: 3px solid var(--wrong-red); }
.choice-btn.disabled { pointer-events: none; opacity: 0.5; }
.choice-letter { font-size: 14px; font-weight: 500; color: var(--text-gray); width: 22px; flex-shrink: 0; }
.choice-btn.selected .choice-letter { color: var(--wine); }
.choice-btn.correct-highlight .choice-letter { color: var(--correct-green); }
.choice-btn.wrong-highlight .choice-letter { color: var(--wrong-red); }
.choice-divider { width: 1px; height: 18px; background: rgba(0,0,0,0.15); }
.choice-btn.selected .choice-divider { background: var(--brown); }
.choice-btn.correct-highlight .choice-divider { background: var(--correct-green); }
.choice-btn.wrong-highlight .choice-divider { background: var(--wrong-red); }
.choice-text { color: var(--text-dark); font-size: 15px; font-weight: 400; letter-spacing: 0.08em; }
.choice-btn.selected .choice-text { color: var(--wine); font-weight: 500; }
.choice-btn.correct-highlight .choice-text { color: var(--correct-green); font-weight: 500; }
.choice-btn.wrong-highlight .choice-text { color: var(--wrong-red); font-weight: 500; }

/* ========== Answer Screens ========== */
.result-content { background: var(--cream); gap: 12px; }
.answer-badge { display: inline-block; padding: 6px 24px; font-size: 18px; font-weight: 500; letter-spacing: 0.15em; align-self: flex-start; }
.correct-badge { color: var(--correct-green); border: 1.5px solid var(--correct-green); }
.wrong-badge { color: var(--wrong-red); border: 1.5px solid var(--wrong-red); }
.wrong-label { color: var(--text-gray); font-size: 13px; letter-spacing: 0.1em; }
.answer-hotel { color: var(--text-dark); font-size: 22px; font-weight: 500; letter-spacing: 0.08em; }
.trivia-text { color: var(--text-dark); font-size: 13px; font-weight: 400; line-height: 1.9; letter-spacing: 0.05em; max-height: 180px; overflow-y: auto; }
.next-btn {
  padding: 14px 40px; background: transparent; border: 1.5px solid var(--brown); color: var(--brown);
  font-family: 'Noto Serif JP', serif; font-size: 14px; font-weight: 400; letter-spacing: 0.15em;
  cursor: pointer; align-self: center; margin-top: 4px; transition: all 0.3s ease;
}
.next-btn:active { background: rgba(188,135,109,0.15); }


/* ========== Result Screen ========== */
.result-bg-light { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(160deg, var(--cream) 0%, #e8e0d8 100%); }
.result-wrapper {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 40px;
}
.result-label { color: var(--brown); font-size: 12px; font-weight: 500; letter-spacing: 0.4em; }
.result-score-area { display: flex; align-items: baseline; gap: 4px; }
.result-score { color: var(--text-dark); font-size: 72px; font-weight: 200; line-height: 1; }
.result-total { color: var(--text-gray); font-size: 24px; font-weight: 300; }
.result-message { color: var(--text-dark); font-size: 16px; font-weight: 400; letter-spacing: 0.1em; text-align: center; line-height: 1.8; }
.result-divider { width: 300px; height: 1px; background: var(--brown); margin: 8px 0; }
.prize-area { text-align: center; }
.prize-label { color: var(--brown); font-size: 11px; letter-spacing: 0.3em; margin-bottom: 8px; }
.prize-name { color: var(--text-dark); font-size: 22px; font-weight: 500; letter-spacing: 0.1em; }
.result-footer { color: var(--text-gray); font-size: 12px; font-weight: 300; letter-spacing: 0.1em; text-align: center; line-height: 1.8; margin-top: 12px; }

/* ========== Photo Slideshow ========== */
.photo-slideshow { position: relative; width: 100%; height: 100%; animation: kenburns 30s linear forwards; transform-origin: center center; }
.photo-slideshow .photo-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.8s ease; }
.photo-slideshow .photo-img.active { opacity: 1; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.08); } }

/* ========== Photo Dots ========== */
.photo-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,0.4); border: 1px solid rgba(255,255,255,0.6);
  cursor: pointer; transition: all 0.3s ease; pointer-events: auto;
}
.photo-dot.active { background: rgba(255,255,255,0.9); transform: scale(1.2); }

/* ========== Settings Icon ========== */
.settings-icon {
  position: fixed; bottom: 16px; left: 16px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7); cursor: pointer; z-index: 9999;
  border-radius: 50%; background: rgba(0,0,0,0.05); transition: color 0.3s ease;
}
.settings-icon:active { color: rgba(255,255,255,0.8); background: rgba(0,0,0,0.1); }

/* ========== Password Modal ========== */
.password-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 99999; }
.password-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); }
.password-box {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #fff; padding: 32px; width: 300px; text-align: center;
}
.password-title { color: var(--text-dark); font-size: 16px; font-weight: 500; letter-spacing: 0.1em; margin-bottom: 20px; font-family: 'Noto Serif JP', serif; }
.password-input-wrap { position: relative; width: 100%; }
.password-input {
  width: 100%; padding: 14px 48px 14px 14px; font-size: 24px; text-align: center; letter-spacing: 0.3em;
  border: 1.5px solid rgba(0,0,0,0.1); font-family: 'Noto Serif JP', serif; outline: none;
}
.password-input:focus { border-color: var(--brown); }
.password-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 8px; line-height: 0;
}
.password-eye svg { stroke: #999; }
.password-buttons { display: flex; gap: 10px; margin-top: 20px; }
.password-btn { flex: 1; padding: 12px; font-size: 14px; font-family: 'Noto Serif JP', serif; cursor: pointer; border: 1.5px solid; }
.password-btn.cancel { background: transparent; border-color: rgba(0,0,0,0.1); color: var(--text-gray); }
.password-btn.submit { background: transparent; border-color: var(--brown); color: var(--brown); }
.password-error { color: var(--wrong-red); font-size: 12px; margin-top: 12px; }

/* Large tag support */
large { font-size: 1.3em; }

/* Start slideshow with labels */
.start-slideshow > div {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity 1s ease;
}
.start-slideshow > div.active { opacity: 1; }
.start-slideshow > div > img {
  width: 100%; height: 100%; object-fit: cover;
}
.start-photo-label {
  position: absolute;
  bottom: 16px;
  left: 20px;
  color: rgba(255,255,255,0.85);
  font-size: 1.8vw;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}

/* Hide settings icon on start screen */
.settings-icon.hide { opacity: 0; pointer-events: none; }

/* Fix start slideshow images */
.start-slideshow > div > img {
  opacity: 1 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Hotel name label with black bar */
.start-photo-label {
  position: absolute !important;
  bottom: 16px !important;
  left: 16px !important;
  color: #fff !important;
  font-size: 2.5vw !important;
  font-weight: 400 !important;
  letter-spacing: 0.1em !important;
  text-shadow: none !important;
  background: rgba(0,0,0,0.5) !important;
  padding: 8px 20px !important;
}

/* Result screen logo */
.result-logo {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 28vw;
  height: auto;
  z-index: 2;
}
