/*
 * Flippr: home / news page layout fixes (loaded after app.css).
 *   - header: logo and Play Now on one row, centred on the banner, smaller on small screens
 *   - nav: one line on desktop (no "What's / New" wrapping), counter pushed right, hamburger under 992px
 *   - welcome slider (assets/js/welcome.js): one height for every slide, art on every screen size
 *   - news cards: same height, readable headline size, even gaps
 */

/* Header */
header { background-size: cover; max-height: none; }
header .row { align-items: center; flex-wrap: nowrap; min-height: 220px; }
header .logo { flex: 1 1 auto; text-align: left; margin: 0; }
header img { height: auto; width: 309px; max-width: 100%; margin: 30px 0; }
header .play-link, header .col-4 { flex: 0 0 auto; margin: 0; text-align: right; }
header button { white-space: nowrap; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18); transition: transform .1s; }
header button:hover { transform: translateY(-2px); }

/* Nav: one line, grouped into dropdowns (Shop / My Penguin / Community) */
nav.navbar { padding: 0 15px; }
nav .navbar-collapse { align-items: center; }
nav .navbar-nav { flex-wrap: nowrap; align-items: center; }
nav .nav-link, nav .navbar-expand-lg .navbar-nav .nav-link { white-space: nowrap; padding: 22px 0; margin-right: 34px; font-size: 17px; }
nav .navbar-nav > .nav-item:last-child > .nav-link { margin-right: 0; }
nav .nav-link:hover, nav .nav-item.active > .nav-link, nav .drop:hover > .nav-link, nav .drop.open > .nav-link { color: #ffd954; }
nav .nav-link .fa-caret-down { font-size: 13px; margin-left: 3px; opacity: .8; }
nav .online { list-style: none; margin-left: auto; padding-left: 20px; white-space: nowrap; }
nav #counter { white-space: nowrap; font-weight: 600; font-size: 14px; background: rgba(0, 0, 0, 0.15); border-radius: 20px; padding: 6px 14px; }

nav .drop { position: relative; }
nav .drop-menu {
  display: none; position: absolute; top: 100%; left: -16px; z-index: 1000; min-width: 190px;
  margin: 0; padding: 8px 0; list-style: none; background: #fff; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 40, 80, 0.25);
}
nav .drop-menu a { display: block; padding: 9px 18px; color: #016DB0; font-weight: 600; font-size: 15px; white-space: nowrap; text-decoration: none; }
nav .drop-menu a:hover { background: #DBF0FF; }
nav .drop.open > .drop-menu { display: block; }
@media (hover: hover) and (min-width: 992px) {
  nav .drop:hover > .drop-menu { display: block; }
}

@media (max-width: 991.98px) {
  nav.navbar { padding: 14px 15px; }
  nav .navbar-toggler { margin: 0 auto; display: block; }
  nav .navbar-nav { flex-wrap: wrap; flex-direction: column; padding-top: 8px; }
  nav .nav-link, nav .navbar-expand-lg .navbar-nav .nav-link { padding: 12px 0; margin-right: 0; }
  nav .drop-menu { position: static; box-shadow: none; background: rgba(255, 255, 255, 0.12); margin-bottom: 6px; text-align: center; }
  nav .drop-menu a { color: #fff; }
  nav .drop-menu a:hover { background: rgba(255, 255, 255, 0.15); }
}

/* Welcome slider (assets/js/welcome.js) */
.welcome { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; grid-template-areas: "prev view next" ". dots .";
  align-items: center; column-gap: 14px; margin: 30px 0 26px; color: #016db0; }
.welcome-viewport { grid-area: view; overflow: hidden; border-radius: 14px; background: #fff;
  box-shadow: 0 4px 16px rgba(1, 109, 176, .14); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.welcome-track { display: flex; margin: 0; padding: 0; list-style: none; transition: transform .55s cubic-bezier(.22, .7, .2, 1); }
.welcome-slide { flex: 0 0 100%; min-width: 0; display: flex; align-items: center; gap: 30px; padding: 36px 48px; }
.welcome-text { flex: 1 1 auto; min-width: 0; }
.welcome-text h2 { font: 700 40px/1.15 'Montserrat', sans-serif; color: #016db0; margin: 0 0 14px; }
.welcome-text p { font-size: 18px; line-height: 1.6; margin: 0; color: #1b5f8f; }
.welcome-art { flex: 0 0 34%; display: flex; justify-content: center; align-items: center; height: 240px; }
.welcome-art img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; pointer-events: none; }
.welcome-slide.art-left .welcome-art { order: -1; }   /* Aunt Arctic on the left, the words on the right */
/* bigger, standing on the card's bottom edge (her art ends at the waist) */
@media (min-width: 768px) {
  .welcome-slide.art-left { padding-bottom: 0; align-items: stretch; }
  .welcome-slide.art-left .welcome-text { align-self: center; padding-bottom: 36px; }
  .welcome-slide.art-left .welcome-art { height: auto; min-height: 290px; align-items: flex-end; padding-top: 6px; }
  .welcome-slide.art-left .welcome-art img { max-height: 300px; }
}
@media (min-width: 768px) and (max-width: 991px) { .welcome-slide.art-left .welcome-art { flex-basis: 42%; } }
.welcome-arrow { width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: #fff;
  box-shadow: 0 2px 8px rgba(1, 109, 176, .2); display: flex; align-items: center; justify-content: center; transition: transform .15s, background .15s; }
.welcome-arrow.prev { grid-area: prev; }
.welcome-arrow.next { grid-area: next; }
.welcome-arrow:hover { transform: scale(1.08); background: #eaf5fd; }
.welcome-arrow:focus, .welcome-dot:focus { outline: none; }
.welcome-arrow:focus-visible, .welcome-dot:focus-visible { outline: 3px solid #ffb703; outline-offset: 2px; }
.welcome-arrow svg { width: 22px; height: 22px; fill: none; stroke: #016db0; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.welcome-dots { grid-area: dots; display: flex; justify-content: center; gap: 10px; margin-top: 16px; }
.welcome-dot { width: 11px; height: 11px; border-radius: 6px; border: 0; padding: 0; cursor: pointer; background: #9fcbea; transition: width .25s, background .25s; }
.welcome-dot.on { width: 30px; background: #016db0; }
@media (prefers-reduced-motion: reduce) { .welcome-track { transition: none; } }
@media (max-width: 991.98px) {
  .welcome-slide { padding: 28px 30px; gap: 20px; }
  .welcome-text h2 { font-size: 30px; }
  .welcome-text p { font-size: 16px; }
  .welcome-art { height: 190px; }
}
/* phones: no arrows (swipe and the dots), the art above the words */
@media (max-width: 767.98px) {
  .welcome { grid-template-columns: minmax(0, 1fr); grid-template-areas: "view" "dots"; margin: 16px 0 18px; }
  .welcome-arrow { display: none; }
  .welcome-slide { flex-direction: column; align-items: stretch; text-align: center; padding: 22px 20px 26px; gap: 14px; }
  .welcome-art { flex: 0 0 auto; height: 150px; order: -1; }
  .welcome-text h2 { font-size: 25px; margin-bottom: 10px; }
  .welcome-text p { font-size: 15px; }
}

/* News cards */
main > .row { margin-left: -12px; margin-right: -12px; }
main #article { margin: 12px; display: flex; flex-direction: column; box-shadow: 0 2px 8px rgba(1, 109, 176, 0.12); }
main #article img { display: block; aspect-ratio: 520 / 290; object-fit: cover; }
main #article #title { flex: 1 1 auto; padding: 18px 20px 22px; }
main #article #title h2 { font-size: 12px; letter-spacing: 1px; margin-bottom: 8px; opacity: .8; }
main #article #title h1 { font-size: 18px; line-height: 1.35; margin: 0; overflow-wrap: break-word; hyphens: none; }

@media (max-width: 991.98px) {
  main #article #title h1 { font-size: 16px; }
}

/* Phones */
@media (max-width: 767.98px) {
  header .row { min-height: 0; }
  header img { width: auto; height: 56px; margin: 22px 0; }
  header button { font-size: 18px; padding: 8px 20px; }
  main #article { margin: 10px 15px; flex: 0 0 auto; width: calc(100% - 30px); max-width: calc(100% - 30px); }
}

/* ---------- Home: the island hero (art from the old homepag.fla: its sign now has the new logo on Flippr blue; BuddyCrafted, from Buddy.fla, stands where Aunt Arctic was) ----------
 * The art is 2940x1500 (51vw tall at full width); the hero shows min(42vw, 620px) of it, 70% down. Rendered with
 * tools/site/svg_supersample.py (no seams between the shapes), WebP with a JPEG for old browsers. */
header.hero { position: relative; background: #0a6fc0 url("/assets/img/island-buddycrafted.jpg") center 70% / 100% auto no-repeat; max-height: none;
  background-image: image-set(url("/assets/img/island-buddycrafted.webp") type("image/webp"), url("/assets/img/island-buddycrafted.jpg") type("image/jpeg"));
  --hero-h: min(42vw, 620px); }
header.hero { min-height: var(--hero-h); }

/* ---------- Footer: one bar, social icons on the right ---------- */
footer #main { padding: 34px 0 30px; }
footer .foot { display: flex; align-items: center; gap: 30px; }
footer .foot-text { flex: 1; min-width: 0; }
footer .foot-text p { margin: 0 0 8px; }
footer .foot-text .credit { margin: 0; font-size: 14px; opacity: .7; }
footer .icon.social { display: flex; gap: 26px; align-items: center; margin: 0; }
footer .icon .fa-twitter { margin-right: 0; }
footer #credits { display: none; }

@media (max-width: 767px) {
  header.hero { background-image: url("/assets/img/island-buddycrafted-small.jpg"); --hero-h: 51vw;
    background-image: image-set(url("/assets/img/island-buddycrafted-small.webp") type("image/webp"), url("/assets/img/island-buddycrafted-small.jpg") type("image/jpeg")); }
      footer #main { padding: 26px 0 22px; font-size: 15px; }
  footer .foot { flex-direction: column; align-items: flex-start; gap: 16px; }
  footer .icon.social { font-size: 26px; }
}

/* Play Now in the nav bar: Club Penguin's orange button */
nav .nav-play { margin-left: auto; display: inline-block; padding: 8px 30px 9px; border-radius: 30px; white-space: nowrap;
  font: 800 19px/1.2 'Montserrat', sans-serif; color: #fff !important; text-decoration: none !important; letter-spacing: .3px;
  text-shadow: 0 2px 0 rgba(150, 60, 0, .55);
  background: linear-gradient(#ffc23d 0%, #fca21f 45%, #f07a0a 100%); border: 3px solid #b85600;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 3px 0 #8f3f00, 0 5px 10px rgba(0, 0, 0, .25); transition: transform .1s, filter .1s; }
nav .nav-play:hover { transform: translateY(-2px); filter: brightness(1.06); }
nav .nav-play:active { transform: translateY(1px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), 0 1px 0 #8f3f00; }
@media (max-width: 991px) {
  /* phones: Play Now stays on the bar next to the menu button */
  nav .nav-play { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); font-size: 16px; padding: 6px 20px 7px; }
  nav .nav-play:hover { transform: translateY(-50%); }
  nav .navbar-collapse.show ~ .nav-play, nav .navbar-collapse.collapsing ~ .nav-play { top: 31px; }
}

/* ---------- Home: one top bar (like clubpenguin.com): logo, links, Play Now and your penguin, over the island ---------- */
.topbar { position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 10px rgba(0, 0, 0, .2); }
.topbar nav.navbar { padding-top: 8px; padding-bottom: 8px; }
.topbar .nav-logo { flex: 0 0 auto; margin-right: 26px; }
.topbar .nav-logo img { height: 46px; width: auto; display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
.topbar .nav-play { margin-left: auto; }
.topbar .nav-penguin { display: flex; align-items: center; margin-left: 14px; }
.topbar .nav-penguin canvas { width: 46px; height: 46px; border-radius: 50%; display: block;
  background: radial-gradient(circle at 50% 35%, #ffffff 0%, #d6ecfb 70%, #a9d3f2 100%);
  border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); transition: transform .15s; }
.topbar .nav-penguin:hover canvas { transform: scale(1.07); }
.topbar .nav-penguin.signed-out canvas { filter: grayscale(1) opacity(.6); }
@media (max-width: 991px) {
  .topbar nav.navbar { padding: 8px 12px; }
  .topbar .nav-logo { order: 0; margin-right: auto; }
  .topbar .nav-logo img { height: 34px; }
  .topbar .nav-play { order: 1; position: static; transform: none; margin-left: 8px; }
  .topbar .nav-play:hover { transform: none; }
  .topbar .nav-penguin { order: 2; margin-left: 8px; }
  .topbar .nav-penguin canvas { width: 38px; height: 38px; }
  .topbar .navbar-toggler { order: 3; margin-left: 8px; }
  .topbar .navbar-collapse { order: 4; }
}
@media (max-width: 400px) {
  .topbar .nav-logo img { height: 28px; }
  .topbar .nav-play { font-size: 14px; padding: 5px 14px 6px; }
}
/* (the links, Play Now and your penguin on one line) */
@media (min-width: 992px) {
  .topbar .navbar-nav .nav-link { padding-left: 12px; padding-right: 12px; }
  .topbar .nav-logo { margin-right: 14px; }
}
@media (min-width: 992px) and (max-width: 1199px) {
  .topbar .nav-logo img { height: 38px; }
  .topbar .navbar-nav .nav-link { padding-left: 8px; padding-right: 8px; font-size: 15px; }
  .topbar .nav-play { font-size: 17px; padding: 7px 22px 8px; }
}
/* the links centred between the logo and Play Now, evenly spaced */
@media (min-width: 992px) {
  .topbar .navbar-collapse { justify-content: center; }
  .topbar .navbar-nav { gap: clamp(10px, 2.4vw, 36px); }
  .topbar .navbar-nav .nav-link { padding-left: 6px; padding-right: 6px; }
  .topbar .nav-play { margin-left: 0; }
}
/* pages without Play Now: My Penguin takes the right end */
.topbar .nav-penguin { margin-left: auto; }
.topbar .nav-play + .nav-penguin { margin-left: 14px; }
@media (max-width: 991px) { .topbar .nav-play + .nav-penguin { margin-left: 8px; } }

/* ---------- Top bar and footer: Club Penguin's look ----------
 * Burbank (the game's own font) instead of Montserrat, a bright sky blue bar like the game's frame (#009af2) with a
 * deeper edge, and a deep blue footer to close the page. */
@font-face { font-family: 'Burbank Small'; font-weight: bold; font-display: swap; src: url('/assets/fonts/Burbank%20Small%20Bold.woff2') format('woff2'); }
.navbar-outer, nav, nav.navbar { background: transparent; }
.navbar-outer { background: linear-gradient(180deg, #3bbcff 0%, #13a0f5 48%, #0687e6 100%);
  border-bottom: 3px solid #0567c4; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 3px 12px rgba(0, 40, 100, .25); }
nav .nav-link, nav .navbar-expand-lg .navbar-nav .nav-link { font-family: 'Burbank Small', 'Arial Rounded MT Bold', Arial, sans-serif;
  font-weight: bold; font-size: 20px; letter-spacing: .3px; color: #fff; text-shadow: 0 2px 0 rgba(0, 70, 150, .45); }
nav .nav-link:hover, nav .nav-item.active > .nav-link, nav .drop:hover > .nav-link, nav .drop.open > .nav-link { color: #ffe14d; }
nav .nav-play { font-family: 'Burbank Small', 'Arial Rounded MT Bold', Arial, sans-serif; font-weight: bold; font-size: 22px; letter-spacing: .4px; }
nav .drop-menu a { font-family: 'Burbank Small', Arial, sans-serif; font-weight: bold; font-size: 17px; }
@media (min-width: 992px) and (max-width: 1199px) {
  .topbar .navbar-nav .nav-link { font-size: 17px; }
  .topbar .nav-play { font-size: 18px; }
}
@media (max-width: 991px) { nav .nav-play { font-size: 18px; } }
nav .navbar-toggler:focus { outline: none; box-shadow: 0 0 0 3px rgba(255, 225, 77, .75); }
@media (max-width: 400px) { .topbar .nav-play { font-size: 16px; } }
footer #main { background: linear-gradient(180deg, #0a6fd2 0%, #08509f 100%); border-top: 3px solid #3bbcff; }
footer a { color: rgba(255, 255, 255, .85); }
@media (min-width: 992px) { .topbar .nav-play { margin-left: 18px; } }
/* phones and tablets: the menu button right after the logo, Play Now and your penguin on the right */
@media (max-width: 991px) {
  .topbar .nav-logo { order: 0; margin-right: 10px; }
  .topbar .navbar-toggler { order: 1; margin: 0 auto 0 0; }
  /* (app.css only styles the button up to 960px: same look up to 991px) */
  .topbar .navbar-toggler { background: transparent; border: 2px solid #fff; border-radius: 6px; color: #fff; font-size: 28px; line-height: 1; padding: 4px 10px; }
  .topbar .navbar-toggler i { padding: 6px; }
  .topbar .nav-play { order: 2; margin-left: 8px; }
  .topbar .nav-penguin { order: 3; margin-left: 8px; }
  .topbar .navbar-collapse { order: 4; }
}

/* ---------- Flippr 2018 site art (from Sandor's old Flippr website) ----------
 * The snow drift on the top edge of blue panels (.snow-cap, like the 2018 site's "On Now" box), the puffle doodle
 * pattern on the footer and the penguin peeking over it. */
.snow-cap { position: absolute; top: 0; right: 60px; width: 240px; height: 39px; pointer-events: none; z-index: 2;
  background: url("/assets/img/snow.svg") no-repeat top left / 100% 100%; }
@media (max-width: 575px) { .snow-cap { right: 24px; width: 160px; height: 26px; } }
footer #main { background-image: url("/assets/img/pattern-doodles.png"), linear-gradient(180deg, #0a6fd2 0%, #08509f 100%);
  background-size: 135px, auto; background-repeat: repeat, no-repeat; }
footer #main { position: relative; }
@media (min-width: 992px) {
  footer #main .foot { padding-right: 200px; }
  /* Sandor, standing on the footer's bottom, head over its top edge, at the right of the page's column. Click him and
     he says something (avatar.js) */
  footer #main .sandor { position: absolute; bottom: 0; right: max(15px, calc((100% - 1140px) / 2 + 10px)); width: 196px; height: 214px;
    padding: 0; border: 0; background: url("/assets/img/footer-penguin.png") no-repeat bottom center / contain; cursor: pointer; z-index: 3;
    transform-origin: 50% 100%; transition: transform .15s; }
  footer #main .sandor:hover { transform: scale(1.04); }
  footer #main .sandor:focus { outline: none; }
  footer #main .sandor:focus-visible { outline: 3px solid #ffe14d; outline-offset: 4px; border-radius: 12px; }
  footer #main .sandor.talk { animation: sandor-hop .35s ease-out; }
  @keyframes sandor-hop { 40% { transform: translateY(-10px); } }
  /* his speech bubble: the game's welcome bubble (Buddy's) look, its flag tail on his beak (beak tip at 77, 68 in his
     196 x 214 box) */
  footer #main .say { position: absolute; right: calc(100% - 47px); top: 76px; width: max-content; max-width: 270px; padding: 12px 18px;
    border-radius: 14px; background: linear-gradient(170deg, #fbfbfb 0%, #f4f5f7 55%, #e6eaf2 100%); color: #3e4e56;
    border: 3px solid #63809c; box-shadow: 0 6px 14px rgba(0, 30, 80, .28); font: bold 19px/1.22 "Burbank Small", Arial, sans-serif;
    text-align: left; opacity: 0; transform: translateY(6px) scale(.96); transform-origin: 100% 0; transition: opacity .18s, transform .18s;
    pointer-events: none; }
  footer #main .say .tail { position: absolute; right: -31px; top: -11px; width: 36px; height: 30px; overflow: visible; }
  footer #main .say.on { opacity: 1; transform: none; }
}
/* short pages: the footer sits at the bottom of the window, no empty strip under it */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > * { flex-shrink: 0; }
body > footer { margin-top: auto; }

/* Home (and any page with Play Now): Play Now takes the room the links had, so they were squeezed from the logo to
   Play Now. Closer together there, centred with air on both sides; pages without Play Now (Minigames) stay as they are */
@media (min-width: 992px) {
  .topbar nav:has(.nav-play) .navbar-nav .nav-link { margin-right: 0; }
  .topbar nav:has(.nav-play) .navbar-nav { gap: clamp(22px, 3.4vw, 52px); }
  .topbar nav:has(.nav-play) .nav-play { margin-left: 18px; }
}

/* Nav with "Get The App" (5 links): a bit tighter so Play Now and your penguin still fit on one line */
@media (min-width: 992px) and (max-width: 1399px) { .topbar .navbar-nav .nav-link { margin-right: 20px; font-size: 18px; } }
@media (min-width: 992px) and (max-width: 1199px) { .topbar .navbar-nav .nav-link { margin-right: 12px; font-size: 15px; } .topbar .nav-play { font-size: 16px; padding: 7px 16px 8px; margin-left: 10px; } }
