:root{
  --orange-trim-passive: #4da3bf;
  --orange-trim: #3c8096;
  --select-orange: #d47624;   /* selected / checked buttons: bg + border */
  --hover-orange: #f08114;    /* hover state everywhere: bg + border, white text */
  --dark-grey-base: #333333;
  --light-grey-base: #888888;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Noto Sans TC", sans-serif;
}

/* Backdrop: warm paper + ~4% greyscale SVG grain + a very soft edge
   vignette + a barely-there vertical gradient (lighter top → slightly
   deeper bottom), carried by BODY behind the transparent slides, so
   question content glides over a constant backdrop. The grain is an inline
   feTurbulence tile (zero extra requests); the vignette darkens the
   edges by ~5% to settle focus on the question. .slide-video stays
   solid black and covers everything behind it. */
body {
    overflow: hidden;
    /* dvh (where supported) tracks the VISIBLE mobile viewport — on
       phones the browser chrome (URL bar) is excluded, so landscape
       slides fit what's actually on screen instead of overflowing
       below it. 100vh stays as the fallback for older browsers. */
    height: 100vh;
    height: 100dvh;
    background:
        radial-gradient(ellipse 120% 90% at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(58, 52, 40, 0.055) 100%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E"),
        linear-gradient(to bottom, #fbf9f5 0%, #f1efe8 100%) #faf8f3;
}

.slide{
    position: absolute;
    width: 100%;
    height: 100vh;  /* fallback */
    height: 100dvh; /* visible-viewport height on mobile (see body note) */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    background: transparent; /* paper + grain + gradient + vignette live on body */
    transition: transform 0.8s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.slide h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-align: center;
}

.slide h3{
    margin-top: 10px;
    margin-bottom: 0px;
    flex: none;
}

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--orange-trim);
    transition: width 0.3s;
    z-index: 1000;
}

.slide:nth-child(1) { z-index: 100;}
.slide:nth-child(2) { z-index: 99; }
.slide:nth-child(3) { z-index: 98; }
.slide:nth-child(4) { z-index: 97; }
.slide:nth-child(5) { z-index: 96; }
.slide:nth-child(6) { z-index: 95;}

.submit-btn {
    padding: 1rem 3rem;
    font-size: 1.2rem;
    background: white;
    color: #333;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.3s;
    font-weight: bold;
}

.submit-btn:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .slide h1 {
        font-size: 2rem;
    }
    .slide p {
        font-size: 1.2rem;
    }
}

.shake{
    animation: slide-shaking 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both infinite;
}

@keyframes slide-shaking {
 0% { transform: translateY(0) }
 25% { transform: translateY(5px) }
 50% { transform: translateY(-5px) }
 75% { transform: translateY(5px) }
 100% { transform: translateY(0) }
}

.other-text{
    color: var(--orange-trim);
    border: var(--orange-trim) 1px solid;
    border-radius: 10px;
}

.other-text::placeholder {
    color: var(--orange-trim);
    opacity: 0.5;
}

.other-text[type="text"] {
    -webkit-appearance: none;
    appearance: none;
    background: #FFF;
    font-size: 1.2rem;
    padding: 0 0 0 5px;
    height: 35px;
    width: 200px;
    margin: 0;
    transform: translateY(-50px);
    transition: 0.5s transform ease;
    display: none;
}

.survey-but{
    border: 0;
    background: none;
    position: relative;
}

.survey-start-but{
    border: 1px solid var(--orange-trim);
    color: var(--orange-trim);
    background-color: #FFF;
    padding: 7px 24px;      /* ~20% larger than the original 6px 20px */
    border-radius: 5px;
    font-size: 1.2rem;      /* ~20% larger than the original 1rem */
    font-weight: bold;
    margin-top: 10px;       /* extra separation from the invitation message */
}

.survey-start-but:hover{
    border: 1px solid var(--hover-orange);
    background-color: var(--hover-orange);
    color: #FFF;
}

.slide-up-arrow{
    margin-bottom: 5px;
}

.slide-down-arrow{
    margin-top: 20px;
}

.rating_container{
    display: flex;
}

.survey-rating{
    display: flex;
    flex-direction: column;
    text-align: center;
    font-size: 2rem;
    margin: 3px 5px 0 5px;
}

.survey-rating input[type="radio"]{
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff;
    border: 1px solid var(--dark-grey-base);
    width: 26px;
    height: 26px;
    border-radius: 5px;
    display: inline-block;
    position: relative;
    vertical-align: middle;
    margin: 0 10px 5px 10px;
    cursor: pointer;
}


