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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', sans-serif;
  background: #f5f5f5;
  color: #333;
  padding-bottom: 80px;
}

header {
  background: linear-gradient(135deg, #43a047, #e64a19);
  color: white;
  padding: 16px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

header h1 {
  font-size: 19px;
  font-weight: bold;
  letter-spacing: 0.02em;
}

#updated-at {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 4px;
  min-height: 16px;
}

main {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

/* ---- Loading ---- */

.loading {
  text-align: center;
  padding: 48px 0;
}

.loading p {
  color: #666;
  font-size: 14px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e0e0e0;
  border-top-color: #43a047;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none;
}

/* ---- Error ---- */

.error {
  background: #ffebee;
  border: 1px solid #ef9a9a;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
}

.error button {
  margin-top: 14px;
  padding: 8px 24px;
  background: #e53935;
  color: white;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
}

/* ---- Sections ---- */

section {
  margin-bottom: 24px;
}

section h2 {
  font-size: 17px;
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.caterpillar h2 {
  background: #e8f5e9;
  color: #2e7d32;
  border-left: 4px solid #43a047;
}

.anpanman h2 {
  background: #fff3e0;
  color: #bf360c;
  border-left: 4px solid #e64a19;
}

/* ---- Event cards ---- */

.event-card {
  display: block;
  background: white;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: opacity 0.15s;
}

.event-card:active {
  opacity: 0.7;
}

.caterpillar .event-card {
  border-left: 3px solid #43a047;
}

.anpanman .event-card {
  border-left: 3px solid #e64a19;
}

.event-source {
  font-size: 11px;
  color: #999;
  margin-bottom: 4px;
}

.event-title {
  font-size: 15px;
  font-weight: bold;
  line-height: 1.45;
  margin-bottom: 6px;
  color: #1a73e8;
}

.event-snippet {
  font-size: 13px;
  color: #555;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.no-events {
  color: #999;
  font-size: 14px;
  padding: 12px;
  text-align: center;
}

/* ---- Refresh button ---- */

#refresh-btn {
  position: fixed;
  bottom: 24px;
  right: 20px;
  background: #43a047;
  color: white;
  border: none;
  border-radius: 28px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: bold;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

#refresh-btn:disabled {
  background: #9e9e9e;
  cursor: not-allowed;
}
