:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: #0f172a;
  --panel-2: #14243b;
  --text: #e2e8f0;
  --muted: #8da1bc;
  --accent: #4f46e5;
  --accent-soft: rgba(79, 70, 229, 0.2);
  --success: #22c55e;
  --danger: #f97316;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Pretendard", "Segoe UI", sans-serif;
  background: linear-gradient(135deg, var(--bg), #0b1220);
  color: var(--text);
}

button,
select,
input {
  font: inherit;
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #93c5fd;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.85rem;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.subtitle {
  margin-top: 8px;
  color: var(--muted);
  max-width: 620px;
}

.month-nav,
.year-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--accent-soft);
  color: var(--text);
}

button:hover {
  background: rgba(79, 70, 229, 0.35);
}

.content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 20px 45px rgba(2, 8, 23, 0.25);
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day-cell {
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: var(--panel);
  border-radius: 16px;
  min-height: 92px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  text-align: left;
  color: var(--text);
}

.day-cell.blank {
  background: transparent;
  border-style: dashed;
  opacity: 0.5;
}

.day-cell.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.day-cell.has-record {
  border-color: rgba(34, 197, 94, 0.5);
}

.day-cell.category-champion {
  border-color: #f59e0b;
}

.day-cell.category-champion .day-badge {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
}

.day-cell.category-challenge {
  border-color: #38bdf8;
}

.day-cell.category-challenge .day-badge {
  background: rgba(56, 189, 248, 0.18);
  color: #bae6fd;
}

.day-cell.category-rookie {
  border-color: #a78bfa;
}

.day-cell.category-rookie .day-badge {
  background: rgba(167, 139, 250, 0.18);
  color: #e9d5ff;
}

.day-cell.category-youth {
  border-color: #34d399;
}

.day-cell.category-youth .day-badge {
  background: rgba(52, 211, 153, 0.18);
  color: #bbf7d0;
}

.day-cell.category-display {
  border-color: #fb7185;
}

.day-cell.category-display .day-badge {
  background: rgba(251, 113, 133, 0.18);
  color: #fecdd3;
}

.day-number {
  font-weight: 700;
}

.day-badge {
  font-size: 0.74rem;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
}

.detail-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
}

select {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: var(--panel-2);
  color: var(--text);
}

.add-entry-btn {
  width: 100%;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  color: white;
}

.entry-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.entry-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.entry-chip {
  font-weight: 700;
}

.entry-remove {
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.16);
  color: #fecaca;
}

.detail-summary {
  margin-top: 6px;
  padding: 14px;
  border-radius: 16px;
  background: var(--panel-2);
  color: var(--muted);
  line-height: 1.6;
  border: 1px solid transparent;
}

.detail-summary.category-champion {
  border-color: #f59e0b;
}

.detail-summary.category-challenge {
  border-color: #38bdf8;
}

.detail-summary.category-rookie {
  border-color: #a78bfa;
}

.detail-summary.category-youth {
  border-color: #34d399;
}

.detail-summary.category-display {
  border-color: #fb7185;
}

.sync-card {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sync-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-actions input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: var(--panel-2);
  color: var(--text);
}

.sync-status {
  color: var(--muted);
  font-size: 0.95rem;
}

.sync-status.error {
  color: #fda4af;
}

.summary-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.summary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.monthly-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.summary-item {
  padding: 14px;
  border-radius: 14px;
  background: var(--panel-2);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.summary-item strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
}

@media (max-width: 900px) {
  .content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 16px;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .day-cell {
    min-height: 76px;
    padding: 6px;
  }
}
