/* home: My Secret Santas + the shell's round home button. */

.home-head { margin-bottom: 20px; }
.home-head h1 { font-size: 30px; margin-top: 4px; }
.home-new { margin-bottom: 30px; }

.home-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.home-item { position: relative; }

.home-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transform: rotate(var(--tilt, -1.6deg));
  transition: transform 0.15s ease;
}
.home-card:not([href]) { filter: drop-shadow(0 8px 8px oklch(0.3 0.03 50 / 0.12)); opacity: 0.8; }
.home-card[href]:active { transform: rotate(0deg) scale(0.985); }
.home-card:focus-visible { outline-offset: 6px; }

.home-tag { display: grid; gap: 3px; min-width: 0; padding: 18px 20px 18px 56px; }
.home-name {
  font-size: 22px; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.home-role { font-size: 13px; color: var(--soft); }
.home-status { font-size: 24px; line-height: 1.1; margin-top: 2px; color: var(--soft); }
.home-status[data-tone="act"] { color: var(--red); }
.home-status[data-tone="done"] { color: var(--green); }
.home-status[data-tone="gone"] { color: var(--soft); font-style: italic; }
.home-status[data-tone="load"] { opacity: 0.4; }

.home-remove {
  position: absolute; right: 8px; bottom: 6px;
  min-height: 44px; padding: 0 14px;
  border: 0; background: none; cursor: pointer;
  color: var(--red); font-size: 14px; font-weight: 600; text-decoration: underline;
}

.home-empty { margin-top: 8px; font-size: 26px; color: var(--soft); text-align: center; line-height: 1.2; }

/* the round button, top-left, over the garland wire (which ignores pointer events) */
.home-btn {
  position: fixed;
  top: 8px; left: 10px;
  z-index: 6;
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--kraft-dark);
  border-radius: 50%;
  background: var(--tag);
  color: var(--red);
  box-shadow: 0 3px 0 var(--kraft-dark), 0 8px 10px -6px oklch(0.3 0.03 50 / 0.45);
  cursor: pointer;
  touch-action: manipulation;
}
.home-btn[hidden] { display: none; }
.home-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--kraft-dark); }
body[data-screen="bow"] .home-btn { border-color: oklch(1 0 0 / 0.6); }

/* keep the column's content clear of the button on very narrow screens */
@media (min-width: 560px) {
  .home-btn { left: max(10px, calc(50% - var(--col) / 2 - 56px)); }
}

/* ⋯ on each card: one action, archive (this device's list only) */
.home-more {
  position: absolute; top: 10px; right: 6px; z-index: 2;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: var(--soft); font-size: 22px; line-height: 1; cursor: pointer;
}
.home-more:hover, .home-more[aria-expanded="true"] { background: oklch(0.88 0.03 70 / 0.6); color: var(--ink); }
.home-menu {
  position: absolute; top: 52px; right: 8px; z-index: 3;
  background: var(--tag, #fffaf0); border: 2px solid var(--kraft); border-radius: 12px;
  box-shadow: 0 8px 18px -10px oklch(0.3 0.03 50 / 0.5); padding: 4px;
}
.home-menu[hidden] { display: none; }
.home-archive { min-height: 44px; padding: 0 16px; border: 0; background: transparent; font: 600 15px var(--body, inherit); color: var(--ink); cursor: pointer; border-radius: 8px; }
.home-archive:hover { background: oklch(0.92 0.03 70); }

/* Archived: folded away under the list */
.home-archived { margin: 28px 4px 0; }
.home-archived > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font: 600 13px/1 var(--body, inherit); letter-spacing: 0.12em; text-transform: uppercase; color: var(--soft); }
.home-arch-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.home-arch-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 4px 14px; border: 1px solid var(--line, oklch(0.88 0.02 70)); border-radius: 12px; background: oklch(0.97 0.012 75); }
.home-arch-name { color: var(--ink); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-unarchive { flex: none; min-height: 44px; padding: 0 14px; border: 0; background: transparent; color: var(--red); font: 600 14px var(--body, inherit); cursor: pointer; }

/* ---- the pile of gifts: one per Secret Santa box ever made ------------------ */

.giftpile-slot { margin: -14px 0 22px; }
.giftpile-slot:empty { display: none; }
.giftpile { display: grid; justify-items: center; gap: 2px; }

.gp-stack { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 4px; }
.gp-row { display: flex; justify-content: center; margin-top: -2px; }
.gp-row:first-child { margin-top: 0; }

.gp-gift {
  --rb: var(--red);
  position: relative; flex: none;
  width: 24px; height: 19px; margin: 0 -1px;
  border-radius: 2px;
  background: linear-gradient(180deg, oklch(0.78 0.07 65), var(--kraft) 40%, var(--kraft-dark));
  box-shadow: inset 0 0 0 1px oklch(0.55 0.07 60 / 0.55), 0 1px 1px oklch(0.3 0.03 50 / 0.25);
  transform: rotate(var(--t, 0deg));
  animation: gp-drop 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) both;
  animation-delay: calc(var(--d, 0) * 35ms);
}
.gp-gift::before, .gp-gift::after { content: ""; position: absolute; background: var(--rb); }
.gp-gift::before { top: 0; bottom: 0; left: 50%; width: 5px; margin-left: -2.5px; }   /* upright ribbon */
.gp-gift::after { left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; opacity: 0.92; } /* band */
.gp-gift[data-r="red"] { --rb: var(--red); }
.gp-gift[data-r="green"] { --rb: var(--green); }
.gp-gift[data-r="pine"] { --rb: var(--pine); }
.gp-gift[data-r="gold"] { --rb: var(--gold); }
.gp-gift[data-r="tartan"] {
  --rb: repeating-linear-gradient(90deg, var(--red) 0 2px, oklch(0.3 0.06 155) 2px 3px, var(--red) 3px 4px, var(--gold) 4px 5px);
}

.gp-more {
  position: absolute; right: -34px; bottom: 0;
  padding: 1px 7px; border-radius: 999px;
  background: var(--tag); border: 2px solid var(--kraft-dark);
  color: var(--red); font: 700 12px/1.3 var(--body, inherit);
  animation: gp-drop 0.5s ease both; animation-delay: 1s;
}

.gp-cap { margin: 0; font-size: 22px; line-height: 1.1; color: var(--soft); text-align: center; }

@keyframes gp-drop {
  from { opacity: 0; translate: 0 -14px; }
  to { opacity: 1; translate: 0 0; }
}
