/* style.css — Chá de Casa Nova | Mobile-First */

/* ── Google Fonts ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ── Design Tokens ────────────────────────────────────── */
:root {
  --bg: #0d0d0d;
  --surface: #141414;
  --surface2: #1e1e1e;
  --border: #2a2a2a;
  --gold: #c9b07a;
  --gold-light: #e2ceaa;
  --text: #f0ebe4;
  --text-muted: #888;
  --text-dim: #555;
  --white: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 32px rgba(0, 0, 0, .55);
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --transition: .25s ease;

  /* Touch-friendly minimum tap target */
  --tap-min: 48px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Prevent horizontal overflow on mobile */
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
}

/* ────────────────────────────────────────────────────────
   LOGIN OVERLAY
──────────────────────────────────────────────────────── */
#login-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 1.5rem;
  background: radial-gradient(ellipse at 50% 10%, #1e1912 0%, #0d0d0d 70%);
  text-align: center;
  overflow-y: auto;
}

#login-overlay.hidden {
  display: none;
}

.hero-ornament {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 176, 122, .09) 0%, transparent 70%);
  pointer-events: none;
}

.hero-ornament--top {
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
}

.login-logo {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 9vw, 3.6rem);
  font-weight: 300;
  letter-spacing: .06em;
  color: var(--gold-light);
  line-height: 1.15;
}

.login-sub {
  font-size: .95rem;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.75;
}

/* Google Sign-in button — large tap target */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  width: 100%;
  max-width: 300px;
  min-height: var(--tap-min);
  padding: .85rem 1.6rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .02em;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn-google:active {
  transform: scale(.97);
  background: #2a2a2a;
}

.btn-google svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ── Desktop ── */
@media (min-width: 640px) {
  .btn-google:hover {
    background: #2a2a2a;
    border-color: var(--gold);
    transform: translateY(-2px);
  }
}

/* ────────────────────────────────────────────────────────
   APP WRAPPER
──────────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ────────────────────────────────────────────────────────
   USER BAR — sticky, compact on mobile
──────────────────────────────────────────────────────── */
#user-bar {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 52px;
}

#user-bar.hidden {
  display: none;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  object-fit: cover;
  flex-shrink: 0;
}

.user-name {
  font-size: .82rem;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-signout {
  font-size: .78rem;
  min-height: var(--tap-min);
  padding: 0 .9rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50px;
  color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.btn-signout:active,
.btn-signout:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ────────────────────────────────────────────────────────
   HERO HEADER
──────────────────────────────────────────────────────── */
#hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Mobile: tighter padding */
  padding: 3rem 1.25rem 2.5rem;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, #1e1912 0%, #0d0d0d 65%);
  border-bottom: 1px solid var(--border);
}

.hero-tag {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .75rem;
}

.hero-title {
  font-family: var(--font-serif);
  /* Mobile: smaller, readable */
  font-size: clamp(2rem, 8vw, 4.2rem);
  font-weight: 300;
  line-height: 1.1;
  color: var(--white);
  letter-spacing: .02em;
  margin-bottom: 1rem;
}

.hero-title span {
  color: var(--gold-light);
  font-style: italic;
}

.hero-msg {
  font-size: .92rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* Hero details chips — wrappable on mobile */
.hero-details {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .6rem;
  justify-content: center;
}

.hero-detail {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .78rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: .4rem .85rem;
  background: rgba(255, 255, 255, .02);
  line-height: 1.3;
}

.hero-detail svg {
  width: 13px;
  height: 13px;
  color: var(--gold);
  flex-shrink: 0;
}

/* ── Desktop hero ── */
@media (min-width: 640px) {
  #hero {
    padding: 5rem 2rem 4rem;
  }

  .hero-msg {
    font-size: 1rem;
  }
}

/* ────────────────────────────────────────────────────────
   SECTIONS
──────────────────────────────────────────────────────── */
.section {
  padding: 2.5rem 1rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  text-align: center;
}

@media (min-width: 640px) {
  .section {
    padding: 3.5rem 1.5rem;
  }
}

.section-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: .4rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 300;
  color: var(--white);
  margin-bottom: .6rem;
  line-height: 1.2;
}

.section-desc {
  font-size: .88rem;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.75;
  margin: 0 auto 2rem;
  /* auto centering */
}

/* ────────────────────────────────────────────────────────
   GIFT GRID — Mobile-first single column → 2 → 3
──────────────────────────────────────────────────────── */
#gift-grid {
  display: grid;
  /* Mobile: 2 compact columns */
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
  /* Left-align cards within the centered section */
  text-align: left;
}

