/* Certificates and cards (cards.js): drawn in the page, printed alone. */
.cd-wrap { color: var(--foam, #e9f4f8); }
.cd-sheet { display: grid; place-items: center; margin: 4px 0 12px; }
.cd { width: 100%; max-width: 720px; color: #13212e; font-family: Georgia, "Times New Roman", serif; }
.cd-cert { background: #fbf6e8; border: 3px double #a86b32; outline: 6px solid #fbf6e8; box-shadow: 0 0 0 9px #c9973f; border-radius: 6px;
  padding: 22px 26px 16px; }
.cd-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cd-title { text-align: center; flex: 1; }
.cd-title small { display: block; font: 600 13px Oswald, sans-serif; letter-spacing: .3em; text-transform: uppercase; color: #a86b32; }
.cd-title b { display: block; font: 700 clamp(26px, 5vw, 40px) Oswald, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #0f2a44; }
.cd-flag { width: 64px; height: auto; border: 1px solid #13212e; }
.cd-insignia { width: 64px; height: 64px; object-fit: contain; }
.cd-mid { display: flex; gap: 20px; align-items: center; margin: 14px 0 8px; }
.cd-frame { flex: 0 0 150px; height: 190px; background: #fff; border: 2px solid #13212e; border-radius: 8px; padding: 6px; display: grid; place-items: center; }
.cd-frame.small { flex: 0 0 96px; height: 120px; }
.cd-you { width: 100%; height: 100%; object-fit: contain; }
.cd-text { flex: 1; text-align: center; }
.cd-text p { margin: 2px 0; font-size: 16px; color: #34414d; }
.cd-text h2 { margin: 4px 0; font: italic 700 clamp(22px, 4vw, 30px) Georgia, serif; color: #0f2a44; }
.cd-text h3 { margin: 4px 0; font: 700 22px Oswald, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #a86b32; }
.cd-crew { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; border-top: 1px solid #d8c9a3; padding-top: 8px; }
.cd-crew img { width: 70px; height: 96px; object-fit: contain; }
.cd-reserve { text-align: center; font-style: italic; color: #5b6b7a; }
.cd-awards { display: flex; gap: 8px; justify-content: center; margin-top: 6px; }
.cd-awards img { width: 46px; height: 46px; object-fit: contain; }
.cd-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 14px; color: #5b6b7a; }
.cd-seal { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #d6453d; color: #fff; font-size: 22px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .5); }
/* the fleet photo: a polaroid, white frame, thick bottom margin, handwritten caption, a slight tilt */
.cd-photo { max-width: 440px; background: #fff; padding: 14px 14px 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transform: rotate(-1.5deg); border-radius: 2px; }
.cd-shot { position: relative; background: linear-gradient(180deg, #b7d3e3 0, #8ebcd6 55%, #1f6fa8 100%); aspect-ratio: 4 / 3; overflow: hidden; }
.cd-sea { position: absolute; left: 0; right: 0; top: 8%; }
.cd-ships { width: 100%; height: auto; }
.cd-group { position: absolute; left: 4%; right: 4%; bottom: 4%; display: flex; align-items: flex-end; gap: 4px; }
.cd-group .cd-crew { border: 0; padding: 0; flex-wrap: nowrap; gap: 0; }
.cd-group .cd-crew img { width: 54px; height: 76px; }
.cd-group .cd-flag { width: 46px; align-self: flex-start; margin-left: auto; }
.cd-hand { margin: 10px 4px 0; font: 22px "Segoe Print", "Bradley Hand", "Comic Sans MS", cursive; color: #13212e; text-align: center; }
.cd-hand.small { font-size: 15px; margin-top: 2px; color: #5b6b7a; }
.cd-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cd-faces { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.cd-facebtn { width: 74px; height: 74px; padding: 2px; border-radius: 10px; border: 2px solid var(--line, #33506b); background: #fff; cursor: pointer; }
.cd-facebtn img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
#cdPrintArea { display: none; }
@media (max-width: 560px) {
  .cd-mid { flex-direction: column; gap: 10px; }
  .cd-frame { flex-basis: auto; width: 130px; height: 160px; }
  .cd-crew img { width: 48px; height: 66px; }
  .cd-cert { padding: 16px 12px 12px; }
}
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body.cd-printing > *:not(#cdPrintArea) { display: none !important; }
  html, body.cd-printing { background: #fff !important; }
  body.cd-printing { min-height: 0 !important; }
  body.cd-printing #cdPrintArea { display: grid !important; place-items: center; min-height: 170mm; }
  body.cd-printing .cd { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* the easter egg: a midshipman peeks in from the corner (egg.js) */
.egg-peek { position: fixed; left: 14px; bottom: -150px; width: 92px; z-index: 30; cursor: pointer; transition: bottom .8s ease, transform .4s ease;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35)); }
.egg-peek.up { bottom: -18px; }
.egg-peek.salute { transform: rotate(-8deg); }
.egg-bubble { position: fixed; left: 96px; bottom: 96px; z-index: 31; background: #fff; color: #13212e; border: 2px solid #13212e; border-radius: 12px;
  padding: 6px 12px; font: 600 15px Oswald, sans-serif; letter-spacing: .04em; }
@media (prefers-reduced-motion: reduce) { .egg-peek { transition: none; } }
