* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', sans-serif;
  background: #f5f0eb;
  color: #333;
  min-height: 100vh;
}

header {
  background: linear-gradient(135deg, #2d5016, #4a7c28);
  color: #fff;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.admin-link {
  position: absolute;
  top: 16px;
  right: 20px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.15);
  padding: 6px 14px;
  border-radius: 20px;
  transition: background 0.2s;
}

.admin-link:hover {
  background: rgba(255,255,255,0.3);
  color: #fff;
}

header h1 {
  font-size: 1.8rem;
  margin-bottom: 4px;
  letter-spacing: 2px;
}

.subtitle {
  font-size: 0.9rem;
  opacity: 0.85;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

.loading, .no-menu {
  text-align: center;
  padding: 40px;
  font-size: 1.1rem;
  color: #888;
}

/* 日付セクション */
.day-section {
  margin-top: 32px;
}

.day-header {
  background: #fff;
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.day-header.is-today {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  border: 2px solid #4a7c28;
}

.day-date {
  font-size: 1.3rem;
  font-weight: bold;
  color: #2d5016;
}

.day-weekday {
  font-size: 0.95rem;
  color: #666;
}

.day-header.is-today .day-label {
  background: #c0392b;
  color: #fff;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
}

.day-header.is-off {
  background: #f0f0f0;
  opacity: 0.7;
}

.day-off-label {
  background: #999;
  color: #fff;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
}

.category-section {
  margin-bottom: 12px;
}

.category-title {
  font-size: 1.05rem;
  color: #2d5016;
  border-bottom: 2px solid #4a7c28;
  padding-bottom: 4px;
  margin-bottom: 10px;
  display: inline-block;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.menu-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border-left: 4px solid #4a7c28;
}

.menu-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.menu-card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: #222;
}

.card-nutrition {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: #555;
  margin-bottom: 2px;
}

.card-nutrition span:first-child {
  font-weight: bold;
  color: #2d5016;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.menu-card .tap-hint {
  font-size: 0.75rem;
  color: #aaa;
}

.click-count {
  font-size: 0.75rem;
  color: #4a7c28;
  font-weight: bold;
}

/* 日付間の区切り線 */
.day-divider {
  border: none;
  border-top: 1px dashed #ccc;
  margin-top: 8px;
}

/* モーダル */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: #fff;
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  animation: modalIn 0.25s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.93); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #999;
  line-height: 1;
}

.modal-close:hover {
  color: #333;
}

.modal-header {
  margin-bottom: 16px;
}

.modal-category {
  display: inline-block;
  background: #e8f5e9;
  color: #2d5016;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 8px;
}

.modal-header h2 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.modal-nutrition {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.85rem;
  color: #555;
}

.modal-nutrition b {
  color: #2d5016;
}

.memo-section h3 {
  font-size: 1.05rem;
  color: #2d5016;
  margin-bottom: 12px;
}

.memo-section ul {
  list-style: none;
}

.memo-section li {
  background: #fafaf5;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-left: 3px solid #8bc34a;
}

.memo-section .ingredient-name {
  font-weight: bold;
  color: #2d5016;
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.memo-section .ingredient-memo {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
}

/* レスポンシブ */
@media (max-width: 600px) {
  header h1 {
    font-size: 1.4rem;
  }

  .menu-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 20px;
  }

  .day-header {
    flex-wrap: wrap;
    gap: 6px;
  }
}
