*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Imprima", sans-serif;
  background: #d4ebf8;
  -webkit-tap-highlight-color: transparent;
}

:focus:not(:focus-visible) {
  outline: none;
}

canvas:focus {
  outline: none;
}

::selection {
  background: var(--select-bg);
  color: var(--select-fg);
}

::-moz-selection {
  background: var(--select-bg);
  color: var(--select-fg);
}

:root {
  --select-bg: rgba(157, 210, 255, 0.68);
  --select-fg: #2a3d52;
  --bubble-glow:
    0 4px 22px rgba(61, 143, 212, 0.16),
    0 0 26px rgba(61, 143, 212, 0.14),
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 -1px 0 rgba(61, 143, 212, 0.07) inset;
  --bubble-glow-strong:
    0 6px 28px rgba(61, 143, 212, 0.24),
    0 0 36px rgba(61, 143, 212, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.98) inset,
    0 -1px 0 rgba(61, 143, 212, 0.08) inset;
}

@keyframes bubble-glow {
  0%,
  100% {
    box-shadow: var(--bubble-glow);
  }
  50% {
    box-shadow: var(--bubble-glow-strong);
  }
}

#globeCanvas,
#indiaCanvas,
#countryCanvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.bubble-surface {
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.94) 0%,
    rgba(236, 246, 255, 0.84) 55%,
    rgba(255, 255, 255, 0.9) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.98);
  border-radius: 999px;
  backdrop-filter: blur(18px) saturate(1.45);
  box-shadow:
    0 6px 22px rgba(61, 143, 212, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 -1px 0 rgba(61, 143, 212, 0.07) inset;
}

.globe-back {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 11;
  padding: 0.55rem 1rem;
  font-family: "Imprima", sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #2a3d52;
  text-decoration: none;
  animation: bubble-glow 3.2s ease-in-out infinite;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.globe-back:hover,
.globe-back:focus-visible {
  color: #6eb8ea;
  background: linear-gradient(
    135deg,
    rgba(157, 210, 255, 0.62) 0%,
    rgba(212, 235, 248, 0.78) 100%
  );
  border-color: rgba(157, 210, 255, 0.75);
  transform: translateY(-1px);
  animation: none;
  box-shadow: var(--bubble-glow-strong);
}

.globe-hint {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.5rem 1rem;
  font-family: "Imprima", sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  color: #6b8299;
  pointer-events: none;
  animation: bubble-glow 3.2s ease-in-out infinite;
}

.india-header {
  position: fixed;
  top: 1.25rem;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  pointer-events: none;
}

.india-title {
  margin: 0;
  padding: 0.45rem 1.15rem;
  font-family: "Hachi Maru Pop", cursive;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 400;
  line-height: 1.2;
  color: #2a3d52;
  white-space: nowrap;
  text-align: center;
}

.state-label {
  margin: 0;
  padding: 0.45rem 1rem;
  font-family: "Imprima", sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #2a3d52;
  max-width: min(90vw, 24rem);
  text-align: center;
}

.state-info {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 12;
  width: 18rem;
  height: 18rem;
  padding: 0.75rem 0.8rem 0.85rem;
  overflow: visible;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  border-radius: 0.95rem;
  transform: translate(-50%, calc(-100% - 16px)) scale(0.94);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s ease;
}

.state-info::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border: 9px solid transparent;
  filter: drop-shadow(0 3px 3px rgba(61, 143, 212, 0.1));
}

.state-info[data-placement="above"]::after,
.state-info:not([data-placement])::after {
  bottom: -17px;
  border-top-color: rgba(255, 255, 255, 0.96);
}

.state-info[data-placement="below"] {
  transform: translate(-50%, 16px) scale(0.94);
}

.state-info[data-placement="below"].is-open {
  transform: translate(-50%, 16px) scale(1);
}

.state-info[data-placement="below"]::after {
  top: -17px;
  bottom: auto;
  border-top-color: transparent;
  border-bottom-color: rgba(255, 255, 255, 0.96);
}

.state-info.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, calc(-100% - 16px)) scale(1);
}

.state-info__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.state-info__close {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
  width: 1.55rem;
  height: 1.55rem;
  border: 0;
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.92);
  color: #2a3d52;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(61, 143, 212, 0.12);
}

.state-info__image {
  display: block;
  width: 100%;
  height: 6.25rem;
  object-fit: cover;
  border-radius: 0.6rem;
  margin-bottom: 0.55rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(212, 235, 248, 0.9), rgba(184, 221, 240, 0.75));
  opacity: 1;
  transition: opacity 0.2s ease;
}

.state-info__image.is-loading {
  opacity: 0.35;
}

.state-info__title {
  margin: 0 1.6rem 0.35rem 0;
  font-family: "Hachi Maru Pop", cursive;
  font-size: 1.15rem;
  font-weight: 400;
  color: #2a3d52;
  line-height: 1.2;
  flex-shrink: 0;
}

.state-info__label {
  margin: 0 0 0.28rem;
  font-family: "Imprima", sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b8299;
  flex-shrink: 0;
}

.state-info__highlights {
  margin: 0 0 0.45rem;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  flex-shrink: 0;
}

.state-info__highlights li {
  padding: 0.18rem 0.48rem;
  font-family: "Imprima", sans-serif;
  font-size: 0.62rem;
  color: #2a3d52;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(61, 143, 212, 0.16);
  border-radius: 999px;
}

.state-info__about {
  margin: 0;
  font-family: "Imprima", sans-serif;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #4a6278;
  overflow-y: auto;
  flex: 1;
  padding-right: 0.1rem;
}

@media (pointer: coarse) {
  .globe-back:focus,
  .globe-back:focus-visible,
  a:focus,
  button:focus {
    outline: none;
  }
}
