:root {
  --gold: #f6b31a;
  --gold-dark: #e09e00;
  --navy: #22314f;
  --navy-dark: #192842;
  --ink: #2b2b33;
  --blue: #3f7de0;
  --blue-dark: #2f61b8;
  --pink: #ff5fa2;
  --pink-dark: #e04488;
  --cream: #fff8e6;
  --white: #ffffff;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(34, 49, 79, 0.12);
  --max-w: 1120px;

  /* Claymorphic surfaces: soft inner highlight + chunky outer shadow */
  --clay-shadow: inset 0 3px 6px rgba(255,255,255,0.9), inset 0 -4px 8px rgba(34,49,79,0.06), 0 10px 24px rgba(34,49,79,0.14);
  --clay-shadow-lift: inset 0 3px 6px rgba(255,255,255,0.9), inset 0 -4px 8px rgba(34,49,79,0.06), 0 18px 34px rgba(34,49,79,0.18);
  --tint-gold: #fff4d6;
  --tint-blue: #e9f1ff;
  --tint-pink: #ffeaf3;
  --edge-gold: #f6d78a;
  --edge-blue: #b9d0f5;
  --edge-pink: #f7bcd6;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.7;
  position: relative;
}

img {
  max-width: 100%;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--gold); color: var(--navy); }

a:focus-visible,
button:focus-visible,
summary:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--blue-dark);
  outline-offset: 2px;
  border-radius: 999px;
}
.faq-item summary:focus-visible { border-radius: 8px; }
.prize-card--link:focus-visible { border-radius: 24px; }

html { scrollbar-color: var(--gold) var(--cream); scrollbar-width: thin; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 999px; border: 3px solid var(--cream); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}
.icon-title { width: 24px; height: 24px; color: var(--gold-dark); vertical-align: -5px; margin-right: 4px; }
.icon-solid { stroke: none; fill: currentColor; }

/* Decorative floating letters */
.letter-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.float-letter {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  font-weight: 800;
  font-family: Georgia, "Times New Roman", serif;
  user-select: none;
}

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease, background .15s ease;
}
.btn:active { transform: translateY(3px); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy);
  box-shadow: 0 5px 0 var(--gold-dark), 0 10px 18px rgba(246, 179, 26, 0.35);
}
.btn-primary:active { box-shadow: 0 2px 0 var(--gold-dark), 0 4px 10px rgba(246, 179, 26, 0.35); }

.btn-outline {
  background: var(--white);
  color: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 5px 0 var(--navy);
}
.btn-outline:active { box-shadow: 0 2px 0 var(--navy); }

.btn-ghost {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy);
  border-color: transparent;
  font-size: 14px;
  padding: 10px 18px;
  white-space: nowrap;
  box-shadow: 0 4px 0 var(--gold-dark);
}
.btn-ghost:hover { filter: brightness(1.05); }
.btn-ghost:active { box-shadow: 0 1px 0 var(--gold-dark); }

.btn-lg { padding: 17px 34px; font-size: 17px; }
.btn-lg .icon { width: 20px; height: 20px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.header-inner {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 20px;
}
.header-top {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { flex-shrink: 0; }
.brand-logo { height: 56px; width: auto; border-radius: 12px; }

.header-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.header-inner .btn-ghost { flex-shrink: 0; }

/* Hamburger toggle: mobile only */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.22);
  color: var(--white);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s ease;
}
.nav-toggle:hover { background: rgba(255,255,255,0.22); }
.nav-toggle .icon { width: 20px; height: 20px; }
.nav-toggle .icon-x { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-x { display: block; }

/* Nav: collapsed dropdown on mobile, inline row on desktop */
.header-nav {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.header-nav.is-open { display: flex; }
.header-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.header-nav a:hover { background: var(--gold); color: var(--navy); border-color: var(--gold); }
.header-nav .icon { width: 18px; height: 18px; }

@media (max-width: 859px) {
  .header-inner .btn-ghost {
    font-size: 12.5px;
    padding: 8px 14px;
  }
  .header-inner .btn-ghost .icon { width: 15px; height: 15px; }
}

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .header-nav {
    display: flex !important;
    flex-direction: row;
    gap: 8px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin-top: 0;
  }
  .header-nav a {
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13.5px;
  }
  .header-nav .icon { width: 15px; height: 15px; }
}

/* Content above the letter field */
main, footer { position: relative; z-index: 1; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffe9ad 0%, var(--cream) 70%);
  padding: 48px 20px 20px;
  text-align: center;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: url("../assets/images/kids-bg.png") repeat;
  opacity: 0.35;
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
}
.hero-inner {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
}
.hero-title {
  max-width: 560px;
  width: 90%;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 0 auto;
  animation: float-y 3.6s ease-in-out infinite, title-glow 3.6s ease-in-out infinite;
}