@media (min-width: 480px) {
  #gift-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (min-width: 768px) {
  #gift-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  #gift-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ────────────────────────────────────────────────────────
   GIFT CARD
──────────────────────────────────────────────────────── */
.gift-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  /* Mobile: tighter padding */
  padding: 1rem .9rem .9rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
  /* Prevent text selection on tap */
  -webkit-user-select: none;
  user-select: none;
}

@media (min-width: 640px) {
  .gift-card {
    padding: 1.25rem 1.15rem 1rem;
  }
}


.gift-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.gift-card.has-image {
  min-height: 240px;
  justify-content: flex-end;
  border-color: rgba(255, 255, 255, 0.15);
}

.gift-card.has-image .gift-name {
  color: var(--white);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.gift-card.has-image .gift-content {
  /* Give content a slight translucent background for readability */
  background: rgba(0, 0, 0, 0.2);
  margin: 0 -.9rem -.9rem;
  padding: 1rem .9rem .9rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

@media (min-width: 640px) {
  .gift-card.has-image .gift-content {
    margin: 0 -1.15rem -1rem;
    padding: 1.25rem 1.15rem 1rem;
  }
}


.gift-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.9) 100%);
  z-index: 1;
}

.gift-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

/* Active state for mobile tap feedback */
.gift-card:active {
  transform: scale(.98);
}

@media (min-width: 640px) {
  .gift-card {
    padding: 1.25rem 1.15rem 1rem;
  }

  .gift-card:hover {
    border-color: rgba(201, 176, 122, .35);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .4);
  }
}

.gift-card.is-chosen {
  border-color: rgba(201, 176, 122, .25);
  background: #161510;
}

.gift-card.is-mine {
  border-color: rgba(201, 176, 122, .6);
}

.gift-icon {
  font-size: 1.8rem;
  line-height: 1;
  position: relative;
  z-index: 2;
}

/* Removed old .gift-photo rules */

.gift-name {
  font-family: var(--font-serif);
  /* Mobile: slightly smaller */
  font-size: .95rem;
  font-weight: 400;
  color: var(--white);
  line-height: 1.35;
  flex: 1;
}

@media (min-width: 640px) {
  .gift-name {
    font-size: 1.05rem;
  }
}

.gift-status {
  font-size: .72rem;
  color: var(--gold);
  display: flex;
  align-items: flex-start;
  gap: .3rem;
  min-height: 1rem;
  line-height: 1.4;
  word-break: break-word;
}

.gift-status svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  margin-top: 2px;
}

.gift-custom-wrap {
  display: none;
  flex-direction: column;
  gap: .5rem;
}

.gift-custom-wrap.visible {
  display: flex;
}

.gift-custom-input {
  width: 100%;
  padding: .55rem .75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .88rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
  min-height: var(--tap-min);
}

.gift-custom-input:focus {
  border-color: var(--gold);
}

.gift-actions {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
  margin-top: auto;
}

/* Buttons — full-width, generous tap target on mobile */
.btn-choose,
.btn-swap {
  flex: 1;
  min-height: 42px;
  padding: .5rem .5rem;
  border-radius: 50px;
  font-size: .8rem;
  font-weight: 600;
  border: none;
  letter-spacing: .02em;
  transition: background var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}

.btn-choose {
  background: var(--gold);
  color: #0d0d0d;
}

.btn-choose:active {
  background: var(--gold-light);
  transform: scale(.97);
}

@media (min-width: 640px) {
  .btn-choose {
    flex: none;
    padding: .45rem 1.1rem;
  }

  .btn-choose:hover {
    background: var(--gold-light);
    transform: scale(1.03);
  }
}

.btn-swap {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-swap:active {
  border-color: var(--gold);
  color: var(--gold);
}

@media (min-width: 640px) {
  .btn-swap {
    flex: none;
    padding: .45rem 1rem;
  }

  .btn-swap:hover {
    border-color: var(--gold);
    color: var(--gold);
  }
}

/* ────────────────────────────────────────────────────────
   DIVIDER
──────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border) 30%, var(--border) 70%, transparent 100%);
  margin: 0 1rem;
}

/* ────────────────────────────────────────────────────────
   MESSAGE BOARD
──────────────────────────────────────────────────────── */
#message-section {
  padding: 2.5rem 1rem 0;
}

