/* =========================================================
   票券失效頁 — 色系比照 www.qrpass.cc（深青綠底、橘色強調）
   ========================================================= */
:root {
    color-scheme: light;
    --green-900: #0a4237;
    --green-800: #0e5245;
    --line: #269f89;
    --paper: #f5f1e8;       /* 官網米白 */
    --paper-deep: rgba(0, 0, 0, .2);
    --card: #ffffff;
    --ink: #0a3a31;         /* 深青綠，取代原本的深棕 */
    --ink-soft: #4b6a63;
    --leo: #ffa208;         /* 官網橘 */
    --leo-soft: #fff0d4;
    --wood: #269f89;        /* 官網細線綠 */
    --coral: #ffa208;
    --coral-ink: #e07a3a;   /* 官網 CTA 帶的焦橘 */
    --outline: 2.5px;
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
    --ease-out: cubic-bezier(.22, 1, .36, 1);
    --font-cjk: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", sans-serif;
    --font-display: "Bricolage Grotesque", "Arial Rounded MT Bold", "Segoe UI", sans-serif;
}

html { -webkit-text-size-adjust: 100%; }

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    overflow-x: hidden;
    background: var(--green-800);
    color: var(--ink);
    font-family: var(--font-cjk);
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--leo); color: var(--ink); }

/* ---------- 背景 ---------- */
.backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: linear-gradient(160deg, var(--green-900) 0%, var(--green-800) 55%, #11604f 100%);
}

/* 官網風格細格線＋柔光 */
.backdrop::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(40% 40% at 20% 30%, rgba(62, 203, 160, .18), transparent 70%),
        radial-gradient(35% 35% at 90% 90%, rgba(255, 162, 8, .14), transparent 70%);
}
.backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(38, 159, 137, .16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(38, 159, 137, .16) 1px, transparent 1px);
    background-size: 64px 64px;
    background-position: -1px -1px;
    -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 20%, transparent 80%);
    mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 20%, transparent 80%);
}

/* 豹紋斑點＝QR 定位點：兩者都是圓角方框 */
.spot {
    position: absolute;
    display: block;
    border: clamp(7px, 1vw, 12px) solid var(--wood);
    border-radius: 28%;
    opacity: .3;
    animation: drift 18s ease-in-out infinite alternate;
}
.spot::after {
    content: "";
    position: absolute;
    inset: 26%;
    border-radius: 26%;
    background: var(--wood);
}
.spot-a { width: 120px; height: 120px; top: 8%;  left: 4%;  transform: rotate(-14deg); }
.spot-b { width: 72px;  height: 72px;  top: 70%; left: 9%;  transform: rotate(10deg); animation-delay: -6s; }
.spot-c { width: 96px;  height: 96px;  top: 6%;  right: 7%; transform: rotate(18deg); animation-delay: -3s; }
.spot-d { width: 54px;  height: 54px;  bottom: 9%; right: 30%; transform: rotate(-8deg); animation-delay: -9s; border-width: 6px; }
.spot-e { width: 140px; height: 140px; bottom: -40px; right: -30px; transform: rotate(24deg); animation-delay: -12s; }
.spot-d::after, .spot-e::after { display: none; }

@keyframes drift {
    to { translate: 14px -22px; rotate: 9deg; }
}

/* ---------- 版面 ---------- */
.page {
    min-height: 100vh;
    min-height: 100dvh;
    padding-block: clamp(24px, 6vh, 72px);
    padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
}

/* ---------- 吉祥物舞台 ---------- */
.stage {
    --px: 0;
    --py: 0;
    position: relative;
    width: min(100%, 520px);
    aspect-ratio: 1;
    isolation: isolate;
    animation: rise 1s var(--ease-spring) both;
}

.stage-blob {
    position: absolute;
    inset: 13%;
    z-index: -2;
    background: var(--paper);
    border: var(--outline) solid var(--ink);
    border-radius: 47% 53% 44% 56% / 55% 43% 57% 45%;
    box-shadow: 8px 10px 0 var(--paper-deep);
    animation: morph 12s ease-in-out infinite alternate;
    translate: calc(var(--px) * -10px) calc(var(--py) * -8px);
}
.stage-blob::before {
    content: "";
    position: absolute;
    inset: 9%;
    border: 1.5px dashed rgba(10, 58, 49, .3);
    border-radius: inherit;
}

