@font-face {
  font-family: 'Caveat';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/Caveat-Bold.woff2') format('woff2');
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

h1 {
  font-family: 'Caveat', cursive;
  font-size: 2.75rem;
  font-weight: 700;
  margin: 0 0 4px;
  transform: rotate(-1.5deg);
}

.subtitle {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.legend {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: #444;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.free {
  background: #ffffff;
  border: 1.5px solid #1a1a1a;
}

.dot.busy {
  background: #d9d9d9;
  border: 1.5px solid #d9d9d9;
}

.dot.marathon {
  background: #1a1a1a;
  border: 1.5px solid #1a1a1a;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 6px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day {
  aspect-ratio: 1 / 1;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.75rem;
  background: #ffffff;
  overflow: hidden;
}

.day.empty {
  border: none;
}

.day.past {
  border-color: #f0f0f0;
  color: #ccc;
}

.day-num {
  font-weight: 600;
  font-size: 0.85rem;
}

.day.past .day-num {
  color: #ccc;
}

.day-status {
  font-size: 0.65rem;
  line-height: 1.2;
  color: #999;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.day.busy {
  background: #fafafa;
}

.day.busy .day-status {
  color: #999;
}

.day.free {
  background: #ffffff;
  border: 1.5px solid #1a1a1a;
}

.day.free .day-status {
  color: #1a1a1a;
  font-weight: 600;
}

.day.marathon {
  background: #1a1a1a;
  border: 1.5px solid #1a1a1a;
}

.day.marathon .day-num,
.day.marathon .day-status {
  color: #ffffff;
  font-weight: 600;
}

.day.today .day-num::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #1a1a1a;
  margin-left: 4px;
}

footer {
  text-align: center;
  margin-top: 32px;
  color: #666;
  font-size: 0.85rem;
}

@media (max-width: 400px) {
  .day {
    padding: 4px;
    font-size: 0.65rem;
  }
  .day-status {
    font-size: 0.55rem;
  }
}

@media (min-width: 700px) {
  main {
    max-width: 720px;
    padding: 48px 32px 80px;
  }

  .day {
    padding: 10px;
    font-size: 0.9rem;
  }

  .day-num {
    font-size: 1rem;
  }

  .day-status {
    font-size: 0.78rem;
  }

  .legend {
    font-size: 0.95rem;
  }

  .weekdays {
    font-size: 0.85rem;
  }

  .subtitle {
    font-size: 1rem;
  }
}

#booking {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
}

.slot {
  border: 1.5px solid #1a1a1a;
  border-radius: 8px;
  padding: 24px 32px;
  text-align: center;
  width: 100%;
  max-width: 320px;
}

.slot-day {
  font-family: 'Caveat', cursive;
  font-size: 1.8rem;
  font-weight: 700;
}

.slot-detail {
  margin-top: 4px;
  color: #666;
  font-size: 0.9rem;
}

#confirm-btn,
.btn-link {
  display: inline-block;
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 1.7rem;
  padding: 10px 30px;
  border: 2.5px solid #1a1a1a;
  border-radius: 16px 8px 18px 10px;
  background: #ffffff;
  color: #1a1a1a;
  text-decoration: none;
  cursor: pointer;
  transform: rotate(-1deg);
  box-shadow: 3px 3px 0 #1a1a1a;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#confirm-btn:hover,
.btn-link:hover {
  transform: rotate(0.5deg) translateY(-2px);
  box-shadow: 4px 6px 0 #1a1a1a;
}

#confirm-btn {
  background: #1a1a1a;
  color: #ffffff;
}

.confirmation {
  text-align: center;
  margin-top: 48px;
}

.big-message {
  font-family: 'Caveat', cursive;
  font-size: 3rem;
  font-weight: 700;
  margin: 0;
  transform: rotate(-1deg);
}

#booking.hidden,
#confirmation.hidden {
  display: none;
}
