:root {
  --ink: #2d352c;
  --muted: #6f7b6c;
  --rose: #c98888;
  --coral: #d8a27d;
  --lemon: #eadca7;
  --mint: #b9d2bd;
  --sage: #c9dcc7;
  --sage-soft: #dfeade;
  --sage-pale: #eef5ec;
  --sage-deep: #728f78;
  --olive: #465b45;
  --clay: #b98b72;
  --paper: #fffaf0;
  --panel: rgba(255, 250, 240, 0.84);
  --line: rgba(70, 91, 69, 0.16);
  --shadow: 0 24px 80px rgba(57, 79, 55, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Quicksand", Arial, sans-serif;
  background: var(--sage);
}

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

button {
  cursor: pointer;
}

.invite-locked {
  overflow: hidden;
}

.invite-locked .app-shell {
  display: none;
}

.invite-gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 250, 240, 0.74), transparent 34%),
    radial-gradient(circle at 78% 74%, rgba(114, 143, 120, 0.28), transparent 36%),
    var(--sage);
}

.invite-gate.hidden {
  display: none;
}

.invite-card {
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: rgba(255, 250, 240, 0.9);
  box-shadow: var(--shadow);
}

.invite-card img {
  width: 84px;
  height: 84px;
  border: 4px solid #fff;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 16px 30px rgba(57, 79, 55, 0.16);
}

.invite-card h1 {
  max-width: none;
  font-size: 34px;
}

.invite-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.invite-card label {
  display: grid;
  gap: 7px;
  color: var(--olive);
  font-size: 13px;
  font-weight: 900;
}

.invite-card button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--sage-deep), var(--clay));
  font-weight: 900;
}

.invite-card small {
  min-height: 18px;
  color: #9f5f4f;
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(238, 245, 236, 0.72);
  backdrop-filter: blur(20px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
}

.brand-badge {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 18px;
  overflow: hidden;
  color: #fff;
  font-family: "Baloo 2", sans-serif;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--sage-deep), var(--clay));
  box-shadow: 0 12px 30px rgba(70, 91, 69, 0.22);
}

.brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 58%;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--clay);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Baloo 2", sans-serif;
  letter-spacing: 0;
}

h1 {
  max-width: 210px;
  margin-bottom: 0;
  font-size: 25px;
  line-height: 1;
}

.character-card,
.panel,
.composer,
.memory-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.character-card {
  padding: 18px;
}

.chosen-memory {
  margin: 0 0 16px;
}

.chosen-memory img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 6px solid #fff;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 16px 34px rgba(57, 79, 55, 0.18);
}

.chosen-memory figcaption {
  margin-top: 8px;
  color: var(--clay);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.character-card p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.mascot.duo {
  display: flex;
  justify-content: center;
  min-height: 142px;
  padding-top: 12px;
}

.character {
  position: relative;
  display: grid;
  justify-items: center;
  width: 112px;
  transform: rotate(-4deg);
}

.character.simarik {
  margin-left: -18px;
  transform: rotate(5deg);
}

.portrait-head {
  position: relative;
  display: block;
  width: 96px;
  height: 96px;
  border: 4px solid #fff;
  border-radius: 50%;
  overflow: hidden;
  background: var(--sage-soft);
  box-shadow: 0 12px 26px rgba(57, 79, 55, 0.18);
}

.simarik .portrait-head {
  background: #e8d3c6;
}

.portrait-head img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mincik .portrait-head img {
  object-position: 52% 34%;
}

.simarik .portrait-head img {
  object-position: 52% 58%;
}

.character strong {
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
}

.panel {
  padding: 16px;
}

.panel-title,
.top-strip,
.section-heading,
.memory-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title h2,
.top-strip h2,
.section-heading h2 {
  margin: 0;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  background: var(--sage-deep);
}

.album-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 12px 0;
}

.hidden,
.target-folder-pill.hidden,
.memory-form label.hidden {
  display: none;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.92);
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 88px;
  resize: vertical;
  padding: 12px;
}

.album-form button,
.primary-action {
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--sage-deep), var(--clay));
}

.album-form button {
  padding: 0 14px;
}

.album-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.album-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.72);
}

.album-item.active {
  border-color: rgba(114, 143, 120, 0.5);
  background: var(--sage-pale);
}

