:root {
  color-scheme: light;
  font-family: 'Segoe UI', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
  color: #1a1d23;
}

.slide {
  width: 100vw;
  height: 100vh;
  background: linear-gradient(165deg, #fbf3c5 0%, #fdecc0 58%, #f0e3b2 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  border-radius: 0;
  position: relative;
  padding: clamp(24px, 5vw, 54px);
  overflow: hidden;
}

/* Fullscreen presentation mode */
html:fullscreen .slide,
html:-webkit-full-screen .slide,
html:-moz-full-screen .slide {
  background: linear-gradient(165deg, #fbf3c5 0%, #fdecc0 58%, #f0e3b2 100%);
  padding: clamp(32px, 6vw, 64px);
  display: flex;
  align-items: center;
  justify-content: center;
}

html:fullscreen .traffic-scene,
html:-webkit-full-screen .traffic-scene,
html:-moz-full-screen .traffic-scene {
  width: 100%;
  max-width: 1200px;
  height: auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(48px, 8vw, 160px);
  align-items: center;
  justify-content: center;
}

.slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 82% 18%, rgba(255, 255, 255, 0.55), transparent 55%);
  pointer-events: none;
}

.traffic-scene {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(32px, 6vw, 120px);
  align-items: center;
  height: 100%;
  justify-items: start;
}

.traffic-stand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2vw, 18px);
  filter: drop-shadow(0 18px 28px rgba(25, 29, 35, 0.16));
}

.traffic-light {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 26px;
  border-radius: 28px;
  background: #2f3b46;
  border: 4px solid #14191e;
}

.traffic-light::before {
  content: '';
  position: absolute;
  inset: -18px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.04);
}

.traffic-light::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -26px;
  transform: translateX(-50%);
  width: clamp(48px, 6.4vw, 72px);
  height: clamp(20px, 3vw, 30px);
  border-radius: 12px;
  background: linear-gradient(180deg, #6d7a86 0%, #4c5a66 100%);
  box-shadow: 0 8px 14px rgba(20, 24, 28, 0.22);
  z-index: 1;
}

.light {
  position: relative;
  width: clamp(72px, 8vw, 112px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: #2c353f;
  box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.light::after {
  content: '';
  position: absolute;
  inset: 18% 22% 42% 18%;
  border-radius: 50% 50% 45% 45%;
  background: rgba(255, 255, 255, 0.28);
  transform: rotate(-18deg);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.light.is-on::after {
  opacity: 1;
}

.stand-pole {
  width: clamp(28px, 3.5vw, 38px);
  height: clamp(320px, 35vw, 450px);
  border-radius: clamp(14px, 1.8vw, 19px);
  background: linear-gradient(180deg, #6d7a86 0%, #4c5a66 100%);
  box-shadow: 
    inset 0 0 0 3px rgba(0, 0, 0, 0.18),
    0 8px 16px rgba(0, 0, 0, 0.15);
  margin-top: -28px;
  position: relative;
  z-index: 0;
}

.stand-pole::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 15%;
  width: 35%;
  height: calc(100% - 16px);
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0%, transparent 40%);
}

.stand-pole::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(80px, 10vw, 120px);
  height: clamp(24px, 3vw, 32px);
  border-radius: clamp(12px, 1.5vw, 16px);
  background: linear-gradient(180deg, #7b868f 0%, #4f5a63 100%);
  box-shadow: 
    inset 0 -2px 0 rgba(0, 0, 0, 0.24),
    0 4px 8px rgba(0, 0, 0, 0.2);
}

.stand-base {
  display: none;
}

.traffic-message {
  position: relative;
  width: clamp(400px, 50vw, 600px);
  height: clamp(280px, 36vw, 420px);
}

.tag {
  position: absolute;
  padding: clamp(32px, 4.5vw, 44px) clamp(52px, 7.5vw, 88px);
  border-radius: 60px;
  border: 6px solid #d4a843;
  background: linear-gradient(145deg, #fdeaa7 0%, #f9e3a3 35%, #f0d670 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: clamp(3.2rem, 6vw, 5rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  box-shadow: 
    0 20px 40px rgba(213, 180, 83, 0.4),
    0 8px 16px rgba(0, 0, 0, 0.2),
    inset 0 3px 0 rgba(255, 255, 255, 0.4),
    inset 0 -2px 0 rgba(212, 168, 67, 0.6);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  backdrop-filter: blur(2px);
  line-height: 1;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tag::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 66px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), transparent 60%);
  z-index: -1;
}

.tag:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 
    0 25px 50px rgba(213, 180, 83, 0.5),
    0 12px 24px rgba(0, 0, 0, 0.25),
    inset 0 3px 0 rgba(255, 255, 255, 0.5),
    inset 0 -2px 0 rgba(212, 168, 67, 0.7);
}

