:root {
  --kfc-red: #e4002b;
  --kfc-red-dark: #a3001f;
  --kfc-black: #1a1a1a;
  --kfc-white: #ffffff;
  --kfc-cream: #fff6ec;
  --grey-border: #9d9d9d;
  --font-display: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #fff;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}

[hidden] {
  display: none !important;
}

/* ---------- Page wrapper ---------- */

.device {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
}

/* ---------- Ad container ---------- */

.ad {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--kfc-white);
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- Loader ---------- */

.loader {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--kfc-white);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.ad:not(.is-loading) .loader {
  opacity: 0;
  visibility: hidden;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(228, 0, 43, 0.15);
  border-top-color: var(--kfc-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Close button ---------- */

.close-btn {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: 10px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
}

.close-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
}

/* ---------- Video ---------- */

.video-wrap {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.video-ui {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.countdown {
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

.sound-btn {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
}

.sound-btn svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

.sound-btn .icon-sound,
.sound-btn.is-unmuted .icon-muted {
  display: none;
}

.sound-btn.is-unmuted .icon-sound {
  display: block;
}

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--kfc-red);
}

.play-overlay,
.replay-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.play-overlay svg,
.replay-overlay svg {
  width: 44px;
  height: 44px;
  padding: 8px;
  border-radius: 50%;
  background: var(--kfc-red);
  fill: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* Fallback slate when no video file is available */

.video-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--kfc-red);
  overflow: hidden;
}

.fallback-stripes {
  position: absolute;
  inset: -50%;
  background: repeating-linear-gradient(
    90deg,
    var(--kfc-red) 0 28px,
    var(--kfc-white) 28px 40px
  );
  opacity: 0.18;
  animation: stripes 6s linear infinite;
}

@keyframes stripes {
  to { transform: translateX(80px); }
}

.fallback-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
}

.fallback-logo {
  font-family: var(--font-display);
  font-size: 54px;
  line-height: 1;
  letter-spacing: 2px;
  animation: pop 0.8s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.fallback-tag {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  animation: fadeUp 0.6s 0.5s ease both;
}

@keyframes pop {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fadeUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---------- Key visual ---------- */

.kv {
  position: relative;
  flex: none;
  width: 100%;
  aspect-ratio: 640 / 239;
  cursor: pointer;
  overflow: hidden;
}

.kv-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  display: block;
}

.kv-art {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 4%;
  padding: 0 5%;
  background:
    radial-gradient(circle at 18% 50%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(135deg, var(--kfc-red) 0%, var(--kfc-red-dark) 100%);
  color: var(--kfc-white);
}

.bucket {
  position: relative;
  flex: none;
  width: 27%;
  height: 84%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: bucketIn 0.7s 0.3s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.bucket-chicken {
  position: absolute;
  top: 0;
  left: 6%;
  right: 6%;
  height: 34%;
  border-radius: 50% 50% 30% 30%;
  background:
    radial-gradient(circle at 25% 60%, #d98a2b 0 28%, transparent 30%),
    radial-gradient(circle at 55% 40%, #e9a03f 0 30%, transparent 32%),
    radial-gradient(circle at 80% 62%, #c97a1f 0 26%, transparent 28%);
}

.bucket-body {
  position: relative;
  height: 72%;
  clip-path: polygon(0 0, 100% 0, 88% 100%, 12% 100%);
  background: repeating-linear-gradient(
    90deg,
    var(--kfc-red) 0 16%,
    var(--kfc-white) 16% 26%
  );
  border-top: 4px solid var(--kfc-white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bucket-body span {
  padding: 2px 6px;
  background: var(--kfc-white);
  color: var(--kfc-red);
  font-family: var(--font-display);
  font-size: clamp(10px, 3.6vw, 15px);
  border-radius: 3px;
}

.kv-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.kv-title {
  font-family: var(--font-display);
  font-size: clamp(17px, 6.4vw, 26px);
  line-height: 0.98;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  animation: fadeUp 0.6s 0.4s ease both;
}

.kv-sub {
  font-size: clamp(10px, 3.1vw, 13px);
  font-weight: 600;
  opacity: 0.95;
  animation: fadeUp 0.6s 0.55s ease both;
}

.kv-pill {
  margin-top: 2px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--kfc-white);
  color: var(--kfc-red);
  font-size: clamp(9px, 2.8vw, 11px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  animation: fadeUp 0.6s 0.7s ease both, nudge 2.4s 1.6s ease-in-out infinite;
}

@keyframes bucketIn {
  from { transform: translateY(30%) scale(0.7); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes nudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2px); }
}

/* ---------- Store locator ---------- */

.locator {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.map {
  position: relative;
  flex: 1;
  min-height: 90px;
  background: #e8eaed;
}

.map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.map-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #eef0f2;
  color: #555;
  font-size: 12px;
  font-weight: 600;
  transition: opacity 0.4s ease;
}

.map-status.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.pin-pulse {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--kfc-red);
  box-shadow: 0 0 0 0 rgba(228, 0, 43, 0.5);
  animation: pulse 1.4s ease-out infinite;
}

@keyframes pulse {
  to { box-shadow: 0 0 0 18px rgba(228, 0, 43, 0); }
}

.store-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--kfc-white);
  border-top: 1px solid var(--grey-border);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}

.store-info {
  flex: 1;
  min-width: 0;
}

.store-label {
  color: var(--kfc-red);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.store-name {
  margin-top: 1px;
  color: var(--kfc-black);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-meta {
  margin-top: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  color: #555;
  font-size: 10.5px;
}

.store-meta span:empty {
  display: none;
}

.cta-group {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 38%;
  max-width: 150px;
}

.cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.cta svg {
  flex: none;
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.cta:active {
  transform: scale(0.96);
  filter: brightness(0.92);
}

.cta-primary {
  background: var(--kfc-red);
  color: var(--kfc-white);
}

.cta-secondary {
  background: var(--kfc-white);
  color: var(--kfc-red);
  border: 1.5px solid var(--kfc-red);
}

/* ---------- Closed (preview only) ---------- */

.closed-screen {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #f4f4f4;
  color: #555;
  font-size: 14px;
}

.closed-screen button {
  padding: 8px 18px;
  border-radius: 4px;
  background: var(--kfc-red);
  color: #fff;
  font-weight: 700;
}

/* ---------- Small / short phones ---------- */

@media (max-height: 560px) {
  .store-bar {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .cta {
    height: 24px;
    font-size: 10px;
  }
}