.stage-ring {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    overflow: visible;
    animation: spin 48s linear infinite;
}
.stage-ring text {
    fill: rgba(255, 255, 255, .88);
    font-family: var(--font-display), var(--font-cjk);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.stage-shadow {
    position: absolute;
    left: 24%;
    right: 30%;
    bottom: 13%;
    height: 5%;
    z-index: -1;
    border-radius: 50%;
    background: rgba(0, 0, 0, .35);
    filter: blur(6px);
    animation: shadow 3.6s ease-in-out infinite;
}

.mascot-wrap {
    position: absolute;
    inset: 4% 2% 6% 6%;
    transform: rotate(calc(var(--px) * 4deg)) translate(calc(var(--px) * 8px), calc(var(--py) * 6px));
    transform-origin: 50% 90%;
}
.mascot {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    animation: bob 3.6s ease-in-out infinite;
    transform-origin: 40% 85%;
}

/* ---------- 票券 ---------- */
.ticket {
    --notch: 15px;
    --stub-h: 128px;
    position: relative;
    width: min(100%, 500px);
    /* 深底上改用柔和陰影讓卡片浮起；drop-shadow 會跟著缺角走 */
    filter:
        drop-shadow(0 4px 10px rgba(2, 24, 20, .22))
        drop-shadow(0 24px 40px rgba(2, 24, 20, .42));
    animation: slide-in 1s .15s var(--ease-out) both;
}

.ticket-body,
.ticket-stub {
    position: relative;
    background-repeat: no-repeat;
}

.ticket-body {
    padding: clamp(28px, 4vw, 44px) clamp(24px, 3.6vw, 40px) 30px;
    border-radius: 22px 22px 0 0;
    background:
        radial-gradient(circle at 0 100%, transparent var(--notch), var(--card) calc(var(--notch) + .5px)) 0 100% / 51% 60px,
        radial-gradient(circle at 100% 100%, transparent var(--notch), var(--card) calc(var(--notch) + .5px)) 100% 100% / 51% 60px,
        linear-gradient(var(--card), var(--card)) 0 0 / 100% calc(100% - 59px);
    background-repeat: no-repeat;
}

.ticket-stub {
    gap: clamp(14px, 2.4vw, 22px);
    min-height: var(--stub-h);
    padding: 22px clamp(24px, 3.6vw, 40px) 24px;
    border-radius: 0 0 22px 22px;
    background:
        radial-gradient(circle at 0 0, transparent var(--notch), var(--leo-soft) calc(var(--notch) + .5px)) 0 0 / 51% 60px,
        radial-gradient(circle at 100% 0, transparent var(--notch), var(--leo-soft) calc(var(--notch) + .5px)) 100% 0 / 51% 60px,
        linear-gradient(var(--leo-soft), var(--leo-soft)) 0 100% / 100% calc(100% - 59px);
    background-repeat: no-repeat;
}

/* 撕線 */
.ticket-stub::before {
    content: "";
    position: absolute;
    top: -1px;
    left: calc(var(--notch) + 10px);
    right: calc(var(--notch) + 10px);
    border-top: 2px dashed var(--ink);
    opacity: .55;
}

.eyebrow {
    padding: 7px 14px 7px 11px;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    background: var(--paper);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    line-height: 1;
}
.eyebrow-pulse {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--coral);
}
.eyebrow-pulse::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1.5px solid var(--coral);
    animation: ping 2s var(--ease-out) infinite;
}

h1 {
    margin: 22px 0 16px;
    font-size: clamp(34px, 4.4vw, 52px);
    font-weight: 900;
    line-height: 1.28;
    letter-spacing: .01em;
    text-wrap: balance;
}
h1 em {
    position: relative;
    font-style: normal;
    white-space: nowrap;
    z-index: 0;
}
/* 手繪感螢光筆底線 */
h1 em::after {
    content: "";
    position: absolute;
    left: -.08em;
    right: -.1em;
    bottom: .04em;
    height: .36em;
    z-index: -1;
    background: var(--coral);
    opacity: .38;
    border-radius: .3em .5em .25em .6em;
    transform: rotate(-1.5deg) scaleX(0);
    transform-origin: 0 50%;
    animation: highlight .7s .75s var(--ease-out) forwards;
}
/* 句點改成一顆 QR 模組般的紅色小方塊 */
.period {
    display: inline-block;
    width: .2em;
    height: .2em;
    margin-left: .12em;
    border-radius: .05em;
    background: var(--coral-ink);
    vertical-align: baseline;
}
.phrase { display: inline-block; }
.reason-text { text-wrap: pretty; }

.intro {
    margin: 0 0 22px;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.85;
}

.reason {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.65;
    animation: fade-up .6s var(--ease-out) both;
}
.reason:nth-child(1) { animation-delay: .55s; }
.reason:nth-child(2) { animation-delay: .65s; }
.reason + .reason { border-top: 1.5px dashed rgba(10, 58, 49, .18); }

.reason-no {
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 26px;
    margin-top: 1px;
    border: 1.5px solid var(--ink);
    border-radius: 8px 9px 7px 10px;
    background: var(--leo);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: .04em;
}

