/* Couples Hub — a homey take on the Angie system (Design.md tokens, warmed up).
   The page is a "room": a papered wall, pieces that hang on it (calendar, garland,
   corkboard, diary, framed card), soft light, almost no words. Display voice is
   Gowun Batang in italic (the enamel-sign serif the strips already use); body stays
   Pretendard; Space Mono carries dates + D-days like little engravings. */

:root {
  --paper:        #FAF8F3;
  --paper-raised: #FFFFFF;
  --ink:          #201D19;
  --ink-soft:     #6E675D;
  --line:         #E8E2D7;
  --pink:         #FF7BA3;
  --pink-tint:    #FFE0EA;
  --blue:         #5FA0FF;
  --blue-tint:    #DCEBFF;
  --accent:       #C67B5C;   /* per-theme warm accent */
  --accent-soft:  #F3E2D7;
  --wall:         url('/hub/assets/themes/cream.webp');
  --wall-veil:    rgba(250, 248, 243, .84);
  --shadow:       0 12px 34px rgba(32, 29, 25, .09);
  --font-display: "Gowun Batang", "Pretendard", serif;
  --font-body:    "Pretendard", system-ui, sans-serif;
  --font-mono:    "Space Mono", "Pretendard", monospace;
}

/* --- themes ------------------------------------------------------------- */
body[data-theme="dusk"] {
  --paper: #FAF6F6; --line: #EBE0E4;
  --accent: #A886C6; --accent-soft: #EDE3F4;
  --wall: url('/hub/assets/themes/dusk.webp');
  --wall-veil: rgba(250, 246, 246, .78);
}
body[data-theme="garden"] {
  --paper: #F7F9F4; --line: #E2E8DC;
  --accent: #6E9C77; --accent-soft: #E2EFE4;
  --wall: url('/hub/assets/themes/garden.webp');
  --wall-veil: rgba(247, 249, 244, .8);
}
body[data-theme="night"] {
  --paper: #23212A; --paper-raised: #2C2A34;
  --ink: #F2EDE3; --ink-soft: #A9A297;
  --line: #3B3844;
  --accent: #E4B063; --accent-soft: #453B2D;
  --pink-tint: #4A3340; --blue-tint: #2F3A4E;
  --wall: url('/hub/assets/themes/night.webp');
  --wall-veil: rgba(30, 28, 36, .72);
  --shadow: 0 12px 34px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  line-height: 1.45;
}
/* The wall: the theme art behind everything, softened by a veil so the pieces read. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: var(--wall) center / cover no-repeat;
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: var(--wall-veil);
}

.mono { font-family: var(--font-mono); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
a { color: inherit; }

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* --- buttons -------------------------------------------------------------- */
.btn {
  display: inline-block;
  background: var(--ink); color: var(--paper-raised);
  font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: 4px;
  transition: transform .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(32,29,25,.18); }
.btn:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.btn.ghost {
  background: var(--paper-raised); color: var(--ink);
  border: 1px solid var(--line);
}
body.dark .btn { background: var(--ink); color: #23212A; }

/* ==========================================================================
   GATE screens (loading / signin / start / locked / doors)
   ========================================================================== */
.gate {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
}
.gate-heart {
  font-size: 34px; color: var(--pink);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.18); opacity: 1; } }

.gate-card {
  width: min(480px, 100%);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 44px 40px 36px;
  text-align: center;
}
.gate-kicker { font-size: 11px; letter-spacing: .3em; color: var(--accent); }
.gate-title {
  font-family: var(--font-display); font-style: italic; font-weight: 700;
  font-size: clamp(30px, 6vw, 40px); line-height: 1.15;
  margin: 14px 0 10px; letter-spacing: -.01em;
}
.gate-sub { color: var(--ink-soft); font-size: 15px; max-width: 36ch; margin: 0 auto; }
.gate-err { color: #C4574B; font-size: 14px; margin-top: 10px; }
.gate-body { margin-top: 26px; display: grid; gap: 14px; justify-items: center; }
.gate-or { font-size: 11px; letter-spacing: .25em; color: var(--ink-soft); }
.gate-mail { display: flex; gap: 8px; width: 100%; max-width: 340px; }
.gate-input {
  flex: 1; min-width: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px;
  padding: 11px 14px; font-size: 15px;
}
.gate-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.gate-fine { margin-top: 22px; font-size: 12.5px; color: var(--ink-soft); }
.gate-back { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--ink-soft); text-decoration: none; }
.gate-back:hover { color: var(--ink); }

