@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=M+PLUS+Rounded+1c:wght@500;700&display=swap');

:root {
  --bg: linear-gradient(135deg, #ffe259 0%, #ffa751 50%, #ff5f6d 100%);
  --surface: rgba(255, 255, 255, 0.14);
  --panel: rgba(255, 255, 255, 0.2);
  --text: #0f172a;
  --muted: #1f2937;
  --accent: #7c3aed;
  --green: #0ea5e9;
  --yellow: #f97316;
  --red: #ef4444;
  --shadow: 0 18px 55px rgba(15, 23, 42, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Space Grotesk', 'M PLUS Rounded 1c', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

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

.title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.logo-dot {
  width: 28px;
  height: 28px;
  border-radius: 12px 12px 4px 12px;
  background: linear-gradient(135deg, #0ea5e9, #a855f7);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.7);
  font-weight: 700;
}

h1 {
  margin: 2px 0 0;
  font-size: 26px;
  letter-spacing: -0.02em;
}

h2 {
  margin: 0;
  letter-spacing: -0.01em;
}

.menu-button {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  border: none;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.menu-button span {
  width: 22px;
  height: 3px;
  background: #0f172a;
  border-radius: 99px;
  display: block;
  position: relative;
}

.menu-button span + span {
  margin-top: 4px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.time-card {
  padding: 26px 28px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.22);
  color: #0f172a;
  box-shadow: var(--shadow);
  border: 2px solid rgba(255, 255, 255, 0.25);
  min-height: 180px;
}

.time-card.now {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.9), rgba(124, 58, 237, 0.9));
  color: #f8fafc;
}

.time-card.target {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.9), rgba(239, 68, 68, 0.9));
  color: #fff7ed;
}

.label {
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 13px;
  opacity: 0.9;
}

.time {
  margin: 0;
  font-size: clamp(42px, 6vw, 52px);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.sub {
  margin: 4px 0 0;
  opacity: 0.9;
  font-weight: 600;
}

.next-card {
  margin-top: 10px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
}

.current-card {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.8);
  color: #e2e8f0;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
}

.current-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.current-count {
  text-align: right;
  color: #e2e8f0;
}

.current-count .count-label {
  color: #e2e8f0;
}

.current-count .countdown {
  color: #e2e8f0;
}

.now-badge {
  background: #facc15;
  color: #0f172a;
}

.current-label {
  margin: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.8;
}

.current-title {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 800;
}

.current-range {
  margin: 6px 0 0;
  font-weight: 700;
  font-size: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 14px;
  background: #0ea5e9;
  color: #0b1021;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 12px;
}

.next-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.next-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.next-time {
  margin: 0 0 6px;
  font-weight: 600;
  color: #1f2937;
  font-size: 20px;
}

.count-wrapper {
  text-align: right;
}

.count-label {
  margin: 0;
  font-weight: 700;
  color: #0f172a;
}

.countdown {
  margin: 4px 0 8px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.list-card {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
}

.list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.list-meta {
  background: rgba(15, 23, 42, 0.08);
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 700;
}

.schedule-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.schedule-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.04);
}

.schedule-time {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.schedule-title {
  font-weight: 600;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.primary {
  border: none;
  padding: 10px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0ea5e9, #a855f7);
  color: #0b1021;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
}

.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ghost {
  border: 1px solid rgba(15, 23, 42, 0.2);
  background: transparent;
  padding: 10px 16px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
}

.more-indicator {
  margin-top: 10px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
}

.menu-panel {
  position: absolute;
  top: 72px;
  right: 24px;
  background: #0b1021;
  color: #f8fafc;
  padding: 10px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  min-width: 180px;
  z-index: 20;
}

.menu-panel button {
  width: 100%;
  border: none;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-weight: 700;
  cursor: pointer;
}

.menu-panel .danger {
  background: rgba(239, 68, 68, 0.16);
  color: #fecdd3;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 15, 40, 0.35);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  border-radius: 20px;
  width: min(420px, 90vw);
  box-shadow: var(--shadow);
  z-index: 11;
}

.modal-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.modal-body {
  padding: 16px;
  display: grid;
  gap: 12px;
}

label {
  font-weight: 700;
  display: grid;
  gap: 6px;
}

input[type="text"],
input[type="file"] {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  font-size: 16px;
}

.helper {
  margin: 0;
  font-size: 14px;
  color: #475569;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.icon {
  border: none;
  background: rgba(15, 23, 42, 0.06);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

.danger-text {
  color: var(--red);
}

@media (max-width: 640px) {
  .schedule-item {
    grid-template-columns: 70px 1fr;
    grid-template-areas:
      "time title"
      "remove remove";
  }

  .schedule-item .pill {
    justify-self: start;
    margin-top: 8px;
  }

  .count-wrapper {
    text-align: left;
    width: 100%;
  }
}