.tag:last-child {
  top: 48%;
  left: 18%;
  transform: rotate(-3deg);
  z-index: 1;
  animation: floatDown 4s ease-in-out infinite;
  padding: clamp(32px, 4.5vw, 44px) clamp(64px, 8.5vw, 108px);
  width: auto;
  min-width: clamp(360px, 46vw, 520px);
}

.traffic-message .tag:first-child {
  top: 12%;
  left: 6%;
  transform: rotate(-6deg);
  z-index: 2;
  animation: floatUp 4s ease-in-out infinite;
}

.group-badge {
  position: absolute;
  bottom: clamp(20px, 3vw, 40px);
  right: clamp(20px, 3vw, 40px);
  padding: clamp(12px, 2vw, 18px) clamp(20px, 3vw, 32px);
  border-radius: 28px;
  border: 3px solid #2d7a3e;
  background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
  color: #ffffff;
  font-weight: 600;
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 
    0 8px 16px rgba(76, 175, 80, 0.3),
    0 3px 6px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  z-index: 10;
}

@keyframes floatUp {
  0%, 100% { transform: rotate(-6deg) translateY(0px); }
  50% { transform: rotate(-6deg) translateY(-3px); }
}

@keyframes floatDown {
  0%, 100% { transform: rotate(-3deg) translateY(0px); }
  50% { transform: rotate(-3deg) translateY(2px); }
}

.ground-bar {
  position: absolute;
  left: -12%;
  bottom: -12%;
  width: 150%;
  height: clamp(80px, 12vw, 140px);
  background: linear-gradient(180deg, #e5cf9c 0%, #d4b978 100%);
  border-top: 4px solid rgba(0, 0, 0, 0.08);
  border-radius: 45% 45% 0 0 / 18% 18% 0 0;
}

@media (max-width: 740px) {
  .traffic-scene {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .tag:last-child {
    align-self: center;
    transform: translateX(0);
  }

  .tag:first-child {
    align-self: center;
  }
}

@keyframes glowRed {
  0%,
  28% {
    background: #ff4f5a;
    box-shadow: 0 0 26px rgba(255, 79, 90, 0.48), inset 0 0 0 4px rgba(0, 0, 0, 0.35);
  }
  28.01%,
  100% {
    background: #2c353f;
    box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.35);
  }
}

@keyframes glowGreen {
  0%,
  33% {
    background: #2c353f;
    box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.35);
  }
  33.01%,
  63% {
    background: #58e0a4;
    box-shadow: 0 0 24px rgba(88, 224, 164, 0.45), inset 0 0 0 4px rgba(0, 0, 0, 0.35);
  }
  63.01%,
  100% {
    background: #2c353f;
    box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.35);
  }
}

@keyframes glowYellow {
  0%,
  66% {
    background: #2c353f;
    box-shadow: inset 0 0 0 4px rgba(0, 0, 0, 0.35);
  }
  66.01%,
  100% {
    background: #ffe066;
    box-shadow: 0 0 20px rgba(255, 224, 102, 0.42), inset 0 0 0 4px rgba(0, 0, 0, 0.35);
  }
}

.light.red {
  animation: glowRed 9s infinite;
}

.light.green {
  animation: glowGreen 9s infinite;
}

.light.yellow {
  animation: glowYellow 9s infinite;
}

.light.red::after,
.light.green::after,
.light.yellow::after {
  animation: inherit;
}