@media (min-width: 640px) {
  #message-section {
    padding: 3.5rem 1.5rem 0;
  }
}

#message-section .section {
  padding-bottom: 0;
}

/* Form stacked on mobile, inline on md+ */
.msg-form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-width: 600px;
  /* Center the form block inside the centered section */
  margin: 0 auto;
  text-align: left;
}

.msg-textarea {
  width: 100%;
  min-height: 100px;
  padding: .9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  /* 16px prevents iOS zoom */
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.msg-textarea:focus {
  border-color: var(--gold);
}

.msg-textarea::placeholder {
  color: var(--text-dim);
}

.btn-send {
  width: 100%;
  min-height: var(--tap-min);
  padding: 0 1.5rem;
  background: var(--gold);
  color: #0d0d0d;
  border: none;
  border-radius: 50px;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .04em;
  transition: background var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn-send:active {
  background: var(--gold-light);
  transform: scale(.98);
}

.btn-send:disabled {
  opacity: .5;
}

@media (min-width: 640px) {
  .msg-form {
    flex-direction: row;
    align-items: flex-end;
  }

  .msg-form .msg-textarea {
    flex: 1;
    min-height: 64px;
  }

  .btn-send {
    width: auto;
    white-space: nowrap;
  }

  .btn-send:hover {
    background: var(--gold-light);
  }
}

/* ────────────────────────────────────────────────────────
   BALLOON MURAL — Mobile-first
──────────────────────────────────────────────────────── */
#mural {
  position: relative;
  width: 100%;
  /* Mobile: taller to accommodate stacked balloons */
  min-height: 480px;
  overflow: hidden;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  background: radial-gradient(ellipse at 60% 40%, #0f0f0d 0%, #0d0d0d 100%);
}

.mural-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: .88rem;
  font-style: italic;
  pointer-events: none;
  text-align: center;
  padding: 1rem;
}

/* Balloon — smaller on mobile */
.balloon {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  animation: floatBalloon var(--dur, 12s) ease-in-out var(--delay, 0s) infinite alternate;
  will-change: transform;
  /* Mobile: constrained width */
  max-width: 145px;
  width: 145px;
}

@media (min-width: 480px) {
  .balloon {
    max-width: 165px;
    width: 165px;
  }
}

@media (min-width: 768px) {
  .balloon {
    max-width: 180px;
    width: 180px;
  }
}

.balloon-inner {
  background: var(--surface2);
  border: 1px solid rgba(201, 176, 122, .22);
  border-radius: 16px 16px 16px 4px;
  padding: .65rem .8rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .55);
  width: 100%;
  word-break: break-word;
  text-align: left;
  position: relative;
}

.balloon-inner::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 14px;
  border: 7px solid transparent;
  border-top-color: rgba(201, 176, 122, .22);
}

.balloon-user {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .35rem;
}

.balloon-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  object-fit: cover;
  flex-shrink: 0;
}

.balloon-name {
  font-size: .67rem;
  font-weight: 600;
  color: var(--gold-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.balloon-text {
  font-size: .76rem;
  color: var(--text);
  line-height: 1.5;
}

.balloon-string {
  width: 2px;
  height: 22px;
  background: linear-gradient(to bottom, rgba(201, 176, 122, .3), transparent);
  border-radius: 1px;
}

@keyframes floatBalloon {
  0% {
    transform: translate(0, 0) rotate(var(--rot-from, -1.5deg));
  }

  33% {
    transform: translate(var(--tx1, 8px), var(--ty1, -15px)) rotate(var(--rot-mid, 1deg));
  }

  66% {
    transform: translate(var(--tx2, -6px), var(--ty2, -5px)) rotate(var(--rot-from, -1deg));
  }

  100% {
    transform: translate(var(--tx3, 4px), var(--ty3, -20px)) rotate(var(--rot-to, 2deg));
  }
}

/* ────────────────────────────────────────────────────────
   CUSTOM GIFT SECTION
   ──────────────────────────────────────────────────────── */
#custom-gifts-section {
  padding-top: 0;
}

.custom-gift-container {
  background: rgba(201, 176, 122, .05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  max-width: 600px;
  margin: 0 auto;
}

.custom-gift-list {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  margin-bottom: 1.5rem;
}

.custom-gift-item {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .8rem;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: fadeIn .4s ease-out;
}

.custom-gift-item img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--gold);
}

.custom-gift-item .info {
  flex: 1;
}

.custom-gift-item .author {
  display: block;
  font-size: .75rem;
  color: var(--gold-light);
  font-weight: 600;
}

