/* Tablet and phone layouts for the website (handoff step 3). Loaded after the page's own <style>, so equal selectors win here.
   Desktop (1240 px and wider) is unchanged: the page keeps its 1200 px column. */

.wrap { width: min(1200px, calc(100% - 40px)); }

/* The "coming soon" message box: empty until used, it was only pushed down by its own small height, so a dark sliver
   showed at the bottom of every screen. Kept fully out of sight until it is shown. */
#toast { transform: translate(-50%, calc(100% + 60px)); visibility: hidden; transition: transform .45s cubic-bezier(.34, 1.5, .5, 1), visibility 0s linear .45s; }
#toast.on { transform: translate(-50%, 0); visibility: visible; transition: transform .45s cubic-bezier(.34, 1.5, .5, 1), visibility 0s; }
/* A row's small tags (comment count, 2004) keep their size; only the title is shortened. */
.row .t .cm, .row .t .arch, .row .t .tg { flex-shrink: 0; overflow: visible; }

/* ---------------- narrower desktops and landscape tablets ---------------- */
@media (max-width: 1239px) {
  .tab .lbl { font-size: 14px; }
  .copy { left: 120px; }
}

/* ---------------- tablet (portrait) ---------------- */
@media (max-width: 1100px) {
  .mast { grid-template-columns: 1fr; padding-top: 18px; }
  .brand { justify-self: center; margin-bottom: 0; }
  .brand img { width: 230px; }
  .brand img.card { width: 200px; margin: 0; }
  .bubble { margin-left: 0; margin-top: 10px; }
  .tabs { margin: 12px 0 0; gap: 6px; }
  .tab { height: 104px; }
  .tab .ch img { height: 64px; }
  .tab.play .ch img { height: 68px; }
  .tab .lbl { font-size: 13px; padding: 8px 2px 7px; border-radius: 12px; }
  .tab:first-child { flex: 1.25; }

  .hero { margin: 18px 0 0; height: 300px; }
  .copy, .s3 .copy { left: 36px; width: min(430px, 58%); }
  .s2 .tag, .s3 .tag { left: 36px; }
  .duo { height: 270px; right: -6px; bottom: -14px; }

  .body3 { grid-template-columns: 250px 1fr; gap: 22px; margin-top: 26px; }
  .body3 > aside:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 22px; align-items: start; }
  .body3 > aside:last-child .rank, .body3 > aside:last-child .srv { margin-top: 0; }
  .field label { width: 66px; }
  .shots { grid-template-columns: repeat(2, 1fr); }
  .strip .lab { min-width: 0; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  footer .wrap { flex-wrap: wrap; height: auto; padding: 22px 0; row-gap: 10px; }
  footer nav { margin-left: 0; flex-wrap: wrap; }
}

/* ---------------- phone ---------------- */
@media (max-width: 680px) {
  .wrap { width: calc(100% - 32px); }
  body { font-size: 15px; }

  /* top bar: brand, players online, world flag */
  .util .wrap { gap: 10px; height: 44px; font-size: 12px; }
  .u-brand { font-size: 17px; gap: 6px; }
  .u-brand .pill { font-size: 9.5px; padding: 2px 6px; }
  .u-sep, .u-link, #uWorldName { display: none; }
  .u-world { padding: 4px 8px; gap: 5px; }
  .wmenu { right: -4px; min-width: 220px; }

  /* masthead: the logo, then the tabs as a row you swipe, Play Now first */
  .mast { padding-top: 14px; }
  .brand img { width: 190px; }
  .brand img.card { width: 170px; }
  .bubble { display: none; }
  .tabs { justify-content: flex-start; overflow-x: auto; scroll-snap-type: x proximity; margin: 8px -16px 0; padding: 4px 16px 12px; gap: 8px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab, .tab:first-child { flex: 0 0 auto; width: 92px; height: 92px; scroll-snap-align: start; }
  .tab:first-child { width: 112px; }
  .tab.play { order: -1; width: 100px; }
  .tab .ch img { height: 54px; }
  .tab.play .ch img { height: 58px; }
  .tab .lbl { font-size: 12.5px; padding: 7px 4px 6px; }
  .tab:hover .ch { transform: none; }

  /* hero: the words over the picture, at the bottom */
  .hero { height: 420px; margin: 6px 0 0; }
  .slides { border-radius: 20px; }
  .s1::before { background: linear-gradient(0deg, rgba(var(--hi), .97) 0%, rgba(var(--hi), .88) 42%, rgba(var(--hi), .25) 72%, rgba(var(--hi), .05) 100%); }
  .s1 img.bg { object-position: 60% 30%; }
  .copy, .s3 .copy { left: 20px; right: 20px; width: auto; top: auto; bottom: 34px; justify-content: flex-end; }
  .kick { white-space: normal; font-size: 12px; }
  .copy h1 { font-size: 34px; }
  .copy p { font-size: 14px; max-width: none; margin-bottom: 14px; }
  .btn-play { font-size: 20px; padding: 11px 20px 10px; }
  .btn-ghost { font-size: 13px; padding: 9px 12px; }
  .duo { height: 200px; right: -16px; bottom: auto; top: -22px; }
  .s3 img.bg { width: 100%; opacity: .45; -webkit-mask-image: none; mask-image: none; }
  .s3 .flags img { width: 54px; }
  .s2 .tag { left: 14px; right: 14px; bottom: 34px; flex-wrap: wrap; }
  .pager { bottom: 12px; }

  /* body: one column. The asides open up so each card can take its place:
     login, news, ranking, buddies, worlds, the sale card, the classic corner. */
  .body3 { display: flex; flex-direction: column; align-items: stretch; gap: 18px; margin-top: 22px; }
  .body3 > aside, .body3 > aside:last-child { display: contents; }
  .login { order: 1; }
  .feed { order: 2; gap: 18px; }
  .rank { order: 3; margin-top: 0; }
  .buds { order: 4; margin-top: 0; }
  .srv { order: 5; margin-top: 0; }
  .promo { order: 6; max-width: 340px; width: 100%; align-self: center; }
  .classics { order: 7; margin-top: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
  .classics .k, .classics .cg3, .classics .cg2, .classics .boleh { grid-column: 1 / -1; }
  .bud .inv { opacity: 1; transform: none; }

  .field label { width: 72px; }
  .field input { height: 42px; font-size: 16px; }   /* 16 px: phones do not zoom into the box */
  .b-in, .b-reg { height: 44px; }

  .box { padding: 4px 14px 10px; }
  .strip { margin: 0 -2px 4px; }
  .strip .lab { font-size: 17px; height: 36px; padding: 0 14px 0 10px; gap: 8px; }
  .strip .tabsm { display: none; }
  .row { font-size: 14px; gap: 9px; padding: 10px 2px; }
  .row .tg { display: none; }
  .row .t span { white-space: normal; overflow: visible; }
  .brow { grid-template-columns: 12px 1fr auto; }
  .brow .d { display: none; }
  .brow .who { font-size: 11.5px; }
  .shots { grid-template-columns: 1fr 1fr; gap: 10px; }

  .global { margin-top: 22px; padding: 4px 14px 18px; }
  .tiles { display: flex; overflow-x: auto; gap: 12px; margin: 14px -14px 0; padding: 4px 14px 10px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .tiles::-webkit-scrollbar { display: none; }
  .tile { flex: 0 0 116px; scroll-snap-align: start; }
  .here { display: none !important; }

  footer { margin-top: 30px; }
  footer .wrap { flex-direction: column; align-items: flex-start; gap: 8px; }
  footer nav { gap: 14px; }

  #toast { max-width: calc(100vw - 24px); bottom: 16px; }
}
