/* ==========================================================================
   Components: the building blocks every page and widget reuses, so the
   markup stays short (class="btn btn-primary" instead of 12 utilities).
   Layout (grids, gaps, widths) stays in Tailwind classes.
   ========================================================================== */

/* ---- Cards ---- */
.card {
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(73, 59, 55, .13); min-width: 0; max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.25rem;
  backdrop-filter: blur(6px);
}
@media (max-width: 639px) {
  .card { padding: .85rem .75rem; border-radius: 16px; }
  .arcade-game { padding: .7rem .6rem; }
  .modal { padding: 1.15rem .9rem calc(1.1rem + var(--safe-bottom)); }
}
.card > * + * { margin-top: .875rem; }
.card.is-flat { background: transparent; border-color: transparent; box-shadow: none; backdrop-filter: none; padding-left: 0; padding-right: 0; }
.card-title {
  display: flex; align-items: center; gap: .6rem; min-width: 0;
  font-family: 'Lora', serif; font-weight: 700; font-size: 1.05rem; color: var(--passionfruit);
}
.card-title .card-icon {
  flex-shrink: 0; width: 1.9rem; height: 1.9rem; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(246, 185, 59, .2); color: var(--passionfruit);
}
.card-title .card-icon svg { width: 1rem; height: 1rem; }

/* ---- Page heading ---- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: .25rem; }
.page-head h2 { font-family: 'Lora', serif; font-weight: 700; font-size: 1.75rem; line-height: 1.15; color: var(--passionfruit); }
.page-head p { font-size: .8rem; color: rgba(73, 59, 55, .65); margin-top: .15rem; }
.card > .card-blurb { margin-top: .2rem; margin-bottom: .75rem; font-size: .8rem; line-height: 1.35; color: rgba(73, 59, 55, .65); } /* a game's line under its title (Bedroom) */

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem .95rem; border-radius: var(--radius-sm);
  font-size: .78rem; font-weight: 700; line-height: 1.2; white-space: nowrap;
  transition: background-color .15s, color .15s, transform .15s, box-shadow .15s, opacity .15s;
  cursor: pointer; user-select: none;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn svg { width: .95rem; height: .95rem; }
