:root {
  --bg: #e9edf1;
  --surface: #ffffff;
  --surface-soft: #f7f4ec;
  --text: #281414;
  --muted: #7a6a64;
  --primary: #8f1f1d;
  --primary-strong: #b52f26;
  --gold: #d6a847;
  --green: #17866a;
  --line: rgba(70, 42, 35, 0.1);
  --shadow: 0 18px 44px rgba(47, 29, 25, 0.12);
  --radius: 28px;
  --app-width: 430px;
  --bottom-nav-height: 86px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  touch-action: manipulation;
}

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

.phone-shell {
  position: relative;
  width: min(100%, var(--app-width));
  min-height: 100vh;
  margin: 0 auto;
  overflow: clip;
  background: #eef1f4;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.02), 0 28px 80px rgba(30, 20, 18, 0.16);
}

.app-header {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 8;
  width: min(100%, var(--app-width));
  min-height: 238px;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 20px 78px;
  color: #fff8ea;
  background:
    linear-gradient(135deg, rgba(143, 31, 29, 0.96), rgba(181, 47, 38, 0.94) 54%, rgba(44, 18, 15, 0.98)),
    url("/imagens/banner_v1.jpg") center/cover;
  transform: translateX(-50%);
}

.app-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 0;
  border-radius: 0;
  background: #eef1f4;
}

.app-header__top,
.header-actions,
.brand-mark,
.icon-button,
.avatar-button {
  display: flex;
  align-items: center;
}

.app-header__top {
  position: relative;
  z-index: 1;
  justify-content: space-between;
  gap: 16px;
}

.brand-mark img {
  width: 92px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(30, 0, 0, 0.26));
}

.header-actions {
  gap: 10px;
}

.icon-button,
.avatar-button {
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(40, 0, 0, 0.18);
}

.avatar-button {
  background: #fff8ea;
  color: var(--primary);
}

.greeting {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  margin-top: 28px;
}

.greeting span {
  font-size: 1rem;
  opacity: 0.88;
}

