﻿:root {
  color-scheme: dark;
  --bg: #070b12;
  --panel: #111922;
  --panel-2: #17212c;
  --gold: #ffd45c;
  --text: #fff8ea;
  --muted: #aab7c8;
  --line: rgba(255, 212, 92, 0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 212, 92, 0.13), transparent 28rem),
    linear-gradient(180deg, #0c121b, var(--bg));
  color: var(--text);
}

body {
  padding: env(safe-area-inset-top) 14px calc(88px + env(safe-area-inset-bottom));
}

.hidden {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

.mobile-login {
  display: grid;
  gap: 14px;
  max-width: 520px;
  min-height: calc(100vh - 28px);
  margin: 0 auto;
  align-content: center;
  padding: 24px 0;
}

.mobile-auth-view {
  display: grid;
  gap: 14px;
}

.mobile-auth-view h1 {
  text-align: center;
}

.mobile-auth-view > p {
  margin: 0;
  text-align: center;
}

.login-form {
  margin-top: 6px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

.login-note {
  color: var(--muted);
  font-size: 0.92rem;
}

.mobile-app {
  max-width: 520px;
  margin: 0 auto;
  padding-top: 18px;
}

.mobile-hero {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(15, 23, 32, 0.88);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.mobile-avatar-stage {
  position: relative;
  width: 76px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 212, 92, 0.75);
  background: radial-gradient(circle at 50% 55%, #141008, #030407 70%);
  overflow: hidden;
  box-shadow: 0 0 28px rgba(255, 212, 92, 0.25), inset 0 0 22px rgba(255, 212, 92, 0.08);
}

.mobile-avatar-stage::before,
.mobile-avatar-stage::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  border: 1px solid rgba(255, 212, 92, 0.42);
  pointer-events: none;
}

.mobile-avatar-stage::after {
  inset: 0;
  opacity: 0.35;
}

.mobile-avatar-stage video,
.mobile-avatar-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.mobile-avatar-stage video {
  pointer-events: none;
}

.mobile-avatar-stage video::-webkit-media-controls,
.mobile-avatar-stage video::-webkit-media-controls-panel,
.mobile-avatar-stage video::-webkit-media-controls-overlay-play-button,
.mobile-avatar-stage video::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
  opacity: 0;
}

.mobile-avatar-fallback,
.avatar-choice-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--gold);
  font-weight: 900;
}

.mobile-avatar-stage.login-face {
  width: 112px;
  margin: 0 auto 4px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.65rem, 8vw, 2.5rem);
  line-height: 1;
}

p {
  color: var(--muted);
}

#mobileStatus {
  margin: 8px 0 0;
  font-size: 0.95rem;
}

.quick-card,
.action-tile,
.mobile-form,
.list article {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(17, 25, 34, 0.88);
}

.quick-card {
  margin: 14px 0;
  padding: 16px;
}

.quick-card span,
.action-tile span,
.list small {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.2rem;
}

.quick-card p {
  margin: 8px 0 0;
}

.share-link-box {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.mobile-share-qr {
  display: grid;
  place-items: center;
  width: 188px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 212, 92, 0.28);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}

.mobile-share-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.share-link-box input {
  color: var(--gold);
  font-weight: 800;
}

.share-link-box button {
  border: 1px solid rgba(255, 212, 92, 0.42);
  border-radius: 999px;
  background: rgba(255, 212, 92, 0.12);
  color: var(--gold);
  padding: 13px 16px;
  font-weight: 900;
}

.qr-share-actions {
  grid-template-columns: minmax(188px, auto) 1fr;
  align-items: center;
}

.qr-scanner-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 7, 12, 0.92);
}

.qr-scanner-card {
  width: min(460px, 100%);
  padding: 20px;
  border: 1px solid rgba(255, 212, 92, 0.42);
  border-radius: 24px;
  background: #0f1720;
  text-align: center;
}

.qr-scanner-card h2,
.qr-scanner-card p {
  margin: 0 0 12px;
}

.qr-scanner-card video {
  width: 100%;
  aspect-ratio: 1;
  border: 2px solid var(--gold);
  border-radius: 18px;
  background: #000;
  object-fit: cover;
}

.qr-scanner-status {
  margin-top: 12px !important;
  color: var(--gold);
  font-weight: 800;
}