/* start choices */
.gate-choices { grid-template-columns: 1fr 1fr; align-items: stretch; }
.choice {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 26px 16px 22px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
  transition: transform .18s ease, border-color .18s ease;
  width: 100%;
}
.choice:hover { transform: translateY(-2px); border-color: var(--accent); }
.choice-emoji { font-size: 30px; }
.choice-t { font-family: var(--font-display); font-style: italic; font-size: 19px; }
.choice-s { font-size: 12.5px; color: var(--ink-soft); }
.choice-join { cursor: default; }
.choice-join:hover { transform: none; }
.join-form { display: flex; gap: 6px; width: 100%; margin-top: 4px; }
.join-form .gate-input { text-transform: uppercase; letter-spacing: .18em; text-align: center; }

/* decorative mini strip on the signin card */
.ministrip {
  margin: 30px auto 0; width: 56px;
  background: var(--ink); padding: 6px 5px; border-radius: 2px;
  display: grid; gap: 5px; transform: rotate(-2.5deg);
}
.ministrip-f { display: flex; gap: 3px; background: #efe9de; height: 26px; padding: 4px; }
.ministrip-f i { flex: 1; border-radius: 50% 50% 45% 45%; align-self: end; height: 78%; }
.ms-a { background: var(--pink); }
.ms-b { background: var(--blue); }

/* locked preview (blurred room mock) */
.locked-preview {
  margin: 22px auto 4px; width: min(300px, 90%);
  display: grid; grid-template-columns: 2fr 1fr; gap: 10px;
  filter: blur(2.5px) saturate(.92); opacity: .85;
  pointer-events: none;
}
.lp-cal {
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px;
  padding: 8px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
}
.lp-cell { height: 12px; background: var(--line); border-radius: 2px; }
.lp-cell.on { background: var(--pink); }
.lp-note { background: #FFF3C9; height: 52px; border-radius: 2px; transform: rotate(3deg); }
.lp-strip { background: var(--ink); height: 52px; width: 22px; border-radius: 2px; justify-self: center; transform: rotate(-4deg); }

/* ==========================================================================
   THE ROOM
   ========================================================================== */
.room {
  width: min(1200px, 100%); margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 30px) 60px;
  display: flex; flex-direction: column;
}

/* topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 6px 2px 18px;
}
.brand {
  font-family: var(--font-display); font-style: italic; font-weight: 700;
  font-size: 21px; text-decoration: none;
}
.addr { font-size: 11.5px; letter-spacing: .12em; color: var(--ink-soft); }
.top-right { display: flex; align-items: center; gap: 14px; }
.theme-chips { display: flex; gap: 8px; }
.tchip {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1px solid rgba(32,29,25,.18);
  transition: transform .15s ease;
}
.tchip:hover { transform: scale(1.2); }
.tchip.on { outline: 2px solid var(--ink); outline-offset: 2px; }
.t-cream  { background: linear-gradient(135deg, #F6E9D4, #EAD3B4); }
.t-dusk   { background: linear-gradient(135deg, #D9C6EC, #F4CFC4); }
.t-garden { background: linear-gradient(135deg, #DDEBD8, #AECBAE); }
.t-night  { background: linear-gradient(135deg, #2E2C3A, #4A4258); }
.menu-wrap { position: relative; }
.menu-btn { font-size: 20px; line-height: 1; padding: 2px 8px; color: var(--ink-soft); }
.menu {
  position: absolute; right: 0; top: 30px; z-index: 30;
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow); min-width: 170px; overflow: hidden;
}
.menu-item { display: block; width: 100%; text-align: left; padding: 11px 16px; font-size: 14px; }
.menu-item:hover { background: var(--paper); }

/* hero nameplate */
.hero { text-align: center; padding: 26px 10px 8px; }
.hello { font-size: 11px; letter-spacing: .34em; color: var(--accent); }
.names {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(38px, 7vw, 66px); line-height: 1.08; letter-spacing: -.01em;
  margin: 10px 0 6px;
}
.names em { font-style: italic; }
.names .amp {
  font-style: italic; font-weight: 400; color: var(--accent);
  font-size: .55em; margin: 0 .35em; vertical-align: .12em;
}
.dplus { font-size: 13px; letter-spacing: .22em; color: var(--ink-soft); }
.dplus-set {
  font-family: var(--font-display); font-style: italic; font-size: 15px;
  color: var(--accent); border-bottom: 1px dashed var(--accent); padding-bottom: 1px;
}

/* claim the address */
.claim {
  margin: 20px auto 0; display: flex; align-items: center; gap: 8px;
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 8px 8px 14px; width: fit-content; max-width: 100%;
  flex-wrap: wrap; justify-content: center;
}
.claim-pre { font-size: 13px; color: var(--ink-soft); }
.claim-input {
  width: 130px; background: transparent; border: 0; border-bottom: 2px solid var(--line);
  font-size: 14px; padding: 2px 2px; letter-spacing: .04em;
}
.claim-input:focus { outline: none; border-bottom-color: var(--accent); }
.claim-status { font-size: 11px; color: var(--ink-soft); min-width: 52px; }
.claim-status[data-ok] { color: #1F7A4D; }
body.dark .claim-status[data-ok] { color: #8FBF9A; }

/* ==========================================================================
   the garland — their strips on a string
   ========================================================================== */
.garland { margin-top: 26px; }
.string {
  height: 26px; margin: 0 4%;
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 65%, var(--ink) 20%);
  border-radius: 0 0 50% 50% / 0 0 26px 26px;
  opacity: .5;
}
.pins-wrap { overflow-x: auto; padding: 0 8px 18px; scrollbar-width: thin; }
.pins {
  display: flex; gap: 20px; justify-content: safe center;
  padding: 0 12px; margin-top: -12px; width: max-content; min-width: 100%;
}
.polaroid {
  position: relative; flex: 0 0 auto;
  background: var(--paper-raised); border: 1px solid var(--line);
  padding: 7px 7px 12px; border-radius: 2px;
  box-shadow: 0 8px 20px rgba(32,29,25,.13);
  transform: rotate(var(--tilt, 0deg));
  transition: transform .25s cubic-bezier(.2,.7,.3,1), box-shadow .25s ease;
  text-decoration: none;
}
.polaroid:hover { transform: rotate(0deg) translateY(-4px) scale(1.03); box-shadow: 0 14px 30px rgba(32,29,25,.2); z-index: 2; }
.polaroid img { display: block; height: 158px; width: auto; max-width: 128px; object-fit: contain; }
.pin {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%) rotate(2deg);
  width: 12px; height: 18px; border-radius: 3px;
  background: linear-gradient(180deg, #E2C494, #C9A16A);
  box-shadow: 0 1px 2px rgba(32,29,25,.3);
}
.polaroid.take {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-width: 86px; min-height: 172px;
  border: 1.5px dashed var(--line); background: transparent; box-shadow: none;
  color: var(--ink-soft);
}
.polaroid.take:hover { border-color: var(--accent); color: var(--accent); }
.take-plus { font-size: 26px; line-height: 1; }
.take-t { font-size: 11.5px; text-align: center; max-width: 90px; }

/* ==========================================================================
   the wall grid
   ========================================================================== */
.wall {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, 1fr);
  gap: 26px; margin-top: 26px; align-items: start;
}
.side { display: grid; gap: 26px; }

.piece {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.side .piece { padding: 20px 20px 22px; position: relative; }
.piece-kicker { font-size: 10px; letter-spacing: .3em; color: var(--accent); margin-bottom: 12px; }

/* washi tape on the side pieces */
.side .piece::before {
  content: ""; position: absolute; top: -9px; left: 50%;
  width: 74px; height: 18px; transform: translateX(-50%) rotate(-2deg);
  background: color-mix(in srgb, var(--accent) 26%, var(--paper-raised) 60%);
  opacity: .85; border-radius: 1px;
  box-shadow: 0 1px 2px rgba(32,29,25,.08);
}
.hero.piece, .garland.piece { background: none; border: 0; box-shadow: none; }

/* ==========================================================================
   the calendar
   ========================================================================== */
.cal { padding: 24px 24px 20px; }
.cal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cal-title { display: flex; align-items: baseline; gap: 12px; }
.cal-month {
  font-family: var(--font-display); font-style: italic; font-weight: 700;
  font-size: clamp(26px, 4vw, 34px); letter-spacing: -.01em;
}
.cal-year { font-size: 13px; letter-spacing: .18em; color: var(--ink-soft); }
.cal-nav { display: flex; gap: 4px; }
.cal-btn {
  width: 34px; height: 34px; border-radius: 4px; border: 1px solid var(--line);
  font-size: 17px; line-height: 1; color: var(--ink-soft);
  display: grid; place-items: center;
  transition: border-color .15s ease, color .15s ease;
}
.cal-btn:hover { border-color: var(--ink); color: var(--ink); }

.cal-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 16px; min-height: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 100px;
  padding: 5px 12px 5px 6px; background: var(--paper);
  transition: border-color .15s ease, transform .15s ease;
}
.chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.chip-d {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  background: var(--accent); color: var(--paper-raised);
  padding: 3px 8px; border-radius: 100px;
}
.chip-t { font-size: 12.5px; }

.cal-wd {
  display: grid; grid-template-columns: repeat(7, 1fr);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
  color: var(--ink-soft); text-align: center; padding-bottom: 6px;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 2px; overflow: hidden;
}
.cal-cell {
  min-height: 78px; background: var(--paper-raised);
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 6px; text-align: left;
  transition: background .12s ease;
}
.cal-cell:hover { background: var(--paper); }
.cal-cell.out { opacity: .38; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-cell.sel { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.cal-day { font-size: 11px; color: var(--ink-soft); }
.cal-cell.today .cal-day { color: var(--ink); font-weight: 700; }
.cal-ev {
  max-width: 100%; font-size: 10.5px; line-height: 1.25;
  padding: 2px 6px; border-radius: 3px;
  background: var(--pink-tint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
.cal-ev.by-b { background: var(--blue-tint); }
.cal-ev.yearly { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.cal-ev-t { display: block; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: 9px; color: var(--ink-soft); }

/* per-day editor */
.cal-editor {
  margin-top: 14px; border: 1px solid var(--line); border-radius: 4px;
  padding: 14px 16px; background: var(--paper);
  animation: rise .22s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ed-head { display: flex; align-items: baseline; gap: 10px; }
.ed-date { font-family: var(--font-display); font-style: italic; font-size: 19px; }
.ed-dday { font-size: 11px; letter-spacing: .08em; color: var(--accent); font-weight: 700; }
.ed-close { margin-left: auto; font-size: 18px; color: var(--ink-soft); padding: 0 4px; }
.ed-close:hover { color: var(--ink); }
.ed-list { list-style: none; margin: 10px 0 2px; display: grid; gap: 6px; }
.ed-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: 4px;
  padding: 7px 10px; font-size: 13.5px;
  border-left: 3px solid var(--pink);
}
.ed-item.by-b { border-left-color: var(--blue); }
.ed-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-yr { font-size: 10px; color: var(--ink-soft); letter-spacing: .06em; }
.ed-del { margin-left: auto; color: var(--ink-soft); font-size: 16px; padding: 0 4px; }
.ed-del:hover { color: #C4574B; }
.ed-form { margin-top: 12px; display: grid; gap: 10px; }
.ed-emoji { display: flex; gap: 4px; flex-wrap: wrap; }
.ed-em {
  width: 32px; height: 32px; border-radius: 4px; font-size: 16px;
  display: grid; place-items: center; border: 1px solid transparent;
}
.ed-em:hover { background: var(--paper-raised); }
.ed-em.on { border-color: var(--accent); background: var(--paper-raised); }
.ed-input {
  width: 100%; background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: 4px; padding: 10px 12px; font-size: 14px;
}
.ed-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.ed-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ed-yearly { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.ed-yearly input { accent-color: var(--accent); width: 15px; height: 15px; }
.ed-add {
  background: var(--ink); color: var(--paper-raised); font-weight: 600; font-size: 13.5px;
  padding: 9px 20px; border-radius: 4px;
}
.ed-add:disabled { opacity: .5; }
body.dark .ed-add { color: #23212A; }

/* ==========================================================================
   side pieces
   ========================================================================== */
/* countdown */
.count { text-align: center; }
.count-d {
  font-size: clamp(42px, 5vw, 54px); font-weight: 700; letter-spacing: -.02em;
  color: var(--accent); line-height: 1;
}
.count-what { font-size: 15.5px; margin-top: 8px; }
.count-when { font-size: 11px; letter-spacing: .18em; color: var(--ink-soft); margin-top: 4px; }
.count-empty {
  font-family: var(--font-display); font-style: italic; font-size: 17px;
  color: var(--accent); border-bottom: 1px dashed var(--accent);
}

/* us. (framed card) */
.us { outline: 1px solid var(--line); outline-offset: 5px; }
.us-rows { display: grid; gap: 9px; }
.us-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; }
.us-k { color: var(--ink-soft); }
.us-v { font-size: 13px; letter-spacing: .06em; }
.us-edit { margin-top: 14px; font-size: 12.5px; color: var(--ink-soft); }
.us-edit:hover { color: var(--ink); }
.us-form { display: grid; gap: 10px; }
.us-field { display: grid; gap: 4px; font-size: 12px; }
.us-field .us-k { font-size: 11.5px; }
.us-input {
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px;
  padding: 8px 10px; font-size: 14px; width: 100%;
}
.us-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.us-save {
  margin-top: 4px; background: var(--ink); color: var(--paper-raised);
  font-weight: 600; font-size: 13.5px; padding: 10px; border-radius: 4px;
}
body.dark .us-save { color: #23212A; }

/* diary */
.diary-cover {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 82%, var(--ink) 10%), color-mix(in srgb, var(--accent) 62%, var(--ink) 26%));
  color: #FFF9F0; border-radius: 4px; padding: 16px 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 4px 10px rgba(32,29,25,.12);
  transition: transform .18s ease;
}
.diary-cover:hover { transform: translateY(-1px); }
.diary-heart { font-size: 15px; }
.diary-t { font-family: var(--font-display); font-style: italic; font-size: 17px; }
.diary-open { margin-left: auto; font-size: 10px; letter-spacing: .14em; opacity: .85; }
.diary-inside {
  margin-top: 14px; border: 1px solid var(--line); border-radius: 4px;
  padding: 16px 14px;
  background:
    repeating-linear-gradient(transparent 0 25px, color-mix(in srgb, var(--line) 55%, transparent) 25px 26px),
    var(--paper);
  animation: rise .22s ease both;
}
.diary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stat-n { display: block; font-size: 25px; letter-spacing: -.02em; }
.stat-l { font-size: 11px; color: var(--ink-soft); }
.diary-kinds { margin-top: 16px; display: grid; gap: 7px; }
.dk-row { display: grid; grid-template-columns: 118px 1fr 26px; align-items: center; gap: 8px; font-size: 12.5px; }
.dk-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dk-bar { height: 7px; border-radius: 100px; background: var(--accent-soft); position: relative; overflow: hidden; }
.dk-bar::after { content: ""; position: absolute; inset: 0; width: var(--w, 10%); background: var(--accent); border-radius: 100px; }
.dk-n { text-align: right; font-size: 11px; color: var(--ink-soft); }
.diary-empty {
  display: block; margin-top: 14px; text-align: center;
  font-family: var(--font-display); font-style: italic; font-size: 15px;
  color: var(--accent); text-decoration: none;
}

/* corkboard */
.notes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.notes-empty { grid-column: 1 / -1; font-size: 13px; color: var(--ink-soft); font-style: italic; text-align: center; padding: 10px 0; }
.note {
  position: relative; min-height: 92px;
  padding: 12px 12px 26px; border-radius: 2px;
  transform: rotate(var(--tilt, 0deg));
  box-shadow: 0 6px 14px rgba(32,29,25,.12);
  color: #33301F;
  transition: transform .2s cubic-bezier(.2,.7,.3,1);
}
.note:hover { transform: rotate(0deg) scale(1.02); z-index: 2; }
.note::after { /* folded corner */
  content: ""; position: absolute; right: 0; bottom: 0;
  border-style: solid; border-width: 0 0 14px 14px;
  border-color: transparent transparent rgba(32,29,25,.12) transparent;
}
.tone-butter { background: #FFF3C2; }
.tone-rose   { background: #FFE0EA; }
.tone-sky    { background: #DCEBFF; }
.tone-mint   { background: #DFF5E0; }
.note-body { font-size: 13.5px; line-height: 1.4; word-break: break-word; white-space: pre-wrap; }
.note-meta { position: absolute; left: 10px; right: 8px; bottom: 7px; display: flex; align-items: center; }
.note-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); }
.note-dot.by-b, .note .note-dot.by-b { background: var(--blue); }
.note-del {
  margin-left: auto; font-size: 14px; line-height: 1; color: rgba(51,48,31,.45);
  opacity: 0; transition: opacity .15s ease;
}
.note:hover .note-del, .note-del:focus-visible { opacity: 1; }
.note-del:hover { color: #C4574B; }
.note-form { margin-top: 14px; display: grid; gap: 8px; }
.note-input {
  width: 100%; resize: vertical; min-height: 52px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px;
  padding: 10px 12px; font-size: 13.5px;
}
.note-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.note-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tone-row { display: flex; gap: 7px; }
.tone { width: 17px; height: 17px; border-radius: 50%; border: 1px solid rgba(32,29,25,.15); }
.tone.on { outline: 2px solid var(--ink); outline-offset: 2px; }
.note-actions .btn { padding: 8px 16px; font-size: 13px; }

/* invite */
.invite { text-align: center; }
.invite-sub { font-size: 13.5px; color: var(--ink-soft); }
.invite-code {
  margin: 12px auto; font-size: 24px; letter-spacing: .3em; font-weight: 700;
  padding: 10px 4px 10px 14px; border: 1.5px dashed var(--accent); border-radius: 4px;
  color: var(--accent); width: fit-content; max-width: 100%;
}
.invite.compact { border: 1px solid var(--line); border-radius: 6px; padding: 18px; width: 100%; }
.invite.compact::before { display: none; }

/* footer */
.room-foot {
  margin-top: 44px; text-align: center;
  font-size: 10px; letter-spacing: .3em; color: var(--ink-soft); opacity: .7;
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: var(--ink); color: var(--paper-raised);
  font-size: 13.5px; padding: 11px 20px; border-radius: 100px;
  opacity: 0; pointer-events: none; z-index: 100;
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 10px 26px rgba(32,29,25,.25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.dark .toast { background: #F2EDE3; color: #23212A; }

/* ==========================================================================
   entrance motion — pieces settle onto the wall, one after another
   ========================================================================== */
@keyframes settle {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.room > * { animation: settle .55s cubic-bezier(.2,.7,.25,1) both; }
.room > .topbar { animation-delay: 0s; }
.room > .hero { animation-delay: .06s; }
.room > .garland { animation-delay: .14s; }
.room > .wall { animation: none; }
.wall > .cal { animation: settle .55s cubic-bezier(.2,.7,.25,1) both .2s; }
.side > .piece:nth-child(1) { animation: settle .55s cubic-bezier(.2,.7,.25,1) both .26s; }
.side > .piece:nth-child(2) { animation: settle .55s cubic-bezier(.2,.7,.25,1) both .32s; }
.side > .piece:nth-child(3) { animation: settle .55s cubic-bezier(.2,.7,.25,1) both .38s; }
.side > .piece:nth-child(4) { animation: settle .55s cubic-bezier(.2,.7,.25,1) both .44s; }
.side > .piece:nth-child(5) { animation: settle .55s cubic-bezier(.2,.7,.25,1) both .5s; }
.gate-card.enter { animation: settle .5s cubic-bezier(.2,.7,.25,1) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   responsive
   ========================================================================== */
@media (max-width: 880px) {
  .wall { grid-template-columns: 1fr; }
  .gate-choices { grid-template-columns: 1fr; }
  .addr { display: none; }
  .cal { padding: 16px 12px 14px; }
  .cal-cell { min-height: 62px; padding: 4px; }
  .cal-ev { font-size: 9.5px; padding: 1.5px 4px; }
  .polaroid img { height: 128px; }
  .dk-row { grid-template-columns: 96px 1fr 24px; }
  .gate-card { padding: 34px 22px 28px; }
}

/* keyboard focus */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