.greeting strong {
  max-width: 280px;
  font-size: 1.65rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.app-content {
  position: relative;
  z-index: 12;
  display: grid;
  gap: 18px;
  padding: 220px 16px calc(var(--bottom-nav-height) + 26px);
}

.app-content > section {
  scroll-margin-top: 18px;
}

.hero-card,
.app-card,
.game-card,
.stat-card,
.support-card,
.service-card {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  gap: 18px;
  min-height: 218px;
  padding: 24px;
  border-radius: 32px;
}

.hero-card p,
.section-title span,
.card-heading span,
.support-card span {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-card h1 {
  max-width: 300px;
  margin: 6px 0 0;
  font-size: 1.48rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-card__highlight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 22px;
  color: #fff8ea;
  background: linear-gradient(135deg, #261414, var(--primary));
}

.hero-card__highlight span {
  font-size: 0.82rem;
  opacity: 0.82;
}

.hero-card__highlight strong {
  font-size: 0.95rem;
  text-align: right;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  border-radius: 18px;
  font-weight: 850;
}

.primary-action {
  color: #fff8ea;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 14px 28px rgba(143, 31, 29, 0.22);
}

.secondary-action {
  width: 100%;
  color: var(--primary);
  background: rgba(143, 31, 29, 0.08);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(6, 76px);
  gap: 12px;
  padding: 4px 2px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.quick-actions::-webkit-scrollbar {
  display: none;
}

.quick-action {
  display: grid;
  gap: 8px;
  justify-items: center;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  scroll-snap-align: start;
}

.quick-action span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: #fff8ea;
  background: linear-gradient(135deg, var(--primary), #2d1714);
  box-shadow: 0 12px 26px rgba(91, 37, 31, 0.18);
}

.quick-action i {
  font-size: 1.28rem;
}

.section-block,
.game-card,
.stat-card,
.app-card,
.support-card {
  border-radius: var(--radius);
}

.section-block {
  display: grid;
  gap: 12px;
}

.section-title,
.card-heading,
.support-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title {
  padding: 0 4px;
}

.section-title a {
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.service-card {
  display: grid;
  align-content: space-between;
  gap: 18px;
  min-height: 118px;
  padding: 18px;
  border-radius: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  color: var(--primary);
  background: rgba(143, 31, 29, 0.09);
  font-size: 1.18rem;
}

.service-card span {
  font-size: 0.95rem;
  font-weight: 820;
  line-height: 1.15;
}

.game-card,
.stat-card,
.app-card,
.support-card {
  padding: 20px;
}

.card-heading {
  margin-bottom: 16px;
}

.card-heading strong,
.support-card strong {
  display: block;
  font-size: 1.04rem;
  line-height: 1.18;
}

.game-detail-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.game-detail-list div {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.game-detail-list i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 13px;
  color: var(--green);
  background: rgba(23, 134, 106, 0.1);
}

.game-detail-list span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.game-detail-list strong {
  max-width: 170px;
  font-size: 0.9rem;
  text-align: right;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-grid div {
  min-height: 104px;
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fffaf0, #f7f4ec);
}

.stat-grid span,
.stat-grid small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.stat-grid strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--primary);
  font-size: 1rem;
  line-height: 1.1;
}

.birthday-list {
  display: grid;
  gap: 12px;
}

.group-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.group-card {
  scroll-margin-bottom: calc(var(--bottom-nav-height) + 22px);
}

.group-toggle {
  margin-top: 14px;
  border: 0;
  cursor: pointer;
}

.group-member {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 118px;
  padding: 12px 8px;
  border: 0;
  border-radius: 20px;
  background: #f7f9fa;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: center;
}

.group-member img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  background: #f4e8cf;
}

.group-member strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-member span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(24, 17, 16, 0.56);
  backdrop-filter: blur(10px);
}

.gallery-modal[hidden] {
  display: none;
}

.gallery-modal__dialog {
  position: relative;
  width: min(100%, 390px);
  overflow: hidden;
  border-radius: 30px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(18, 10, 9, 0.36);
}

.gallery-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(30, 20, 18, 0.16);
}

.gallery-modal__dialog img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f4e8cf;
}

.gallery-modal__body {
  display: grid;
  gap: 4px;
  padding: 18px 20px 22px;
}

.gallery-modal__body span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-modal__body strong {
  font-size: 1.35rem;
  line-height: 1.12;
}

.gallery-modal__body small {
  color: var(--muted);
  font-weight: 760;
}

.birthday-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
}

.birthday-row img,
.birthday-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: #f4e8cf;
}

.birthday-row strong,
.birthday-row span {
  display: block;
}

.birthday-row span {
  color: var(--muted);
  font-size: 0.84rem;
}

.birthday-pill {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(143, 31, 29, 0.08);
  font-size: 0.78rem;
  font-weight: 820;
}