.survey-artwork-container {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;

}

.survey-artwork {
  position: relative;
  width: 100%;
  max-width: 380px;
  min-width: 250px;
  overflow: hidden;
  margin: 10px;
  flex: 1 1 100%;
  
}

.survey-artwork-slider-container {
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.survey-artwork-slider {
    display: flex;
    transition: transform 0.4s ease-in-out;
    width: 100%;
    height: 100%;
}

.survey-artwork-slide {
    height: 100%;
    width: 100%;
    /* min-width: 100%; */
    flex: 0 0 100%;
}

.survey-artwork-meta, .price-survey-artwork-meta{
    flex: none;
}

.survey-artwork-meta h3{
    margin: 3px auto;
    text-align: center;
    font-size: 1.2rem;
}

.price-survey-artwork-meta h3{
    text-align: center;
}

.survey-artwork-meta p, .price-survey-artwork-meta p{
    margin: 3px auto;
    text-align: center;
    font-size: 1rem;
}

.survey-price-tag span{
    border: var(--orange-trim) 2px solid;
    border-radius: 5px;
    color: var(--orange-trim);
    font-size: 1.2rem;
    font-weight: bold;
    margin: 5px 0;
    padding: 5px;
    background-color: rgba(255, 255, 255, 0.9);
}

.survey-price-tag{
    display: flex;
    justify-content: center;
    transform: translatex(-50%);
    position: absolute;
    bottom: 5px;
    left: 50%;
}

.survey_rate_image{
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;

    margin: 0 auto;
}

.survey-prev-arrow {
    left: 10px;
}

.survey-next-arrow {
    right: 10px;
}

.price-cover-height{
    margin-top:10px;
    min-height: 0;
}

.slide h2{
    margin-top: 20px;
    margin-bottom: 20px;
}

.end-slide-container{
    width: 90%;
    max-width: 340px;
}

.slide small{
    margin-bottom: 25px;
    color: #666;
    font-size: 0.8rem;
    width: 95%;
    max-width: 380px;
}

#email{
    margin: 20px 0 5px 0;
    width: 95%;
    max-width: 380px;
    height: 35px;
    font-size: 1.2rem;
    padding: 0 3px;
}

.email-invite{
    font-size: 1rem;
}



/* 1. Define the punch animation */
@keyframes rightJab {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  20% { transform: translate(-10px, 5px) scale(0.95) rotate(-10deg); } /* Impact */
  40% { transform: translate(10px, -5px) scale(0.95) rotate(5deg); }  /* Recoil */
  60% { transform: translate(-5px, 2px) scale(0.98) rotate(-2deg); }
  80% { transform: translate(5px, -2px) scale(1) rotate(1deg); }
  100% { transform: translate(0, 0) scale(1) rotate(0deg); }
}

@keyframes leftJab {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  20% { transform: translate(10px, -5px) scale(0.95) rotate(10deg); } /* Impact */
  40% { transform: translate(-10px, 5px) scale(0.95) rotate(-5deg); }  /* Recoil */
  60% { transform: translate(5px, -2px) scale(0.98) rotate(2deg); }
  80% { transform: translate(-5px, 2px) scale(1) rotate(-1deg); }
  100% { transform: translate(0, 0) scale(1) rotate(0deg); }
}

@keyframes nextAnim {
  0% { transform: scale(1) rotate(180deg); }
  45% { transform: scale(1.5) rotate(180deg); } /* Impact */
  60% { transform: scale(0.8) rotate(180deg); }  /* Recoil */
  75% { transform: scale(1.3) rotate(180deg); }
  90% { transform: scale(0.9) rotate(180deg);  }
  100% { transform: scale(1) rotate(180deg); }
}

.rightJab{
    animation-name: rightJab;
    animation-duration: 0.5s; /* Adjust as needed */
    animation-fill-mode: both; /* Ensures element stays at final state after animation */
    animation-iteration-count: 1; /* Runs once, change to 'infinite' for continuous loop */
}

.leftJab{
    animation-name: leftJab;
    animation-duration: 0.5s; /* Adjust as needed */
    animation-fill-mode: both; /* Ensures element stays at final state after animation */
    animation-iteration-count: 1; /* Runs once, change to 'infinite' for continuous loop */
}

/* 2. Apply to element */
.box {
  width: 100px;
  height: 100px;
  background-color: #3498db;
  transition: background-color 0.3s;
}

