/*
 * Gift player. System fonts on purpose: the Fiddich Now web licence covers
 * Glenfiddich's own website only — swap in once licensed for this domain.
 */
:root {
  --green: #204338;
  --green-deep: #0d1f19;
  --ivory: #f7f5f1;
  --gold: #c9a45c;
  --white: #fff;
  --font: -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(120% 80% at 50% 0%, var(--green) 0%, var(--green-deep) 70%);
  background-color: var(--green-deep);
  color: var(--white);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

#app {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
}

.stag {
  position: absolute;
  right: -18%;
  bottom: -4%;
  height: 62svh;
  opacity: 0.08;
  pointer-events: none;
}

/* Only the active screen is shown; screens crossfade. */
.screen {
  grid-area: 1 / 1;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.8s ease, transform 0.8s ease, visibility 0s linear 0.8s;
}

#app[data-screen='gate'] [data-for='gate'],
#app[data-screen='underage'] [data-for='underage'],
#app[data-screen='unwrap'] [data-for='unwrap'],
#app[data-screen='play'] [data-for='play'],
#app[data-screen='state'] [data-for='state'],
#app[data-screen='loading'] [data-for='loading'] {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 500;
  text-transform: uppercase;
}

.body, .fine {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  opacity: 0.75;
}

.fine { font-size: 12px; opacity: 0.6; }

.actions { display: flex; gap: 12px; }

.btn {
  min-width: 120px;
  min-height: 48px;
  padding: 0 28px;
  border: none;
  border-radius: 3px;
  font: 600 12px/1 var(--font);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.btn-light { background: var(--white); color: var(--green-deep); }
.btn-ghost { background: rgba(255, 255, 255, 0.18); color: var(--white); }

/* ── Unwrap ─────────────────────────────────────────────────────────── */

.unwrap {
  position: relative;
  width: min(78vw, 320px);
  aspect-ratio: 4 / 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: none;
  border-radius: 6px;
  background: var(--ivory);
  color: var(--green-deep);
  font-family: var(--font);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  animation: breathe 3.6s ease-in-out infinite;
}

/* Gold ribbons crossing the "gift", with a label tied where they meet. */
.unwrap { overflow: hidden; }
.ribbon { position: absolute; background: var(--gold); }
.ribbon-v { top: 0; bottom: 0; left: calc(50% - 7px); width: 14px; }
.ribbon-h { left: 0; right: 0; top: calc(50% - 7px); height: 14px; }

.gift-label {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 22px;
  background: var(--ivory);
  border: 1px solid var(--gold);
  border-radius: 3px;
}
.unwrap-title { font-size: 22px; font-weight: 500; text-transform: uppercase; }
.unwrap-cta { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.6; }

@keyframes breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ── Player + occasion frames ───────────────────────────────────────── */
/*
 * Every frame is the same gift-card mount — a fine gold inner rule echoing
 * the label's gold band, a stag seal at the top and the occasion set in
 * spaced capitals under the 4:5 video. Themes only change colours and the
 * pattern in the mount, so a new occasion is one small block of variables.
 * TODO(brand): swap in supplied frame artwork if it arrives.
 */
.frame {
  --frame-bg: var(--ivory);
  --frame-pattern: none;
  --frame-rule: var(--gold);
  --frame-ink: var(--green-deep);
  --seal-bg: var(--ivory);

  position: relative;
  width: min(84vw, 380px);
  padding: 22px 22px 64px;
  border-radius: 4px;
  background: var(--frame-pattern), var(--frame-bg);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.25);
}

/* Fine double gold rule just inside the edge. */
.frame::before {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px solid var(--frame-rule);
  border-radius: 2px;
  box-shadow: inset 0 0 0 3px transparent, inset 0 0 0 4px color-mix(in srgb, var(--frame-rule) 45%, transparent);
  pointer-events: none;
}

/* The occasion, set like an engraved line under the picture. */
.frame::after {
  content: attr(data-label);
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  text-align: center;
  color: var(--frame-ink);
  font: 600 11px/1 var(--font);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* Stag seal sitting on the top rule. */
.seal {
  position: absolute;
  z-index: 2;
  top: -17px;
  left: 50%;
  width: 36px;
  height: 36px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--seal-bg);
  box-shadow: 0 0 0 1px var(--frame-rule), 0 4px 10px rgba(0, 0, 0, 0.3);
}

.seal::after {
  content: '';
  position: absolute;
  inset: 6px 7px 5px;
  background: var(--frame-rule);
  -webkit-mask: url('/stag.svg') center / contain no-repeat;
  mask: url('/stag.svg') center / contain no-repeat;
}

.frame video {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 2px;
  background: #000;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--frame-rule) 60%, transparent);
}

.replay {
  position: absolute;
  left: 50%;
  top: calc(22px + (100% - 86px) / 2);
  transform: translate(-50%, -50%);
  min-height: 44px;
  padding: 0 24px;
  border: none;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--green-deep);
  font: 600 12px/1 var(--font);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Classic: ivory mount, gold rule. */
.theme-none { }

/* Christmas: deep forest green with a faint field of gold stars. */
.theme-christmas {
  --frame-bg: linear-gradient(170deg, #1a3d30, #0f2a20);
  --frame-pattern:
    radial-gradient(circle, rgba(201, 164, 92, 0.55) 0.9px, transparent 1.3px) 0 0 / 22px 22px,
    radial-gradient(circle, rgba(255, 255, 255, 0.35) 0.7px, transparent 1.1px) 11px 11px / 22px 22px;
  --frame-ink: var(--gold);
  --seal-bg: #12301f;
}

/* Father's Day: dark tweed with a fine gold pinstripe check. */
.theme-fathers-day {
  --frame-bg: #1d2620;
  --frame-pattern:
    repeating-linear-gradient(90deg, rgba(201, 164, 92, 0.22) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(0deg, rgba(201, 164, 92, 0.22) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.025) 0 2px, transparent 2px 4px);
  --frame-ink: var(--gold);
  --seal-bg: #1d2620;
}

/* Birthday: ivory with soft gold confetti. */
.theme-birthday {
  --frame-pattern:
    radial-gradient(circle at 18% 28%, rgba(201, 164, 92, 0.75) 1.6px, transparent 2px) 0 0 / 34px 34px,
    radial-gradient(circle at 72% 64%, rgba(201, 164, 92, 0.45) 1.1px, transparent 1.5px) 0 0 / 26px 26px,
    radial-gradient(circle at 40% 82%, rgba(32, 67, 56, 0.35) 1.2px, transparent 1.6px) 0 0 / 30px 30px;
}