.custom-gift-item .text {
  font-size: .9rem;
  color: var(--white);
}

.custom-gift-form {
  display: flex;
  gap: .5rem;
}

.custom-gift-form input {
  flex: 1;
  background: #000;
  border: 1px solid var(--border);
  padding: .8rem 1rem;
  border-radius: 12px;
  color: var(--text);
  font-size: .9rem;
  min-height: 48px;
}

.custom-gift-form input:focus {
  outline: none;
  border-color: var(--gold);
}

.btn-send-mini {
  background: var(--gold);
  background: var(--gold-grad);
  border: none;
  padding: 0 1.5rem;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s ease;
  box-shadow: 0 4px 15px rgba(201, 176, 122, 0.2);
  min-height: 48px;
  /* Standard touch target */
}

.btn-send-mini:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201, 176, 122, 0.3);
  filter: brightness(1.1);
}

.btn-send-mini:active {
  transform: translateY(0);
}

.btn-send-mini:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ────────────────────────────────────────────────────────
   FOOTER
──────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-dim);
  font-size: .75rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
  letter-spacing: .05em;
  line-height: 1.8;
}

footer span {
  color: var(--gold);
}

/* ────────────────────────────────────────────────────────
   ADMIN PAGE
──────────────────────────────────────────────────────── */
.admin-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .admin-wrapper {
    padding: 2rem 1.5rem;
    gap: 2rem;
  }
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
}

.admin-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--white);
}

.admin-title small {
  display: block;
  font-family: var(--font-sans);
  font-size: .68rem;
  color: var(--gold);
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-card-header {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

.admin-card-title {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
}

.admin-badge {
  font-size: .7rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: .2rem .65rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Gift table — scrollable on mobile */
.gift-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.gift-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  min-width: 480px;
  /* forces scroll on narrow screens */
}

.gift-table th {
  text-align: left;
  padding: .6rem 1rem;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  white-space: nowrap;
}

.gift-table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  color: var(--text);
  vertical-align: middle;
}

.gift-table tr:last-child td {
  border-bottom: none;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .7rem;
  padding: .2rem .6rem;
  border-radius: 50px;
  font-weight: 500;
  white-space: nowrap;
}

.status-badge.free {
  background: rgba(255, 255, 255, .05);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.status-badge.taken {
  background: rgba(201, 176, 122, .1);
  color: var(--gold-light);
  border: 1px solid rgba(201, 176, 122, .2);
}

/* Messages list */
.msg-list {
  display: flex;
  flex-direction: column;
}

.msg-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  transition: background var(--transition);
}

.msg-item:last-child {
  border-bottom: none;
}

.msg-item-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  object-fit: cover;
  flex-shrink: 0;
}

.msg-item-body {
  flex: 1;
  min-width: 0;
}

.msg-item-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  margin-bottom: .2rem;
}

.msg-item-name {
  font-size: .78rem;
  font-weight: 600;
  color: var(--gold-light);
}

.msg-item-time {
  font-size: .68rem;
  color: var(--text-dim);
}

.msg-item-text {
  font-size: .83rem;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}

.btn-delete {
  min-height: var(--tap-min);
  min-width: var(--tap-min);
  padding: .3rem .65rem;
  background: transparent;
  border: 1px solid #3a1a1a;
  border-radius: var(--radius-sm);
  color: #c97a7a;
  font-size: .72rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn-delete:active,
.btn-delete:hover {
  background: rgba(201, 50, 50, .15);
  border-color: #c97a7a;
}

/* ────────────────────────────────────────────────────────
   MODAL
──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow);
}

.modal-content h2 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--white);
}

/* ────────────────────────────────────────────────────────
   TOAST — anchored to top on mobile (avoids keyboard overlap)
──────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: auto;
  top: 64px;
  /* below sticky user bar */
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: .6rem 1.3rem;
  font-size: .85rem;
  color: var(--text);
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 300;
  white-space: nowrap;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 2rem);
  text-align: center;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 640px) {
  #toast {
    top: auto;
    bottom: 2rem;
    transform: translateX(-50%) translateY(20px);
  }

  #toast.show {
    transform: translateX(-50%) translateY(0);
  }
}

/* ────────────────────────────────────────────────────────
   LOADING SPINNER
──────────────────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 2.5rem auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ────────────────────────────────────────────────────────
   SAFE AREA — for notched phones (iOS)
──────────────────────────────────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  footer {
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
  }
}