/* 3. Trigger the animation */
.box.punched {
  animation: punchStrike 0.4s ease-out;
  background-color: #e74c3c; /* Optional color change */
}


.survey-cont{
    height: calc(100% - 150px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Custom Elements */

.survey-form-A{
    margin: 30px 0 25px 0;
    display: flex;
    gap: 40px;
}

.survey-form-A input[type="radio"] {
      position: absolute;
      opacity: 0;
      width: 0;
      height: 0;
      pointer-events: none;
}

.survey-butt-A {
    display: inline-block;
    width: 60px;
    height: 60px;
    background: #FFF;
    border: 1px solid var(--orange-trim);
    color: var(--orange-trim);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    transition: all 0.2s ease;
    user-select: none;
    align-content: center;
}

/* Hover only on devices with a real cursor — on touchscreens the hover
   state "sticks" after a tap, which made deselected buttons stay dark. */
@media (hover: hover) and (pointer: fine) {
    .survey-butt-A:hover {
        color: #FFF;
        border-color: var(--hover-orange);
        background-color: var(--hover-orange);
    }
}

.survey-form-A input[type="radio"]:checked + .survey-butt-A {
    background:var(--select-orange);
    border-color:var(--select-orange);
    color: #FFF;
    font-weight: bold;
}

/* Focus style for keyboard users */
.survey-form-B input[type="checkbox"]:focus-visible + .survey-butt-B{
    outline: 3px solid #3b82f6;
    outline-offset: 4px;
}

.survey-form-B input[type="checkbox"]:checked + .survey-butt-B {
    background:var(--select-orange);
    border-color:var(--select-orange);
    color: #FFF;
    font-weight: bold;
}

/* Focus style for keyboard users */
.survey-form-B input[type="checkbox"]:focus-visible + .survey-butt-B{
    outline: 3px solid #3b82f6;
    outline-offset: 4px;
}

.survey-form-B{
    display: flex;
    flex-direction: column;
    margin: 30px 0 20px 0;
    gap: 15px;
}

.survey-form-B input[type="radio"] {
      position: absolute;
      opacity: 0;
      width: 0;
      height: 0;
      pointer-events: none;
}

.survey-form-B input[type="checkbox"] {
      position: absolute;
      opacity: 0;
      width: 0;
      height: 0;
      pointer-events: none;
}

.survey-butt-B {
    display: inline-block;
    width: 200px;
    height: 35px;
    background: #FFF;
    border: 1px solid var(--orange-trim);
    color: var(--orange-trim);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    transition: all 0.2s ease;
    user-select: none;
    align-content: center;
}

@media (hover: hover) and (pointer: fine) {
    .survey-butt-B:hover {
        color: #FFF;
        border-color: var(--hover-orange);
        background-color: var(--hover-orange);
    }
}

.survey-form-B input[type="radio"]:checked + .survey-butt-B {
    background:var(--select-orange);
    border-color:var(--select-orange);
    color: #FFF;
    font-weight: bold;
}

/* Focus style for keyboard users */
.survey-form-B input[type="radio"]:focus-visible + .survey-butt-B{
    outline: 3px solid #3b82f6;
    outline-offset: 4px;
}

.survey-grey-but .tri-arrow, .survey-prev-but .tri-arrow{
    width: 80px;
    height: 20px;
    margin-bottom: 10px;
}

.survey-next-but .tri-arrow{
    width: 120px;
    height: 30px;
    margin-bottom: 0;
}

.tri-arrow-part{
    stroke-linecap:round;
    stroke-width: 3px;
}

.survey-but{
    cursor: pointer;
}

.survey-prev-but svg{
    fill:var(--orange-trim);
    stroke:var(--orange-trim);
}

.survey-prev-but:hover{
    transform: translateY(-5px);
    transition: 0.3s transform ease;
}

.survey-prev-but:hover svg{
    fill: var(--hover-orange);
    stroke:var(--hover-orange);
}

.survey-grey-but svg{
    transform: rotate(180deg);
    fill: none;
    stroke: #CCC;
}

.survey-grey-but:hover{
    transform: translateY(5px);
    transition: 0.3s transform ease;
}

.survey-grey-but:hover svg{
    fill: #CCC;
    stroke: #CCC;  
}

.survey-next-but svg{
    transform: rotate(180deg);
    fill: var(--orange-trim-passive);
    stroke: var(--orange-trim-passive);
    animation: nextAnim 1s ease;
}

.survey-next-but:hover{
    transform: translateY(5px);
    transition: 0.3s transform ease;
}

.survey-next-but:hover svg,
.survey-next-but:active svg{
    fill: var(--hover-orange);
    stroke: var(--hover-orange);
}

/* 下一頁 label follows the arrow into the hover orange */
.survey-next-but:hover .next-text,
.survey-next-but:active .next-text{
    color: var(--hover-orange);
}

.next-text{
    position: absolute;
    display: block;
    width: 50px;
    transition: all 0.5s ease;
    font-size: 1rem;
    left: 50%;
    transform: translateX(-50%);
}

.survey-grey-but .next-text{
    opacity: 0;
    top: 0;
    color: #CCC;
}

.survey-next-but .next-text{
    opacity: 1;
    top: -20px;
    color: var(--orange-trim-passive);
}

.end-text{
    width: 90%;
    margin: 0 auto;
    text-align: center;
}

.last-cont{
    /* Vertical stack: 先鋒 (B) on top, notify (A) second, anonymous (C)
       last — DOM order in the template sets the sequence.
       Width mirrors #email (95% / max 380px) so the buttons line up
       exactly with the input above them.
       perspective: gives the empty-email rotateX flip (JS-driven) its
       3D depth — without it the flip reads as a flat squash. */
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 95%;
    max-width: 380px;
    perspective: 700px;
}

.last-cont button{
    width: 100%;
    font-size: 1.1rem;
    font-weight: 600; /* semi-bold */
    line-height: 1.4;
    background-color: #FFF;
    color: var(--orange-trim);
    border: 1px solid var(--orange-trim);
    border-radius: 10px;
    cursor: pointer;
}

.last-cont button:hover{
    background-color: var(--hover-orange);
    border: 1px solid var(--hover-orange);
    color: #FFF;
}

/* "Back face" of a tier button mid-flip: shown while the empty-email
   warning 「請填入您的Email。」 is on the button (class toggled by JS).
   Pastel orange fill + border with a warm dark text for contrast.
   Placed AFTER the :hover rule (same specificity) so the warning face
   keeps its colors even though the cursor is still on the button. */
.last-cont button.flip-back,
.last-cont button.flip-back:hover{
    background-color: #FFD9B3;
    border: 1px solid #FFB877;
    color: #8A4B1F;
}

.last-cont span{
    margin: 10px;
    display: block;
}

/* ────────────────────────────────────────────────
   Video intro slide (slide 0) — full black, video centered
   ──────────────────────────────────────────────── */
.slide-video {
    background: #000;
}
.slide-video .survey-video-cont {
    width: 100%;
    max-width: 1000px;
    height: 100%;
    margin: 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}
/* Fill the viewport on whichever axis binds first for the device ratio;
   object-fit letterboxes the remainder into the black background. */
.slide-video video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

/* Opening text prelude over the video cover (injected by script.js).
   Four phrases fade in at 0s / 1s / 2.5s / 4.5s, justified near the
   top-left; pointer-events: none keeps the cover's play tap intact,
   and .video-playing (added on first play) retires the block. */
.survey-prelude {
    position: absolute;
    top: clamp(14px, 5vh, 48px);
    left: clamp(16px, 5vw, 56px);
    right: clamp(16px, 5vw, 56px);
    text-align: left;
    pointer-events: none;
    z-index: 3;
    color: #c8a86a; /* TMA gold — matches the official page */
    font-size: clamp(1rem, 2.4vw, 1.4rem);
    line-height: 1.7;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.9);
}
.survey-prelude p { margin: 0; }
.survey-prelude span {
    opacity: 0;
    animation: spFadeIn 0.9s ease forwards;
}
.survey-prelude .sp-2 { animation-delay: 1s; }
.survey-prelude .sp-3 { animation-delay: 2.5s; }
.survey-prelude .sp-4 { animation-delay: 4.5s; }
@keyframes spFadeIn {
    to { opacity: 1; }
}
.slide-video.video-playing .survey-prelude { display: none; }
@media (prefers-reduced-motion: reduce) {
    .survey-prelude span { animation: none; opacity: 1; }
}

/* Cover play button — same SVG language as the theme's featured players */
.slide-video .survey-video-cont {
    position: relative;
}
.survey-play-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
.survey-play-overlay .survey-play-butt {
    position: absolute;
    left: 65%;              /* button centre offset 35% in from the right edge */
    top: 50%;
    transform: translate(-50%, -50%);
    width: 96px;
    height: 96px;
    opacity: 0.85;
    filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.6));
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.survey-play-overlay:hover .survey-play-butt,
.survey-play-overlay:focus-visible .survey-play-butt {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
}
@media (max-width: 767px) {
    .survey-play-overlay .survey-play-butt {
        width: 72px;
        height: 72px;
    }
}
@media (max-width: 599px) {
    .survey-play-overlay .survey-play-butt {
        width: 50px;   /* a further ~30% down from the 72px tablet size */
        height: 50px;
    }
}
@media (max-width: 449px) {
    .survey-play-overlay .survey-play-butt {
        width: 38px;   /* 25% down from the 50px tier for narrow phones */
        height: 38px;
    }
}