.album-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.folder-shelf {
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.92), rgba(238, 245, 236, 0.82)),
    radial-gradient(circle at 12% 16%, rgba(234, 220, 167, 0.38), transparent 28%);
}

.folder-shelf-top {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.folder-shelf-top h2 {
  margin: 0;
}

.quick-folder-form {
  display: grid;
  grid-template-columns: minmax(170px, 260px) auto;
  gap: 8px;
}

.quick-folder-form button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--sage-deep), var(--clay));
  box-shadow: 0 12px 24px rgba(57, 79, 55, 0.2);
}

.folder-row {
  display: grid;
  grid-auto-columns: minmax(158px, 192px);
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-color: rgba(114, 143, 120, 0.62) transparent;
}

.folder-card {
  position: relative;
  min-height: 126px;
  border: 1px solid rgba(114, 143, 120, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 250, 240, 0.94), rgba(238, 245, 236, 0.9));
  box-shadow: 0 16px 34px rgba(57, 79, 55, 0.11);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.folder-card::after {
  position: absolute;
  right: 14px;
  bottom: 12px;
  color: rgba(185, 139, 114, 0.42);
  content: "♥";
  font-size: 22px;
  font-weight: 900;
}

.folder-card:hover {
  border-color: rgba(114, 143, 120, 0.58);
  box-shadow: 0 20px 42px rgba(57, 79, 55, 0.16);
  transform: translateY(-2px);
}

.folder-card.active {
  border-color: rgba(114, 143, 120, 0.7);
  background:
    linear-gradient(145deg, var(--sage-pale), rgba(255, 250, 240, 0.94));
  box-shadow: 0 18px 42px rgba(57, 79, 55, 0.18);
}

.folder-open {
  display: grid;
  align-content: end;
  gap: 7px;
  width: 100%;
  height: 100%;
  min-height: 126px;
  border: 0;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  background: transparent;
}

.folder-icon {
  position: relative;
  display: block;
  width: 58px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--lemon), var(--clay));
  box-shadow: 0 10px 22px rgba(185, 139, 114, 0.18);
}

.folder-icon::before {
  position: absolute;
  top: -9px;
  left: 0;
  width: 28px;
  height: 14px;
  border-radius: 7px 7px 0 0;
  content: "";
  background: #e7d38b;
}

.folder-icon::after {
  position: absolute;
  right: 8px;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  content: "";
  background: rgba(255, 255, 255, 0.84);
}

.folder-open strong {
  overflow: hidden;
  font-family: "Baloo 2", sans-serif;
  font-size: 18px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-open small {
  color: var(--muted);
  font-weight: 900;
}

.folder-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--clay);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 20px rgba(185, 139, 114, 0.26);
}

.memory-space {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
}

.top-strip {
  min-height: 46px;
}

.back-button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--sage-deep), var(--clay));
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(143, 173, 152, 0.2);
}

.home-page .composer,
.home-page .folder-memory-heading,
.home-page .memory-grid,
.home-page .empty-state {
  display: none;
}

.folder-page .folder-shelf,
.folder-page .fav-heading,
.folder-page .favorite-row {
  display: none;
}

.folder-page .memory-board {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.78);
  box-shadow: var(--shadow);
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  color: #5b5261;
  background: rgba(255, 250, 240, 0.82);
  font-weight: 800;
}

.invite-exit-button {
  min-height: 38px;
  border: 1px solid rgba(70, 91, 69, 0.14);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--olive);
  background: rgba(255, 250, 240, 0.74);
  font-weight: 900;
}

.privacy-pill span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sage-deep);
  box-shadow: 0 0 0 5px rgba(114, 143, 120, 0.18);
}

.composer {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(420px, 1.7fr);
  gap: 22px;
  padding: 20px;
}

.composer-copy h2 {
  margin-bottom: 8px;
}

.composer-sticker {
  display: block;
  width: min(150px, 72%);
  aspect-ratio: 1 / 0.82;
  margin: 0 0 12px;
  border: 6px solid #fff;
  border-radius: 8px;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 18px 36px rgba(78, 94, 78, 0.14);
  transform: rotate(-3deg);
}

.composer-copy p,
.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.memory-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.memory-form label {
  display: grid;
  gap: 6px;
  color: #69576e;
  font-size: 13px;
  font-weight: 800;
}

