/* The archive uses the ethereal paper, starlight and velvet rose palette. */
.archive-entry {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid rgba(255, 236, 190, 0.55);
  border-radius: 22px;
  color: #fff9ed;
  background: linear-gradient(135deg, #463056 0%, #6e4468 52%, #865276 100%);
  box-shadow: 0 12px 32px rgba(85, 40, 75, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.32);
  text-align: left;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.archive-entry:active {
  transform: scale(0.97);
  box-shadow: 0 4px 14px rgba(85, 40, 75, 0.25);
}
.archive-entry > span:nth-child(2) { flex: 1; }
.archive-entry strong { display: block; font-size: 17px; letter-spacing: .15em; text-shadow: 0 1px 4px rgba(0,0,0,0.25); }
.archive-entry small { display: block; margin-top: 6px; font-size: 11.5px; line-height: 1.7; color: #fcebeb; }
.archive-symbol { font-size: 34px; color: #ffe6aa; filter: drop-shadow(0 0 10px rgba(255, 230, 170, 0.6)); }

.cloud-wrap { padding: 6px 2px 16px; display: flex; flex-direction: column; gap: 15px; }
.cloud-wrap p { margin: 0; white-space: pre-line; }
.cloud-heading { margin: 0; font-size: 22px; text-align: center; color: var(--plum); }
.cloud-lead { font-size: 15.5px; line-height: 1.85; text-align: center; color: var(--plum-soft); }
.cloud-form { display: flex; flex-direction: column; gap: 14px; }
.cloud-field {
  width: 100%;
  font-size: 16px;
  resize: vertical;
  min-height: 120px;
  padding: 14px 16px;
  border: 1px solid rgba(210, 160, 190, 0.6);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--plum);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.04);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.cloud-counter { text-align: right; color: #8a6c82; font-size: 12px; }
.cloud-privacy { font-size: 12px; line-height: 1.8; color: #7e6679; }
.cloud-consent {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 15px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 12px rgba(110, 45, 80, 0.05);
  font-size: 13px;
  line-height: 1.7;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color 0.3s ease;
}
.cloud-consent input { width: 19px; height: 19px; flex-shrink: 0; margin: 2px 0 0; accent-color: #be5885; }
.cloud-status { font-size: 13.5px; line-height: 1.75; color: #72556d; text-align: center; }
.cloud-status:empty { display: none; }
.cloud-status.is-error { color: #b52c54; }
.cloud-success-symbol { text-align: center; color: #cf8a48; font-size: 48px; filter: drop-shadow(0 0 16px rgba(255, 210, 140, 0.6)); }

.cloud-entries { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.cloud-entries li, .legacy-wish {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 18px rgba(110, 45, 80, 0.06), inset 0 1px 1px #fff;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.cloud-entries p, .legacy-wish p { overflow-wrap: anywhere; line-height: 1.8; font-size: 15.5px; color: var(--plum); margin: 0; }
.cloud-entries small { display: block; margin-top: 10px; font-size: 11.5px; color: #856a7d; }
.legacy-wishes { border-top: 1px dashed #d5b8c7; padding-top: 14px; }
.legacy-wishes summary { font-size: 13px; padding: 8px 0; cursor: pointer; color: var(--coral-deep); font-weight: 500; }
.legacy-wish { margin-top: 10px; }

.game-hero {
  padding: 22px 16px 24px;
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(255, 248, 252, 0.95), rgba(255, 242, 230, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 36px -6px rgba(140, 60, 100, 0.12), inset 0 1px 2px #fff;
  text-align: center;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.game-kicker { color: #9f5e7f; font-size: 10.5px; letter-spacing: .22em; line-height: 1.7; text-align: center; font-weight: 600; }
.game-title { margin: 12px 0 8px; font-family: var(--hand); font-size: 26px; line-height: 1.45; text-align: center; color: var(--plum); }
.game-intro { font-size: 13.5px; line-height: 1.95; color: #6d5467; }
.game-progress-label { margin-top: 18px !important; font-size: 12.5px; color: #8e4f74; font-weight: 600; letter-spacing: .06em; }
.game-meter {
  height: 8px;
  margin: 10px 0 22px;
  border-radius: 999px;
  background: rgba(120, 50, 85, 0.1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.game-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #be6b9f 0%, #e88d6c 100%);
  border-radius: inherit;
  box-shadow: 0 0 12px rgba(232, 141, 108, 0.6);
  transition: width 0.7s var(--ease-out);
}
.game-primary {
  width: 100%;
  background: linear-gradient(135deg, #78486f 0%, #ab567b 100%);
  color: #fff9f2;
  box-shadow: 0 8px 22px rgba(120, 50, 85, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.game-chapter h5 { font-size: 12.5px; letter-spacing: .12em; color: #825374; margin: 14px 0 10px; font-weight: 600; }
.game-levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.level-node {
  height: 48px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.85);
  color: #8c7387;
  font-size: 14.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 3px 8px rgba(110, 45, 80, 0.05), inset 0 1px 1px #fff;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform 0.35s var(--spring), box-shadow 0.35s var(--spring), background 0.3s ease;
}
.level-node:not(:disabled):active {
  transform: scale(0.92);
}
.level-node.done {
  background: linear-gradient(135deg, #fdf0df 0%, #f4d8b6 100%);
  color: #7b4f24;
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 14px rgba(214, 163, 102, 0.28), inset 0 1px 1px #fff;
}
.level-node.current {
  color: #fff;
  background: linear-gradient(135deg, #8a537d 0%, #aa5f88 100%);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 4px 18px rgba(150, 75, 120, 0.4), 0 0 0 3px rgba(210, 160, 195, 0.45);
  animation: current-pulse 2.4s ease-in-out infinite;
}
@keyframes current-pulse {
  0%, 100% { box-shadow: 0 4px 18px rgba(150, 75, 120, 0.35), 0 0 0 3px rgba(210, 160, 195, 0.35); }
  50% { box-shadow: 0 6px 24px rgba(150, 75, 120, 0.55), 0 0 0 5px rgba(210, 160, 195, 0.55); }
}
.level-node:disabled { cursor: default; opacity: .55; }

.game-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.game-nav > span { color: #8a6479; font-size: 13px; font-weight: 500; }
.game-nav .btn-text { margin: 0; padding: 8px 4px; font-size: 13px; }
.puzzle-prompt { font-size: 15px; line-height: 1.85; color: var(--plum); }
.puzzle-evidence {
  font-family: ui-monospace, Menlo, Monaco, monospace;
  font-size: 14.5px;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  padding: 18px 16px;
  color: #4a334a;
  background: rgba(248, 241, 246, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  box-shadow: inset 0 2px 6px rgba(90, 40, 70, 0.04), 0 4px 14px rgba(90, 40, 70, 0.05);
  tab-size: 4;
  user-select: text;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.puzzle-form { display: grid; gap: 14px; margin-top: 10px; }
.puzzle-answer {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 15px 18px;
  border: 1.5px solid rgba(210, 160, 190, 0.55);
  border-radius: 16px;
  color: #4b2c4a;
  background: rgba(255, 255, 255, 0.9);
  font: inherit;
  font-size: 16.5px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.puzzle-answer:focus, .cloud-field:focus {
  outline: none;
  border-color: #b26895;
  box-shadow: 0 0 0 4px rgba(178, 104, 149, 0.2);
}
.cloud-wrap button:focus-visible, .cloud-wrap a:focus-visible { outline: 2px solid #8c547c; outline-offset: 3px; }
.cloud-wrap button:disabled { opacity: .6; cursor: wait; }
.puzzle-hints { display: grid; gap: 9px; margin-top: 10px; }
.puzzle-hints p {
  padding: 13px 15px;
  background: linear-gradient(145deg, #fff7eb, #fceddb);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 15px;
  font-size: 13.5px;
  line-height: 1.8;
  color: #724c25;
  box-shadow: 0 4px 12px rgba(180, 110, 60, 0.08);
}
.puzzle-kindness { font-size: 12.5px; text-align: center; color: #936b80; line-height: 1.8; margin-top: 8px; }
.puzzle-notes { border: 1px dashed #d5b8c7; border-radius: 16px; padding: 0 14px 12px; }
.puzzle-notes:not([open]) { padding-bottom: 0; }
.puzzle-notes summary { padding: 13px 0; cursor: pointer; font-size: 13px; color: #825374; }
.puzzle-scratch { min-height: 100px; margin-bottom: 8px; font-size: 16px; }
.victory-star {
  font-size: 72px;
  text-align: center;
  line-height: 1.25;
  color: #d19545;
  text-shadow: 0 0 36px rgba(255, 225, 150, 0.8);
  animation: star-glow 2.5s ease-in-out infinite alternate;
}
@keyframes star-glow {
  0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(255, 215, 140, 0.6)); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 25px rgba(255, 215, 140, 0.9)); }
}
.puzzle-praise {
  padding: 22px 18px;
  font-family: var(--hand);
  font-size: 18.5px;
  line-height: 1.95;
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 243, 225, 0.95), rgba(255, 230, 240, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(140, 60, 100, 0.1);
  color: var(--plum);
}
.puzzle-explanation, .puzzle-review, .notebook-clue { font-size: 13.5px; line-height: 1.85; }
.puzzle-solved { text-align: center; color: #9b6129; font-size: 13.5px; font-weight: 500; }
.puzzle-review summary, .notebook-clue summary { cursor: pointer; padding: 10px 0; font-weight: 500; color: var(--coral-deep); }
.puzzle-review p, .notebook-clue p {
  padding: 13px 15px;
  background: rgba(245, 235, 242, 0.85);
  border-radius: 14px;
  color: var(--plum);
}
.notebook-clue { border-bottom: 1px solid #ebdbe5; }
.prize-wrap { text-align: center; }
.prize-stars {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 13px;
  padding: 24px 20px;
  border-radius: 24px;
  background: linear-gradient(145deg, #3a2546 0%, #5d385a 52%, #754467 100%);
  color: #ffe4ad;
  box-shadow: 0 16px 40px rgba(55, 25, 50, 0.35), inset 0 1px 1px rgba(255, 230, 180, 0.3);
  border: 1px solid rgba(255, 230, 180, 0.3);
}
.prize-stars span { font-size: 20px; filter: drop-shadow(0 0 6px rgba(255, 220, 160, 0.6)); }
.prize-stars span:nth-child(3n) { opacity: .75; font-size: 15px; }
.prize-subtitle { color: #9c6077; font-size: 13.5px; font-weight: 500; }
.prize-letter { font-family: var(--hand); font-size: 17.5px; line-height: 2; text-align: left; padding: 14px; color: var(--plum); }
.prize-gift {
  white-space: pre-line;
  line-height: 1.95;
  font-size: 16.5px;
  padding: 26px 20px;
  border-radius: 20px;
  border: 1px solid #e0c598;
  background: linear-gradient(145deg, #fff4e0, #ffebd0);
  box-shadow: 0 10px 30px rgba(180, 110, 60, 0.12);
  color: #55341a;
}
.prize-claim { font-size: 12.5px; line-height: 1.9; color: #865f73; overflow-wrap: anywhere; }
.prize-card-preview { width: 100%; height: auto; border-radius: 18px; margin: 14px 0; box-shadow: 0 12px 36px rgba(60, 20, 50, 0.25); }

@media (max-width: 350px) {
  .game-levels { gap: 6px; }
  .game-title { font-size: 22px; }
  .puzzle-evidence { font-size: 12.5px; padding: 14px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .level-node.current, .victory-star { animation: none; }
}