@keyframes title-glow {
  0%, 100% {
    filter:
      drop-shadow(0 8px 16px rgba(0,0,0,0.15))
      drop-shadow(0 0 18px rgba(255, 214, 92, 0.55))
      drop-shadow(0 0 34px rgba(255, 183, 40, 0.3));
  }
  50% {
    filter:
      drop-shadow(0 8px 16px rgba(0,0,0,0.15))
      drop-shadow(0 0 26px rgba(255, 224, 120, 0.8))
      drop-shadow(0 0 52px rgba(255, 183, 40, 0.48));
  }
}
.hero-video {
  margin: 22px auto 0;
}
.hero-cta {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.hero-chars {
  max-width: 680px;
  width: 100%;
  aspect-ratio: 1.5 / 1;
  height: auto;
  margin: 14px auto 0;
  animation: float-y 4.2s ease-in-out infinite;
  animation-delay: -1.4s;
}

@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-title, .hero-chars { animation: none; }
  .hero-title {
    filter:
      drop-shadow(0 8px 16px rgba(0,0,0,0.15))
      drop-shadow(0 0 22px rgba(255, 214, 92, 0.6));
  }
}

/* Sections */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 56px 20px;
  text-align: center;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(22px, 4vw, 30px);
  color: var(--navy);
  margin: 0 0 10px;
}
.section-sub {
  color: #5b6478;
  margin: 0 0 32px;
  font-size: 15px;
}

/* Ad video */
.video-frame {
  max-width: 760px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
  border: 5px solid var(--blue-dark);
}
.ad-video { width: 100%; display: none; }
.ad-video--landscape { display: block; aspect-ratio: 16/9; object-fit: cover; }
.ad-video--portrait { display: none; aspect-ratio: 9/16; object-fit: cover; max-width: 380px; margin: 0 auto; }

@media (max-width: 767px) {
  .ad-video--landscape { display: none; }
  .ad-video--portrait { display: block; }
}

/* Prizes */
.prize-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
}
.prize-card {
  position: relative;
  background: linear-gradient(180deg, var(--white), #fffaf0);
  border-radius: 24px;
  padding: 30px 18px 24px;
  box-shadow: var(--clay-shadow);
  border: 3px solid var(--edge-gold);
  transition: transform .2s cubic-bezier(.22,.61,.36,1), box-shadow .2s ease;
}
.prize-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--clay-shadow-lift);
}
.prize-card--quarter {
  border-color: var(--pink);
  background: linear-gradient(180deg, var(--white), var(--tint-pink));
}
.prize-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  white-space: nowrap;
}
.prize-img { height: 120px; width: auto; margin: 10px auto 14px; object-fit: contain; }
.prize-name { margin: 0 0 4px; font-size: 17px; color: var(--navy); }
.prize-note { margin: 0; color: #5b6478; font-size: 14px; }

.prize-card--link { display: block; cursor: pointer; }
.prize-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  color: var(--blue-dark);
  font-weight: 700;
  font-size: 13.5px;
}
.prize-cta .icon { width: 14px; height: 14px; }
.prize-card--link:hover .prize-cta { text-decoration: underline; }

/* Shared panel geometry. Only one card level per section: the how-to section is
   itself the card, while invite and FAQ hand that role to their inner items. */