.family-request-alert {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 950;
  max-width: 540px;
  margin: 0 auto;
  padding: 18px;
  border: 2px solid var(--gold);
  border-radius: 22px;
  background: rgba(15, 23, 32, 0.98);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.7), 0 0 24px rgba(255, 212, 92, 0.2);
}

.family-request-alert small,
.family-request-alert strong,
.family-request-alert p { display: block; margin: 0 0 8px; }
.family-request-alert small { color: var(--gold); font-weight: 900; }
.family-request-alert strong { font-size: 1.18rem; }
.family-request-alert .mobile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

@media (max-width: 430px) {
  .qr-share-actions { grid-template-columns: 1fr; justify-items: center; }
  .qr-share-actions button { width: 100%; }
}

.sync-mobile-box {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.sync-mobile-box input,
.sync-mobile-box textarea {
  color: var(--gold);
  font-weight: 900;
}

.sync-mobile-box textarea {
  min-height: 96px;
  resize: vertical;
  word-break: break-all;
}

.sync-mobile-box button {
  border: 1px solid rgba(255, 212, 92, 0.42);
  border-radius: 999px;
  background: rgba(255, 212, 92, 0.12);
  color: var(--gold);
  padding: 14px 16px;
  font-weight: 900;
}

.mobile-panel {
  display: none;
}

.mobile-panel.active {
  display: grid;
  gap: 12px;
}

.mobile-back-button {
  display: inline-flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(255, 212, 92, 0.52);
  border-radius: 20px;
  background: rgba(255, 212, 92, 0.14);
  color: var(--gold);
  padding: 16px 22px;
  font-size: 1.12rem;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.mobile-back-button span {
  font-size: 1.65rem;
  line-height: 1;
}

.mobile-back-button:active {
  transform: scale(0.98);
}

.mobile-button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.mobile-button-grid button {
  min-height: 54px;
  border: 1px solid rgba(255, 212, 92, 0.35);
  border-radius: 16px;
  background: rgba(255, 212, 92, 0.1);
  color: var(--gold);
  padding: 12px;
  font-weight: 900;
}

.action-tile {
  width: 100%;
  padding: 18px;
  color: var(--text);
  text-align: left;
}

.game-link-card {
  color: inherit;
  text-decoration: none;
}

.game-link-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.action-tile strong {
  display: block;
  margin-top: 8px;
  font-size: 1.25rem;
}

.action-tile small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.96rem;
}

.action-tile.disabled-tile {
  opacity: 0.5;
  filter: grayscale(0.45);
}

.action-tile.disabled-tile strong::after {
  content: " pronto";
  color: var(--gold);
  font-size: 0.86rem;
}

.mobile-avatar-categories,
.avatar-picker-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mobile-avatar-categories {
  grid-template-columns: 1fr;
  margin-bottom: 12px;
}

.mobile-avatar-category {
  display: grid;
  gap: 9px;
  min-height: 118px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(22, 32, 43, 0.94), rgba(15, 23, 31, 0.9));
  color: var(--text);
  padding: 18px;
  text-align: left;
}

.mobile-avatar-category.active {
  border-color: rgba(255, 212, 92, 0.72);
  background: linear-gradient(135deg, rgba(255, 212, 92, 0.14), rgba(20, 28, 36, 0.94));
  box-shadow: 0 0 0 4px rgba(255, 212, 92, 0.08);
}

.mobile-avatar-category span {
  width: max-content;
  border: 1px solid rgba(255, 212, 92, 0.32);
  border-radius: 999px;
  color: var(--gold);
  padding: 6px 10px;
  font-size: 0.76rem;
}

.mobile-avatar-category strong {
  font-size: 1.08rem;
}

.mobile-avatar-category p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.avatar-choice {
  display: grid;
  gap: 10px;
  justify-items: center;
  min-height: 154px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  background: rgba(17, 25, 34, 0.88);
  color: var(--text);
  padding: 12px;
  text-align: center;
}

.avatar-choice.active {
  border-color: rgba(255, 212, 92, 0.72);
  background: rgba(255, 212, 92, 0.12);
  box-shadow: 0 0 0 4px rgba(255, 212, 92, 0.08);
}

