/* workspace/rapidprototypes/surfacewalk/css/cards.css */
/* The full-screen cards and what goes with them, linked by index.html after its style block: the game over and fate */
/* card (#hud-gameover) and the win card (#hud-win) share the class card-screen and the fate card layout; then the death */
/* card gallery (js/fate-gallery.js), the goal line under the scan count and the gold specimen banner (js/main-goal.js). */
.card-screen {
  position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding: 15vh 16px 16px; z-index: 25;
  background: radial-gradient(ellipse at 50% 62%, rgba(40, 8, 12, 0.3) 0%, rgba(4, 5, 10, 0.86) 75%);
}
.gameover-box { width: min(440px, 100%); padding: 26px 28px 24px; text-align: center; }
.gameover-label { font-size: 12px; font-weight: 700; letter-spacing: 4px; text-transform: uppercase; color: var(--danger); }
.gameover-title { font-size: 38px; font-weight: 800; line-height: 1.1; margin: 6px 0 12px; letter-spacing: -0.5px; }
.gameover-result { font-size: 15px; line-height: 1.45; color: var(--muted); margin-bottom: 22px; }
.gameover-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.gameover-buttons button {
  padding: 11px 22px; border-radius: 999px; cursor: pointer; font: 700 15px var(--font);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#hud-try-again, #win-keep-exploring {
  border: 0; color: #2b1606; background: linear-gradient(180deg, #ffc27f 0%, var(--accent) 55%, var(--accent-deep) 100%);
  box-shadow: 0 6px 18px rgba(240, 138, 60, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
#hud-gameover-new-planet, #win-new-planet, .gallery-open-button { border: 1px solid rgba(255, 255, 255, 0.28); color: var(--text); background: rgba(255, 255, 255, 0.08); }
.gameover-buttons button:hover { transform: translateY(-1px); }
.gameover-buttons button:active { transform: translateY(1px); }
.gameover-buttons button:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.7); outline-offset: 2px; }
/* The fate card (Fates.show adds the class fate to #hud-gameover, MainGoal.win to #hud-win): the view fades to black in 0.9 s, then the card */
/* fades in, centred. Wide windows: the square picture on the left, min(420px, 56vh) on each side, and the label, */
/* title, caption, numbers line and buttons on the right in rows 2 to 6; rows 1 and 7 share the spare height, so the */
/* text sits in the middle of the picture's height. The picture (800 by 800) shows whole; the placeholder canvas */
/* (1600 by 900) is cropped to its centre, and the picture fades in over it in 0.25 s once loaded (the class loaded). */
.fate-picture, .fate-caption { display: none; }
.card-screen.fate { padding: 16px; overflow-y: auto; background: rgba(0, 0, 0, 0.94); animation: fate-fade 0.9s ease-in 1 both; }
@keyframes fate-fade { from { background-color: rgba(0, 0, 0, 0); } to { background-color: rgba(0, 0, 0, 0.94); } }
.card-screen.fate .gameover-box {
  --fate-picture-size: min(420px, 56vh);
  display: grid; grid-template-columns: var(--fate-picture-size) minmax(0, 380px); grid-template-rows: minmax(24px, 1fr) repeat(5, auto) minmax(24px, 1fr);
  width: auto; max-width: 100%; margin: auto; padding: 0; overflow: hidden; text-align: left; animation: fate-card-in 0.6s ease-out 0.9s 1 both;
}
@keyframes fate-card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card-screen.fate .fate-picture {
  display: block; position: relative; grid-column: 1; grid-row: 1 / -1; align-self: center; width: var(--fate-picture-size); aspect-ratio: 1 / 1;
  background: #05070c;
}
.fate-picture canvas, .fate-picture img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.fate-picture img { opacity: 0; transition: opacity 0.25s ease; }
.fate-picture img.loaded { opacity: 1; }
.card-screen.fate .gameover-label { grid-column: 2; grid-row: 2; margin: 0 30px; }
.card-screen.fate .gameover-title { grid-column: 2; grid-row: 3; font-size: 32px; margin: 4px 30px 10px; }
.card-screen.fate .fate-caption { grid-column: 2; grid-row: 4; display: block; margin: 0 30px 14px; font-size: 17px; line-height: 1.45; color: var(--text); }
.card-screen.fate .gameover-result { grid-column: 2; grid-row: 5; margin: 0 30px 22px; font-size: 13px; font-variant-numeric: tabular-nums; }
.card-screen.fate .gameover-buttons { grid-column: 2; grid-row: 6; justify-content: flex-start; padding: 0 30px; }
/* Windows 760 px wide or less: the picture full width at the top of the card and the text centred under it. */
@media (max-width: 760px) {
  .card-screen.fate .gameover-box { display: block; width: min(440px, 100%); padding: 0 0 20px; text-align: center; }
  .card-screen.fate .fate-picture { width: 100%; margin-bottom: 16px; }
  .card-screen.fate .gameover-label, .card-screen.fate .gameover-title { margin-left: 20px; margin-right: 20px; }
  .card-screen.fate .gameover-title { font-size: 28px; }
  .card-screen.fate .fate-caption { margin: 0 20px 12px; }
  .card-screen.fate .gameover-result { margin: 0 20px 18px; }
  .card-screen.fate .gameover-buttons { justify-content: center; padding: 0 20px; }
}
@media (max-width: 760px) {
  .gameover-box { padding: 22px 18px 20px; }
  .gameover-title { font-size: 30px; }
}
/* The win card: the label in the scanner's glow instead of the danger red. */
#hud-win .gameover-label { color: var(--glow); }
/* The goal line under the scan count (MainGoal.refresh); green once the goal is done. */
#hud-goal { margin-top: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
#hud-goal:empty { display: none; }
#hud-goal.done { color: #9cf0a8; }
/* The gold specimen banner: slides in at the top centre, shimmers and fades after 4.5 s (the class show). */
#hud-gold {
  position: fixed; top: 64px; left: 50%; transform: translate(-50%, -12px); padding: 9px 20px; border-radius: 999px; z-index: 14;
  font: 800 15px var(--font); letter-spacing: 0.6px; color: #3a2400; pointer-events: none; opacity: 0; white-space: nowrap;
  background: linear-gradient(100deg, #e0a023 0%, #ffe08a 45%, #fff6d0 50%, #ffe08a 55%, #e0a023 100%); background-size: 240% 100%;
  box-shadow: 0 0 22px rgba(255, 194, 58, 0.6);
}
#hud-gold.show { animation: gold-in 4.5s ease-out 1 both, gold-shine 1.6s linear infinite; }
@keyframes gold-in {
  0% { opacity: 0; transform: translate(-50%, -12px) scale(0.9); } 8% { opacity: 1; transform: translate(-50%, 0) scale(1.06); }
  14% { transform: translate(-50%, 0) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, 0); }
}
@keyframes gold-shine { from { background-position: 100% 0; } to { background-position: -140% 0; } }
/* The Death cards button in the top row and the gallery button on the cards. */
#hud-gallery-button { padding: 9px 13px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.22); cursor: pointer; }
#hud-gallery-button { color: var(--text); background: rgba(14, 18, 28, 0.62); font: 700 13px var(--font); }
#hud-gallery-button:hover { background: rgba(40, 46, 66, 0.78); }
#hud-gallery-button:focus-visible, #hud-gallery button:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.7); outline-offset: 2px; }
/* The death card gallery (FateGallery): a grid of every card over a dark screen; a card not seen yet is a dark outline. */
#hud-gallery { position: fixed; inset: 0; z-index: 30; display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; }
#hud-gallery { padding: 6vh 16px 16px; background: rgba(2, 3, 8, 0.9); }
.gallery-box { width: min(940px, 100%); padding: 20px 22px 22px; }
.gallery-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.gallery-title { font-size: 22px; font-weight: 800; }
#gallery-count { margin-left: 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
#gallery-close { padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.28); }
#gallery-close { color: var(--text); background: rgba(255, 255, 255, 0.08); font: 700 14px var(--font); cursor: pointer; }
#gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gallery-card { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 3 / 4; display: flex; flex-direction: column; }
.gallery-card.seen { background: #0b0e16; border: 1px solid rgba(255, 255, 255, 0.18); }
.gallery-card.seen img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: #05070c; }
.gallery-card.unseen { border: 2px dashed rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.02); }
.gallery-mark { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 46px; font-weight: 800; color: rgba(255, 255, 255, 0.1); }
.gallery-name { padding: 8px 10px 2px; font-size: 14px; font-weight: 800; }
.gallery-card.unseen .gallery-name { color: rgba(255, 255, 255, 0.28); text-align: center; padding-bottom: 12px; }
.gallery-times { padding: 0 10px 8px; font-size: 11px; color: var(--muted); }
#gallery-records { margin-top: 16px; font-size: 13px; line-height: 1.5; color: var(--muted); }
