/* ---------- Grupay: bottom bar and the Home, Crear grupo, Chats and Perfil screens ---------- */
/* Classes carry the gp- prefix so they never land on a game's markup (lessons/layout.md). */

.mark img { width: 28px; height: 28px; border-radius: 8px; }

/* Bottom bar: shown only on the five sections (body[data-nav]), never over a table */
.gp-nav {
  position: fixed; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); z-index: 40;
  width: calc(100% - 28px); max-width: 492px; height: 64px; border-radius: 32px; padding: 4px;
  display: none; grid-template-columns: repeat(5, 1fr); align-items: center;
}
body[data-nav] .gp-nav { display: grid; }
body[data-nav] .screen.active .hub-wrap { padding-bottom: calc(104px + var(--safe-b)); }
body[data-nav] .toast, body[data-nav] .conn { bottom: calc(92px + var(--safe-b)); }
body[data-nav] .screen.active::after { /* content fades out under the floating bar */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: calc(120px + var(--safe-b)); z-index: 20; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(10, 18, 16, .85) 70%);
}
.gp-nav a {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 28px; font-size: .66rem; font-weight: 600; color: rgba(245, 239, 225, .72); text-decoration: none;
  transition: background .2s, color .2s, transform .15s;
}
.gp-nav a svg { width: 23px; height: 23px; }
.gp-nav a:active { transform: scale(.94); }
.gp-nav a.on:not(.gp-nav-create) {
  color: var(--gold-2); background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 2px 10px rgba(0, 0, 0, .25);
}
.gp-nav-create span {
  width: 44px; height: 44px; margin-top: -2px; border-radius: 50%; display: grid; place-items: center; color: #2a1f05;
  background: radial-gradient(90% 70% at 35% 20%, rgba(255, 255, 255, .6), transparent 60%), linear-gradient(180deg, var(--gold-2), var(--gold) 60%, #b8923a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 6px 18px rgba(217, 180, 90, .35);
}
.gp-nav-create.on { color: var(--gold-2); }
.gp-nav-create svg { width: 24px; height: 24px; }

/* Shared pieces */
.gp-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 4px; }
.gp-section-head h3 { margin: 0; font-size: 1.05rem; }
.gp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gp-list a {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; color: var(--ink); text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); transition: transform .15s;
}
.gp-list a:active { transform: scale(.98); }
.gp-list .grow { flex: 1; min-width: 0; font-size: .9rem; line-height: 1.35; }
.gp-list small { display: block; color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-list .avatar { width: 38px; height: 38px; font-size: 1.05rem; }
.gp-up { color: #5fd08a; }
.gp-down { color: #ef8a7f; }
.gp-amt { font-weight: 700; font-size: .9rem; white-space: nowrap; }
.gp-group-emoji {
  width: 46px; height: 46px; flex: none; display: grid; place-items: center; font-size: 1.4rem; border-radius: 14px;
  background: radial-gradient(100% 100% at 30% 20%, var(--games-1), var(--games-2)); border: 1px solid var(--gold-dim);
}

/* Home: balances */
.gp-balance {
  padding: 16px; border-radius: 22px; display: flex; flex-direction: column; gap: 12px;
  background: radial-gradient(120% 90% at 85% 0%, var(--money-1), var(--money-2)); border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .35);
}
.gp-net small, .gp-split small { display: block; font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: rgba(245, 239, 225, .75); }
.gp-net b { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
.gp-net.gp-up b { color: #9ff0bf; }
.gp-net.gp-down b { color: #ffb3aa; }
.gp-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gp-split a { padding: 12px; border-radius: 16px; background: rgba(0, 0, 0, .22); color: var(--ink); text-decoration: none; }
.gp-split b { font-size: 1.2rem; }
.gp-owed b { color: #9ff0bf; }
.gp-owe b { color: #ffb3aa; }
.gp-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gp-quick a {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .8rem; font-weight: 600;
}
.gp-quick svg { width: 24px; height: 24px; color: var(--gold-2); }

/* Crear grupo */
.gp-create, .gp-invite { display: flex; flex-direction: column; gap: 14px; }
.gp-create .emoji-grid { grid-template-columns: repeat(8, 1fr); }
.gp-create .emoji-grid button { height: 44px; }
.gp-invite-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.gp-invite-head h2 { margin: 4px 0 0; }
.gp-invite-head p { margin: 0; }
.gp-invite-head .gp-group-emoji { width: 64px; height: 64px; font-size: 2rem; border-radius: 20px; }
.gp-qr { align-self: center; width: 200px; height: 200px; padding: 12px; border-radius: 20px; background: var(--card-bg); box-shadow: 0 12px 30px rgba(0, 0, 0, .4); }
.gp-qr svg { width: 100%; height: 100%; display: block; shape-rendering: crispEdges; }
.gp-invite > p { margin: -6px 0 0; }
.gp-link { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 16px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); }
.gp-link span { flex: 1; min-width: 0; font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Chats */
.gp-chats .grow b { display: block; }
.gp-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.gp-unread { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; font-size: .7rem; font-weight: 800; background: #5fd08a; color: #062015; }
.gp-chat-title { display: flex; flex-direction: column; min-width: 0; }
.gp-chat-title small { font-size: .72rem; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-messages {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
  padding: 10px 16px; max-width: 520px; width: 100%; margin: 0 auto;
}
.gp-messages > * { flex-shrink: 0; }
.gp-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; }
.gp-msg.mine { align-self: flex-end; justify-content: flex-end; }
.gp-msg .avatar { width: 30px; height: 30px; font-size: .85rem; }
.gp-msg-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gp-msg.mine .gp-msg-body { align-items: flex-end; }
.gp-msg-body > small { font-size: .72rem; color: var(--gold-2); font-weight: 600; padding-left: 4px; }
.gp-msg-body time { font-size: .66rem; color: var(--muted); padding: 0 4px; }
.gp-bubble { padding: 9px 13px; border-radius: 18px 18px 18px 6px; background: var(--surface-2); font-size: .92rem; line-height: 1.4; overflow-wrap: anywhere; }
.gp-msg.mine .gp-bubble { border-radius: 18px 18px 6px 18px; background: linear-gradient(180deg, #1f7a5c, var(--games-1)); }
.gp-system { align-self: center; margin: 4px 0; padding: 6px 12px; border-radius: 12px; font-size: .78rem; color: var(--muted); background: var(--surface); text-align: center; }
.gp-expense {
  width: 230px; display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 18px;
  background: radial-gradient(120% 90% at 85% 0%, var(--money-1), var(--money-2)); border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
}
.gp-expense small { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: rgba(245, 239, 225, .75); }
.gp-expense b { font-size: 1rem; }
.gp-expense-total { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
.gp-expense p { margin: 0 0 8px; }
.gp-expense .btn { width: 100%; }
.gp-paid { align-self: flex-start; padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: #9ff0bf; background: rgba(0, 0, 0, .25); }
.gp-composer {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px calc(8px + var(--safe-b));
  max-width: 520px; width: 100%; margin: 0 auto;
}
.gp-composer input {
  flex: 1; min-width: 0; height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); outline: none;
  background: rgba(0, 0, 0, .28); color: var(--ink); font-size: 1rem;
}
.gp-composer .btn { width: 44px; min-height: 44px; height: 44px; padding: 0; border-radius: 50%; flex: none; }
.gp-composer .icon-btn { flex: none; color: var(--gold-2); }

/* Perfil & Stats */
.gp-me-head { display: flex; align-items: center; gap: 14px; }
.gp-me-head h2 { margin: 0; font-size: 1.3rem; }
.gp-me-head p { margin: 2px 0 0; }
.gp-me-head .grow { flex: 1; min-width: 0; }
.gp-rep {
  padding: 16px; border-radius: 20px; background: radial-gradient(120% 90% at 85% 0%, var(--games-1), var(--games-2)); border: 1px solid var(--gold-dim);
}
.gp-rep > div { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gp-rep small { width: 100%; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: rgba(245, 239, 225, .75); }
.gp-rep > div b { font-size: 2.2rem; font-weight: 800; color: var(--gold-2); }
.gp-stars { color: var(--gold-2); letter-spacing: 2px; }
.gp-rep p { margin: 6px 0 0; font-size: .88rem; color: rgba(245, 239, 225, .85); }
.gp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gp-stats div { padding: 12px 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.gp-stats b { display: block; font-size: 1.05rem; }
.gp-stats small { font-size: .7rem; color: var(--muted); }
.gp-points { padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: var(--gold-2); background: rgba(217, 180, 90, .14); border: 1px solid var(--gold-dim); }
.gp-coupons { display: flex; flex-direction: column; gap: 10px; }
.gp-coupon {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; position: relative; overflow: hidden;
  background: linear-gradient(120deg, var(--c), rgba(0, 0, 0, .25)); border: 1px dashed rgba(255, 255, 255, .25);
}
.gp-coupon-emoji { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: 1.4rem; border-radius: 12px; background: rgba(255, 255, 255, .14); }
.gp-coupon .grow { flex: 1; min-width: 0; }
.gp-coupon p { margin: 2px 0 0; font-size: .82rem; color: rgba(245, 239, 225, .85); }
.gp-coupon .btn { flex: none; }
