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

/* ── Fonts ───────────────────────────────────────────────────────────── */
body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  background-color: #f5c45a;
  background-image: url('bg.png');
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  background-attachment: scroll;
}

@media (min-width: 768px) {
  body {
    background-image: url('largebg.png');
    background-position: top center;
  }
}

/* ── Layout ──────────────────────────────────────────────────────────── */
.page-wrap {
  display: flex;
  justify-content: flex-start;
  min-height: 100vh;
}

.content-panel {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 28px 22px 60px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

@media (min-width: 768px) {
  .content-panel {
    margin: 0;
    max-width: 460px;
    padding: 28px 20px 60px;
  }
}

/* ── Floating desktop CTA ────────────────────────────────────────────── */
.desktop-cta-btn {
  display: none;
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 50;
  background: #e06840;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px 26px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.desktop-cta-btn:hover { background: #c95930; transform: translateY(-1px); }
@media (min-width: 768px) { .desktop-cta-btn { display: block; } }

/* ── Cards ───────────────────────────────────────────────────────────── */
.card {
  background: rgba(250, 245, 230, 0.52);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border-radius: 18px;
  padding: 24px 20px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.12);
}

/* ── Header card ─────────────────────────────────────────────────────── */
.header-card {
  text-align: center;
  padding: 28px 24px 22px;
}

.header-card h1 {
  font-family: 'Inika', serif;
  font-size: clamp(2.4rem, 9vw, 3.2rem);
  font-weight: 700;
  color: #1e1208;
  letter-spacing: -0.3px;
}

/* ── Crown divider ───────────────────────────────────────────────────── */
.crown-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 12px;
}

