:root {
  --leaf: #5fb85f;
  --leaf-dark: #2f7d46;
  --sky: #9eddf0;
  --sun: #ffd166;
  --coral: #ff7a66;
  --cream: #fffaf0;
  --ink: #24352f;
  --muted: #68766f;
  --line: #d9e8d4;
  --card: rgba(255, 255, 255, 0.94);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 12% 18%, var(--sun) 0 42px, transparent 43px),
    radial-gradient(circle at 22% 74%, rgba(255, 122, 102, 0.35) 0 34px, transparent 35px),
    radial-gradient(circle at 82% 22%, rgba(95, 184, 95, 0.3) 0 54px, transparent 55px),
    linear-gradient(180deg, #a9e7f4 0%, #d8f7e3 58%, #9bd278 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  content: "";
}

body::before {
  right: -74px;
  bottom: 18px;
  width: 280px;
  height: 170px;
  border-radius: 52% 48% 42% 58%;
  background: var(--leaf);
  box-shadow:
    -48px -54px 0 -18px var(--leaf),
    -94px -84px 0 -35px var(--leaf),
    58px -38px 0 -22px var(--leaf),
    -32px 90px 0 -58px var(--leaf-dark);
}

body::after {
  left: -58px;
  bottom: 0;
  width: 120vw;
  height: 110px;
  border-radius: 52% 48% 0 0;
  background:
    radial-gradient(circle at 16% 74%, #3f8f49 0 18px, transparent 19px),
    radial-gradient(circle at 64% 80%, #3f8f49 0 15px, transparent 16px),
    #71b957;
}

.page-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 28px 16px 42px;
}

.birthday-card {
  width: min(100%, 760px);
  overflow: hidden;
  border: 1px solid rgba(47, 125, 70, 0.22);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 22px 50px rgba(36, 53, 47, 0.18);
  backdrop-filter: blur(8px);
}

.card-section {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.card-section:last-child {
  border-bottom: 0;
}

.intro-section {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 18px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.28), rgba(95, 184, 95, 0.16)),
    var(--cream);
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 1;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.2rem;
}

p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.dino-badge {
  position: relative;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: #d8f7e3;
  border: 3px solid #82c96c;
}

.dino-head {
  position: absolute;
  left: 16px;
  top: 24px;
  width: 54px;
  height: 40px;
  border-radius: 52% 44% 44% 52%;
  background: var(--leaf);
  box-shadow: 20px -11px 0 -5px var(--leaf), 18px 6px 0 -9px #ffffff;
}

.dino-head::before {
  position: absolute;
  left: 9px;
  top: -13px;
  width: 9px;
  height: 14px;
  border-radius: 9px 9px 2px 2px;
  background: var(--coral);
  box-shadow: 13px -3px 0 var(--coral), 26px 0 0 var(--coral);
  content: "";
}

.dino-head::after {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #17251f;
  box-shadow: 14px 16px 0 -3px #17251f;
  content: "";
}

.section-heading {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
}

.gift-tools {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.sort-control {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px 6px 12px;
  color: var(--ink);
  background: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
}

.sort-control select {
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  padding: 4px 6px;
  color: var(--ink);
  background: #f5fbf1;
  font: inherit;
  font-weight: 400;
}

.sync-status {
  color: var(--muted);
  font-size: 0.86rem;
}

.gift-list {
  display: grid;
  gap: 10px;
}

.gift-item {
  display: grid;
  grid-template-columns: 22px auto minmax(0, max-content) minmax(16px, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.gift-item input {
  width: 22px;
  height: 22px;
  accent-color: var(--leaf-dark);
}

.gift-title {
  min-width: 0;
  font-size: 1rem;
  line-height: 1.35;
  word-break: break-word;
}

.gift-spacer {
  min-width: 16px;
}

.gift-link,
.gift-link-placeholder {
  min-width: 58px;
  min-height: 34px;
}

.gift-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2f7d46;
  border-radius: 8px;
  padding: 7px 10px;
  color: #ffffff;
  background: linear-gradient(180deg, #52ad57 0%, #2f8d4b 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 2px 0 #25693b;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.gift-link:hover,
.gift-link:focus-visible {
  border-color: #245f36;
  background: linear-gradient(180deg, #3f9749 0%, #236d3c 100%);
  transform: translateY(-1px);
}

.gift-link:focus-visible {
  outline: 3px solid rgba(95, 184, 95, 0.28);
  outline-offset: 2px;
}

.gift-link-placeholder {
  display: block;
}

.gift-price {
  width: fit-content;
  justify-self: end;
  white-space: nowrap;
  border-radius: 999px;
  padding: 3px 8px;
  color: #1f6b3a;
  background: #e4f6dc;
  font-size: 0.86rem;
  line-height: 1.2;
}

.gift-item.is-checked .gift-title {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.gift-item.is-saving {
  opacity: 0.72;
}

.error-message {
  margin-top: 12px;
  color: #a43122;
}

.general-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  line-height: 1.5;
}

@media (max-width: 560px) {
  .page-shell {
    align-items: flex-start;
    padding-top: 18px;
  }

  .card-section {
    padding: 18px;
  }

  .intro-section {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: block;
  }

  .gift-tools {
    display: grid;
    justify-content: stretch;
    margin-bottom: 12px;
  }

  .sort-control {
    justify-content: space-between;
  }

  .sync-status {
    display: block;
  }

  .gift-item {
    grid-template-columns: 22px auto minmax(0, 1fr) auto;
  }

  .gift-spacer {
    display: none;
  }

  .gift-price {
    grid-column: 3 / 5;
    justify-self: end;
    margin-top: 2px;
  }
}