/* Play icon: white at load, then a 1s dissolve to TMA gold starting
   1s after the last prelude line has finished fading in (sp-4 starts
   at 4.5s + 0.9s fade → dissolve begins at 6.4s, lands at 7.4s). The
   white comes from the SVG's own <defs><style> in the CPT markup;
   CSS animations outrank those normal declarations, so no !important
   is needed (and none may be added here — an !important fill would
   beat the animation and freeze the color). */
@keyframes spbToGoldFill {
    from { fill: #FFF; stroke: #FFF; }
    to   { fill: #c8a86a; stroke: #c8a86a; }
}
@keyframes spbToGoldStroke {
    from { stroke: #FFF; }
    to   { stroke: #c8a86a; }
}
.survey-play-overlay .spb-1 {
    animation: spbToGoldFill 1s ease 6.4s forwards;
}
.survey-play-overlay .spb-2 {
    animation: spbToGoldStroke 1s ease 6.4s forwards;
}
@media (prefers-reduced-motion: reduce) {
    /* No dissolve — straight to the gold end-state (matches the
       prelude, which also renders instantly for these users). */
    .survey-play-overlay .spb-1 {
        animation: none;
        fill: #c8a86a !important;
        stroke: #c8a86a !important;
    }
    .survey-play-overlay .spb-2 {
        animation: none;
        stroke: #c8a86a !important;
    }
}

/* Rotate hint — portrait phones only, never intercepts touches.
   Anchored exactly 30px above the video frame's top edge (the 1:1 cut's
   picture is 100vw tall and vertically centred, so its top edge sits at
   50% + 50vw from the bottom).
   Shown ONLY while the portrait cut is actually playing: before playback
   the cover artwork carries the rotate recommendation itself, so the
   coded hint stays hidden until JS adds .show-rotate-hint to the slide
   (and removes it again if a rotation swaps in the landscape cut). */
.rotate-hint {
    display: none;
}
@media (orientation: portrait) {
    .slide-video.show-rotate-hint .rotate-hint {
        position: absolute;
        left: 50%;
        bottom: calc(50% + 50vw + 5px); /* 5px off the frame's top edge */
        transform: translateX(-50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        color: #fff;
        font-size: 0.9rem;
        letter-spacing: 0.08em;
        text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
        pointer-events: none;
        z-index: 5;
        animation: rotateHintPulse 2.4s ease-in-out infinite;
    }
    .rotate-hint svg {
        /* Paul's icon is a tall phone outline (83×115 viewBox) — size by
           height, let width follow the aspect ratio. */
        width: auto;
        height: 36px; /* 30% smaller than the original 52px */
    }
}
@keyframes rotateHintPulse {
    0%, 100% { opacity: 0.5; }
    50%      { opacity: 1; }
}

/* Invitation line between the replay link and 開始 — super-title weight */
.survey-invite-msg {
    margin: 1.75rem auto;
    padding: 0 1.25rem;
    max-width: 36em;
    text-align: center;
    color: #2e3a40;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: 0.08em;
}
@media (max-width: 767px) {
    .survey-invite-msg {
        font-size: 1.35rem;
    }
}
@media (max-width: 599px) {
    .survey-invite-msg {
        font-size: 1.15rem;
    }
}

/* Rotate-to-portrait prompt on the invite slide (between the invitation
   line and 開始). Hidden by default; shown only on touch devices held in
   landscape — desktop viewports are landscape too but have nothing to
   rotate. Flashes to catch the eye; static for reduced-motion users. */
.portrait-hint {
    display: none;
}
@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
    .portrait-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.6rem;
        margin: 0 auto 0.9rem;
        color: #000;
        font-size: 1rem;
        font-weight: 500;
        letter-spacing: 0.08em;
        animation: portraitHintFlash 1.2s ease-in-out infinite;
    }
    .portrait-hint svg {
        width: auto;
        height: 32px;   /* tall phone outline — size by height */
        display: block;
    }
}
@keyframes portraitHintFlash {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.15; }
}
@media (prefers-reduced-motion: reduce) {
    .portrait-hint { animation: none; }
}

/* Subtle replay link under the 開始 button */
.video-replay-but {
    display: block;
    margin: 1.25rem auto 0;
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    color: #8aa2ae;
    font-size: 0.9rem;
    text-decoration: underline;
    cursor: pointer;
}
.video-replay-but:hover {
    color: #f08114;
}

/* ────────────────────────────────────────────────
   Defensive landscape layout — short viewports only (phones held
   sideways after the video). Portrait and desktop are untouched.
   Long option lists wrap into two columns so nothing clips.
   ──────────────────────────────────────────────── */
@media (orientation: landscape) and (max-height: 500px) {
    .slide {
        padding: 14px 30px;
    }
    .slide h3 {
        font-size: 1.1rem;
        margin-bottom: 0;
    }
    .slide h2 {
        font-size: 1.1rem;
        margin: 0 0 6px 0;
    }
    .survey-cont {
        height: auto;
    }
    .survey-form-A {
        margin: 16px 0 12px 0;
        gap: 24px;
    }
    .survey-form-B {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 14px;
        margin: 14px 0 10px 0;
        max-width: 470px;
    }
    .survey-butt-B {
        width: 190px;
        height: 32px;
        font-size: 1.05rem;
    }
    .other-text[type="text"] {
        width: 190px;
        height: 32px;
        font-size: 1.05rem;
    }
    .survey-invite-msg {
        font-size: 1.1rem;
        margin: 0.6rem auto;
        line-height: 1.5;
    }
    .last-cont {
        gap: 4px;
        margin-top: 6px;
    }
    #email {
        margin-top: 4px;
    }
}

/* ────────────────────────────────────────────────
   Navigation arrows pinned near the screen edges.
   (Centering uses auto margins, not transform, so the
   hover translateY and nextAnim animations still work.)
   ──────────────────────────────────────────────── */
.slide > .survey-prev-but {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: max-content;
    z-index: 10;
}
.slide > .survey-grey-but,
.slide > .survey-next-but {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: max-content;
    z-index: 10;
}
@media (orientation: landscape) and (max-height: 500px) {
    .slide > .survey-prev-but { top: 14px; }
    .slide > .survey-grey-but,
    .slide > .survey-next-but { bottom: 14px; }
}

/* Directional arrow fade: when navigating forward, the incoming slide's
   PREV arrow (the one opposite the pressed control) starts fading in at
   the halfway point of the slide transition; when navigating backward,
   the incoming NEXT arrow gets the same treatment. The arrow matching
   the pressed control appears immediately, so rapid tapping stays fluid.
   Classes are toggled in JS. */
.slide > .survey-prev-but,
.slide > .survey-grey-but,
.slide > .survey-next-but {
    transition: opacity 0.4s ease;
}
.slide.prev-arrow-hidden > .survey-prev-but {
    opacity: 0;
    pointer-events: none;
}
.slide.next-arrow-hidden > .survey-grey-but,
.slide.next-arrow-hidden > .survey-next-but {
    opacity: 0;
    pointer-events: none;
}

/* ────────────────────────────────────────────────
   Thank-you page comment box (給製作團隊的留言)
   ──────────────────────────────────────────────── */
.comment-cont {
    margin-top: 1.5rem;
    text-align: center;
}
.survey-thankyou h2 {
    text-align: center;
}
/* ────────────────────────────────────────────────
   Last slide (.slide-end)
   ──────────────────────────────────────────────── */
/* Heading: ONE h2, always exactly two lines — 謝謝您的參與 (black) over
   我們即將要開始群眾募資！ (orange). Each span is its own block and never
   wraps; on very narrow phones the launch line shrinks to fit instead
   of breaking onto a third line. */
.slide .survey-end-title {
    margin: 20px 0 12px;
    text-align: center;
    line-height: 1.35;
}
.survey-end-title span {
    display: block;
    white-space: nowrap;
}
.survey-end-title .set-thanks {
    color: #000;
}
.survey-end-title .set-launch {
    color: var(--hover-orange);
    font-size: 1.8rem;           /* desktop / tablet */
    font-weight: 700;
}
@media (orientation: portrait) and (max-width: 820px) {
    .survey-end-title .set-launch {
        /* 1.6rem on portrait mobile, capped so the 12 glyphs always fit
           the slide's inner width (viewport − 2×30px padding) on one line */
        font-size: min(1.6rem, calc((100vw - 60px) / 12.2));
    }
}
/* Mission statement under the heading. (.slide prefix: must outrank the
   generic `.slide p` 1.2rem rule that applies up to 768px.) */
.slide .survey-launch-sub {
    max-width: 560px;
    margin: 0 auto 20px;
    font-size: 1rem;
    line-height: 1.85;
    text-align: left;
}

/* Smartphones, either orientation: promo copy and the email disclaimer
   each step down a size, with tighter leading. */
@media (orientation: portrait) and (max-width: 600px),
       (orientation: landscape) and (max-height: 500px) {
    .slide .survey-launch-sub {
        font-size: 0.9rem;
        line-height: 1.55;
    }
    .slide #emailHelp {
        font-size: 0.7rem;
        line-height: 1.5;
    }
}