.btn-sm { padding: .35rem .7rem; font-size: .72rem; }
.btn-primary { background: var(--passionfruit); color: #fff; box-shadow: 0 6px 14px -6px rgba(108, 38, 92, .55); }
.btn-primary:hover:not(:disabled) { background: #5a1f4d; }
.btn-accent { background: var(--pulp); color: #fff; box-shadow: 0 6px 14px -6px rgba(243, 169, 43, .6); }
.btn-accent:hover:not(:disabled) { background: #e39a1f; }
.btn-soft { background: rgba(246, 185, 59, .22); color: var(--ink); }
.btn-soft:hover:not(:disabled) { background: rgba(246, 185, 59, .38); }
.btn-ghost { color: rgba(73, 59, 55, .6); }
.btn-ghost:hover:not(:disabled) { background: rgba(73, 59, 55, .06); color: var(--ink); }
.btn-danger { color: var(--guava); }
.btn-danger:hover:not(:disabled) { background: rgba(233, 140, 145, .15); }
.btn-calm { background: var(--greentea); color: #fff; }
.btn-calm:hover:not(:disabled) { background: #7f9665; }

/* Small round icon button (edit, delete, widget controls) */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 1.75rem; height: 1.75rem; border-radius: 9999px;
  color: rgba(73, 59, 55, .35); transition: color .15s, background-color .15s;
}
.icon-btn:hover { color: var(--passionfruit); background: rgba(246, 185, 59, .18); }
.icon-btn.danger:hover { color: var(--guava); background: rgba(233, 140, 145, .15); }
.icon-btn svg { width: .9rem; height: .9rem; }

/* Link-style text button */
.link { font-size: .75rem; font-weight: 700; color: var(--passionfruit); display: inline-flex; align-items: center; gap: .25rem; }
.link:hover { text-decoration: underline; }
.link svg { width: .8rem; height: .8rem; }

/* ---- Form fields ---- */
.input {
  width: 100%; padding: .55rem .8rem; border-radius: var(--radius-sm);
  border: 1px solid rgba(73, 59, 55, .16); background: #fff;
  font-size: .875rem; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: rgba(73, 59, 55, .38); }
.input:focus { outline: none; border-color: var(--passionfruit); box-shadow: 0 0 0 3px rgba(108, 38, 92, .12); }
textarea.input { resize: vertical; min-height: 4.5rem; }
.label { display: block; font-size: .72rem; font-weight: 700; color: rgba(73, 59, 55, .8); margin-bottom: .3rem; }
.hint { font-size: .7rem; color: rgba(73, 59, 55, .5); }
.error-text { font-size: .75rem; font-weight: 700; color: var(--guava); }

/* Checkbox / toggle row */
.check { display: inline-flex; align-items: center; gap: .5rem; font-size: .78rem; color: rgba(73, 59, 55, .8); cursor: pointer; }
.check input { width: 1rem; height: 1rem; accent-color: var(--passionfruit); }

/* Color swatches (forms, mood editor) */
.swatch { width: 1.6rem; height: 1.6rem; border-radius: 9999px; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(73, 59, 55, .15); transition: transform .15s var(--ease-bounce); }
.swatch:hover { transform: scale(1.12); }
.swatch.is-active { box-shadow: 0 0 0 2px var(--ink); }

/* Square choice button (travel icons, emojis, numbers) */
.choice {
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid rgba(73, 59, 55, .1); border-radius: var(--radius-sm);
  color: rgba(73, 59, 55, .6); transition: border-color .15s, background-color .15s, color .15s;
}
.choice:hover { border-color: rgba(108, 38, 92, .35); background: rgba(246, 185, 59, .1); }
.choice.is-active { border-color: var(--passionfruit); background: rgba(246, 185, 59, .18); color: var(--passionfruit); }

/* ---- Tabs (segmented control) ---- */
.tabs { display: inline-flex; flex-wrap: wrap; gap: .2rem; padding: .2rem; border-radius: 12px; background: rgba(73, 59, 55, .06); max-width: 100%; }
.tab {
  display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border-radius: 9px;
  font-size: .75rem; font-weight: 700; color: rgba(73, 59, 55, .6); transition: background-color .15s, color .15s;
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: #fff; color: var(--passionfruit); box-shadow: 0 1px 3px rgba(73, 59, 55, .12); }
.tab .dot { width: .4rem; height: .4rem; border-radius: 9999px; background: var(--guava); }

/* ---- Badges ---- */
.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .5rem; border-radius: 9999px; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.badge svg { width: .7rem; height: .7rem; }
.badge-private { background: rgba(73, 59, 119, .12); color: var(--ink-purple); }
.badge-nsfw { background: rgba(233, 140, 145, .2); color: #c4626a; }
.badge-stamp { background: rgba(243, 169, 43, .2); color: var(--passionfruit); }

/* ---- Rows (lists inside cards) ---- */
.row-item {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: var(--radius-sm);
  background: rgba(255, 248, 233, .85); border: 1px solid rgba(73, 59, 55, .13); min-width: 0;
  transition: border-color .15s, background-color .15s;
}
.row-item:hover { border-color: rgba(246, 185, 59, .55); background: rgba(255, 248, 233, 1); }
.row-item .row-actions, .lang-row .row-actions { display: flex; align-items: center; opacity: 0; transition: opacity .15s; }
.row-item:hover .row-actions, .row-item:focus-within .row-actions, .lang-row:hover .row-actions, .lang-row:focus-within .row-actions { opacity: 1; }
@media (hover: none) { .row-item .row-actions, .lang-row .row-actions { opacity: 1; } }

.lang-row {
  cursor: pointer;
  transition: background-color .15s, border-color .15s, opacity .18s, filter .18s;
}
.lang-row:hover {
  background-color: rgba(246, 185, 59, 0.16) !important;
  border-color: rgba(246, 185, 59, 0.5) !important;
}
.lang-row.is-inactive {
  opacity: 0.38;
  filter: grayscale(1);
  background: rgba(73, 59, 55, 0.035) !important;
  border-color: rgba(73, 59, 55, 0.05) !important;
}
.lang-row.is-inactive:hover {
  opacity: 0.55;
  background: rgba(73, 59, 55, 0.07) !important;
  border-color: rgba(73, 59, 55, 0.1) !important;
}

.tick {
  width: 1.2rem; height: 1.2rem; flex-shrink: 0; border-radius: 6px; border: 1.5px solid var(--passionfruit);
  display: inline-flex; align-items: center; justify-content: center; background: #fff; color: #fff; transition: background-color .15s;
}
.tick.is-done { background: var(--passionfruit); }
.tick svg { width: .8rem; height: .8rem; }

.empty { font-size: .78rem; font-style: italic; color: rgba(73, 59, 55, .5); padding: .5rem 0; }
.section-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: rgba(73, 59, 55, .55); }

/* ---- Header ---- */
.site-header {
  position: relative; z-index: 40; /* scrolls away on phones (the bottom bar has everything); sticks from sm up */
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(73, 59, 55, .07);
  transition: background-color .3s;
}
.nav-link {
  position: relative; display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 10px;
  font-size: .82rem; font-weight: 700; color: rgba(73, 59, 55, .7); white-space: nowrap; transition: background-color .15s, color .15s;
}
.nav-link:hover { background: rgba(246, 185, 59, .18); color: var(--ink); }
.nav-link.is-active { background: var(--passionfruit); color: #fff; box-shadow: 0 6px 14px -8px rgba(108, 38, 92, .7); }
.nav-link svg { width: 1rem; height: 1rem; }
.nav-link.nav-locked { padding-left: .6rem; padding-right: .6rem; color: rgba(73, 59, 55, .45); } /* the Bedroom, until it's tapped: just a lock */
.nav-link.nav-locked:hover svg { animation: lock-jiggle .4s ease-in-out; }
.is-unlocking { animation: nav-unlock .55s var(--ease-bounce); }
.is-unlocking span:not(.nav-dot) { animation: fade-in .4s ease-out .1s both; }
@keyframes lock-jiggle { 25% { transform: rotate(-12deg); } 75% { transform: rotate(10deg); } }
@keyframes nav-unlock { from { transform: scale(.85); opacity: .5; } } /* (never bigger than itself: the menu would get a scrollbar) */
.nav-dot { position: absolute; top: .2rem; right: .25rem; width: .5rem; height: .5rem; border-radius: 9999px; background: var(--guava); border: 2px solid #fff; }

/* Bottom tab bar on phones */
.mobile-nav {
  position: fixed; left: 0; right: 0; bottom: 0; width: 100%; z-index: 50; transform: translate3d(0, 0, 0); -webkit-transform: translate3d(0, 0, 0);
  display: flex; justify-content: space-around; padding: .35rem .25rem calc(.35rem + var(--safe-bottom));
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(73, 59, 55, .14);
}
.mobile-nav .nav-link { flex-direction: column; gap: .15rem; padding: .35rem .4rem; font-size: .6rem; min-width: 3rem; }
.mobile-nav .nav-link svg { width: 1.2rem; height: 1.2rem; }
.mobile-nav .nav-link.is-active { background: transparent; color: var(--passionfruit); box-shadow: none; }
.mobile-nav .nav-link.is-active svg { transform: translateY(-1px); }
@media (min-width: 640px) { .mobile-nav { display: none; } .site-header { position: sticky; top: 0; } }

/* ---- Modal (also a bottom sheet on phones) ---- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 1100; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(73, 59, 55, .45); backdrop-filter: blur(3px); animation: fade-in .15s ease-out;
}
.modal {
  position: relative; width: 100%; max-height: 92vh; overflow-y: auto;
  background: var(--milk); border-radius: 22px 22px 0 0; padding: 1.4rem 1.25rem calc(1.25rem + var(--safe-bottom));
  box-shadow: var(--shadow-pop); animation: sheet-up .22s var(--ease-bounce);
}
.modal-title { font-family: 'Lora', serif; font-weight: 700; font-size: 1.25rem; color: var(--passionfruit); padding-right: 2rem; }
.modal-close { position: absolute; top: .9rem; right: .9rem; z-index: 10; }
.modal form:not(.flex) > * + * { margin-top: .85rem; }
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 1rem; }
  .modal { max-width: 28rem; border-radius: 20px; padding: 1.5rem; animation: pop-in .2s var(--ease-bounce); }
  .modal.modal-wide { max-width: 36rem; }
  .modal.modal-xl { max-width: 52rem; }
}

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: calc(5.5rem + var(--safe-bottom)); z-index: 1200; transform: translateX(-50%);
  padding: .6rem 1.1rem; border-radius: 9999px; font-size: .78rem; font-weight: 700; color: #fff;
  background: var(--passionfruit); box-shadow: var(--shadow-pop); animation: toast-in .25s var(--ease-bounce);
  max-width: calc(100vw - 2rem); text-align: center;
}
.toast.is-error { background: #c4626a; }
@media (min-width: 640px) { .toast { bottom: 1.5rem; } }

/* ---- Widget boards ---- */
.widget-handle, [data-handle], [data-box-handle], [data-drag-handle] { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; } @media (max-width: 639px) { .widget-handle { cursor: default; touch-action: auto; } }
.widget-handle:active { cursor: grabbing; }
.is-dragging { opacity: .45; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop-in { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-in { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* Formatted text (core/richtext.js): the editor and anything showing it */
.rich ul { list-style: disc; padding-left: 1.4em; }
.rich ol { list-style: decimal; padding-left: 1.4em; }
.rich mark { background: rgba(246, 185, 59, .45); color: inherit; padding: 0 .1em; border-radius: .2em; }
.rich-editor { border-radius: .75rem; }
.rich-tools { display: flex; flex-wrap: wrap; gap: .125rem; margin-bottom: .25rem; }
.rich-tools button { width: 1.9rem; height: 1.9rem; display: inline-flex; align-items: center; justify-content: center; border-radius: .5rem; color: rgba(73, 59, 55, .6); transition: background-color .15s, color .15s; }
.rich-tools button:hover { background: rgba(73, 59, 55, .07); color: var(--ink); }
.rich-tools button.is-active { background: rgba(246, 185, 59, .3); color: var(--ink); }
.rich[contenteditable] { overflow-y: auto; max-height: 50vh; white-space: pre-wrap; cursor: text; }
.rich.is-empty::before { content: attr(data-placeholder); color: rgba(73, 59, 55, .35); pointer-events: none; }

/* Widgets on a board (Home, the Bedroom): with a mouse, the card behind them and their title, icon and
   controls are there but light (see-through) — pointing at one brings it out fully */
@media (hover: hover) {
  [data-board] .card-head .card-title, [data-board] .card-head a.icon-btn, [data-board] .card-blurb { opacity: .5; transition: opacity .2s; }
  .card-controls { opacity: .3; transition: opacity .2s; }
  [data-board] [data-card]:hover .card-head .card-title, [data-board] [data-card]:hover .card-head a.icon-btn, [data-board] [data-card]:hover .card-blurb, [data-card]:hover .card-controls { opacity: 1; transition: opacity .25s .1s; }
  .card-controls:focus-within { opacity: 1; }
  [data-board] [data-card].is-collapsed .card-head .card-title, [data-board] [data-card].is-collapsed .card-controls { opacity: 1; } /* folded up: its title stays (else nothing shows) */
  [data-board] .card { background: rgba(255, 255, 255, .55); border-color: rgba(73, 59, 55, .1); box-shadow: none; backdrop-filter: blur(3px); transition: background-color .25s, border-color .25s, box-shadow .25s; }
  [data-board] [data-card]:hover .card { background: rgba(255, 255, 255, .6); border-color: rgba(73, 59, 55, .07); box-shadow: var(--shadow-card); transition-delay: .05s; }
}

/* Art, Essentials, and Memories pages: see-through boxes like games (not hovered) */
[data-page="gallery"] .card,
[data-page="lists"] .card,
[data-page="memories"] .card,
.page-art .card,
.page-essentials .card,
.page-memories .card {
  background: rgba(255, 255, 255, .5);
  border-color: rgba(73, 59, 55, .12);
  box-shadow: none;
  backdrop-filter: blur(3px);
  transition: background-color .25s, border-color .25s, box-shadow .25s;
}
[data-page="gallery"] .card:hover,
[data-page="lists"] .card:hover,
[data-page="memories"] .card:hover,
.page-art .card:hover,
.page-essentials .card:hover,
.page-memories .card:hover {
  background: rgba(255, 255, 255, .58);
  border-color: rgba(73, 59, 55, .14);
  box-shadow: var(--shadow-card);
}

.is-sorting { background: rgba(246, 185, 59, .12); border-radius: .75rem; box-shadow: 0 6px 16px rgba(73, 59, 55, .12); position: relative; z-index: 1; }

/* Memories: a vertical timeline down the middle, the two of us at its start (bottom) */
.timeline { position: relative; }
.timeline::before { content: ''; position: absolute; top: 0; bottom: 1.5rem; left: 50%; width: 16px; transform: translateX(-50%); opacity: .6; /* a gently curvy line: one wave, repeated down */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='120' viewBox='0 0 16 120'%3E%3Cpath d='M8 0C16 20 16 40 8 60C0 80 0 100 8 120' fill='none' stroke='%23E98C91' stroke-width='2'/%3E%3C/svg%3E") repeat-y; }
.timeline-month { position: relative; margin: 1.5rem 0 1rem; text-align: center; }
.timeline-month span { font-family: 'Lora', serif; font-weight: 700; color: var(--passionfruit); background: var(--milk); padding: .15rem .7rem; border-radius: 9999px; box-shadow: 0 1px 4px rgba(73, 59, 55, .1); }
/* Alternating left and right of the line (phones too), each a little nearer or farther from it */
.timeline-item { position: relative; margin-bottom: 1rem; width: 50%; padding-right: var(--gap, 1.25rem); display: flex; justify-content: flex-end; }
.timeline-item.is-right { margin-left: 50%; padding-right: 0; padding-left: var(--gap, 1.25rem); justify-content: flex-start; }
.timeline-dot { position: absolute; right: -.375rem; top: 1.45rem; width: .75rem; height: .75rem; border-radius: 9999px; background: #fff; border: 2px solid var(--guava); }
.timeline-item.is-right .timeline-dot { right: auto; left: -.375rem; }
.timeline-start { position: relative; padding-top: .5rem; text-align: center; }
.timeline-us { display: inline-flex; }
.timeline-us > span + span { margin-left: -.85rem; }
.timeline-us > span { display: inline-block; border-radius: 9999px; box-shadow: 0 6px 14px -6px rgba(73, 59, 55, .45); animation: avatar-breathe 5s ease-in-out infinite; }
.timeline-us > .us-1 { animation-delay: 2.5s; }

/* A memory: a small face (icon, date, mini polaroid…) in a white box, a short label below */
.memory { display: flex; flex-direction: column; align-items: center; gap: .2rem; width: 7.5rem; text-align: center; }
.memory-face { padding: .5rem; min-width: 2.6rem; min-height: 2.6rem; border-radius: 14px; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px -6px rgba(73, 59, 55, .3); border: 1px solid rgba(246, 185, 59, .35); transition: transform .3s var(--ease-bounce); }
.memory-face:hover { transform: translateY(-3px) scale(1.07); }
.memory.is-photo .memory-face { padding: .25rem .25rem .7rem; border-radius: 3px; border-color: rgba(73, 59, 55, .08); transform: rotate(-4deg); }
.memory.is-photo .memory-face:hover { transform: rotate(0) scale(1.1); }
/* The box hugs its face, so sizes follow the kind: a big envelope, a polaroid, a date stamp, then the small things */
.memory-label { font-size: .7rem; font-weight: 700; color: rgba(73, 59, 55, .7); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memory-day { font-size: .58rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(73, 59, 55, .35); }
.memory-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; border-radius: 8px; border: 2px dashed var(--guava); color: var(--guava); font-size: .5rem; font-weight: 700; text-transform: uppercase; line-height: 1; }
.memory-date b { font-size: .85rem; font-family: 'Lora', serif; }

/* Games and Bedroom: every button in the widgets the same height (small ones too) */
[data-board="games"] [data-mount] .btn, [data-board="bedroom"] [data-mount] .btn { min-height: 2.3rem; padding-top: .5rem; padding-bottom: .5rem; font-size: .78rem; }

/* A chip with an × that only shows when pointed at (on touch: always, small) — e.g. the wheel's entries */
.chip-x-btn { display: inline-flex; align-items: center; justify-content: center; padding-right: .35rem; color: rgba(73, 59, 55, .4); }
.chip-x-btn:hover { color: var(--guava, #D6334A); }
.chip-x-btn.is-corner { position: absolute; top: -.4rem; right: -.4rem; width: 1.1rem; height: 1.1rem; padding: 0; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(73, 59, 55, .25); }
@media (hover: hover) {
  .chip-x .chip-x-btn { opacity: 0; transition: opacity .15s; }
  .chip-x .chip-x-btn:not(.is-corner) { width: 0; padding: 0; overflow: hidden; }
  .chip-x:hover .chip-x-btn { opacity: 1; }
  .chip-x:hover .chip-x-btn:not(.is-corner) { width: auto; padding-right: .35rem; }
}

/* On the Memories board: who it's from (top left) and the reaction smiley half over the bottom right edge
   (notes, letters, poems, postcards, photo moments); a note's own buttons sit below it, shown on hover (touch: a tap) */
.board-item, .letter-pin { position: relative; }
.board-by { position: absolute; left: -.55rem; top: -.55rem; z-index: 20; line-height: 0; }
.board-react { position: absolute; right: -.6rem; bottom: -.75rem; z-index: 20; display: inline-flex; align-items: center; padding: .1rem .2rem; border-radius: 999px; background: #fff; border: 1px solid rgba(73, 59, 55, .16); box-shadow: 0 2px 6px -2px rgba(73, 59, 55, .35); }
.board-tools { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; display: flex; align-items: center; justify-content: center; gap: .25rem; padding-top: .9rem; opacity: 0; pointer-events: none; transition: opacity .2s; }
.board-item:hover .board-tools, .board-item.is-touched .board-tools, .letter-pin:hover .board-tools, .letter-pin.is-touched .board-tools { opacity: 1; pointer-events: auto; }
.board-tools .icon-btn { background: rgba(255, 255, 255, .9); box-shadow: 0 2px 6px -3px rgba(73, 59, 55, .35); }

/* Memories timeline: who it's from, on the box's corner */
.memory-face { position: relative; }
.memory-by { position: absolute; right: -.5rem; top: -.5rem; z-index: 1; line-height: 0; }

/* Touch: a held finger shows the hint (title) of what's under it (ui.js) */
.touch-tip { position: fixed; z-index: 9999; max-width: 16rem; padding: .3rem .6rem; border-radius: .6rem; background: rgba(46, 40, 48, .92); color: #fff; font-size: .75rem; line-height: 1.3; text-align: center; pointer-events: none; animation: fade-in .15s; }
.touch-tip[hidden] { display: none; }
@media (hover: none) { .pin, .letter-pin, .board-item, .shelf-item, .mm-card { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; } }

/* Avatar photos: a duotone in their color (--tint-filter, util.js tintFilter; the avatar's color) — in color, with a
   glow, when pointed at. (The emoji ones stay as they are.) */
.avatar-photo { background: #fff; transition: box-shadow .3s; }
.avatar-photo img { filter: var(--tint-filter, grayscale(1)); }
.avatar-photo:hover { box-shadow: 0 0 0 2px #fff, 0 0 16px 4px var(--tint, #6C265C); }
.avatar-photo:hover img { filter: none; }

/* The site's name in the top bar: a soft glow when pointed at */
.brand-title { transition: text-shadow .3s; }
a:hover > .brand-title { text-shadow: 0 0 14px rgba(246, 185, 59, .85), 0 0 2px rgba(246, 185, 59, .6); }

/* Mini Golf (minigolf.js): the course on paper, its name below; the scorecard */
.golf-canvas { display: block; width: 100%; aspect-ratio: 400 / 240; border-radius: .75rem; cursor: crosshair; }
.golf-name { display: flex; align-items: center; gap: .3rem; font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(46, 40, 48, .45); }
.golf-card { width: 100%; font-size: .75rem; text-align: center; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.golf-card th { font-weight: 700; color: rgba(46, 40, 48, .45); padding: .2rem; }
.golf-card td { padding: .25rem; border-top: 1px solid rgba(46, 40, 48, .08); color: var(--ink); }
.golf-card th:first-child { width: 2rem; }
.golf-dot { width: .6rem; height: .6rem; border-radius: 9999px; background: color-mix(in srgb, var(--game) 55%, #fff); box-shadow: inset 0 0 0 1px rgba(46, 40, 48, .3); }
.golf-dot.is-mine { background: #fff; }

/* ==========================================================================
   The Games page (boards.js arcade): a box per game, all the same size, two across (the Playground the
   whole width), in my order (the grip moves one). Closed: the game faint behind a veil with its icon;
   open: just the game, the grip and a ✕ on the box's top edge. Above: the small ones in a row.
   ========================================================================== */
:root { --game: #6C265C; --game-deep: #431739; --game-soft: rgba(108, 38, 92, .14); --arcade-gap: 1.5rem; }
@media (min-width: 640px) { :root { --arcade-gap: 2.25rem; } }
.arcade-nav { display: flex; flex-wrap: nowrap; gap: .45rem; padding: .15rem 0 var(--arcade-gap); }
.arcade-chip { position: relative; flex: 1 1 0; min-width: 0; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .28rem; padding: .35rem .2rem;
  border-radius: .95rem; font-size: clamp(.5rem, .85vw, .62rem); font-weight: 700; line-height: 1.1; text-align: center; color: var(--game-deep); background: rgba(255, 255, 255, .7);
  box-shadow: inset 0 0 0 1px var(--game-soft); transition: background-color .15s, filter .2s, opacity .2s; }
.arcade-chip svg { color: var(--game); flex-shrink: 0; width: clamp(1.1rem, 2.1vw, 1.5rem); height: clamp(1.1rem, 2.1vw, 1.5rem); }
.arcade-chip span:not(.nav-dot) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arcade-chip:hover { background: var(--game-soft); }
.arcade-chip:not(.is-open) { filter: grayscale(1); opacity: .6; } /* (closed games: grey) */
.arcade-chip:not(.is-open):hover { opacity: .85; }
.arcade-chip > * { pointer-events: none; } /* (the whole tile is the button) */
.arcade-chip .nav-dot { top: .25rem; right: .25rem; }
@media (max-width: 639px) { .arcade-nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .35rem; padding-bottom: var(--arcade-gap); } .arcade-chip { flex: none; width: 100%; height: auto; aspect-ratio: 1; font-size: .56rem; } .arcade-chip svg { width: 1.25rem; height: 1.25rem; } }
/* Each box as high as its game; on wide screens two across with equal horizontal & vertical spacing, flush left and right (boards.js masonry) */
.arcade { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: var(--arcade-gap); grid-auto-rows: 4px; align-items: start; }
.arcade-cell { padding-bottom: var(--arcade-gap); min-width: 0; max-width: 100%; }
.arcade-cell:hover, .arcade-cell:focus-within { z-index: 10; }
[data-card]:has(.fantasy-slip:hover), [data-card]:has(.fantasy-slip:focus-visible),
.arcade-cell:has(.fantasy-slip:hover), .arcade-cell:has(.fantasy-slip:focus-visible),
.arcade-box:has(.fantasy-slip:hover), .arcade-box:has(.fantasy-slip:focus-visible) { z-index: 35; }
.arcade-box { position: relative; scroll-margin-top: 7rem; border-radius: var(--radius); background: rgba(255, 255, 255, .82); border: 1px solid rgba(73, 59, 55, .14); min-width: 0; max-width: 100%;
  box-shadow: var(--shadow-card); backdrop-filter: blur(6px); }
.arcade-game { position: relative; padding: 1rem; border-radius: inherit; }
.arcade-box:not(.is-open) .arcade-game { min-height: 9.5rem; pointer-events: none; filter: grayscale(1) contrast(.6) opacity(.3); } /* (closed: faint and grey behind the veil) */
.arcade-veil { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem; border-radius: inherit;
  background: transparent; color: var(--game); transition: background-color .25s; }
.arcade-veil:hover { background: rgba(255, 255, 255, .3); }
/* Closed: see-through, like the cards on the boards (pointing at it brings it out a little) */
.arcade-box:not(.is-open) { background: rgba(255, 255, 255, .5); border-color: rgba(73, 59, 55, .12); box-shadow: none; backdrop-filter: blur(3px); transition: background-color .25s, box-shadow .25s; }
.arcade-box:not(.is-open):hover { background: rgba(255, 255, 255, .5); box-shadow: var(--shadow-card); }
/* Pinned (on top, always open): see-through like a closed one, the game itself in full; its buttons only when pointed at */
.arcade-box.is-pinned, .arcade-box.is-pinned:hover { background: rgba(255, 255, 255, .26); border-color: rgba(73, 59, 55, .04); box-shadow: none; backdrop-filter: blur(3px); }
.arcade-veil .nav-dot { top: .75rem; right: .75rem; }
.arcade-cover { width: 4.5rem; height: 4.5rem; border-radius: 1.4rem; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .85); box-shadow: inset 0 0 0 1px var(--game-soft); transition: transform .25s var(--ease-bounce); }
.arcade-veil:hover .arcade-cover { transform: scale(1.06); }
.arcade-label { font-weight: 700; font-size: .88rem; color: var(--game-deep); background: rgba(255, 255, 255, .85); padding: .1rem .6rem; border-radius: 9999px; }
.arcade-tools { position: absolute; z-index: 3; top: -.8rem; right: -.8rem; display: flex; gap: .3rem; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, visibility 0s linear .2s; }
.arcade-box:hover .arcade-tools { opacity: .65; visibility: visible; pointer-events: auto; transition: opacity .2s ease, visibility 0s linear 0s; }
.arcade-tools:hover, .arcade-tools:focus-within { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .15s ease, visibility 0s linear 0s; }
@media (hover: none) { .arcade-tools { opacity: .75; visibility: visible; pointer-events: auto; transition: none; } } /* (touch: no hover — always available) */
.arcade-tool { width: 1.6rem; height: 1.6rem; border-radius: 9999px; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .9); color: rgba(73, 59, 55, .38); box-shadow: 0 2px 6px -2px rgba(73, 59, 55, .2); transition: color .15s, background-color .15s, box-shadow .15s; }
.arcade-tool:hover { background: #fff; color: var(--game); box-shadow: 0 2px 6px -2px rgba(73, 59, 55, .35); }
.arcade-tool[hidden] { display: none; }
@media (max-width: 639px) { .arcade-tool-wide { display: none; } }
[data-card].is-dragging { opacity: .6; }
.is-opening-box { animation: arcade-open .35s var(--ease-bounce); }
@keyframes arcade-open { from { opacity: .5; transform: scale(.985); } }
@media (min-width: 640px) {
  .arcade { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arcade-cell.is-wide { grid-column: 1 / -1; }
  .arcade-cell.is-wide .arcade-game { padding: 1.25rem 1.5rem; }
}
/* Inside a game: the buttons and the turn line in the game color too (one flat color) */
.arcade-game .btn-accent, .arcade-game .btn-primary, .arcade-game .btn-calm { background: var(--game) !important; color: #fff !important; border-color: var(--game) !important; }
.arcade-game .btn-soft { background: var(--game-soft); color: var(--game-deep); }
.arcade-game .tab.is-active { color: var(--game-deep); }

/* Whose turn: their sleeping avatar, or mine, sits on the box's top-left edge (Games, Bedroom) */
.arcade-box > .game-who, .arcade-game .game-who { position: absolute; z-index: 4; top: -.8rem; left: -.8rem; } /* (the box's corner in its middle) */
.arcade-box > .game-who > :first-child, .arcade-game .game-who > :first-child { width: 2.1rem; height: 2.1rem; box-shadow: 0 0 0 3px #fff, 0 4px 10px -4px rgba(73, 59, 55, .4); }
/* A game's start over (or give up): next to the grip and ✕ on the top edge */
.arcade-box:not(.is-open) .game-tool { display: none; }

/* Playground: one toolbar under the canvas on every tab — brushes, eraser and dropper; the color; undo, clear, extras */
.pg-toolbar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .5rem .75rem; padding: .25rem 0; }
/* Under every canvas: the toolbar centered, something on its right (Freeform: who drew last) — on phones one under the other */
.pg-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; }
.pg-row > .pg-toolbar { grid-column: 2; }
.pg-row > .pg-side { grid-column: 3; justify-self: end; }
@media (max-width: 767px) { .pg-row { display: flex; flex-direction: column; } .pg-row > .pg-side:empty { display: none; } }
.pg-sep { width: 1px; height: 1.4rem; background: rgba(73, 59, 55, .12); }
.pg-color { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .65rem .25rem .3rem; border-radius: 9999px; cursor: pointer; color: var(--game-deep); box-shadow: inset 0 0 0 1px rgba(73, 59, 55, .12); }
.pg-color:hover { box-shadow: inset 0 0 0 1px var(--game); }
.pg-swatch { width: 1.4rem; height: 1.4rem; border-radius: 9999px; box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px rgba(73, 59, 55, .25); }
canvas.is-picking { cursor: copy !important; }


/* A small round picker (pick() in ui.js): the face, and its options popping out on hover / tap */
.pick { position: relative; display: inline-flex; flex-shrink: 0; }
.pick-face { width: 2.25rem; height: 2.25rem; border-radius: 9999px; display: flex; align-items: center; justify-content: center; background: #fff; box-shadow: inset 0 0 0 1px rgba(73, 59, 55, .15); }
.pick-face > * { width: 1.75rem; height: 1.75rem; }
.pick-menu { position: absolute; z-index: 40; bottom: calc(100% + .35rem); right: -.25rem; display: none; gap: .3rem; padding: .35rem; border-radius: 9999px; background: #fff; box-shadow: var(--shadow-pop); white-space: nowrap; }
.pick-menu::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: .5rem; } /* (the gap to the face stays hoverable) */
.pick-menu button { width: 1.9rem; height: 1.9rem; border-radius: 9999px; display: flex; align-items: center; justify-content: center; transition: transform .15s var(--ease-bounce); }
.pick-menu button > * { width: 1.6rem; height: 1.6rem; }
.pick-menu button:hover { transform: scale(1.12); }
.pick-menu button.is-active { box-shadow: 0 0 0 2px var(--passionfruit); }
.pick.is-open .pick-menu { display: flex; }
@media (hover: hover) { .pick:hover .pick-menu { display: flex; } }
.pick-swatch { display: block; border-radius: 9999px; box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px rgba(73, 59, 55, .15); }
.who-both { position: relative; display: block; border-radius: 9999px; overflow: hidden; }
.who-both > span { position: absolute; inset: 0; }
.who-both > span:first-child { clip-path: inset(0 50% 0 0); }
.who-both > span:last-child { clip-path: inset(0 0 0 50%); }
.who-both > span > * { width: 100% !important; height: 100% !important; }

/* Home → Us: the moods float higher — their bubbles reach up over the card's top edge; only the bubbles take taps,
   the card's own title and buttons under them stay usable */
.us-moods { position: relative; z-index: 2; margin-top: -4.5rem; pointer-events: none; }
.us-moods > * > * { pointer-events: auto; }

/* Memories board: what it shows (under the board) — small round emoji buttons, faint until pointed at or on */
.board-filter { padding: .25rem .75rem; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: rgba(73, 59, 55, .7); background: rgba(255, 255, 255, .85); border: 1.5px solid rgba(73, 59, 55, .18); opacity: .85; transition: opacity .15s, background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
.board-filter:hover { opacity: 1; color: var(--ink); background: #fff; border-color: rgba(73, 59, 55, .35); }
.board-filter.is-on { opacity: 1; color: #fff; background: var(--passionfruit); border-color: var(--passionfruit); box-shadow: 0 2px 6px -2px rgba(108, 38, 92, .35); }
canvas { max-width: 100%; }
[data-board], [data-grid], [data-card] { min-width: 0; max-width: 100%; }
