/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  min-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.hidden { display: none !important; }

/* ─── GIF Overlay ────────────────────────────────────────────── */
#gif-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.6s ease;
}

#gif-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

#dd-gif {
  width: 100vw;
  height: auto;
}

/* ─── Corkboard ──────────────────────────────────────────────── */
#corkboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 52px 20px 44px;
  gap: 28px;

  /* Cork base colour */
  background-color: #b07840;
  /* Grain: two sets of faint diagonal lines crossing each other */
  background-image:
    repeating-linear-gradient(
      42deg,
      transparent 0px, transparent 9px,
      rgba(0,0,0,0.025) 9px, rgba(0,0,0,0.025) 10px
    ),
    repeating-linear-gradient(
      -42deg,
      transparent 0px, transparent 13px,
      rgba(0,0,0,0.018) 13px, rgba(0,0,0,0.018) 14px
    ),
    /* colour variation patches */
    radial-gradient(ellipse 55% 40% at 20% 25%, rgba(220,170,90,0.28) 0%, transparent 100%),
    radial-gradient(ellipse 45% 55% at 80% 75%, rgba(130,80,25,0.22) 0%, transparent 100%),
    radial-gradient(ellipse 70% 60% at 55% 55%, rgba(190,130,60,0.12) 0%, transparent 100%);

  /* Edge vignette */
  box-shadow: inset 0 0 100px rgba(0,0,0,0.45);
}

/* ─── Flyer ──────────────────────────────────────────────────── */
#flyer {
  position: relative;
  width: min(440px, 92vw);
  transform: rotate(-1.3deg);
  /* No background here — paper lives on #flyer-body so torn tabs are truly transparent */
}

/* ─── Thumbtack ──────────────────────────────────────────────── */
#flyer-pin {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #ff7070 0%, #cc1010 45%, #7a0000 100%);
  box-shadow:
    0 0 0 2px rgba(80,0,0,0.5),
    0 3px 7px rgba(0,0,0,0.55),
    inset 0 2px 3px rgba(255,200,200,0.3);
  z-index: 5;
}

#flyer-pin::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 10px;
  background: linear-gradient(to bottom, #aaa 0%, #666 100%);
  border-radius: 0 0 2px 2px;
}

/* ─── Flyer body ─────────────────────────────────────────────── */
#flyer-body {
  padding: 36px 28px 18px;
  font-family: 'Special Elite', 'Courier New', serif;
  color: #111;

  background: #faf6ee;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent 0px, transparent 3px,
      rgba(0,0,0,0.008) 3px, rgba(0,0,0,0.008) 4px
    );

  box-shadow:
    2px 3px 0   rgba(0,0,0,0.08),
    4px 6px 8px rgba(0,0,0,0.18),
    7px 12px 28px rgba(0,0,0,0.22),
    0 0 0 1px rgba(0,0,0,0.06);
}

/* Header */
#flyer-header { text-align: center; margin-bottom: 14px; }

.flyer-presents {
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  letter-spacing: 0.04em;
  line-height: 1.35;
  margin-bottom: 2px;
  font-weight: normal;
  text-transform: uppercase;
}

.flyer-title {
  font-size: clamp(2.2rem, 8vw, 3.2rem);
  letter-spacing: 0.1em;
  line-height: 1.1;
  margin: 6px 0 8px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.12);
}

.flyer-detail {
  font-size: clamp(0.9rem, 3.2vw, 1.05rem);
  letter-spacing: 0.06em;
  line-height: 1.55;
}

#seats-display {
  font-size: clamp(0.8rem, 2.8vw, 0.95rem);
  color: #555;
  margin-top: 6px;
  min-height: 1.4em;
  letter-spacing: 0.05em;
}

.flyer-payment {
  font-size: clamp(0.78rem, 2.6vw, 0.9rem);
  color: #333;
  margin-top: 5px;
  letter-spacing: 0.03em;
}

.flyer-payment a {
  color: #111;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Rule */
.flyer-rule {
  border: none;
  border-top: 1.5px solid #222;
  margin: 14px 0;
}

/* Checklist */
.checklist {
  list-style: none;
  padding: 0;
  font-size: clamp(0.9rem, 3.5vw, 1.05rem);
  line-height: 1.75;
  letter-spacing: 0.03em;
}

.check {
  display: inline-block;
  width: 1.4em;
  font-weight: bold;
}

/* Pull invite */
.pull-invite {
  text-align: center;
  font-size: clamp(1.15rem, 4.5vw, 1.4rem);
  font-weight: bold;
  letter-spacing: 0.06em;
  margin-top: 10px;
  text-transform: uppercase;
  color: #7c3aed;
  text-shadow: 2px 2px 0 #f9a8d4;
}

/* ─── Tab strip ──────────────────────────────────────────────── */
#tab-strip {
  display: flex;
  align-items: flex-start;
  border-top: 2px dashed #555;
  background: transparent; /* lets corkboard show through torn slots */
  height: 92px;
}

.tab {
  flex: 1;
  height: 100%;
}

.tab + .tab {
  border-left: 1px dashed #aaa;
}

/* Torn tab: completely removed — corkboard shows through */
.tab.torn {
  background: transparent;
  border-left-color: transparent;
  cursor: default;
  pointer-events: none;
}

