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

body {
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
  padding: 12px;
  padding-top: max(12px, env(safe-area-inset-top, 12px));
}

.header {
  text-align: center;
  margin-bottom: 16px;
  padding-top: 24px;
}

.time {
  font-size: 2rem;
  font-weight: 700;
  color: #1a73e8;
}

.date {
  font-size: 0.85rem;
  color: #666;
  margin-top: 4px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  border-left: 4px solid #ff9800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.1s;
}

.card:active {
  transform: scale(0.98);
}

.card.yagiyama {
  border-left-color: #8bc34a;
}

.station {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

.to {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.arrow {
  color: #888;
  font-size: 0.8rem;
}

.dest-badge {
  font-size: 1.1rem;
  font-weight: 700;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dest-badge.arai {
  background: #ff9800;
  color: #fff;
}

.dest-badge.yagiyama {
  background: #8bc34a;
  color: #fff;
}

.remain {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2e7d32;
}

.remain.soon {
  color: #e65100;
}

.remain.now {
  color: #c62828;
  animation: blink 0.5s infinite;
}

@keyframes blink {
  50% {
    opacity: 0.5;
  }
}

.scheduled {
  font-size: 1.2rem;
  color: #555;
  margin-top: 4px;
  font-weight: 600;
}

.next {
  font-size: 0.75rem;
  color: #666;
  margin-top: 8px;
  border-top: 1px solid #ddd;
  padding-top: 8px;
}

.footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.7rem;
  color: #999;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: 90%;
  max-width: 360px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #888;
}

.modal-section {
  margin-bottom: 16px;
}

.modal-label {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 8px;
}

.modal-select {
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
}

.time-input {
  display: flex;
  gap: 8px;
  align-items: center;
}

.time-input select {
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
}

.search-btn {
  width: 100%;
  padding: 12px;
  background: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
}

.search-btn:disabled {
  background: #ccc;
}

.result-box {
  margin-top: 16px;
  padding: 16px;
  background: #f0f7ff;
  border-radius: 8px;
}

.result-title {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 8px;
}

.result-time {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a73e8;
}

.result-detail {
  font-size: 0.85rem;
  color: #555;
  margin-top: 8px;
}