.howto-section,
.panel-section {
  position: relative;
  max-width: calc(var(--max-w) - 40px);
  margin: 28px auto;
}
.howto-section {
  background: linear-gradient(180deg, var(--white), var(--tint-gold));
  border: 3px solid var(--edge-gold);
  border-radius: 28px;
  box-shadow: var(--clay-shadow);
}
.howto-copy { max-width: 600px; margin: 0 auto 26px; color: var(--navy); font-size: 16px; }

/* Invite: the template reads as an actual note handed to the teacher */
.invite-card {
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
  background: var(--white);
  border: 3px solid var(--edge-blue);
  border-radius: 22px;
  padding: 26px 26px 24px;
  box-shadow: var(--clay-shadow);
}
.invite-card-head {
  display: inline-block;
  font-weight: 700;
  color: var(--white);
  background: var(--blue-dark);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 14px;
  font-size: 14px;
}
.invite-text { color: var(--navy); font-size: 16px; }
.invite-link { color: var(--blue-dark); word-break: break-all; }
.invite-card .btn { margin-top: 20px; width: 100%; justify-content: center; }

/* FAQ: each question is its own chunky card */
.faq-list { max-width: 780px; margin: 0 auto; text-align: left; display: grid; gap: 14px; }
.faq-item {
  background: var(--white);
  border: 3px solid var(--edge-pink);
  border-radius: 20px;
  padding: 18px 22px;
  box-shadow: var(--clay-shadow);
  transition: transform .2s cubic-bezier(.22,.61,.36,1);
}
.faq-item:hover { transform: translateY(-3px); }
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 18px;
  color: var(--navy);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "+";
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pink);
  color: var(--white);
  font-size: 20px;
  line-height: 1;
}
.faq-item[open] summary::before { content: "–"; background: var(--navy); }
.faq-item p { margin: 12px 0 2px 40px; color: #4a5268; font-size: 16px; }

/* Social */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 5px 0 var(--navy-dark);
  transition: transform .1s ease, box-shadow .1s ease, background .15s ease;
}
.social-link:hover { background: var(--navy-dark); }
.social-link:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--navy-dark); }
.social-link .icon { width: 22px; height: 22px; }

.social-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 28px;
}

.contact-card {
  border-radius: 22px;
  padding: 22px 28px 24px;
  box-shadow: var(--clay-shadow);
  text-align: center;
}
.contact-card--line { background: linear-gradient(180deg, var(--white), #eafbf0); border: 3px solid #b9e8c9; }
.contact-card--fb { background: linear-gradient(180deg, var(--white), var(--tint-blue)); border: 3px solid var(--edge-blue); }
.contact-title { margin: 0 0 14px; font-weight: 700; color: var(--navy); font-size: 17px; }
.contact-image {
  width: 140px;
  height: 140px;
  margin: 0 auto 16px;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 4px 10px rgba(34,49,79,0.12);
}
.line-contact-icon { width: 22px; height: 22px; border-radius: 50%; }

.social-link--line {
  background: #06c755;
  color: var(--navy);
  box-shadow: 0 5px 0 #028a3c;
}
.social-link--line:hover { background: #05b94d; }
.social-link--line:active { box-shadow: 0 2px 0 #028a3c; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 36px 20px 100px;
  color: #5b6478;
  font-size: 13px;
}
.footer-logo { height: 36px; margin: 0 auto 10px; border-radius: 8px; }

/* LINE floating button */
.line-float {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
}
.line-float-btn {
  position: relative;
  display: block;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  background: var(--white);
  animation: line-pulse 2.4s ease-in-out infinite;
}
.line-float-btn img { width: 100%; height: 100%; border-radius: 50%; }
@keyframes line-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

.line-teaser {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--navy);
  color: var(--white);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  padding: 8px 12px;
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.line-teaser::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: var(--navy);
}
.line-qr-popup {
  position: absolute;
  bottom: 70px;
  right: 0;
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px;
  width: 150px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s ease, transform .18s ease;
}
.line-qr-popup p { margin: 8px 0 0; font-size: 12px; color: var(--navy); }
.line-float:hover .line-qr-popup,
.line-float:focus-within .line-qr-popup {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 480px) {
  .line-qr-popup { display: none; }
  .line-teaser { font-size: 11px; padding: 6px 10px; right: calc(100% + 8px); }
}