.divider-line {
  display: block;
  flex: 1;
  height: 2px;
  max-width: 90px;
  border-radius: 2px;
}
.divider-line--left  { background: linear-gradient(to right, transparent, #D89B00); }
.divider-line--right { background: linear-gradient(to left,  transparent, #D89B00); }

.crown-img {
  width: 42px;
  height: auto;
  display: block;
  flex-shrink: 0;
}

.header-subtitle {
  font-family: 'Inter', sans-serif;
  color: #4a3820;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ── Share card ──────────────────────────────────────────────────────── */
.share-card { text-align: center; }

.share-count {
  font-family: 'Inter', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: #D89B00;
  margin-bottom: 12px;
}

.share-action-btn {
  display: block;
  width: 100%;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background 0.15s;
}
.share-action-btn:hover { background: #333; }

.share-subtitle {
  font-size: 0.8rem;
  color: #6b5a40;
}

/* ── Clocks card ─────────────────────────────────────────────────────── */
.clocks-card { padding: 0; overflow: hidden; }

.clocks-section { padding: 22px 14px 20px; }

.needs-work-section { border-top: 1px solid rgba(180,160,120,0.35); }

.section-title {
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.progress-title   { color: #2d7a3a; }
.needs-work-title { color: #c0392b; }

/* ── Clocks grid ─────────────────────────────────────────────────────── */
.clocks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* ── Clock card ──────────────────────────────────────────────────────── */
.clock-card {
  background: rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 6px 4px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
  user-select: none;
}
.clock-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.13);
  background: rgba(255,255,255,0.92);
}
.clock-card:active { transform: translateY(0); }

/* ── SVG dial ────────────────────────────────────────────────────────── */
.dial-wrapper {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}
.dial-wrapper svg {
  width: 72px;
  height: 72px;
  transform: rotate(-90deg);
  display: block;
}

.dial-bg       { fill: none; stroke: #e4ddd0; stroke-width: 6; }
.dial-progress {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease, stroke 0.4s ease;
}

.dial-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

/* ── Clock icon (SVG line art) ───────────────────────────────────────── */
.clock-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.clock-icon svg {
  width: 100%;
  height: 100%;
}

.clock-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.67rem;
  text-align: center;
  color: #3a2e1e;
  line-height: 1.3;
  min-height: calc(0.67rem * 1.3 * 2);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Join blurb ──────────────────────────────────────────────────────── */
.join-blurb {
  padding: 16px 18px 20px;
  border-top: 1px solid rgba(180,160,120,0.35);
  text-align: center;
}
.join-blurb p {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: #4a3820;
  line-height: 1.65;
  margin-bottom: 16px;
}
.join-cause-btn {
  display: block;
  width: 100%;
  background: #e06840;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 15px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.join-cause-btn:hover { background: #c95930; transform: translateY(-1px); }

/* ── Modal overlay ───────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(18, 24, 44, 0.94);
  z-index: 200;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  padding: 24px 16px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }

/* ── Modal close button (outside the card) ───────────────────────────── */
.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 1.9rem;
  font-weight: 700;
  cursor: pointer;
  color: #1e1208;
  line-height: 1;
  padding: 4px;
  z-index: 1;
}
.modal-close-btn:hover { opacity: 0.55; }

/* ── Clock detail modal card ─────────────────────────────────────────── */
.clock-modal-card {
  background: rgba(250, 245, 230, 0.97);
  border-radius: 20px;
  padding: 32px 28px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  position: relative;
}

.modal-dial-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.modal-dial-wrap .dial-wrapper,
.modal-dial-wrap .dial-wrapper svg { width: 140px; height: 140px; }
.modal-dial-wrap .dial-bg       { stroke-width: 9; }
.modal-dial-wrap .dial-progress { stroke-width: 9; }
.modal-dial-wrap .dial-value    { font-size: 1.75rem; }

.modal-clock-title {
  font-family: 'Inika', serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #1e1208;
  margin-bottom: 10px;
}

.modal-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.modal-divider .divider-line { max-width: 50px; background: #2d7a3a; }

.modal-clock-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-clock-icon svg { width: 100%; height: 100%; }

.modal-description {
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  color: #4a3820;
  line-height: 1.72;
  margin-bottom: 20px;
}

.modal-source-link {
  font-family: 'Inter', sans-serif;
  color: #2678d4;
  font-size: 0.92rem;
  text-decoration: none;
}
.modal-source-link:hover { text-decoration: underline; }

.modal-source-caption {
  text-align: center;
  color: #b0b8c8;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  line-height: 1.6;
  max-width: 380px;
  word-break: break-all;
}

/* ── Share modal card ────────────────────────────────────────────────── */
.share-modal-card {
  background: rgba(250, 245, 230, 0.97);
  border-radius: 20px;
  padding: 32px 28px 24px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.share-modal-title {
  font-family: 'Inika', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: #1e1208;
  margin-bottom: 6px;
}

.share-modal-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: #6b5a40;
  margin-bottom: 24px;
}

.share-options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.share-option-btn {
  background: rgba(255, 255, 255, 0.85);
  border: none;
  border-radius: 14px;
  padding: 14px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.12s, transform 0.1s;
}
.share-option-btn:hover  { background: rgba(255,255,255,0.98); transform: translateY(-2px); }
.share-option-btn:active { transform: translateY(0); }

.share-option-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.share-option-icon svg { width: 28px; height: 28px; }

.share-option-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  color: #3a2e1e;
  line-height: 1.2;
  text-align: center;
}

.share-modal-cancel {
  width: 100%;
  background: transparent;
  border: 2px solid rgba(180,160,120,0.45);
  border-radius: 50px;
  padding: 11px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #6b5a40;
  cursor: pointer;
  transition: background 0.12s;
}
.share-modal-cancel:hover { background: rgba(180,160,120,0.15); }

/* ── Join modal card ─────────────────────────────────────────────────── */
.join-modal-card {
  background: rgba(250, 245, 230, 0.97);
  border-radius: 20px;
  padding: 32px 52px 32px;
  max-width: 420px;
  width: 100%;
}

.join-modal-title {
  font-family: 'Inika', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e1208;
  text-align: center;
  margin-bottom: 24px;
}

.join-form { display: flex; flex-direction: column; gap: 0; }

.form-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid #c9821a;
  padding: 10px 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: #333;
  outline: none;
  margin-bottom: 4px;
}
.form-input::placeholder { color: #aaa; }
.form-input:focus { border-bottom-color: #e06840; }

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: #4a3820;
  line-height: 1.4;
}

.form-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid #c9821a;
  border-radius: 3px;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  position: relative;
}
.form-checkbox:checked { background: #c9821a; }
.form-checkbox:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  width: 100%;
}

.form-rule {
  border: none;
  border-top: 1px solid #d8d0c0;
  margin: 18px 0 16px;
}

.interest-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: #2a1f0e;
  text-align: center;
  margin-bottom: 14px;
  line-height: 1.4;
}

.interest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.interest-grid .clock-card {
  border: 2px solid transparent;
  padding: 16px 8px 14px;
  transition: border-color 0.15s, transform 0.12s, box-shadow 0.12s;
}
.interest-grid .clock-card.selected {
  border-color: #e06840;
  background: rgba(255,240,230,0.92);
}

.join-submit-btn {
  display: block;
  width: 100%;
  background: #e06840;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 15px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.join-submit-btn:hover { background: #c95930; transform: translateY(-1px); }

/* ── Toast ───────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #1e1208;
  color: #fff;
  padding: 10px 24px;
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