.skeleton {
  border-radius: 18px;
  background: linear-gradient(90deg, #f1eee8, #fffaf3, #f1eee8);
  background-size: 220% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}

.rules-card ol {
  display: grid;
  gap: 10px;
  padding-left: 22px;
  margin: 0 0 16px;
}

.rules-card li {
  padding-left: 4px;
  color: #4c3530;
  font-weight: 700;
  line-height: 1.35;
}

.support-card {
  min-height: 96px;
  background: linear-gradient(135deg, #fff, #fff4d9);
}

.support-card i {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  color: #fff8ea;
  background: var(--gold);
  font-size: 1.2rem;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  width: min(100%, var(--app-width));
  min-height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  padding: 10px 6px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(80, 44, 35, 0.08);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  box-shadow: 0 -16px 34px rgba(54, 33, 29, 0.12);
  transform: translateX(-50%);
}

.bottom-nav a {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 58px;
  border-radius: 18px;
  color: #85746f;
  font-size: 0.65rem;
  font-weight: 780;
}

.bottom-nav i {
  font-size: 1.17rem;
}

.bottom-nav a.is-active {
  color: var(--primary);
  background: rgba(143, 31, 29, 0.09);
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

@media (hover: hover) {
  .service-card:hover,
  .quick-action:hover,
  .primary-action:hover,
  .secondary-action:hover {
    transform: translateY(-2px);
  }
}

@media (min-width: 720px) and (max-width: 959px) {
  body {
    padding: 24px 0;
    background:
      linear-gradient(90deg, rgba(143, 31, 29, 0.06), transparent 22%, transparent 78%, rgba(143, 31, 29, 0.06)),
      var(--bg);
  }

  .phone-shell,
  .bottom-nav {
    border-radius: 34px;
  }

  .phone-shell {
    min-height: calc(100vh - 48px);
  }

  .bottom-nav {
    bottom: 24px;
  }

  .app-header {
    top: 24px;
    border-radius: 34px 34px 0 0;
  }

  .app-content {
    padding-top: 244px;
  }
}

@media (min-width: 960px) {
  :root {
    --app-width: 1120px;
    --bottom-nav-height: 78px;
  }

  body {
    padding: 24px;
    background:
      radial-gradient(circle at 18% 10%, rgba(214, 168, 71, 0.18), transparent 28%),
      radial-gradient(circle at 84% 20%, rgba(143, 31, 29, 0.12), transparent 24%),
      var(--bg);
  }

  .phone-shell {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 48px);
    border-radius: 34px;
    overflow: hidden;
  }

  .app-header {
    position: relative;
    top: auto;
    left: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    width: 100%;
    min-height: 188px;
    padding: 26px 34px 66px;
    border-radius: 34px 34px 0 0;
    transform: none;
  }

  .app-header::after {
    height: 40px;
    inset: auto 0 0;
    border-radius: 0;
  }

  .app-header__top {
    grid-column: 1 / -1;
  }

  .brand-mark img {
    width: 112px;
    height: 68px;
  }

  .greeting {
    margin-top: 18px;
  }

  .greeting strong {
    max-width: 520px;
    font-size: 2rem;
  }

  .app-content {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
    flex: 1;
    padding: 22px 22px 24px;
  }

  .hero-card {
    grid-column: span 5;
    min-height: 284px;
  }

  .quick-actions {
    grid-column: span 7;
    align-self: stretch;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow: visible;
    padding: 0;
  }

  .quick-action {
    flex: initial;
    align-content: center;
    min-height: 132px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 26px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .section-block {
    grid-column: span 7;
  }

  .service-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .service-card {
    min-height: 126px;
  }

  .game-card {
    grid-column: span 5;
  }

  .stat-card {
    grid-column: span 7;
  }

  .birthday-card {
    grid-column: span 5;
  }

  .group-card {
    grid-column: span 5;
  }

  .group-gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rules-card {
    grid-column: span 7;
  }

  .support-card {
    grid-column: span 5;
    min-height: 154px;
  }

  .bottom-nav {
    position: relative;
    left: auto;
    bottom: auto;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    min-height: var(--bottom-nav-height);
    width: calc(100% - 44px);
    margin: 0 22px 22px;
    padding: 10px;
    border: 1px solid rgba(80, 44, 35, 0.08);
    border-radius: 26px;
    box-shadow: 0 14px 36px rgba(54, 33, 29, 0.12);
    transform: none;
  }

  .bottom-nav a {
    grid-template-columns: auto auto;
    align-content: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 16px;
    font-size: 0.78rem;
  }

  .bottom-nav a.is-active {
    box-shadow: inset 0 0 0 1px rgba(143, 31, 29, 0.08);
  }
}

@media (max-width: 370px) {
  .app-content {
    padding-inline: 12px;
  }

  .hero-card,
  .game-card,
  .stat-card,
  .app-card,
  .support-card {
    padding: 18px;
  }

  .bottom-nav span {
    font-size: 0.59rem;
  }
}

@media (max-width: 430px) {
  .quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .quick-action {
    min-width: 0;
  }

  #grupo {
    scroll-margin-top: 18px;
  }
}
