@font-face {
  font-family: "DigitsDisplay";
  src: url("../font/digits.otf") format("truetype");
  font-display: swap;
  unicode-range: U+0030-0039;
}

body {
  overflow: hidden;
  background: var(--bg);
}

#canvas {
  display: block;
}

.bottom-bar {
  position: fixed;
  bottom: clamp(12px, 3vh, 32px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 2vh, 16px);
  z-index: 10;
  max-width: calc(100vw - 16px);
}

.floating-menu {
  position: relative;
  display: flex;
  gap: clamp(10px, 3vw, 16px);
  padding: clamp(12px, 3vw, 20px) clamp(18px, 4vw, 24px);
  max-width: 100%;
  background: var(--glass-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 9999px;
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.floating-menu::before {
  content: "";
  position: absolute;
  top: 1px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.8),
    transparent
  );
  border-radius: 50%;
}

.floating-menu a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(60px, 15vw, 80px);
  height: clamp(60px, 15vw, 80px);
  flex-shrink: 0;
  border-radius: 50%;
  color: rgba(0, 0, 0, 0.7);
  text-decoration: none;
  transition: all 0.3s var(--ease);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.06),
    inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

.floating-menu a:hover {
  transform: scale(1.1) translateY(-2px);
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.2) 100%
  );
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.7);
  color: rgba(0, 0, 0, 0.9);
}

.floating-menu a:active {
  transform: scale(1.05);
}

.floating-menu a svg {
  width: clamp(32px, 8.5vw, 44px);
  height: clamp(32px, 8.5vw, 44px);
  filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.5));
}

/* ホバー時の吹き出し（説明ラベル） */
.floating-menu a::after,
.floating-menu a::before {
  position: absolute;
  left: 50%;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.floating-menu a::after {
  content: attr(data-tooltip);
  bottom: calc(100% + 14px);
  transform: translate(-50%, 6px);
  padding: 8px 14px;
  border-radius: 12px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  color: rgba(0, 0, 0, 0.8);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.25) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.7);
}

.floating-menu a::before {
  content: "";
  bottom: calc(100% + 9px);
  width: 11px;
  height: 11px;
  transform: translate(-50%, 6px) rotate(45deg);
  background: rgba(255, 255, 255, 0.32);
  border-right: 1px solid rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.floating-menu a:hover {
  z-index: 2;
}

.floating-menu a:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.floating-menu a:hover::before {
  opacity: 1;
  transform: translate(-50%, 0) rotate(45deg);
}

.year-selector {
  position: fixed;
  top: clamp(12px, 3vh, 32px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.year-button {
  display: inline-flex;
  align-items: center;
  gap: clamp(14px, 3vw, 16px);
  padding: clamp(17px, 3.6vw, 18px) clamp(28px, 5.8vw, 30px)
    clamp(17px, 3.6vw, 18px) clamp(30px, 6.2vw, 32px);
  background: var(--glass-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 9999px;
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  color: rgba(0, 0, 0, 0.75);
  font-family: "DigitsDisplay", var(--font-sans);
  font-size: clamp(19px, 4.2vw, 20px);
  font-weight: 700;
  letter-spacing: 0.2em;
  font-feature-settings: "tnum" 1;
  line-height: 1;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.year-button:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.4) 100%
  );
  color: rgba(0, 0, 0, 0.9);
}

.year-arrow {
  width: clamp(20px, 4.4vw, 22px);
  height: clamp(20px, 4.4vw, 22px);
  opacity: 0.6;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.year-button:hover .year-arrow {
  opacity: 0.8;
}

.year-selector.open .year-arrow {
  transform: rotate(180deg);
  opacity: 0.8;
}

.year-options {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  min-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  margin: 0;
  list-style: none;
  background: var(--glass-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 22px;
  border: var(--glass-border);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.12),
    inset 0 1px 1px rgba(255, 255, 255, 0.6);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-6px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.year-selector.open .year-options {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.year-options li {
  display: flex;
}

.year-option {
  flex: 1;
  padding: clamp(14px, 3.2vw, 15px) clamp(28px, 5.8vw, 30px);
  background: transparent;
  border: none;
  border-radius: 16px;
  color: rgba(0, 0, 0, 0.7);
  font-family: "DigitsDisplay", var(--font-sans);
  font-size: clamp(19px, 4.2vw, 20px);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-feature-settings: "tnum" 1;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.year-option:hover {
  background: rgba(255, 255, 255, 0.38);
  color: rgba(0, 0, 0, 0.92);
}

.year-option[aria-selected="true"] {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.95);
  font-weight: 800;
}

.year-option[aria-selected="true"]:hover {
  background: rgba(0, 0, 0, 0.08);
}
