* { margin:0; padding:0; box-sizing:border-box; }

html, body { height:100%; }
body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  color: #fff;
  background: #0a0a0a;
  overflow-y: auto;
  text-align: center;
  position: relative;
}

#bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

#video-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: -1;
}

.content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding-top: 12vh;
  padding-left: 20px;
  padding-right: 20px;
}

.typewriter {
  font-size: 2.8rem;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  border-right: 3px solid #fff;
  width: fit-content;
  margin: 0 auto 28px;
  color: #ffdbb0;
  letter-spacing: 1px;
  animation: typing 3s steps(30,end), blink .8s step-end infinite;
}
@keyframes typing { from { width:0 } to { width:100% } }
@keyframes blink { 50% { border-color: transparent } }

.input-box {
  margin: 18px 0 28px;
}
input#yearInput, select#countrySelect {
  width: 220px;
  padding: 12px;
  border-radius: 8px;
  border: 0;
  background: rgba(255,255,255,0.1);
  color: #000000;
  text-align: center;
  font-size: 1rem;
  outline: none;
  margin-right: 10px;
}
input#yearInput::placeholder { color: #ddd; }

#searchBtn {
  padding: 12px 18px;
  border-radius: 8px;
  border: 0;
  background: #fff;
  color: #0b0b0b;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  transition: transform .14s ease, box-shadow .14s ease;
}
#searchBtn:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,0.45); }

#result {
  display: block;
  max-width: 820px;
  margin: 18px auto 40px;
  text-align: left;
  background: rgba(12,12,12,0.75);
  padding: 22px;
  border-radius: 14px;
  color: #eee;
  box-shadow: 0 10px 35px rgba(0,0,0,0.7);
  line-height: 1.6;
}

.hidden { display: none; }

#result h2 {
  text-align: center;
  margin-bottom: 12px;
  color: #ffd08a;
  font-size: 1.6rem;
}

#result img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  margin: 10px auto 14px;
  opacity: 0;
  transform: translateY(10px);
  animation: ghostFade .9s forwards;
  animation-delay: 0.12s;
}
@keyframes ghostFade {
  from { opacity: 0; transform: translateY(12px) scale(.995) }
  to   { opacity: 1; transform: translateY(0) scale(1) }
}

#result p { margin: 10px 0; font-size: 1.05rem; }

button.speakBtn {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  border: none;
  background: #ffdbb0;
  color: #0b0b0b;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}
button.speakBtn:hover {
  background: #ffd86b;
  transform: translateY(-2px);
}

footer {
  position: relative;
  z-index: 1;
  margin: 34px 0 24px;
  color: #ddd;
  font-size: 0.95rem;
}
.highlight {
  color: #fff;
  font-weight: 700;
}
/* Enhanced clock canvas */
#clockCanvas {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 350px;
  height: 350px;
  z-index: 10;
  pointer-events: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.85);
  box-shadow: 0 0 50px rgba(255, 255, 255, 0.3),
              0 0 100px rgba(255, 215, 0, 0.3),
              0 0 150px rgba(30, 144, 255, 0.2);
  display: none;
}

#clockCanvas.active {
  display: block;
  animation: popIn 0.3s ease-out forwards;
}

@keyframes popIn {
  from { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}