/* -------------------------------------------------------
   CHRISTMAS THEME VARIABLES
------------------------------------------------------- */
:root {
  --bg: #f7f4f0;
  --bg-dark: #03110a;

  --card: #ffffff;
  --card-border: rgba(0, 0, 0, 0.08);
  --card-shadow: rgba(0, 0, 0, 0.1);

  --red: #c62525;
  --red-dark: #9f1b1b;
  --green: #1e4d2b;
  --gold: #d4a017;

  --text-main: #333333;
  --text-soft: #6b6b6b;

  --accent: var(--red);
  --accent-soft: rgba(198, 37, 37, 0.12);

  --radius: 18px;
}

/* -------------------------------------------------------
   GLOBAL
------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 55%),
    radial-gradient(circle at top right, rgba(255, 243, 230, 0.9), transparent 55%),
    linear-gradient(to bottom, #f7f4f0, #f1e6dc);
  color: var(--text-main);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 1.25rem;
}

/* -------------------------------------------------------
   LAYOUT
------------------------------------------------------- */
.app-shell {
  max-width: 1100px;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1.5rem;
}

@media (max-width: 800px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------
   CARDS
------------------------------------------------------- */
.card {
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(255,245,240,0.98));
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 24px var(--card-shadow);
  padding: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .9rem;
}

.title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--red-dark);
}

.subtitle {
  color: var(--text-soft);
  font-size: .9rem;
}

.badge {
  font-size: .75rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(198,37,37,0.3);
  color: var(--red-dark);
}

/* -------------------------------------------------------
   FORM FIELDS
------------------------------------------------------- */
.field-group {
  margin-bottom: .9rem;
}

.field-label {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-soft);
  margin-bottom: .35rem;
  display: flex;
  justify-content: space-between;
}

.field-label span {
  font-size: .7rem;
}

input[type="text"],
select,
textarea {
  width: 100%;
  padding: .6rem .75rem;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.9);
  font-size: .9rem;
  color: var(--text-main);
  transition: border-color .1s, box-shadow .1s, background .1s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(198,37,37,0.25);
  background: white;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.error-msg {
  font-size: .8rem;
  color: #b91c1c;
}

/* -------------------------------------------------------
   STYLE GRID
------------------------------------------------------- */
.santa-style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .75rem;
}

.santa-style-card {
  border-radius: 16px;
  padding: .45rem .45rem .6rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.98), rgba(255,244,238,0.98));
  border: 2px solid transparent;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  text-align: center;
  cursor: pointer;
  transition: .1s;
}

.santa-style-card.is-selected {
  border-color: var(--red);
  box-shadow: 0 0 0 1px rgba(198,37,37,0.4), 0 10px 22px rgba(198,37,37,0.4);
}

.santa-style-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 12px;
}

/* -------------------------------------------------------
   PILLS (TONE SELECTOR)
------------------------------------------------------- */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.pill {
  border-radius: 999px;
  padding: .45rem .95rem;
  font-size: .85rem;
  border: 1px solid var(--red);
  background: rgba(198,37,37,0.06);
  cursor: pointer;
  white-space: nowrap;
}

.pill--selected {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: white;
  border-color: var(--red-dark);
  box-shadow: 0 6px 14px rgba(198,37,37,0.35);
}

/* -------------------------------------------------------
   BUTTONS
------------------------------------------------------- */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .7rem;
}

.btn {
  border-radius: 999px;
  padding: .55rem 1.3rem;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  box-shadow: 0 10px 22px rgba(198,37,37,0.45);
}

.btn-ghost {
  background: rgba(30,77,43,0.06);
  color: var(--green);
  border: 2px solid var(--green);
}

/* -------------------------------------------------------
   SCRIPT PREVIEW
------------------------------------------------------- */
.script-preview {
  padding: .8rem .9rem;
  border-radius: 12px;
  border: 1px dashed rgba(0,0,0,0.16);
  background: rgba(255,255,255,0.9);
  font-size: .9rem;
  white-space: pre-wrap;
}

/* -------------------------------------------------------
   PHONE PREVIEW FRAME (BUILDER)
------------------------------------------------------- */
.phone-frame {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  aspect-ratio: 9/19.5;
  border-radius: 32px;
  border: 2px solid var(--red);
  padding: .5rem;
  background: linear-gradient(to bottom, #fff8f0, #ffede5);
  box-shadow: 0 18px 40px rgba(198,37,37,0.35);
  position: relative;
}

.phone-notch {
  position: absolute;
  top: .5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 18px;
  background: rgba(0,0,0,0.12);
  border-radius: 999px;
}

.phone-inner {
  position: absolute;
  inset: .9rem .5rem .6rem;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* -------------------------------------------------------
   INCOMING CALL UI
------------------------------------------------------- */
.call-header {
  padding: .6rem .75rem;
  text-align: center;
  font-size: .82rem;
  color: var(--text-soft);
}

.call-avatar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
}

.call-avatar img {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  object-fit: cover;
  border: 3px solid white;
  box-shadow: 0 0 0 4px rgba(214,59,59,0.35), 0 14px 30px rgba(0,0,0,0.35);
}

.call-footer {
  display: flex;
  justify-content: center;
  gap: 1.4rem;
  padding-bottom: .9rem;
}

/* Call buttons */
.call-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  font-size: 1.1rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.call-btn.accept { background: var(--green); }
.call-btn.decline { background: var(--red); }
.call-btn.end {
  background: var(--red);
  width: 70px;
  border-radius: 999px;
  font-size: .8rem;
  text-transform: uppercase;
}

/* -------------------------------------------------------
   LIVE CALL
------------------------------------------------------- */
.live-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: .7rem;
  background: linear-gradient(to top, rgba(0,0,0,.45), transparent 35%, transparent 70%, rgba(0,0,0,.35));
  color: white;
}

