:root {
  --app-space-1: 4px;
  --app-space-2: 8px;
  --app-space-3: 12px;
  --app-space-4: 16px;
  --app-space-5: 20px;
  --app-space-6: 24px;
  --app-space-8: 32px;
  --app-page-width: 640px;
  --app-control-height: 44px;
  --app-bottom-nav-height: 68px;
}

html {
  scroll-padding-bottom: calc(var(--app-bottom-nav-height) + var(--app-space-6) + env(safe-area-inset-bottom));
}

body {
  min-width: 320px;
  letter-spacing: 0;
}

#app-content {
  min-height: 100dvh;
}

#app-content > section {
  min-height: 100dvh;
}

#app-content .container {
  width: 100%;
  max-width: var(--app-page-width);
  padding-right: var(--app-space-4) !important;
  padding-left: var(--app-space-4) !important;
}

.app-has-bottom-nav #app-content {
  padding-bottom: calc(var(--app-bottom-nav-height) + var(--app-space-6) + env(safe-area-inset-bottom));
}

.app-has-bottom-nav #app-content .pb-120,
.app-focused-flow #app-content .pb-120 {
  padding-bottom: var(--app-space-8);
}

.app-has-bottom-nav #app-content .header-area {
  margin-top: calc(var(--app-space-5) + env(safe-area-inset-top)) !important;
  margin-bottom: var(--app-space-5) !important;
}

.app-has-bottom-nav #app-content .page-title {
  padding-top: var(--app-space-5) !important;
  padding-bottom: var(--app-space-5) !important;
}

.app-has-bottom-nav #app-content h3,
.app-focused-flow #app-content h3 {
  font-size: 24px;
  line-height: 1.25;
}

#app-content .gradient-btn-full {
  min-height: var(--app-control-height);
  padding: 10px var(--app-space-4);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.2;
}

#app-content .gradient-btn,
#app-content .btn-4 {
  width: auto;
  min-height: 40px;
  padding: var(--app-space-2) 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.2;
}

#app-content .btn-4.w-100 {
  width: 100% !important;
}

#app-content .btn-5 {
  width: auto;
  max-width: none;
  min-height: 40px;
  padding: var(--app-space-2) 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1.2;
}

#app-content .account-setting {
  padding: var(--app-space-3);
  border-radius: 8px;
}

#app-content .recent-match-area .match-list-item,
#app-content .chat-area .chat-list-item {
  border-radius: 8px;
}

#app-content .chat-area .chat-list-item {
  min-height: 64px;
  padding: var(--app-space-2) var(--app-space-3);
}

.app-bottom-nav {
  position: fixed;
  z-index: 1030;
  right: var(--app-space-4);
  bottom: calc(var(--app-space-2) + env(safe-area-inset-bottom));
  left: var(--app-space-4);
  max-width: 608px;
  margin: 0 auto;
}

.app-bottom-nav__surface,
.app-bottom-nav__guest {
  min-height: var(--app-bottom-nav-height);
  border: 1px solid rgb(var(--n30));
  border-radius: 8px;
  background: rgb(var(--n1));
  box-shadow: 0 8px 24px rgba(31, 35, 48, 0.14);
}

.app-bottom-nav__surface {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--app-space-1);
  padding: var(--app-space-1);
}

.app-bottom-nav__item {
  position: relative;
  min-width: 0;
  min-height: 58px;
  padding: 6px 2px;
  border-radius: 6px;
  color: rgb(var(--n500));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  line-height: 1.15;
  text-align: center;
}

.app-bottom-nav__item i {
  font-size: 21px;
  line-height: 1;
}

.app-bottom-nav__item.active {
  color: rgb(var(--p2-300));
  background: rgb(var(--p2-50));
  font-weight: 600;
}

.app-bottom-nav__badge {
  position: absolute;
  top: 4px;
  left: calc(50% + 8px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 2px solid rgb(var(--n1));
  border-radius: 8px;
  background: #c62828;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  line-height: 12px;
}

.app-bottom-nav__guest {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--app-space-2);
  padding: var(--app-space-3);
}

.app-button {
  min-height: var(--app-control-height);
  padding: 10px var(--app-space-4);
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.app-button--primary {
  background: var(--gradient);
  color: rgb(var(--n1));
}

.app-button--secondary {
  border-color: rgb(var(--p2-75));
  background: rgb(var(--n1));
  color: rgb(var(--p2-300));
}

.app-segmented-control {
  padding: var(--app-space-1);
  border: 1px solid rgb(var(--n30));
  border-radius: 8px;
  background: rgb(var(--n1-2));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--app-space-1);
}

.app-segmented-control__item {
  min-height: 40px;
  padding: var(--app-space-2) var(--app-space-3);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgb(var(--n500));
  font-size: 14px;
  font-weight: 600;
}

.app-segmented-control__item.active {
  background: rgb(var(--n1));
  box-shadow: 0 1px 4px rgba(31, 35, 48, 0.12);
  color: rgb(var(--p2-300));
}

.app-text-action {
  min-height: 40px;
  padding: var(--app-space-2);
  color: rgb(var(--p2-300));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--app-space-1);
  font-size: 14px;
  font-weight: 600;
}

.payment-privacy-note {
  padding: var(--app-space-2) 0 var(--app-space-2) var(--app-space-3);
  border-left: 3px solid rgb(var(--p2-300));
  display: flex;
  align-items: flex-start;
  gap: var(--app-space-3);
}

.payment-privacy-note > i {
  flex: 0 0 auto;
  color: rgb(var(--p2-300));
  font-size: 22px;
  line-height: 1.2;
}

.payment-privacy-note h4 {
  margin: 0 0 var(--app-space-1);
  color: rgb(var(--n700));
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.payment-privacy-note p {
  margin: 0;
  color: rgb(var(--n300));
  font-size: 12px;
  line-height: 1.55;
}

.payment-privacy-note--compact {
  align-items: center;
}

@media (max-width: 360px) {
  .app-bottom-nav {
    right: var(--app-space-3);
    left: var(--app-space-3);
  }

  .app-bottom-nav__item {
    font-size: 10px;
  }

  .app-bottom-nav__item i {
    font-size: 20px;
  }
}

@media (min-width: 768px) {
  #app-content .container {
    padding-right: var(--app-space-6) !important;
    padding-left: var(--app-space-6) !important;
  }
}