.avatar-choice-media {
  position: relative;
  width: 82px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 212, 92, 0.52);
  background: #05070b;
  overflow: hidden;
}

.avatar-choice-media video,
.avatar-choice-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-choice small {
  display: block;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.avatar-choice strong {
  display: block;
  margin-top: 4px;
  font-size: 0.98rem;
}

@media (min-width: 560px) {
  .mobile-avatar-categories {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.mobile-form {
  display: grid;
  gap: 12px;
  padding: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  background: #071019;
  color: var(--text);
  padding: 14px;
  outline: none;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 76px;
}

.mobile-form .password-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 212, 92, 0.35);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(255, 212, 92, 0.08);
  padding: 0;
  transform: translateY(-50%);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 212, 92, 0.7);
  box-shadow: 0 0 0 4px rgba(255, 212, 92, 0.12);
}

.mobile-form button {
  border: 1px solid rgba(255, 212, 92, 0.45);
  border-radius: 999px;
  background: rgba(255, 212, 92, 0.12);
  color: var(--gold);
  padding: 15px 18px;
  font-weight: 900;
}

.mobile-form .face-id-button {
  border-color: rgba(98, 223, 255, 0.55);
  background: rgba(98, 223, 255, 0.12);
  color: #9cecff;
}

.ghost-button {
  border: 1px solid rgba(255, 212, 92, 0.35);
  border-radius: 999px;
  background: transparent;
  color: var(--gold);
  padding: 14px 18px;
  font-weight: 900;
}

.shopping-family-button {
  width: 100%;
  margin-top: 14px;
}

.list {
  display: grid;
  gap: 10px;
}

.list article {
  padding: 14px;
}

.list strong {
  display: block;
  font-size: 1.04rem;
}

.list p {
  margin: 8px 0 0;
}

.mini-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
}

.mini-delete,
.mini-start-trip {
  margin-top: 12px;
  border: 1px solid rgba(255, 96, 96, 0.35);
  border-radius: 999px;
  background: rgba(255, 96, 96, 0.09);
  color: #ff9d9d;
  padding: 10px 14px;
  font-weight: 800;
}

.mini-actions .mini-delete,
.mini-actions .mini-start-trip {
  margin-top: 0;
}

.mini-start-trip {
  border-color: rgba(94, 224, 142, 0.5);
  background: rgba(94, 224, 142, 0.12);
  color: #91f1b5;
  text-decoration: none;
}

.mobile-tabs {
  position: fixed;
  z-index: 5;
  left: 10px;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(88px, 1fr);
  gap: 6px;
  max-width: 520px;
  margin: 0 auto;
  padding: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background: rgba(7, 11, 18, 0.92);
  backdrop-filter: blur(18px);
}

.mobile-tabs::-webkit-scrollbar {
  display: none;
}

.mobile-tabs button {
  min-height: 48px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.mobile-tabs button.active {
  background: rgba(255, 212, 92, 0.13);
  color: var(--gold);
}

.mobile-floating-avatar {
  position: fixed;
  z-index: 8;
  right: 14px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  width: 76px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 212, 92, 0.72);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, #141008, #030407 72%);
  overflow: hidden;
  box-shadow: 0 0 28px rgba(255, 212, 92, 0.25), 0 18px 45px rgba(0, 0, 0, 0.42);
}

.mobile-floating-avatar::before,
.mobile-floating-avatar::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 212, 92, 0.38);
  border-radius: 50%;
  pointer-events: none;
}

.mobile-floating-avatar::after {
  inset: 0;
  opacity: 0.3;
}

.mobile-floating-avatar video,
.mobile-floating-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.password-eye .eye-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.password-eye .eye-icon path,
.password-eye .eye-icon circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-eye.is-visible .eye-icon {
  filter: drop-shadow(0 0 6px rgba(255, 212, 92, 0.55));
}

/* Allow names, fields and cards to shrink to a small phone's available width. */
.mobile-hero { grid-template-columns: 86px minmax(0, 1fr); }
.mobile-app, .mobile-login { overflow-wrap: anywhere; }
.mobile-app *, .mobile-login * { min-width: 0; }
.mobile-app img, .mobile-app video { max-width: 100%; }
@media (max-width: 360px) {
  .mobile-button-grid { grid-template-columns: minmax(0, 1fr); }
}