/* 票根：被劃掉的票券圖示 */
.stub-icon {
    position: relative;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 18px;
    background: var(--card);
    box-shadow: 0 0 0 1.5px rgba(10, 58, 49, .14) inset;
    color: var(--ink);
    font-size: 38px;
    line-height: 1;
}
.stub-icon .bi { transform: rotate(-12deg); opacity: .85; }
/* 斜線：進場時從左上劃到右下 */
.stub-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 64%;
    height: 4px;
    margin: -2px 0 0 -32%;
    border-radius: 4px;
    background: var(--coral-ink);
    box-shadow: 0 0 0 2.5px var(--card);
    transform: rotate(45deg) scaleX(0);
    animation: strike .5s 1s var(--ease-out) forwards;
}

.stub-meta { min-width: 0; }
.stub-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.stub-value {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.4;
}
.stub-note {
    font-family: var(--font-display);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--ink-soft);
}

/* 失效章 */
.stamp {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    align-content: center;
    width: 84px;
    height: 84px;
    border: 3px solid var(--coral-ink);
    border-radius: 50%;
    outline: 1.5px solid var(--coral-ink);
    outline-offset: -9px;
    color: var(--coral-ink);
    line-height: 1;
    mix-blend-mode: multiply;
    transform: rotate(-14deg);
    /* 印章不均勻的墨色 */
    -webkit-mask: radial-gradient(circle at 30% 70%, #000 50%, rgba(0, 0, 0, .68) 85%);
    mask: radial-gradient(circle at 30% 70%, #000 50%, rgba(0, 0, 0, .68) 85%);
    animation: stamp .45s 1.15s var(--ease-spring) both;
}
.stamp-main {
    font-size: 21px;
    font-weight: 900;
    letter-spacing: .08em;
    margin-left: .08em;
}
.stamp-sub {
    margin-top: 5px;
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .32em;
    margin-left: .32em;
}

/* ---------- 動態 ---------- */
@keyframes rise   { from { opacity: 0; transform: translateY(40px) scale(.92); } }
@keyframes slide-in { from { opacity: 0; transform: translate(40px, 10px) rotate(3deg); } }
@keyframes fade-up  { from { opacity: 0; transform: translateY(10px); } }
@keyframes highlight { to { transform: rotate(-1.5deg) scaleX(1); } }
@keyframes spin   { to { transform: rotate(360deg); } }
@keyframes bob    { 50% { transform: translateY(-10px) rotate(-1.2deg); } }
@keyframes shadow { 50% { transform: scaleX(.86); opacity: .7; } }
@keyframes morph  {
    to { border-radius: 55% 45% 52% 48% / 46% 56% 44% 54%; rotate: -6deg; }
}
@keyframes ping   {
    from { transform: scale(.6); opacity: 1; }
    to   { transform: scale(1.8); opacity: 0; }
}
@keyframes stamp  {
    from { opacity: 0; transform: rotate(-30deg) scale(2.2); }
    to   { opacity: .92; transform: rotate(-14deg) scale(1); }
}
@keyframes strike {
    to { transform: rotate(45deg) scaleX(1); }
}

/* ---------- 斷點 ---------- */
@media (min-width: 992px) {
    .stage { margin-right: -24px; }
    .ticket { margin-left: 8px; }
}

@media (max-width: 991.98px) {
    .page { align-items: flex-start !important; }
    .stage { width: min(78vw, 380px); margin-bottom: -18px; }
    .ticket { margin-top: 0; }
    @keyframes slide-in { from { opacity: 0; transform: translateY(30px); } }
}

@media (max-width: 575.98px) {
    .page { padding-top: 12px; }
    .stage { width: min(72vw, 270px); margin-bottom: -10px; }
    .stage-ring text { font-size: 10.5px; }
    .ticket { --notch: 13px; }
    .ticket-body { padding: 26px 22px 22px; border-radius: 18px 18px 0 0; }
    .ticket-stub { padding: 20px 22px 22px; border-radius: 0 0 18px 18px; min-height: 0; }
    h1 { font-size: clamp(30px, 9vw, 38px); margin: 18px 0 12px; }
    .intro { font-size: 14.5px; margin-bottom: 14px; }
    .reason { font-size: 15px; gap: 12px; padding: 12px 0; }
    .stub-icon { width: 62px; height: 62px; border-radius: 15px; font-size: 31px; }
    .stamp { position: absolute; top: -34px; right: 14px; width: 74px; height: 74px; }
    .stamp-main { font-size: 18px; }
    .stub-value { font-size: 15px; }
    .spot-a, .spot-c { opacity: .2; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0s !important;
    }
    .mascot-wrap, .stage-blob { transform: none; translate: none; }
}
