/* ── memorybox · notes from the room ─────────────────────────────
   Fixed-viewport app: a camera pans/zooms over an infinite linen
   board; notes are absolutely positioned world objects. Japandi
   feel: clarity, warmth, air. Mobile-first. */

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

:root {
  --paper-bg: #e0d5c0; /* washi: real paper, a shade deeper */
  --ink: #35302a;
  --ink-soft: #5c5546;
  --ink-faint: #8a7f6d;
  --clay: #a9714b;
  --line: #cfc2a8;
  --serif: "Fraunces", Georgia, serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  font-family: var(--serif);
  color: var(--ink);
  background-color: var(--paper-bg);
  /* real paper: fibre grain (generated noise) + soft top light + weave */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.07'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    linear-gradient(rgba(255, 250, 238, 0.4), rgba(0, 0, 0, 0) 35%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.1) 0 1px, transparent 1px 3px),
    radial-gradient(circle at 30% 40%, rgba(110, 92, 64, 0.06) 1px, transparent 2px);
  background-size: 220px 220px, 100% 100%, auto, 67px 71px;
  -webkit-text-size-adjust: 100%;
}

img { -webkit-user-drag: none; user-select: none; }

/* ── Stage & world ── */
#stage {
  position: absolute;
  inset: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
#stage:active { cursor: grabbing; }

#world {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform-origin: 0 0;
}
#world.glide { transition: transform 0.35s ease; }