/* Available tab: full height, clickable */
.tab.available {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #f0eade;
  transition: background 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tab.available:hover  { background: #fffef4; }
.tab.available:active { background: #f0e8c8; }

.tab.available span {
  display: block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: 'Special Elite', 'Courier New', serif;
  font-size: clamp(0.6rem, 1.8vw, 0.78rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  max-height: 84px;
}

/* ─── Board message (post-RSVP yes) ─────────────────────────── */
#board-msg {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.3rem, 5vw, 1.8rem);
  font-weight: 600;
  color: #fef5d4;
  text-align: center;
  text-shadow:
    0 1px 4px rgba(0,0,0,0.6),
    0 0 20px rgba(0,0,0,0.3);
  max-width: min(440px, 92vw);
  line-height: 1.45;
  padding: 0 8px;
}

#board-msg a {
  color: #ffe566;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#board-msg strong {
  font-size: 1.1em;
  display: block;
  margin-bottom: 4px;
}

/* ─── Post-it note (post-RSVP no) ───────────────────────────── */
#postit {
  position: relative;
  background: #fef08a;
  padding: 28px 28px 36px;
  width: min(220px, 80vw);
  box-shadow:
    3px 3px 0 rgba(0,0,0,0.12),
    5px 8px 18px rgba(0,0,0,0.3);
  transform: rotate(3deg);
  font-family: 'Caveat', cursive;
  font-size: clamp(1.4rem, 6vw, 1.9rem);
  font-weight: 600;
  color: #2a2a2a;
  text-align: center;
  line-height: 1.3;
}

/* Fold at bottom-right corner */
#postit::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  background: linear-gradient(
    225deg,
    #b07840 50%,   /* corkboard colour shows through fold */
    #d4b86a 50%
  );
}

/* Pin through the post-it */
#postit-pin {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #ff7070 0%, #cc1010 45%, #7a0000 100%);
  box-shadow:
    0 0 0 2px rgba(80,0,0,0.5),
    0 3px 6px rgba(0,0,0,0.5);
  z-index: 5;
}

#postit-pin::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 8px;
  background: linear-gradient(to bottom, #aaa, #666);
  border-radius: 0 0 2px 2px;
}

/* ─── Yes-RSVP toast ─────────────────────────────────────────── */
#yes-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 250;
  background: #faf6ee;
  padding: 28px 36px;
  opacity: 1;
  transition: opacity 0.8s ease;
  pointer-events: none;
  border: 2px solid #000;
  box-shadow: 4px 4px 0 #000, 8px 8px 20px rgba(0,0,0,0.35);
}

#yes-toast.fade-out {
  opacity: 0;
}

#yes-toast p {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.8rem, 7vw, 2.8rem);
  font-weight: 700;
  color: #7c3aed;
  text-align: center;
  text-shadow: 2px 2px 0 #f9a8d4;
  line-height: 1.3;
}

/* ─── Modal overlay ──────────────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* ─── Modal card ─────────────────────────────────────────────── */
#modal-card {
  position: relative;
  background: #faf6ee;
  width: 100%;
  max-width: 400px;
  padding: 36px 28px 28px;

  /* Hard-edged "printed" shadow */
  border: 1.5px solid #222;
  box-shadow:
    4px 4px 0 rgba(0,0,0,0.55),
    8px 8px 18px rgba(0,0,0,0.3);

  font-family: 'Special Elite', 'Courier New', serif;
  color: #111;
  transform: rotate(0.6deg);
}

#modal-title {
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 20px;
}

.modal-field {
  margin-bottom: 18px;
}

.modal-field label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 5px;
}

.modal-field input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid #333;
  padding: 5px 0;
  font-family: 'Special Elite', 'Courier New', serif;
  font-size: clamp(1rem, 4vw, 1.15rem);
  color: #111;
  outline: none;
}

.modal-field input:focus {
  border-bottom-color: #000;
}

.modal-field input::placeholder { color: #aaa; }

#modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

.btn-primary {
  width: 100%;
  padding: 11px 16px;
  background: #111;
  color: #faf6ee;
  border: 2px solid #111;
  font-family: 'Special Elite', 'Courier New', serif;
  font-size: clamp(0.9rem, 3.5vw, 1rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-primary:hover { background: #333; border-color: #333; }

.btn-secondary {
  width: 100%;
  padding: 11px 16px;
  background: transparent;
  color: #666;
  border: 1.5px solid #bbb;
  font-family: 'Special Elite', 'Courier New', serif;
  font-size: clamp(0.85rem, 3.2vw, 0.95rem);
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-secondary:hover { border-color: #666; color: #333; }

.btn-primary:disabled,
.btn-secondary:disabled { opacity: 0.45; cursor: default; }

#modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.7rem;
  color: #999;
  cursor: pointer;
  line-height: 1;
  font-family: serif;
  transition: color 0.15s;
}

#modal-close:hover { color: #111; }

.modal-error {
  background: #fff0f0;
  border: 1px solid #cc6666;
  color: #aa0000;
  padding: 8px 12px;
  font-family: 'Special Elite', 'Courier New', serif;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  margin-bottom: 14px;
}
