/* Observation memories live outside the device; the 480px display stays unchanged. */
.memory-panel {
  min-width: 0;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #dce6cf;
  border-radius: 12px;
  background: linear-gradient(145deg, #fbfcf8, #f2f6eb);
  box-shadow: 0 5px 18px #31492506;
  color: #355235;
  overflow-wrap: anywhere;
}
.memory-panel[hidden] { display: none !important; }
.memory-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
}
.memory-heading > span {
  color: #789264;
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: .6px;
}
.memory-heading > strong {
  max-width: 100%;
  color: #355235;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}
#memory-summary {
  margin: 10px 0 12px;
  color: #687e5c;
  font-size: 11px;
  line-height: 1.85;
}
#memory-summary:empty { display: none; }
.memory-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.memory-list:empty { display: none; }
.memory-panel .memory-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  width: 100%;
  min-width: 0;
  min-height: 74px;
  margin: 0;
  padding: 11px;
  border: 1px solid #e0e8d7;
  border-radius: 10px;
  background: #ffffffc7;
  color: #385435;
  text-align: left;
}
.memory-panel .memory-card > img {
  display: block;
  width: 48px;
  height: 48px;
  max-width: 100%;
  border-radius: 8px;
  object-fit: cover;
  background: #e7eee1;
}
.memory-panel .memory-card > span:not(.memory-medal) {
  display: block;
  min-width: 0;
}
.memory-panel .memory-card strong,
.memory-panel .memory-card small {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.memory-panel .memory-card strong {
  color: #385435;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}
.memory-panel .memory-card small {
  margin-top: 3px;
  color: #7a8b6e;
  font-size: 10px;
  line-height: 1.65;
}
.memory-panel button.memory-card:hover {
  border-color: #b5c99e;
  background: #f4f8ee;
}
.memory-panel button.memory-card:focus-visible {
  outline: 3px solid #91b36a;
  outline-offset: 3px;
}
.memory-panel .memory-card[aria-pressed="true"],
.memory-panel .memory-card.is-selected {
  border-color: #91ad76;
  background: #edf4e4;
  box-shadow: inset 0 0 0 1px #91ad7620;
}
.memory-collection {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid #dfe8d5;
}
.memory-collection:empty { display: none; }
.memory-collection-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 3px 8px;
  min-width: 0;
  margin-bottom: 1px;
}
.memory-collection-heading strong {
  font-size: 11px;
  line-height: 1.6;
  font-weight: 600;
  color: #506c42;
}
.memory-collection-heading small {
  color: #8a997d;
  font-size: 9px;
  line-height: 1.6;
}
.memory-collection .memory-card {
  border-color: #d9e4c9;
  background: #f5f8ed;
}
.memory-collection .memory-card.is-new {
  border-color: #b0c58a;
  background: linear-gradient(120deg, #f9fbf3, #edf4dd);
}
.memory-medal {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #d4dfbf;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #f6f9e8, #e1ebc8 75%);
  color: #7b9750;
  box-shadow: inset 0 1px 0 #fff9;
}
.memory-medal svg {
  display: block;
  width: 30px;
  height: 30px;
  max-width: 100%;
  color: inherit;
  --vein: #edf4d9;
}
.memory-empty {
  margin: 0;
  color: #849375;
  font-size: 10px;
  line-height: 1.8;
}
.memory-details{margin:0;padding:0 0 0 17px;font-size:11px;line-height:1.8;color:#718565}
.memory-details li{margin:7px 0}.memory-details strong,.memory-details span{display:block}.memory-details strong{font-weight:500;color:#49663e}
.memory-cards{display:grid;gap:8px;max-height:268px;overflow:auto;scrollbar-width:thin;padding:2px}
.memory-theme{min-height:44px;border:1px solid #cddbbd!important;border-radius:8px;font-size:11px;background:#fff!important}

/* New screen states contain one short reward label, never the recap text. */
.screen[data-state="reflection"] .screen-word {
  font-size: 67px;
  letter-spacing: 2px;
}
.screen[data-state="reflection"] svg.screen-icon { animation: none; }
.screen[data-state="souvenir"] .screen-word {
  font-size: 52px;
  letter-spacing: 1.5px;
}
.screen[data-state="souvenir"] svg.screen-icon {
  animation: memory-souvenir-pop .7s cubic-bezier(.2, .8, .2, 1.1) both;
}
@keyframes memory-souvenir-pop {
  0% { opacity: .35; transform: scale(.72); }
  65% { opacity: 1; transform: scale(1.07); }
  100% { opacity: 1; transform: scale(1); }
}

@media (max-width: 760px) {
  .memory-panel { margin-top: 16px; padding: 15px; }
  .memory-heading > strong { font-size: 16px; }
  #memory-summary { font-size: 12px; }
  .memory-panel .memory-card { gap: 12px; min-height: 76px; }
  .memory-panel .memory-card strong { font-size: 13px; }
  .memory-panel .memory-card small { font-size: 11px; }
}
@media (max-width: 390px) {
  .memory-panel { padding: 12px; }
  .memory-panel .memory-card {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 10px;
    gap: 9px;
  }
  .memory-panel .memory-card > img,
  .memory-medal { width: 42px; height: 42px; }
  .memory-medal svg { width: 27px; height: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  .screen[data-state="souvenir"] svg.screen-icon { animation: none; }
}
