:root {
  --orange: #ff7900;
  --orange-deep: #e56a00;
  --navy: #0c2d7a;
  --navy-panel: #0a2463;
  --grey-bg: #e3e3e3;
  --grey-light: #ececec;
  --ink: #1a1a1a;
  --stage: 600px;
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html,
body {
  margin: 0;
  min-height: 100%;
  background: #111;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  font-family: Arial, "Segoe UI", sans-serif;
}

#stage {
  width: var(--stage);
  height: var(--stage);
  position: relative;
  overflow: hidden;
  background: var(--grey-bg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.frame {
  display: none;
  position: absolute;
  inset: 0;
}

.frame.is-active { display: block; }

button {
  font-family: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

/* —— Logo lockups —— */
.lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lockup__mark {
  width: 52px;
  height: 52px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.lockup__pride {
  font-family: "Arial Black", Impact, Arial, sans-serif;
  font-size: 28px;
  letter-spacing: 0.06em;
  line-height: 1;
  color: #fff;
}

.lockup--intro .lockup__mark { width: 58px; height: 58px; }
.lockup--intro .lockup__pride { font-size: 32px; }

.lockup--panel .lockup__mark { width: 48px; height: 48px; }
.lockup--panel .lockup__pride { font-size: 26px; }

.lockup--tab .lockup__mark { width: 28px; height: 28px; }
.lockup--tab .lockup__pride { font-size: 14px; letter-spacing: 0.1em; }

.lockup--end .lockup__mark { width: 36px; height: 36px; }
.lockup--end .lockup__pride { font-size: 18px; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }

/* —— Frame 1: intro —— */
.intro-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.intro-grey {
  flex: 0 0 305px;
  background: var(--grey-bg);
}

.intro-band {
  flex: 1;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 22px;
}

.intro-sunset {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 180, 90, 0.35) 0%, transparent 28%),
    linear-gradient(180deg, #ffb347 0%, #ff8c42 35%, #e85d04 68%, #7b2cbf 100%);
}

.intro-band .lockup {
  position: relative;
  z-index: 1;
}

[data-frame="intro"].intro-play .intro-band {
  animation: intro-rise 1.1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes intro-rise {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* —— Frame 2: upload —— */
.upload-bg {
  position: absolute;
  inset: 0;
  background: var(--grey-bg);
}

.upload-lower {
  position: absolute;
  inset: 292px 0 0;
  background: #f7f7f7;
}

.corner-stripe {
  position: absolute;
  right: 0;
  top: 270px;
  width: 138px;
  height: 88px;
  overflow: hidden;
  pointer-events: none;
}

.corner-stripe::before,
.corner-stripe::after {
  content: "";
  position: absolute;
  right: -34px;
  width: 172px;
  height: 27px;
  transform: rotate(18deg);
}

.corner-stripe::before {
  background: var(--orange);
  top: 17px;
}

.corner-stripe::after {
  background: var(--navy);
  top: 41px;
}

.upload-content {
  position: relative;
  z-index: 1;
  height: 100%;
  text-align: center;
}

.logo-panel {
  position: absolute;
  top: 244px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy-panel);
  border-radius: 6px;
  padding: 14px 28px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

h1 {
  position: absolute;
  top: 354px;
  left: 0;
  right: 0;
  margin: 0;
  font-family: "Arial Black", Impact, Arial, sans-serif;
  font-size: 46px;
  line-height: 0.95;
  letter-spacing: -0.02em;
}

h1 .line { display: block; }

.blue { color: var(--navy); }
.orange { color: var(--orange); }

.subcopy {
  position: absolute;
  top: 448px;
  left: 0;
  right: 0;
  margin: 0;
  color: #444;
  font-size: 17px;
  line-height: 1.35;
}

#upload-btn {
  position: absolute;
  top: 518px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 36px;
  border: 2px solid #b8b8b8;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
}

#upload-btn:hover { border-color: #888; }

.upload-error {
  position: absolute;
  left: 40px;
  right: 40px;
  top: 565px;
  margin: 0;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 700;
}

/* —— Frame 3: confirm —— */
.confirm-bg {
  position: absolute;
  inset: 0;
  background: var(--grey-bg);
}

.photo-card {
  position: absolute;
  left: 38px;
  right: 38px;
  top: 142px;
  bottom: 86px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.status {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  max-width: 520px;
  padding: 8px 14px;
  border-radius: 6px;
  background: rgba(10, 36, 99, 0.92);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.confirm-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 86px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  padding: 0 20px 10px;
}

#retake,
#confirm {
  flex: 1;
  max-width: 168px;
  padding: 12px 8px;
  border: 2px solid #c8c8c8;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

#confirm:disabled {
  opacity: 0.45;
  cursor: default;
}

.logo-tab {
  align-self: flex-end;
  background: var(--navy-panel);
  border-radius: 8px 8px 0 0;
  padding: 8px 16px 10px;
  margin: 0 -4px;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.12);
}

/* —— Frame 4–5: result —— */
.result-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 202px;
  display: flex;
  gap: 10px;
  padding: 16px 16px 10px;
  background: var(--grey-bg);
}

.dash-panel {
  flex: 1;
  background: var(--navy-panel);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.gauge-panel {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 8px 8px 3px;
}

#meter-svg {
  width: 100%;
  max-width: 250px;
  height: auto;
  display: block;
}

.specs-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  padding: 8px;
}

.spec-cc {
  margin: 0;
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 38px;
  letter-spacing: 0.02em;
  line-height: 1;
}

.spec-speed {
  margin: 8px 0 0;
  font-family: "Arial Black", Arial, sans-serif;
  font-size: 28px;
  letter-spacing: 0.03em;
  line-height: 1;
}

.result-bottom {
  position: absolute;
  left: 0;
  right: 0;
  top: 202px;
  bottom: 0;
  background: #222;
}

#result-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.logo-tab--result {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 3;
  border-radius: 10px 10px 0 0;
  padding: 10px 22px 12px;
}

#hotspot {
  position: absolute;
  z-index: 2;
  left: 40px;
  top: 40px;
  width: 320px;
  height: 280px;
  pointer-events: none;
}

#oil {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

#oil > * { pointer-events: auto; }

.drag-bar {
  position: absolute;
  left: 50%;
  bottom: 58px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(540px, 96%);
  height: 42px;
  padding: 0 18px;
  background: var(--orange);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.drag-chevrons {
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

#bottle {
  position: absolute;
  left: 0;
  top: 0;
  width: 108px;
  height: 200px;
  touch-action: none;
  cursor: grab;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
}

#bottle.is-dragging { cursor: grabbing; }

#bottle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* —— Frame 6: end video —— */
#end-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.end-brand {
  position: absolute;
  z-index: 2;
  left: 14px;
  top: 14px;
}

#play-btn {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 88px;
  height: 88px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
}

#play-btn::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin-left: 10px;
  border-style: solid;
  border-width: 16px 0 16px 26px;
  border-color: transparent transparent transparent #222;
}

#replay {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 10px 22px;
  border: 0;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
