:root {
  --bg: #0f1115;
  --surface: #181b22;
  --surface-hover: #1f232c;
  --border: #2a2f3a;
  --text: #e8eaf0;
  --muted: #8a91a0;
  --accent: #e0a458;
  --radius: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
}

.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.count {
  color: var(--muted);
  margin-top: 4px;
}

.view-toggle {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.view-toggle button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 36px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.view-toggle button:hover {
  color: var(--text);
}

.view-toggle button[aria-pressed="true"] {
  background: var(--surface-hover);
  color: var(--accent);
}

.view-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.gifts {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 24px;
}

.gifts.grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.gifts.list {
  grid-template-columns: 1fr;
  gap: 14px;
}

.gift a {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}

.gift a:hover,
.gift a:focus-visible {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  outline: none;
}

.thumb {
  aspect-ratio: 4 / 3;
  background: #12151b center / cover no-repeat;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.placeholder {
  width: 25%;
  height: auto;
  opacity: 0.5;
}

.info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px 20px;
}

.name {
  font-weight: 600;
  font-size: 1.05rem;
}

.domain {
  color: var(--muted);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gifts.list .gift a {
  flex-direction: row;
  align-items: center;
}

.gifts.list .thumb {
  flex: 0 0 96px;
  aspect-ratio: 1;
}

.gifts.list .placeholder {
  width: 36%;
}

.gifts.list .info {
  min-width: 0;
  padding: 16px 24px;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 64px 0;
}

@media (max-width: 600px) {
  body {
    padding: 28px 16px;
  }

  .header {
    align-items: center;
    margin-bottom: 28px;
  }

  h1 {
    font-size: 1.6rem;
    line-height: 1.2;
  }

  .count {
    font-size: 0.9rem;
  }

  .view-toggle {
    flex-shrink: 0;
  }

  .gifts.grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
  }

  .gifts.grid .info {
    padding: 12px 14px 14px;
  }

  .gifts.list .thumb {
    flex-basis: 72px;
  }

  .gifts.list .info {
    padding: 12px 16px;
  }
}
