* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Hiragino Sans', 'Meiryo', sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #1a1a2e;
  color: #e0e0e0;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
}

header h1 {
  font-size: 1.2rem;
  color: #ffd700;
}

.year-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.year-selector label {
  font-size: 0.9rem;
}

#year-select {
  background: #0f3460;
  color: #e0e0e0;
  border: 1px solid #ffd700;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 200px;
  flex-shrink: 0;
  background: #16213e;
  padding: 16px 12px;
  overflow-y: auto;
  border-right: 1px solid #0f3460;
}

.filter-section {
  margin-bottom: 20px;
}

.filter-section h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffd700;
  margin-bottom: 8px;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-btn {
  background: #0f3460;
  color: #e0e0e0;
  border: 1px solid #0f3460;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.filter-btn:hover {
  background: #1a4a8a;
}

.filter-btn.active {
  background: #ffd700;
  color: #1a1a2e;
  border-color: #ffd700;
  font-weight: bold;
}

main {
  flex: 1;
  position: relative;
}

#map {
  width: 100%;
  height: 100%;
}

.map-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(22, 33, 62, 0.9);
  color: #e0e0e0;
  padding: 20px 32px;
  border-radius: 8px;
  border: 1px solid #0f3460;
  font-size: 1rem;
  text-align: center;
  pointer-events: none;
  z-index: 1000;
}

.popup-content {
  line-height: 1.6;
  font-size: 0.85rem;
  min-width: 160px;
}

.popup-content a {
  color: #0066cc;
  text-decoration: none;
}

.popup-content a:hover {
  text-decoration: underline;
}

.event-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
}

.event-item {
  background: #0f3460;
  border: 1px solid #0f3460;
  border-radius: 4px;
  padding: 8px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.event-item:hover {
  background: #1a4a8a;
  border-color: #ffd700;
}

.event-item-name {
  font-weight: bold;
  color: #ffd700;
  margin-bottom: 4px;
}

.event-item-details {
  color: #b0b0b0;
  font-size: 0.7rem;
  line-height: 1.4;
}

/* 広告セクション */
.ad-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #0f3460;
}

/* フッター */
.main-footer {
  background: #16213e;
  border-top: 1px solid #0f3460;
  padding: 12px 20px;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: #b0b0b0;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links a {
  color: #ffd700;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: #ffed4e;
  text-decoration: underline;
}

.footer-links .separator {
  color: #0f3460;
}

/* レスポンシブ: モバイル */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    max-height: 40vh;
    overflow-y: auto;
    border-right: none;
    border-bottom: 1px solid #0f3460;
    padding: 12px;
  }

  .filter-section {
    margin-bottom: 12px;
  }

  main {
    height: 60vh;
  }

  .footer-content {
    font-size: 0.7rem;
  }
}
