/* ============================================================
   Project Careerpillar Photo Booth - Ocean look
   Colors: Ocean (blues + white) | Font: Playful & Round | Layout: Big Center
   ============================================================ */

:root {
  --color-primary:      #0ea5e9;
  --color-primary-dark: #0369a1;
  --color-accent:       #22d3ee;
  --color-deep:         #062a45;
  --color-text:         #06263a;
  --color-card:         #ffffff;
  --color-soft:         #e0f2fe;

  --font-main: 'Nunito', 'Zen Maru Gothic', 'Noto Sans TC', system-ui, sans-serif;
  --font-cjk:  'Zen Maru Gothic', 'Noto Sans TC', 'Nunito', system-ui, sans-serif;

  --radius: 24px;
  --shadow: 0 18px 40px rgba(4, 38, 64, 0.28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--color-text);
  background: linear-gradient(180deg, #0891b2 0%, #0369a1 45%, #062a45 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Background bubbles ---------- */
.bubbles {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.bubbles span {
  position: absolute;
  bottom: -120px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.85), rgba(255,255,255,0.06) 70%);
  animation: rise linear infinite;
}
.bubbles span:nth-child(1)  { left: 6%;  width: 26px; height: 26px; animation-duration: 13s; animation-delay: 0s; }
.bubbles span:nth-child(2)  { left: 18%; width: 14px; height: 14px; animation-duration: 10s; animation-delay: 2s; }
.bubbles span:nth-child(3)  { left: 30%; width: 34px; height: 34px; animation-duration: 16s; animation-delay: 1s; }
.bubbles span:nth-child(4)  { left: 44%; width: 18px; height: 18px; animation-duration: 11s; animation-delay: 4s; }
.bubbles span:nth-child(5)  { left: 57%; width: 28px; height: 28px; animation-duration: 15s; animation-delay: 0.5s; }
.bubbles span:nth-child(6)  { left: 68%; width: 12px; height: 12px; animation-duration: 9s;  animation-delay: 3s; }
.bubbles span:nth-child(7)  { left: 78%; width: 40px; height: 40px; animation-duration: 18s; animation-delay: 2s; }
.bubbles span:nth-child(8)  { left: 88%; width: 20px; height: 20px; animation-duration: 12s; animation-delay: 5s; }
.bubbles span:nth-child(9)  { left: 50%; width: 10px; height: 10px; animation-duration: 8s;  animation-delay: 6s; }
.bubbles span:nth-child(10) { left: 24%; width: 22px; height: 22px; animation-duration: 14s; animation-delay: 7s; }

@keyframes rise {
  0%   { transform: translateY(0) scale(1);   opacity: 0; }
  10%  { opacity: 0.9; }
  100% { transform: translateY(-115vh) scale(1.15); opacity: 0; }
}

/* ---------- Corner sprites ---------- */
.sprite {
  position: fixed;
  bottom: 18px;
  width: clamp(90px, 14vw, 190px);
  height: auto;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.25));
  animation: bob 4s ease-in-out infinite;
}
.sprite-left  { left: 14px; }
.sprite-right { right: 14px; animation-delay: 1.2s; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* ---------- Booth & screens ---------- */
.booth {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
}

.screen { display: none; }
.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: min(680px, 100%);
  animation: fadein 0.35s ease;
}
@keyframes fadein { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Text ---------- */
.kicker {
  font-family: var(--font-cjk);
  letter-spacing: 0.18em;
  color: #cffafe;
  font-size: 1rem;
  margin: 0 0 6px;
}
.title {
  font-family: var(--font-cjk);
  font-size: clamp(3rem, 12vw, 5.5rem);
  line-height: 1.02;
  margin: 0;
  color: #ffffff;
  text-shadow: 0 6px 0 rgba(3, 105, 161, 0.55), 0 14px 30px rgba(0,0,0,0.35);
}
.subtitle {
  font-size: clamp(1.05rem, 3.6vw, 1.4rem);
  color: #e0f2fe;
  margin: 18px 0 26px;
}
.screen-title {
  font-family: var(--font-cjk);
  color: #ffffff;
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  margin: 0 0 18px;
  text-shadow: 0 3px 12px rgba(0,0,0,0.3);
}
.hint { color: #bae6fd; font-size: 0.95rem; margin-top: 16px; }
.step-label { color: #e0f2fe; font-size: 1.1rem; margin: 22px 0 12px; }
.loading-text { color: #ffffff; font-size: 1.5rem; font-family: var(--font-cjk); }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-cjk);
  font-size: 1.15rem;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 16px 34px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
  box-shadow: var(--shadow);
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: linear-gradient(180deg, #38bdf8, #0ea5e9); color: #ffffff; }
.btn-primary:hover { background: linear-gradient(180deg, #22d3ee, #0284c7); }
.btn-secondary { background: #ffffff; color: var(--color-primary-dark); }
.btn-ghost {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  box-shadow: none;
  font-size: 1rem;
  padding: 12px 26px;
  margin-top: 14px;
  border: 2px solid rgba(255,255,255,0.4);
}
.btn-big { font-size: 1.5rem; padding: 22px 60px; margin-top: 6px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 22px;
}

/* ---------- Camera ---------- */
.camera-wrap {
  width: min(640px, 92vw);
  border-radius: var(--radius);
  overflow: hidden;
  border: 6px solid #ffffff;
  box-shadow: var(--shadow);
  background: #012;
}
#video { display: block; width: 100%; height: auto; background: #012; }

.shutter {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 7px solid #ffffff;
  background: radial-gradient(circle at 35% 30%, #67e8f9, #0ea5e9);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.1s ease;
}
.shutter:active { transform: scale(0.9); }

/* ---------- Preview + styles ---------- */
.preview-wrap {
  width: min(420px, 84vw);
  border-radius: var(--radius);
  overflow: hidden;
  border: 6px solid #ffffff;
  box-shadow: var(--shadow);
}
#preview-img { display: block; width: 100%; height: auto; }

.styles { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.style-chip {
  font-family: var(--font-cjk);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 130px;
  padding: 16px 10px;
  border-radius: 20px;
  border: 3px solid rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.14);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}
.style-chip:hover { transform: translateY(-3px); }
.style-chip.selected {
  background: #ffffff;
  color: var(--color-primary-dark);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(34,211,238,0.5);
}
.style-emoji { font-size: 2rem; }

/* ---------- Result frame ---------- */
.frame {
  background: linear-gradient(180deg, #0ea5e9, #0c4a6e);
  padding: 16px 16px 8px;
  border-radius: 18px;
  border: 6px solid #ffffff;
  box-shadow: var(--shadow);
  width: min(440px, 86vw);
}
#result-img { display: block; width: 100%; height: auto; border-radius: 10px; background: #fff; }
.frame-caption {
  font-family: var(--font-cjk);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 12px 0 8px;
  font-size: 1.2rem;
}

/* ---------- Loading spinner ---------- */
.spinner {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 9px solid rgba(255,255,255,0.25);
  border-top-color: #ffffff;
  animation: spin 0.9s linear infinite;
  margin-bottom: 22px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.oops { font-size: 4rem; margin-bottom: 10px; }

/* ---------- Phones ---------- */
@media (max-width: 480px) {
  .sprite { width: 84px; opacity: 0.9; }
  .btn-big { padding: 18px 44px; }
  .row { gap: 10px; }
}
