@font-face {
  font-family: "Heading";
  src: url("/assets/fonts/heading.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Body";
  src: url("/assets/fonts/body.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "Body", sans-serif;
  color: #343c2c;
  background: #f5f3eb;
  --background: #f5f3eb;
  --olive: #566346;
  --safe-top: max(
    env(safe-area-inset-top, 0px),
    var(--tg-content-safe-area-inset-top, 0px)
  );
  --safe-bottom: max(
    env(safe-area-inset-bottom, 0px),
    var(--tg-content-safe-area-inset-bottom, 0px)
  );
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible {
  outline: 3px solid #566346;
  outline-offset: 4px;
}
.icon-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.shell {
  width: min(100%, 540px);
  min-height: 100svh;
  min-height: var(--tg-viewport-stable-height, 100svh);
  margin: 0 auto;
  padding: calc(24px + var(--safe-top))
    max(24px, env(safe-area-inset-right, 0px)) 0
    max(24px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
}

.brand {
  flex: none;
  text-align: center;
  font-family: "Heading", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.25em;
  line-height: 1.3;
  padding-left: 0.25em;
  margin-bottom: 24px;
}

.brand span {
  display: block;
  width: 27px;
  height: 1px;
  background: #b4b8a8;
  margin: 11px auto 0;
}
main {
  display: flex;
  flex-direction: column;
  flex: 1;
}
h1 {
  font-family: "Heading", Georgia, serif;
  font-size: clamp(32px, 8.9vw, 48px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0;
}
.intro {
  margin: 14px 0 24px;
  color: #606557;
  font-size: 13px;
  line-height: 1.5;
}
.categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.category {
  position: relative;
  min-width: 0;
  min-height: 126px;
  padding: 20px 18px 17px;
  background: #faf9f4;
  border: 1px solid #dcded4;
  border-radius: 15px;
  color: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
  box-shadow: 0 2px 8px rgb(43 52 34 / 2%);
  transition:
    background-color 140ms ease,
    border-color 140ms ease;
}

.category[aria-pressed="true"] {
  background: #e9ecdf;
  border-color: var(--olive);
  box-shadow: inset 0 0 0 1px var(--olive);
}
.category span {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
}
.category-icon {
  width: 47px;
  height: 47px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.category-wide {
  grid-column: 1 / -1;
  min-height: 104px;
  flex-direction: row;
  align-items: center;
  gap: 18px;
}
.category-wide .category-icon {
  width: 47px;
  height: 47px;
}
.check {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 22px;
  height: 22px;
  padding: 3px;
  border-radius: 50%;
  background: var(--olive);
  fill: none;
  stroke: #faf9f4;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  visibility: hidden;
}
.category[aria-pressed="true"] .check {
  visibility: visible;
}

.actions {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 24px 0 calc(18px + var(--safe-bottom));
  background: var(--background);
}
.continue {
  display: block;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 17px;
  padding: 13px 20px;
  background: var(--olive);
  color: #faf9f4;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
}
.continue:disabled {
  background: #dce0d2;
  color: #6c745f;
  cursor: default;
}
.selection-error {
  color: #914d35;
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 12px;
}
.continue:not(:disabled):active {
  background: #465337;
}
.launch-status {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding-bottom: 70px;
  text-align: center;
}
.launch-status p {
  margin: 0;
}
#status-title {
  font-family: "Heading", Georgia, serif;
  font-size: 32px;
  line-height: 1.1;
}
#status-description {
  font-size: 14px;
  color: #606557;
  line-height: 1.6;
}
#retry {
  margin-top: 14px;
}

#collections {
  padding-bottom: calc(24px + var(--safe-bottom));
}
#collections-title {
  outline: none;
}
.collection-types {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}
.collection-card {
  min-width: 0;
  min-height: 167px;
  border: 1px solid #dcded4;
  border-radius: 15px;
  padding: 22px 18px 20px;
  background: #faf9f4;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  box-shadow: 0 2px 8px rgb(43 52 34 / 2%);
  cursor: default;
}
.collection-name {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  margin-top: 18px;
}
.collection-card-active {
  cursor: pointer;
}
.collection-card-active:active {
  background: #e9ecdf;
  border-color: var(--olive);
}
.collection-count {
  font-size: 12px;
  line-height: 1.5;
  margin-top: 5px;
  color: #606557;
}
.add-collection-type {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid #bdc5ae;
  border-radius: 15px;
  background: #e9ecdf;
  color: #3f4b33;
  font-size: 14px;
  font-weight: 500;
}
.add-collection-type svg {
  flex: none;
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.text-back {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  margin: -8px 0 16px;
  border: 0;
  background: transparent;
  color: var(--olive);
  font-size: 14px;
  min-height: 44px;
}

#coins-title {
  outline: none;
}
.coin-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.coin-section {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  min-height: 100px;
  padding: 18px;
  border: 1px solid #dcded4;
  border-radius: 15px;
  background: #faf9f4;
  color: inherit;
  text-align: left;
  cursor: default;
  box-shadow: 0 2px 8px rgb(43 52 34 / 2%);
}
.coin-section-active {
  cursor: pointer;
}
.coin-section-active:active {
  background: #e9ecdf;
  border-color: var(--olive);
}
#coin-collections-title {
  outline: none;
}
#coin-albums-title {
  outline: none;
}
#new-album-title {
  outline: none;
}
.album-form {
  display: flex;
  flex: 1;
  flex-direction: column;
}
.album-form label {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
}
.album-form input {
  width: 100%;
  min-height: 54px;
  padding: 15px;
  border: 1px solid #dcded4;
  border-radius: 15px;
  background: #faf9f4;
  color: inherit;
  font: inherit;
  font-size: 16px;
}
.album-form input:focus-visible {
  outline: 2px solid var(--olive);
  outline-offset: 2px;
}
.field-hint {
  margin: 10px 0 24px;
  color: #606557;
  font-size: 12px;
}
.album-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.album-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 18px;
  border: 1px solid #dcded4;
  border-radius: 15px;
  background: #faf9f4;
}
.album-card-name {
  margin: 0;
  font-family: "Heading", Georgia, serif;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.album-count {
  margin: 0;
  color: #606557;
  font-size: 12px;
}
.album-action {
  cursor: pointer;
}
.collection-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-pill {
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid #dcded4;
  border-radius: 24px;
  background: #faf9f4;
  color: #606557;
  font-size: 12px;
  line-height: 1.5;
}
.filter-pill[aria-pressed="true"] {
  background: var(--olive);
  border-color: var(--olive);
  color: #faf9f4;
}
.empty-state {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 36px 12px;
  text-align: center;
}
.empty-state-icon {
  width: 78px;
  height: 78px;
  padding: 20px;
  border-radius: 50%;
  background: #e9ecdf;
  fill: none;
  stroke: var(--olive);
  stroke-width: 1.6;
  stroke-linejoin: round;
}
.empty-state h2 {
  margin: 0;
  font-family: "Heading", Georgia, serif;
  font-size: 29px;
  line-height: 1.1;
  font-weight: 500;
}
.empty-state p {
  max-width: 29ch;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #606557;
}
.section-icon {
  flex: none;
  width: 49px;
  height: 49px;
  padding: 10px;
  border-radius: 50%;
  background: #e9ecdf;
  fill: none;
  stroke: #3f4b33;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.section-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.section-title {
  font-family: "Heading", Georgia, serif;
  font-size: 27px;
  font-weight: 500;
  line-height: 1.05;
}
.section-description {
  font-size: 12px;
  line-height: 1.5;
  color: #606557;
}
.section-chevron {
  flex: none;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.add-coins {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: default;
}
.add-coins span {
  font-size: 24px;
  line-height: 1;
  font-weight: 400;
}

@media (min-height: 780px) and (min-width: 360px) {
  .shell {
    padding-top: calc(30px + var(--safe-top));
  }
  .brand {
    margin-bottom: 32px;
  }
  .intro {
    margin-bottom: 28px;
  }
  .category {
    min-height: 140px;
    padding-top: 23px;
    gap: 20px;
  }
  .category-wide {
    min-height: 112px;
  }
}

@media (max-width: 350px) {
  .shell {
    padding-left: 18px;
    padding-right: 18px;
  }
  .brand {
    margin-bottom: 20px;
  }
  h1 {
    font-size: 29px;
  }
  .intro {
    font-size: 12px;
    margin-bottom: 20px;
  }
  .category {
    min-height: 116px;
    padding: 17px 15px;
    gap: 12px;
  }
  .category span {
    font-size: 15px;
  }
  .category-wide {
    min-height: 90px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .category {
    transition: none;
  }
}