/* Smartphone, portrait: promo copy shares the exact column of the email
   field, the disclaimer and the buttons (95% / max 380px). */
@media (orientation: portrait) and (max-width: 600px) {
    .slide .survey-launch-sub {
        width: 95%;
        max-width: 380px;
        margin-bottom: 4px;
    }
    .slide-end #emailHelp {
        margin-bottom: 18px;
    }
}

/* Short portrait phones (iPhone SE / 8 class, or any phone whose in-app
   browser chrome eats the height): reserve the back-arrow strip at the
   top and tighten the vertical rhythm so the whole slide — heading
   through the third button — stays on screen without clipping. */
@media (orientation: portrait) and (max-width: 600px) and (max-height: 620px) {
    .slide.slide-end {
        padding: 50px 30px 12px;
    }
    .slide .survey-end-title {
        margin: 0 0 8px;
        line-height: 1.3;
    }
    .slide-end #email {
        margin-top: 10px;
    }
    .slide-end #emailHelp {
        margin-bottom: 12px;
    }
    .slide-end .last-cont {
        gap: 8px;
    }
    .slide-end .last-cont span {
        margin: 7px 10px;
    }
}

/* Smartphone, landscape: heading centered across the top, then two
   columns — promo copy + email + disclaimer on the left, the three
   buttons on the right. Grid on the slide itself (no wrapper markup), so
   the JS that swaps this slide's contents for the thank-you screen is
   untouched; the thank-you block simply spans both columns. */