.target-folder-pill {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 62px;
  border: 1px solid rgba(114, 143, 120, 0.34);
  border-radius: 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, var(--sage-pale), #fff7df);
}

.target-folder-pill span {
  color: var(--clay);
  font-size: 12px;
  font-weight: 900;
}

.target-folder-pill strong {
  overflow: hidden;
  font-family: "Baloo 2", sans-serif;
  font-size: 18px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.memory-form .wide {
  grid-column: 1 / 3;
}

.primary-action {
  align-self: end;
  min-height: 46px;
  padding: 0 16px;
}

.memory-board {
  position: relative;
}

.section-heading {
  margin-bottom: 14px;
}

.folder-memory-heading {
  margin-top: 24px;
}

.favorite-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 16px;
}

.polaroid-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(114, 143, 120, 0.28);
  border-radius: 8px;
  padding: 10px 10px 12px;
  background: var(--paper);
  box-shadow: 0 18px 36px rgba(78, 94, 78, 0.13);
  transform: rotate(-1.2deg);
}

.polaroid-card:nth-child(even) {
  transform: rotate(1.2deg);
}

.polaroid-media {
  display: grid;
  width: 100%;
  aspect-ratio: 1 / 1;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  color: var(--muted);
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.92), rgba(238, 245, 236, 0.96)),
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(255, 255, 255, 0.42) 12px 24px);
}

.polaroid-media span {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  background: var(--sage-deep);
  font-family: "Baloo 2", sans-serif;
  font-size: 34px;
  line-height: 42px;
}

.polaroid-media p {
  margin: -22px 0 0;
  font-size: 13px;
  font-weight: 800;
}

.polaroid-media img,
.polaroid-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.polaroid-copy {
  display: grid;
  gap: 7px;
}

.favorite-title,
.favorite-note {
  border-color: rgba(143, 173, 152, 0.32);
  background: rgba(255, 255, 255, 0.84);
}

.favorite-title {
  min-height: 34px;
  padding: 0 9px;
  font-weight: 900;
}

.favorite-note {
  min-height: 54px;
  padding: 9px;
  font-size: 13px;
}

.polaroid-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.polaroid-actions label,
.favorite-clear {
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 900;
}

.polaroid-actions label {
  color: #fff;
  background: linear-gradient(135deg, var(--sage-deep), var(--clay));
}

.polaroid-actions input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.favorite-clear {
  color: var(--clay);
  background: var(--sage-pale);
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.memory-card {
  overflow: hidden;
  background: rgba(255, 250, 240, 0.88);
}

.media-frame {
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 3;
  place-items: center;
  background: linear-gradient(135deg, #fff7df, var(--sage-soft));
}

.media-frame img,
.media-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-content {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.memory-date {
  margin-bottom: 3px;
  color: var(--clay);
  font-size: 12px;
  font-weight: 800;
}

.memory-content h3 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.1;
}

.memory-note {
  min-height: 42px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.album-chip {
  max-width: 150px;
  overflow: hidden;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff7df;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delete-button {
  border: 0;
  color: var(--clay);
  background: transparent;
  font-weight: 900;
}

.empty-state {
  display: grid;
  justify-items: center;
  padding: 36px 20px;
  text-align: center;
}

.empty-state.hidden {
  display: none;
}

.empty-state h3 {
  margin: 10px 0 6px;
}

.empty-state p {
  max-width: 420px;
  margin-bottom: 0;
  color: var(--muted);
}

.empty-characters {
  display: flex;
  gap: 10px;
}

.empty-characters span {
  width: 42px;
  height: 42px;
  border: 4px solid #fff;
  border-radius: 45%;
  background: var(--clay);
}

.empty-characters span:last-child {
  background: var(--mint);
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .folder-shelf-top {
    align-items: stretch;
    flex-direction: column;
  }

  .favorite-row {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 640px) {
  .sidebar,
  .memory-space {
    padding: 16px;
  }

  .brand-lockup,
  .top-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .memory-form {
    grid-template-columns: 1fr;
  }

  .memory-form .wide {
    grid-column: auto;
  }

  .quick-folder-form {
    grid-template-columns: 1fr;
  }

  .folder-row {
    grid-auto-columns: minmax(138px, 160px);
  }

  .favorite-row {
    grid-template-columns: 1fr;
  }
}