.live-top {
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
}

.live-bottom {
  display: none;
  justify-content: center;
  padding-bottom: 1.2rem;
  z-index: 5;
}

.status-pill {
  font-size: .7rem;
  padding: .15rem .6rem;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(249,250,251,0.4);
}

/* -------------------------------------------------------
   MOBILE FULLSCREEN MODE
------------------------------------------------------- */
@media (max-width: 640px) {
  body {
    padding: 0;
    background: black;
  }


  .card-phone {
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
  }

  .phone-frame {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
    padding: 0;
    background: black;
    box-shadow: none;
  }

  .phone-inner {
    inset: env(safe-area-inset-top, 12px)
           env(safe-area-inset-right, 0)
           env(safe-area-inset-bottom, 8px)
           env(safe-area-inset-left, 0);
    border-radius: 0;
  }
}
.santa-style-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 0.35rem;
}

.santa-thumb-wrapper {
  position: relative;
}

.santa-style-card--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.santa-style-card--disabled img {
  filter: grayscale(90%) blur(2px) brightness(0.7);
}

.santa-coming-soon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 12px;
  letter-spacing: 0.05em;
}

.santa-style-grid img {
  max-width: 180px;     /* adjust to your taste */
  width: 100%;
  height: auto;
  border-radius: 12px;
}
.santa-style-grid .santa-style-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}


/* -------------------------------------------------------
   MOBILE FULLSCREEN MODE
   (ONLY for the kid call page)
------------------------------------------------------- */
/* -------------------------------------------------------
   MOBILE FULLSCREEN MODE
   (ONLY for the kid call page)
------------------------------------------------------- */
@media (max-width: 640px) {
  body.call-only-page {
    padding: 0;
    background: black;
  }

  body.call-only-page .card-builder {
    display: none;
  }

  body.call-only-page .card-phone {
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
  }

  body.call-only-page .phone-frame {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
    padding: 0;
    background: black;
    box-shadow: none;
  }

  body.call-only-page .phone-inner {
    inset: env(safe-area-inset-top, 12px)
           env(safe-area-inset-right, 0)
           env(safe-area-inset-bottom, 8px)
           env(safe-area-inset-left, 0);
    border-radius: 0;
  }
}



/* -------------------------------------------------------
   MOBILE LAYOUT FIXES FOR BUILDER (Santa-call.html)
------------------------------------------------------- */
@media (max-width: 768px) {
  /* Make the whole page a simple vertical stack */
  .app-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    align-items: stretch;
  }

  /* Cards: full width, softer padding on small screens */
  .card {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 1rem 1.1rem;
    border-radius: 18px;
  }

  .card-builder,
  .card-phone {
    width: 100%;
    max-width: 480px;
    margin-inline: auto;
  }

  /* Keep the fake phone nicely centered and not gigantic */
  .phone-frame {
    width: 100%;
    max-width: 360px;
    margin: 0 auto;
  }

  /* On the builder page we don’t need weird insets like the call-only page */
  .phone-inner {
    position: relative;
    inset: auto;
    border-radius: 24px;
  }

  /* Tighten up vertical spacing inside the phone on mobile */
  .phone-top-row,
  .phone-bottom-row {
    padding: 0.35rem 0.6rem;
  }

  .live-status-pill {
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
  }

  .call-status-text {
    font-size: 0.85rem;
  }

  .call-controls button {
    transform: scale(0.9);
  }

  /* Form fields: reduce side-by-side crowding if any */
  .field-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
  }
}

/* -------------------------------------------------------
   MOBILE FIX: Make preview video fill the phone frame
------------------------------------------------------- */
/* -------------------------------------------------------
   MOBILE: Make preview phone taller
------------------------------------------------------- */
@media (max-width: 640px) {

  /* Phone frame should simulate a real phone screen ratio */
  .phone-frame {
    width: 100%;
    max-width: 360px;        /* good size for mobile preview */
    aspect-ratio: 9 / 16;    /* 🔥 forces tall phone shape */
    margin: 0 auto;
    overflow: hidden;
  }

  /* Make the inside stretch to fill that ratio */
  .phone-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  /* Make the video container fill the phone */
  .call-video-shell {
    flex: 1;                 /* 🔥 take all available height */
    position: relative;
    overflow: hidden;
  }

  /* Video fills the full phone now */
  .live-video,
  #santaVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}


/* iOS Hang Up Button */
.end-call-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #FF3B30; /* iOS system red */
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow:
      0 8px 20px rgba(255, 59, 48, 0.35),
      0 4px 10px rgba(255, 59, 48, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.end-call-btn svg {
  width: 28px;
  height: 28px;
  fill: white;
  transform: rotate(-225deg); /* same tilt as iOS End Call */
  opacity: 0.95;             /* iOS icon slightly softened */
}

.end-call-btn:active {
  transform: scale(0.94);
  box-shadow:
      0 4px 12px rgba(255, 59, 48, 0.3),
      0 2px 6px rgba(255, 59, 48, 0.2);
}