@media (orientation: landscape) and (max-height: 500px) {
    .slide.slide-end {
        display: grid;
        padding-top: 44px;   /* keeps the heading clear of the back arrow */
        grid-template-columns: minmax(0, 380px) minmax(0, 380px);
        column-gap: 32px;
        justify-content: center;
        align-content: center;
        align-items: start;
    }
    .slide-end > .survey-end-title {
        grid-column: 1 / -1;
        margin: 0 0 10px;
        line-height: 1.3;
    }
    .slide-end .survey-end-title .set-launch {
        font-size: 1.4rem;
    }
    .slide-end > .survey-launch-sub,
    .slide-end > #email,
    .slide-end > #emailHelp {
        grid-column: 1;
        width: 100%;
        max-width: none;
    }
    .slide-end > .survey-launch-sub { margin: 0 0 8px; }
    .slide-end > #email             { margin: 0 0 5px; }
    .slide-end > #emailHelp         { margin: 0; }
    .slide-end > .last-cont {
        grid-column: 2;
        grid-row: 2 / span 3;
        align-self: center;
        width: 100%;
        max-width: none;
        margin-top: 0;
        gap: 8px;
    }
    .slide-end > #submit-error,
    .slide-end > .survey-thankyou {
        grid-column: 1 / -1;
        justify-self: center;
    }
}
.comment-box textarea {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0.5rem 0;
    border: 1px solid var(--orange-trim);
    border-radius: 10px;
    color: var(--orange-trim);
    background: #FFF;
    font-size: 1rem;
    padding: 8px;
    resize: vertical;
}
.comment-box textarea::placeholder {
    color: var(--orange-trim);
    opacity: 0.5;
}
.comment-send {
    display: block;
    margin: 1rem auto 0; /* centered, with extra breathing room above */
    border: 1px solid var(--orange-trim);
    color: var(--orange-trim);
    background: #FFF;
    padding: 5px 18px;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
}
.comment-status {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #3d4a52;
}
.survey-thankyou h2 sup {
    font-size: 0.7em;
}
@media (hover: hover) and (pointer: fine) {
    .comment-send:hover {
        background: var(--hover-orange);
        border-color: var(--hover-orange);
        color: #FFF;
    }
}

