*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--paper);color:var(--ink);font:600 15px/1.5 "Nunito Sans",sans-serif}img{display:block;max-width:100%}h1,h2,h3{font-family:"Lilita One";font-weight:400;margin:0}
.adventure-hero{background:var(--night);color:var(--cream);padding:88px max(24px,calc((100vw - 1180px)/2)) 118px;display:flex;justify-content:space-between;gap:40px;align-items:end}
.adventure-hero>div{width:100%}
.adventure-hero h1{font-size:clamp(48px,6vw,74px);line-height:.95;color:var(--mango);max-width:none;text-wrap:balance}
.adventure-hero p{font-size:18px;max-width:650px;margin:17px 0 0;color:rgba(255,241,210,.78)}

/* .hero-back and .header-menu now live in common.css — every Club page needs
   them, not just this one. Do not re-add local copies here. */

/* Flag of the day — a big, rounded white card sitting inside the normal
   1180px content column, pulled up so the navy hero runs down behind
   roughly the top half of it (same floating-card idea as the original,
   just considerably bigger — not a full-bleed coloured band). */
.flag-of-day{max-width:1180px;margin:-92px auto 0;padding:0 max(24px,calc((100vw - 1180px)/2));position:relative;z-index:2}
.fod-card{width:100%;display:flex;align-items:center;gap:30px;background:var(--white);border:2px solid var(--ink);border-radius:26px;padding:32px 36px;box-shadow:0 10px 0 var(--ink)}
.fod-flag{width:170px;height:127px;object-fit:cover;border:3px solid var(--ink);border-radius:14px;flex:0 0 auto;box-shadow:0 6px 0 var(--ink)}
.fod-copy{flex:1 1 auto;min-width:0}
.fod-copy span{display:block;font:900 12px "Nunito Sans";text-transform:uppercase;letter-spacing:1.5px;color:var(--teal-d)}
.fod-copy h3{font-size:clamp(28px,3.6vw,42px);margin:5px 0 3px;color:var(--night)}
.fod-copy p{margin:0;color:#677175;font-weight:700;font-size:15px}
.fod-button{flex:0 0 auto;border:2px solid var(--ink);border-radius:14px;padding:16px 22px;background:var(--orange);color:#fff;font:900 14px "Nunito Sans";cursor:pointer;white-space:nowrap;box-shadow:0 6px 0 var(--ink)}
.fod-button:hover{filter:brightness(1.08)}
.fod-button:active{transform:translateY(4px);box-shadow:none}
@media(max-width:650px){.adventure-hero{padding-bottom:130px}.flag-of-day{margin-top:-40px;padding:0 16px}.fod-card{flex-wrap:wrap;padding:26px 22px;border-radius:22px}.fod-flag{width:120px;height:90px}.fod-button{width:100%}}

/* Continent shelf — each button is a small mosaic of that continent's own
   real flags (not the Colouring Adventures cover art, which doesn't
   belong on a flags-focused page). */
.continent-shelf{display:flex;gap:15px;overflow-x:auto;padding:30px max(24px,calc((100vw - 1180px)/2));background:var(--mango);scroll-snap-type:x mandatory;margin-top:26px}
.continent-button{position:relative;flex:0 0 145px;border:0;background:transparent;padding:0;cursor:pointer;scroll-snap-align:start;color:var(--ink)}
.continent-mosaic{display:grid;grid-template-columns:repeat(2,1fr);gap:3px;aspect-ratio:1054/1492;border:2px solid var(--ink);border-radius:12px;box-shadow:0 5px 0 var(--ink);overflow:hidden;background:#fff}
.continent-mosaic img{width:100%;height:100%;object-fit:cover;display:block}
.continent-label{display:block;font:18px "Lilita One";margin-top:11px}
.continent-button.active .continent-mosaic{outline:5px solid var(--orange);outline-offset:3px}

.library{max-width:1180px;margin:0 auto;padding:65px 24px 90px}
.library-head{display:flex;align-items:end;justify-content:space-between;gap:25px}
.library-head h2{font-size:48px;line-height:1}
.library-head p{margin:8px 0 0;color:#677175}
.selection-bar{display:flex;align-items:center;gap:12px;background:var(--white);border:2px solid var(--ink);border-radius:16px;padding:12px 14px;margin:28px 0 25px;box-shadow:0 5px 0 var(--ink)}
.selection-bar span{margin-right:auto}
.selection-bar strong{font:22px "Lilita One"}
.selection-bar button{border:0;border-radius:99px;padding:9px 14px;font:900 11px "Nunito Sans";cursor:pointer;background:#e4d8c1}
.selection-bar .print-selected{background:var(--orange);color:white}
.selection-bar .print-selected:disabled{opacity:.4;cursor:not-allowed}
.page-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:22px}
.page-card{background:var(--white);border:2px solid var(--ink);border-radius:17px;overflow:hidden;box-shadow:0 6px 0 var(--ink)}
.page-thumb{position:relative;background:white}
.page-thumb img{width:100%;aspect-ratio:4/3;object-fit:cover}
.select-page{position:absolute;top:10px;right:10px;width:34px;height:34px;border:2px solid var(--ink);border-radius:50%;background:white;font-weight:900;cursor:pointer}
.page-card.selected .select-page{background:var(--teal);color:white}
.page-copy{padding:15px}
.page-copy small{font-weight:900;text-transform:uppercase;letter-spacing:1px;color:var(--teal)}
.page-copy h3{font-size:20px;margin:4px 0 12px}
.page-actions{display:flex;gap:6px}
.page-actions button,.page-actions a{flex:1;border:0;border-radius:9px;padding:8px;text-align:center;text-decoration:none;font:900 10px "Nunito Sans";cursor:pointer;background:#e9deca;color:var(--ink)}
.page-actions .view{background:var(--night);color:var(--cream)}

/* Locked (guest) cards. Every country of the continent is still there and
   still named - the flag is dimmed and the actions collapse to one join
   prompt, so the library reads as complete but gated rather than empty. */
.page-card.locked{box-shadow:0 6px 0 rgba(11,26,44,.35);border-color:rgba(11,26,44,.5)}
.page-card.locked .page-thumb img{filter:saturate(.25) opacity(.55)}
.page-card.locked .page-copy h3{color:rgba(11,26,44,.75)}
.lock-page{position:absolute;top:10px;right:10px;width:34px;height:34px;border:2px solid var(--ink);border-radius:50%;background:var(--white);display:grid;place-items:center;font-size:15px;line-height:1}
.page-actions .locked-action{background:var(--night);color:var(--cream);opacity:.9}
.guest-library-panel{margin:28px 0 25px}

.preview-dialog{width:96vw;height:92vh;padding:0;border:0;border-radius:16px;background:var(--night);color:var(--cream);overflow:hidden}
.preview-dialog::backdrop{background:rgba(2,11,23,.82);backdrop-filter:blur(7px)}
.dialog-close{position:absolute;right:16px;top:14px;z-index:2;width:42px;height:42px;border:0;border-radius:50%;font-size:27px;background:var(--orange);color:white;cursor:pointer}
.dialog-image{height:calc(100% - 88px);display:grid;place-items:center;padding:20px}
.dialog-actions{height:88px;display:flex;align-items:center;gap:12px;padding:14px 24px;background:#020b17}
.dialog-actions h2{margin-right:auto}
.dialog-actions button{border:0;border-radius:11px;padding:11px 15px;background:var(--orange);color:white;text-decoration:none;font-weight:900;cursor:pointer}

/* The flag sheet — used both as a scaled-down live preview inside the
   dialog and, unscaled, as the actual print page. Always laid out at true
   A4-landscape mm dimensions; the preview just wraps it in a box and
   scales it down with a CSS transform computed in JS, so the two never
   drift apart. */
.sheet-preview-wrap{width:min(90%,1000px);aspect-ratio:297/210;position:relative;overflow:hidden;background:#ccc}
.sheet-preview-wrap .flag-sheet{box-shadow:0 4px 20px rgba(0,0,0,.3);transform-origin:top left}
.flag-sheet{width:297mm;height:210mm;position:relative;background:#fff;overflow:hidden;font-family:"Lilita One",cursive}
.flag-sheet .country-title{position:absolute;left:13.2mm;top:10.5mm;font-size:26pt;line-height:1;color:#000;text-transform:uppercase;letter-spacing:.2px;margin:0}
.flag-sheet .continent-title{position:absolute;right:56.4mm;top:12mm;font-size:13pt;line-height:1;color:#000;text-transform:uppercase;letter-spacing:.2px;margin:0;text-align:right}
.flag-sheet .flag-swatch{position:absolute;left:248.9mm;top:11.5mm;width:32.68mm;height:24.22mm;object-fit:cover}
/* No drawn border on the frame itself, on purpose — the final colouring
   artwork carries its own border baked in, and two stacked borders was the
   original bug. Until that artwork exists a separate .frame-placeholder
   supplies one clean border plus a prompt, and it removes itself the
   instant a real outline PNG loads (see .frame.has-art below), so the two
   can never appear together. */
.flag-sheet .frame{position:absolute;left:13.2mm;top:29.8mm;width:227.4mm;height:170mm;display:flex;align-items:center;justify-content:center;overflow:hidden}
.flag-sheet .frame img{width:100%;height:100%;object-fit:contain}
.flag-sheet .frame-placeholder{position:absolute;inset:0;border:.6mm solid #000;border-radius:2mm;display:flex;align-items:flex-end;justify-content:center;padding-bottom:6mm}
.flag-sheet .frame-placeholder span{font:400 12pt "Lilita One",cursive;color:#000;opacity:.32;text-transform:uppercase;letter-spacing:.6px}
.flag-sheet .frame.has-art .frame-placeholder{display:none}
.flag-sheet .qr{position:absolute;left:253mm;top:118mm;width:34mm;height:34mm}
.flag-sheet .badge{position:absolute;left:253mm;top:160.2mm;width:32mm;height:auto}
.flag-sheet .badge-url{position:absolute;left:253mm;top:192mm;width:40mm;text-align:center;font:700 8pt/1.2 "Nunito Sans",sans-serif;color:#000;margin:0;letter-spacing:.2px}

.print-pages{display:none}
footer{text-align:center;padding:38px;background:#020b17;color:rgba(255,241,210,.65);font-size:12px}

@media(max-width:900px){.page-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:650px){
  .adventure-hero{display:block;padding:45px 20px 34px}
  .hero-back{margin-bottom:16px}
  .continent-shelf{padding-inline:20px}
  .continent-button{flex-basis:120px}
  .library{padding:48px 16px}
  .library-head{display:block}
  .selection-bar{flex-wrap:wrap}
  .selection-bar span{width:100%}
  .page-grid{grid-template-columns:repeat(2,1fr);gap:13px}
  .page-copy{padding:11px}
  .page-copy h3{font-size:17px}
  .page-actions{display:grid}
  .dialog-actions h2{display:none}
  .dialog-actions{justify-content:center;padding-inline:10px}
}

@media print{
  @page{size:A4 landscape;margin:0}
  body>*{display:none!important}
  .print-pages{display:block!important}
  .print-pages .flag-sheet{page-break-after:always}
  .print-pages .flag-sheet:last-child{page-break-after:auto}
}
