/* Attendance popup (GAME_SPEC §4.20, js/attendanceUi.js). Layout here; colours and shadows are plain
   properties so the UI layer tool can adjust them (docs/web-ui-style.md §6). */
.popup-card--attendance {
  max-width: 440px;
  max-height: calc(100vh - 32px - var(--popup-safe-y));
  max-height: calc(100dvh - 32px - var(--popup-safe-y));
  gap: 10px;
}

.attendance-sub,
.attendance-note {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.35;
  color: #6b4b2a;
}

.attendance-note {
  font-size: 0.8rem;
  color: #8a6a48;
}

.attendance-grid {
  margin: 0;
  padding: 2px;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.attendance-slot {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 92px;
  padding: 6px 4px 8px;
  border-radius: 14px;
  background: #fff8ec;
  border: 2px solid #ecd6b3;
  box-shadow: 0 2px 0 rgba(150, 105, 50, 0.18);
}

/* The seventh day is the big one: two columns wide. */
.attendance-slot[data-big="true"] {
  grid-column: span 2;
  background: #f6ecff;
  border-color: #c9a8ef;
}

/* The animal day: the magic panel fills the card behind its content (mockup 2026-11-02 A). */
.attendance-slot-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  pointer-events: none;
}


.attendance-slot[data-gift="animal"] .attendance-slot-day,
.attendance-slot[data-gift="animal"] .attendance-slot-amount {
  color: #3b1f63;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

.attendance-slot[data-gift="animal"] {
  display: block;
  min-height: 104px;
  padding: 0;
  overflow: visible;
}

.attendance-slot[data-gift="animal"] .attendance-slot-day {
  position: absolute;
  top: 6px;
  left: 10px;
}

.attendance-slot[data-gift="animal"] .attendance-slot-art {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 58%;
  height: auto;
  transform: translateX(-50%);
}

.attendance-slot[data-gift="animal"] .attendance-slot-amount {
  position: absolute;
  left: 10px;
  bottom: 6px;
  max-width: 50%;
  text-align: left;
}

.attendance-slot-icon[data-kind="animal"] {
  width: 100px;
  height: 100px;
  filter: drop-shadow(0 3px 4px rgba(60, 20, 110, 0.35));
}

.attendance-slot-grade {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attendance-slot-grade-star {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.attendance-slot-grade-text {
  position: relative;
  margin-top: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  color: #6b3a00;
  white-space: nowrap;
}

/* Today: a small arrow points at the card to claim. */
.attendance-slot-arrow {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 22px;
  height: 22px;
  transform: translateX(-50%) rotate(90deg);
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(120, 70, 0, 0.4));
}

.attendance-slot[data-state="today"] {
  border-color: #ff9f1c;
  background: #fff1d6;
  box-shadow: 0 0 0 3px rgba(255, 159, 28, 0.35), 0 2px 0 rgba(150, 105, 50, 0.18);
}

.attendance-slot[data-state="stamped"] {
  background: #f1e9dc;
  border-color: #e0d2bd;
}

.attendance-slot-day {
  font-size: 0.8rem;
  font-weight: 700;
  color: #8a5a2b;
}

.attendance-slot-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 52px;
}

.attendance-slot-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}


.attendance-slot-amount {
  max-width: 100%;
  font-size: 0.82rem;
  font-weight: 700;
  color: #4d3420;
  text-align: center;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.attendance-slot-stamp {
  position: absolute;
  top: 34px;
  right: 6px;
  width: 30px;
  height: 30px;
  transform: rotate(-12deg);
  pointer-events: none;
  filter: drop-shadow(0 1px 1px rgba(120, 0, 0, 0.3));
}

@media (max-width: 360px) {
  .attendance-grid { gap: 6px; }
  .attendance-slot-icon { width: 38px; height: 38px; }
  .attendance-slot-art { height: 42px; }
  .attendance-slot-icon[data-kind="animal"] { width: 84px; height: 84px; }
}

/* ---------- wild animal shards (My Collection, GAME_SPEC §4.20) ---------- */
.wild-shard-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  padding: 4px 12px 4px 6px;
  border-radius: 16px;
  background: #fff8ec;
  border: 2px solid #e7cfa6;
  box-shadow: 0 2px 0 rgba(150, 105, 50, 0.15);
}

.wild-shard-bar-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.wild-shard-bar-text {
  font-size: 0.95rem;
  font-weight: 900;
  color: #ffffff;
}

.wild-shard-bar-hint {
  margin-left: auto;
  font-size: 0.72rem;
  color: #8a6a48;
  text-align: right;
}

.collection-card-wild {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  border: 2px solid #c9a8ef;
  background: #f6ecff;
  color: #4a2a7a;
  font-size: 0.72rem;
  font-weight: 800;
}

.collection-card-wild-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.popup-card--wild {
  max-width: 360px;
  gap: 8px;
  text-align: center;
}

.wild-art {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  object-fit: contain;
}

.wild-label,
.wild-progress,
.wild-note {
  margin: 0;
  color: #4d3420;
}

.wild-label {
  font-size: 1rem;
  font-weight: 900;
}

.wild-progress {
  padding: 4px 8px;
  border-radius: 10px;
  background: #fff3cf;
  font-size: 0.9rem;
  font-weight: 800;
}

.wild-note {
  font-size: 0.75rem;
  color: #8a6a48;
}

.wild-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.wild-step {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #ffd34e;
  background: #2f7ee6;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 900;
  box-shadow: 0 3px 0 #1c4f9a;
}

.wild-step:disabled {
  filter: grayscale(1);
  opacity: 0.6;
}

.wild-count {
  min-width: 64px;
  padding: 4px 10px;
  border-radius: 12px;
  background: #ffffff;
  border: 2px solid #e7cfa6;
  font-size: 1.6rem;
  font-weight: 900;
  color: #3f2a14;
}

.wild-actions {
  display: flex;
  gap: 8px;
}

.wild-actions .btn {
  flex: 1 1 0;
}
