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

:root {
  --navy: #0a1628;
  --blue: #1a3a5c;
  --accent: #2e86de;
  --gold: #d4a843;
  --light: #f0f4f8;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(0,0,0,.2);
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--navy);
  color: var(--white);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 14px max(20px, env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
}

.container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Header ── */
.header {
  text-align: center;
  margin-bottom: 22px;
}

.header img {
  width: clamp(56px, 16vw, 72px);
  height: clamp(56px, 16vw, 72px);
  border-radius: 50%;
  border: 3px solid var(--gold);
  object-fit: cover;
  margin-bottom: 8px;
}

.header h1 {
  font-size: clamp(1.05rem, 4.5vw, 1.3rem);
  font-weight: 700;
  letter-spacing: .3px;
}

.header p {
  font-size: clamp(.75rem, 3vw, .85rem);
  color: var(--gold);
  margin-top: 3px;
}

/* ── Cards ── */
.cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.card {
  background: var(--blue);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  transition: transform .15s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  color: var(--white);
  display: block;
}

.card:active { transform: scale(.97); }

.card-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
  line-height: 1;
}

.card h2 {
  font-size: clamp(.95rem, 3.8vw, 1.05rem);
  font-weight: 600;
  margin-bottom: 3px;
}

.card p {
  font-size: clamp(.75rem, 3.2vw, .85rem);
  opacity: .8;
  line-height: 1.4;
}

/* ── QR card ── */
.card-qr { text-align: center; }

.qr-text { margin-bottom: 12px; }

.qr-wrapper {
  background: var(--white);
  border-radius: 10px;
  padding: 8px;
  display: inline-block;
  cursor: pointer;
  margin-bottom: 6px;
  line-height: 0;
}

.qr-wrapper img {
  width: clamp(130px, 38vw, 160px);
  height: clamp(130px, 38vw, 160px);
  display: block;
}

.qr-hint {
  font-size: .7rem !important;
  opacity: .55 !important;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.share-btn:active { opacity: .8; }

/* ── Fullscreen QR ── */
.qr-fullscreen {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 200;
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 20px;
}

.qr-fullscreen.active { display: flex; }

.qr-fullscreen img {
  width: min(85vw, 85vh, 380px);
  height: auto;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.qr-fullscreen p {
  color: #fff;
  margin-top: 16px;
  font-size: .85rem;
  opacity: .7;
}

/* ── Install banner ── */
.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--accent);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .3s;
  z-index: 100;
  gap: 10px;
}

.install-banner.visible { transform: translateY(0); }

.install-banner span {
  font-size: .88rem;
  font-weight: 500;
  flex: 1;
}

.install-banner .btn-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.install-banner button {
  background: var(--white);
  color: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  white-space: nowrap;
}

.install-close {
  background: transparent !important;
  color: var(--white) !important;
  font-size: 1.4rem !important;
  padding: 4px 8px !important;
  line-height: 1;
}

/* ── iOS install modal ── */
.ios-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 300;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.ios-modal.active { display: flex; }

.ios-modal-content {
  background: var(--blue);
  border-radius: 14px;
  padding: 24px;
  max-width: 360px;
  width: 100%;
  color: #fff;
}

.ios-modal-content h3 {
  font-size: 1.1rem;
  margin-bottom: 14px;
  color: var(--gold);
}

.ios-modal-content ol {
  padding-left: 22px;
  font-size: .9rem;
  line-height: 1.6;
}

.ios-modal-content button {
  margin-top: 16px;
  width: 100%;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-weight: 600;
  cursor: pointer;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #333;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: .85rem;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  pointer-events: none;
  z-index: 250;
  max-width: 90vw;
  text-align: center;
}

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

/* ── Tiny screens ── */
@media (max-height: 640px) {
  body { padding-top: 12px; }
  .header { margin-bottom: 14px; }
  .header img { width: 52px; height: 52px; }
  .cards { gap: 10px; }
  .card { padding: 14px; }
  .qr-wrapper img { width: 120px; height: 120px; }
}