/* ────────────────────────────────────────────────
   宣傳方式 slide (promo-form): buttons 20% wider
   (200→240px; landscape 190→228px) for the longer labels.
   ──────────────────────────────────────────────── */
.promo-form .survey-butt-B {
    width: 240px;
}
.promo-form .other-text[type="text"] {
    width: 240px;
}
@media (orientation: landscape) and (max-height: 500px) {
    .promo-form .survey-butt-B {
        width: 228px;
    }
    .promo-form .other-text[type="text"] {
        width: 228px;
    }
}

/* ────────────────────────────────────────────────
   先鋒 checkout button on the pioneer thank-you
   ──────────────────────────────────────────────── */
.pioneer-checkout-btn {
    display: inline-block;
    margin-top: 22px;
    padding: 12px 30px;
    background: var(--orange-trim);
    color: #FFF;
    border-radius: 10px;
    font-size: 1.15rem;
    font-weight: bold;
    text-decoration: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
@media (hover: hover) and (pointer: fine) {
    .pioneer-checkout-btn:hover {
        background: var(--hover-orange);
        color: #FFF;
        transform: translateY(-1px);
    }
}

/* ────────────────────────────────────────────────
   Thank-you: official-page button + social circles
   (FB / IG / Threads / LINE official marks, themed teal)
   ──────────────────────────────────────────────── */
.full-film-msg {
    margin: 20px 0 0;
    font-size: 0.95rem;
    color: #3d4a52;
}
.official-page-btn {
    display: block;              /* centered on the thank-you variants */
    width: fit-content;
    margin: 22px auto 0;
    padding: 11px 26px;
    border: 1px solid var(--orange-trim);
    color: var(--orange-trim);
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease;
}
/* Thank-you share button — above the social circles, same outline
   language as 前往官方網站, hover in the survey's hover orange. */
.ty-share {
    margin-top: 22px;
    text-align: center; /* the pill is inline-flex — centre it like 前往官方網站 */
}
.ty-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 10px 24px;
    background: var(--orange-trim);   /* solid — the most prominent action on the thank-you */
    border: 1px solid var(--orange-trim);
    color: #FFF;                       /* text + icon (currentColor) */
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.ty-share-btn svg {
    width: 17px;
    height: 17px;
    display: block;
}
@media (hover: hover) and (pointer: fine) {
    .ty-share-btn:hover {
        background: var(--hover-orange);
        border-color: var(--hover-orange);
        color: #FFF;
    }
}
.ty-share-done {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #3d4a52;
}
.ty-social {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.6rem;
}
.ty-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1.5px solid var(--orange-trim);
    border-radius: 50%;
    color: var(--orange-trim);
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}
.ty-social svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: currentColor;
}
@media (hover: hover) and (pointer: fine) {
    .official-page-btn:hover {
        background: var(--hover-orange);
        border-color: var(--hover-orange);
        color: #FFF;
    }
    .ty-social a:hover {
        background: var(--hover-orange);
        border-color: var(--hover-orange);
        color: #FFF;
        transform: scale(1.06);
    }
}

/* ────────────────────────────────────────────────
   Survey video subtitles (WebVTT cues)
   ──────────────────────────────────────────────── */
#survey-video::cue {
    font-family: "Noto Sans TC", "PingFang TC", sans-serif;
    font-weight: 200;
    color: #fff;
    /* No backing bar — a four-direction shadow outline keeps the thin
       strokes legible over bright footage instead. */
    background: rgba(0, 0, 0, 0);
    text-shadow:
        -1px -1px 0 rgba(0, 0, 0, 0.85),
         1px -1px 0 rgba(0, 0, 0, 0.85),
        -1px  1px 0 rgba(0, 0, 0, 0.85),
         1px  1px 0 rgba(0, 0, 0, 0.85),
         0 0 6px rgba(0, 0, 0, 0.6);
    line-height: 1.4;
}
/* The SRT exports wrap every line in <b> — neutralise it so the 200
   weight actually shows. */
#survey-video::cue(b) {
    font-weight: 200;
}