/* ── Notes (world objects) ── */
.note {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 2px;
  width: 230px;
  padding: 1.5rem 0.95rem 0.9rem;
  color: var(--note-ink, var(--ink));
  box-shadow: 0 1px 2px rgba(70, 58, 40, 0.10), 0 7px 16px rgba(70, 58, 40, 0.14);
}
.note.lifted {
  box-shadow: 0 2px 3px rgba(70, 58, 40, 0.12), 0 14px 28px rgba(70, 58, 40, 0.22);
}
.note.dragging {
  box-shadow: 0 4px 6px rgba(70, 58, 40, 0.14), 0 22px 40px rgba(70, 58, 40, 0.28);
  z-index: 6;
}
.note.mine { cursor: grab; }
.note.colliding {
  outline: 2px dashed rgba(160, 74, 46, 0.7);
  outline-offset: 3px;
}
.note.relaxing { transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1); }
.note.settling { animation: settle 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards; }
@keyframes settle {
  from { opacity: 0; margin-top: -28px; }
  to   { opacity: 1; margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .note.settling { animation: none; } }

.note.ghost {
  pointer-events: none;
  opacity: 0.92;
  outline: 1.5px dashed rgba(169, 113, 75, 0.55);
  outline-offset: 3px;
  z-index: 6;
}

.pin {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 11px;
  height: 11px;
  margin-left: -5.5px;
  border-radius: 50%;
  box-shadow: 0 2px 3px rgba(50, 38, 20, 0.35), inset 0 -1px 2px rgba(0, 0, 0, 0.25);
}
.pin-brass  { background: radial-gradient(circle at 35% 30%, #d9b87e, #a5834a 65%, #6e5527); }
.pin-clay   { background: radial-gradient(circle at 35% 30%, #cf9075, #a05a41 65%, #6e3a27); }
.pin-moss   { background: radial-gradient(circle at 35% 30%, #a8b790, #75855c 65%, #4c5936); }
.pin-indigo { background: radial-gradient(circle at 35% 30%, #8fa3c9, #4d6390 65%, #313f5e); }
.pin-rose   { background: radial-gradient(circle at 35% 30%, #d9a3ad, #a55a6b 65%, #6e3441); }

.note-text {
  font-size: 1.1rem;
  line-height: 1.4;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.note-name {
  margin-top: 0.75rem;
  text-align: right;
  font-size: 0.92rem;
  opacity: 0.8;
}

.note-photo {
  width: 100%;
  display: block;
  margin-bottom: 0.6rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.tape-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  font-family: "Patrick Hand", cursive;
  font-size: 0.9rem;
  color: #55503f;
  background: repeating-linear-gradient(-45deg, #ece4cf, #ece4cf 6px, #e3dabf 6px, #e3dabf 12px);
  border: 1px dashed rgba(85, 80, 63, 0.45);
  border-radius: 3px;
  padding: 0.25rem 0.65rem;
  cursor: pointer;
}

/* ── Masthead: a big sheet pinned at the origin ── */
.note.masthead {
  width: min(370px, 82vw);
  padding: 2.1rem 1.7rem 1.7rem;
  text-align: center;
  cursor: default;
}
.masthead-title {
  font-weight: 600;
  font-size: 2.3rem;
  line-height: 1.05;
  color: var(--ink);
}
.masthead-tagline {
  margin-top: 0.1rem;
  font-family: "Caveat", cursive;
  font-size: 1.45rem;
  color: var(--clay);
  transform: rotate(-1deg);
}
.masthead-subtitle {
  margin-top: 0.8rem;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.masthead-intro {
  margin-top: 1.1rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.masthead-slam {
  margin-top: 0.8rem;
  font-family: "Patrick Hand", cursive;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.masthead-freeze {
  margin-top: 1rem;
  font-family: "Caveat", cursive;
  font-size: 1.15rem;
  color: var(--clay);
}
.masthead-cap {
  margin-top: 0.5rem;
  font-family: "Caveat", cursive;
  font-size: 1.1rem;
  color: var(--ink-soft);
}
.masthead-cap.pulse { animation: cap-pulse 1s ease; }
@keyframes cap-pulse {
  0%, 100% { color: var(--ink-soft); transform: scale(1); }
  30% { color: #a04a2e; transform: scale(1.08); }
}

.compose-open.capped { opacity: 0.75; }

.banner-reset {
  margin-left: 0.6rem;
  font-family: inherit;
  font-size: inherit;
  color: var(--clay);
  background: none;
  border: none;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* ── Papers ── */
.paper-cream  { background: linear-gradient(176deg, #faf6ec, #f2ebd9); }
.paper-kraft  { background: linear-gradient(176deg, #e0d2b5, #d5c49e); }
.paper-pink   { background: linear-gradient(176deg, #f3e2db, #ecd4c9); }
.paper-sage   { background: linear-gradient(176deg, #dfe4d3, #d2dabf); }
.paper-mist   { background: linear-gradient(176deg, #e1e7e8, #d3dcdd); }
.paper-butter { background: linear-gradient(176deg, #f6eed4, #eee2ba); }
.paper-ruled  {
  background:
    repeating-linear-gradient(#fdfdfa 0 1.6em, #ccd8e4 1.6em calc(1.6em + 1px)),
    #fdfdfa;
}
.paper-torn {
  background: linear-gradient(176deg, #faf5e8, #efe7d0);
  clip-path: polygon(
    1.8% 3.1%, 5% 0.8%, 9% 2.6%, 14% 0.4%, 19% 2.9%, 25% 1%, 31% 3.2%, 37% 0.6%,
    43% 2.4%, 50% 0.3%, 56% 2.8%, 62% 0.9%, 68% 3%, 74% 0.5%, 80% 2.5%, 86% 0.8%,
    92% 2.9%, 97% 1.2%, 99.4% 4%, 98% 9%, 99.6% 16%, 98.2% 25%, 99.5% 34%, 98% 44%,
    99.6% 54%, 98.1% 64%, 99.4% 74%, 98% 84%, 99.5% 92%, 98.2% 97%,
    95% 99.4%, 89% 97.6%, 83% 99.7%, 77% 97.9%, 71% 99.5%, 64% 97.7%, 57% 99.8%,
    50% 98%, 43% 99.6%, 36% 97.8%, 29% 99.7%, 22% 98.1%, 15% 99.5%, 9% 97.9%,
    4% 99.6%, 1% 97%, 0.4% 91%, 1.9% 83%, 0.5% 73%, 2% 63%, 0.6% 53%, 1.8% 43%,
    0.4% 33%, 1.9% 23%, 0.6% 14%, 2% 7%
  );
  filter: drop-shadow(0 3px 3px rgba(70, 58, 40, 0.22)) drop-shadow(0 10px 16px rgba(70, 58, 40, 0.20));
  box-shadow: none;
}
.paper-torn.lifted {
  filter: drop-shadow(0 4px 4px rgba(70, 58, 40, 0.24)) drop-shadow(0 18px 26px rgba(70, 58, 40, 0.26));
  box-shadow: none;
}
.paper-polaroid { background: #fdfdfa; padding: 1.5rem 0.85rem 0.85rem; }
.paper-polaroid .note-text { font-size: 0.98rem; }

/* ── Handwriting (all stacks fall back to Tamil/Malayalam hands) ── */
.font-caveat    { font-family: "Caveat", "Kavivanar", "Chilanka", cursive; }
.font-shadows   { font-family: "Shadows Into Light", "Kavivanar", "Chilanka", cursive; }
.font-patrick   { font-family: "Patrick Hand", "Kavivanar", "Chilanka", cursive; }
.font-homemade  { font-family: "Homemade Apple", "Kavivanar", "Chilanka", cursive; }
.font-indie     { font-family: "Indie Flower", "Kavivanar", "Chilanka", cursive; }
.font-kalam     { font-family: "Kalam", "Kavivanar", "Chilanka", cursive; }
.font-gochi     { font-family: "Gochi Hand", "Kavivanar", "Chilanka", cursive; }
.font-zeyada    { font-family: "Zeyada", "Kavivanar", "Chilanka", cursive; }
.font-dancing   { font-family: "Dancing Script", "Kavivanar", "Chilanka", cursive; }
.font-nanum     { font-family: "Nanum Pen Script", "Kavivanar", "Chilanka", cursive; }
.font-reenie    { font-family: "Reenie Beanie", "Kavivanar", "Chilanka", cursive; }
.font-kavivanar { font-family: "Kavivanar", cursive; }
.font-chilanka  { font-family: "Chilanka", cursive; }

.font-caveat .note-text    { font-size: 1.32rem; }
.font-gochi .note-text     { font-size: 1.2rem; }
.font-zeyada .note-text    { font-size: 1.28rem; line-height: 1.3; }
.font-homemade .note-text  { font-size: 0.9rem; line-height: 1.75; }
.font-kalam .note-text     { font-size: 1rem; }
.font-dancing .note-text   { font-size: 1.25rem; }
.font-nanum .note-text     { font-size: 1.25rem; }
.font-reenie .note-text    { font-size: 1.35rem; line-height: 1.2; }
.font-kavivanar .note-text { font-size: 1rem; line-height: 1.65; }
.font-chilanka .note-text  { font-size: 1.08rem; line-height: 1.55; }

/* ── Stickers: die-cut decorations, free to overlap ── */
.note.sticker {
  width: 64px;
  height: 64px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fdfdfa;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(70, 58, 40, 0.14), 0 5px 10px rgba(70, 58, 40, 0.18);
  z-index: 4; /* stickers always sit above notes */
}
.sticker-art { width: 100%; height: 100%; }
.sticker-emoji { font-size: 2rem; line-height: 1; }

/* elegant peel-off × on your own stickers */
.sticker-x {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 21px;
  height: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 0.85rem;
  line-height: 1;
  color: var(--ink-soft);
  background: #f6f1e5;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(70, 58, 40, 0.2);
  cursor: pointer;
  padding: 0;
}
.sticker-x:hover { color: #a04a2e; border-color: #a04a2e; }

.sticker-open {
  margin-left: 0.6rem;
  width: 46px;
  height: 46px;
  font-size: 1.3rem;
  background: #faf6ec;
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(70, 58, 40, 0.10), 0 5px 14px rgba(70, 58, 40, 0.18);
  cursor: pointer;
  transform: rotate(2deg);
}

.sticker-tray {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  width: min(360px, calc(100vw - 24px));
  padding: 0.8rem 0.9rem 0.6rem;
  background: #f6f1e5;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(35, 28, 18, 0.3);
}
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.35rem;
}
.sticker-choice {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  padding: 3px;
}
.sticker-choice:hover { background: #ece4d0; }
.sticker-choice img { width: 100%; height: 100%; }
.sticker-credit {
  margin-top: 0.5rem;
  font-size: 0.62rem;
  text-align: right;
  color: var(--ink-faint);
}
.sticker-credit a { color: inherit; }

/* ── Fixed chrome ── */
.local-banner {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  background: rgba(236, 228, 211, 0.85);
  padding: 0.2rem 0.7rem;
  border-radius: 99px;
  white-space: nowrap;
}

.presence {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  z-index: 15;
  font-size: 0.72rem;
  color: var(--ink-soft);
  background: rgba(250, 246, 236, 0.9);
  border: 1px solid var(--line);
  padding: 0.2rem 0.7rem;
  border-radius: 99px;
}

.chrome-bottom {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
}

.compose-open {
  font-family: "Caveat", cursive;
  font-size: 1.45rem;
  padding: 0.4rem 1.8rem 0.55rem;
  color: var(--ink);
  background: #faf6ec;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(70, 58, 40, 0.10), 0 5px 14px rgba(70, 58, 40, 0.18);
  transform: rotate(-0.8deg);
  cursor: pointer;
}

.recenter {
  position: fixed;
  right: calc(14px + env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 15;
  width: 42px;
  height: 42px;
  font-size: 1.2rem;
  color: var(--ink-soft);
  background: rgba(250, 246, 236, 0.9);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(70, 58, 40, 0.16);
  cursor: pointer;
}

/* ── Compose sheet ── */
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  max-height: 60dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.2rem 1.2rem calc(1.4rem + env(safe-area-inset-bottom));
  background: #f6f1e5;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 40px rgba(35, 28, 18, 0.28);
}
@media (min-width: 760px) {
  .sheet {
    left: 18px;
    right: auto;
    top: 18px;
    bottom: 18px;
    width: 420px;
    max-height: none;
    border-radius: 8px;
    box-shadow: 0 16px 50px rgba(35, 28, 18, 0.35);
  }
}

.overlay-close {
  position: absolute;
  top: 0.5rem;
  right: 0.7rem;
  font-size: 1.5rem;
  line-height: 1;
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
}

.sheet-hint {
  margin: 0 0 1rem;
  padding-right: 1.4rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.sheet-hint em { color: var(--ink-faint); }

.compose-title {
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 1.1rem 0 0.5rem;
}
.compose-title:first-of-type { margin-top: 0; }

.swatches { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.swatch {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(120, 100, 70, 0.18);
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(70, 58, 40, 0.14);
  font-size: 1.15rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: static;
  clip-path: none;
  filter: none;
}
.swatch[aria-checked="true"] {
  border-color: var(--clay);
  outline: 1.5px solid var(--clay);
  outline-offset: 1px;
  transform: translateY(-2px);
}
/* the torn swatch shows its actual ragged edge (percent clip scales down) */
.swatch.paper-torn {
  clip-path: polygon(
    2% 6%, 10% 1%, 22% 5%, 35% 0.5%, 48% 4%, 62% 1%, 75% 5%, 88% 1%, 98% 4%,
    99% 15%, 97% 35%, 99.5% 55%, 97% 75%, 99% 92%,
    90% 99%, 76% 96%, 62% 99.5%, 48% 96%, 34% 99%, 20% 96%, 8% 99%,
    1% 90%, 3% 70%, 0.5% 50%, 3% 30%, 1% 12%
  );
  filter: none;
}
.inks .swatch { width: 30px; height: 30px; border-radius: 50%; }

.compose-paper {
  margin-top: 1.1rem;
  padding: 0.95rem 0.85rem 0.75rem;
  box-shadow: 0 2px 8px rgba(70, 58, 40, 0.16);
  transform: rotate(-0.6deg);
  clip-path: none;
  filter: none;
}
.compose-paper textarea,
.compose-paper input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: inherit;
  font-family: inherit;
  font-size: 1.1rem;
  line-height: 1.45;
  user-select: text;
  -webkit-user-select: text;
}
.compose-paper input { margin-top: 0.4rem; opacity: 0.8; font-size: 0.95rem; }
.compose-paper ::placeholder { color: currentColor; opacity: 0.4; }

.char-count {
  text-align: right;
  font-size: 0.7rem;
  color: var(--ink-faint);
  margin-top: 0.3rem;
}
.char-count.over { color: #a04a2e; }

.attachments { display: flex; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; align-items: center; }

.attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "Patrick Hand", cursive;
  font-size: 0.95rem;
  color: var(--ink-soft);
  background: #efe8d8;
  border: 1px dashed #b6a888;
  border-radius: 8px;
  padding: 0.38rem 0.8rem;
  cursor: pointer;
}

.btn-ico { width: 15px; height: 15px; flex-shrink: 0; }
.attach-btn.recording .btn-ico { animation: rec-pulse 1.2s ease-in-out infinite; }
@keyframes rec-pulse { 50% { opacity: 0.4; } }
.attach-btn.unavailable { opacity: 0.5; }
.attach-btn.recording {
  background: #a04a2e;
  border-color: #a04a2e;
  border-style: solid;
  color: #fdf9f0;
}
.attach-btn.listening {
  background: #75855c;
  border-color: #75855c;
  border-style: solid;
  color: #fdf9f0;
}

.dictate-status {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--ink-soft);
}
.dictate-status.err { color: #a04a2e; font-style: normal; }

.dictate-lang {
  font-family: var(--serif);
  font-size: 0.82rem;
  color: var(--ink-soft);
  background: #fbf8ef;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.3rem 0.4rem;
}

.attach-preview { margin-top: 0.7rem; font-size: 0.85rem; color: var(--ink-soft); }
.attach-preview img { max-width: 110px; display: block; border-radius: 2px; margin-top: 0.3rem; }
.attach-preview audio { width: 100%; margin-top: 0.3rem; }
.attach-remove {
  background: none;
  border: none;
  color: #a04a2e;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0.2rem 0;
  font-family: var(--serif);
}

.email-row { margin-top: 1rem; }
.email-row input {
  width: 100%;
  font-family: var(--serif);
  font-size: 0.85rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8ef;
  color: var(--ink);
  user-select: text;
  -webkit-user-select: text;
}

.pin-btn {
  width: 100%;
  margin-top: 1.2rem;
  font-family: "Caveat", cursive;
  font-size: 1.45rem;
  padding: 0.5rem;
  color: #fdf9f0;
  background: var(--ink);
  border: none;
  border-radius: 9px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(35, 28, 18, 0.25);
}
.pin-btn:disabled { opacity: 0.55; cursor: wait; }

.delete-btn {
  width: 100%;
  margin-top: 0.6rem;
  font-family: var(--serif);
  font-size: 0.85rem;
  padding: 0.45rem;
  color: #a04a2e;
  background: none;
  border: 1px solid rgba(160, 74, 46, 0.4);
  border-radius: 8px;
  cursor: pointer;
}

.compose-error { margin-top: 0.6rem; font-size: 0.85rem; color: #a04a2e; }

/* ── Room word card ── */
.word-card {
  width: min(340px, calc(100vw - 40px));
  margin: auto;
  padding: 1.8rem 1.5rem 1.6rem;
  text-align: center;
  background: #f8f3e7;
  border-radius: 10px;
  box-shadow: 0 16px 50px rgba(35, 28, 18, 0.4);
}
.word-card h2 {
  font-family: "Caveat", cursive;
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--ink);
}
.word-card p {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.word-card input {
  width: 100%;
  margin-top: 1rem;
  font-family: var(--serif);
  font-size: 1rem;
  text-align: center;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8ef;
  color: var(--ink);
  user-select: text;
  -webkit-user-select: text;
}
.word-card button {
  width: 100%;
  margin-top: 0.8rem;
  font-family: "Caveat", cursive;
  font-size: 1.35rem;
  padding: 0.45rem;
  color: #fdf9f0;
  background: var(--ink);
  border: none;
  border-radius: 9px;
  cursor: pointer;
}
.word-error { color: #a04a2e !important; margin-top: 0.6rem; }

/* ── Enlarge view ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  overflow-y: auto;
  background: rgba(53, 48, 42, 0.45);
  backdrop-filter: blur(3px);
}
.overlay[hidden] { display: none; }

.view-note {
  width: 100%;
  max-width: 420px;
  user-select: text;
  -webkit-user-select: text;
}
.view-note .note {
  position: static;
  width: 100%;
  transform: none;
  cursor: default;
  font-size: 1.12em;
}
