/* justplayweb.com itself: the page inside the JustPlay Explorer window.
   Sizes respond to the window (container queries), not to the screen. */

.site { min-height: 100%; background: #c0c0c0; font-size: 12px; line-height: 1.4; padding: 6px 6px 0; }
.site a { color: #0000ee; }
.site a:visited { color: #551a8b; }
.site h1, .site h2, .site h3 { margin: 0; }
.site p { margin: 0 0 8px; }
.muted { color: #555; }
.hint { color: #444; margin: 8px 0 0 !important; }
.hint--warn { color: #800000; }

/* ---- header -------------------------------------------------------------- */

.banner {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  /* One long level: platformer, racing, fighting. Wide windows show all of
     it; narrow ones keep the height and show the left part. */
  aspect-ratio: 4046 / 360; min-height: 124px; padding: 12px 18px 0; align-items: flex-start; overflow: hidden; box-shadow: var(--sunken);
  background: #4cafed url('/assets/img/banner.webp') left bottom / cover no-repeat;
}
.logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; text-decoration: none; }
.site .logo { color: #fff; }
.logo__face { width: 64px; height: 64px; image-rendering: pixelated; filter: drop-shadow(2px 2px 0 #000); }
.logo__text { display: flex; flex-direction: column; gap: 8px; }
.logo__text b {
  font: 400 24px/1 var(--pixel); color: #ffe14d; letter-spacing: 1px;
  text-shadow: 2px 0 #000, -2px 0 #000, 0 2px #000, 0 -2px #000, 2px 2px #000, -2px -2px #000, 2px -2px #000, -2px 2px #000, 4px 4px 0 #a0522d;
}
.logo__text small { font: 400 9px/1 var(--pixel); color: #fff; text-shadow: 1px 1px 0 #000; text-transform: uppercase; letter-spacing: 1px; }
.search { position: relative; z-index: 1; display: flex; gap: 2px; }
.search .field { width: 220px; height: 25px; font-size: 12px; }

.tabs { display: flex; gap: 0; margin-top: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 7px 16px 6px; margin-right: 2px;
  background: #c0c0c0; box-shadow: var(--raised); color: #000 !important; text-decoration: none; font-weight: 700; font-size: 12px;
}
.tab:hover { background: #d4d4d4; }
.tab:active { box-shadow: var(--pressed); }
.tab.is-active { background: #ffd84a; }

.ad-row { display: flex; justify-content: center; }
.ad-row:not(:empty) { margin: 8px 0 0; }

/* ---- columns ------------------------------------------------------------- */

.site-cols { display: grid; grid-template-columns: 180px minmax(0, 1fr) 250px; gap: 8px; margin-top: 8px; align-items: start; }
.site-cols--two { grid-template-columns: 180px minmax(0, 1fr); }
.site-cols--game { grid-template-columns: minmax(0, 1fr) 250px; }
.site-left, .site-right { display: grid; gap: 8px; }
.site-main { min-width: 0; display: grid; gap: 8px; align-content: start; }
.sticky-ad { position: sticky; top: 8px; }
.sticky-ad:empty { display: none; }

@container (max-width: 1000px) {
  .site-cols { grid-template-columns: 170px minmax(0, 1fr); }
  .site-cols > .site-right { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .site-cols--game { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 640px) {
  .site { padding: 4px 4px 0; }
  .site-cols, .site-cols--two { grid-template-columns: minmax(0, 1fr); }
  .site-left { order: 3; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .site-cols > .site-right { order: 4; }
  .banner { min-height: 150px; padding: 10px 10px 0; flex-wrap: nowrap; flex-direction: column; align-items: stretch; gap: 8px; }
  .logo__face { width: 40px; height: 40px; }
  .logo__text b { font-size: 15px; }
  .logo__text small { font-size: 7px; }
  .search { width: 100%; }
  .search .field { flex: 1; width: auto; }
  .tab { padding: 6px 10px; }
}

/* ---- panels -------------------------------------------------------------- */

.panel { background: #c0c0c0; box-shadow: var(--win); padding: 3px; }
.panel__title {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  height: 20px; padding: 0 3px 0 6px; background: var(--title); color: #fff;
  font: 700 11px/1 var(--ui); text-transform: uppercase; letter-spacing: .5px;
}
.panel__title span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.panel__title i {
  width: 14px; height: 12px; flex: none; background: #c0c0c0 no-repeat center; box-shadow: var(--raised);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='7'%3E%3Cpath d='M0 0h2v1h1v1h2V1h1V0h2v1H7v1H6v1H5v1h1v1h1v1h1v1H6V6H5V5H3v1H2v1H0V6h1V5h1V4h1V3H2V2H1V1H0z'/%3E%3C/svg%3E");
}
.panel__body { padding: 8px; }

.tree { list-style: none; margin: 0; padding: 4px 2px; background: #fff; box-shadow: var(--sunken); }
.panel__body > .tree { margin: -4px; }
.tree__item {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 3px 6px; border: 0; background: none;
  color: #000 !important; text-decoration: none; font: 12px/1.2 var(--ui); text-align: left; cursor: pointer;
}
.tree__item small { margin-left: auto; color: #808080; }
.tree__item:hover span { text-decoration: underline; }
.tree__item.is-active { background: var(--select); color: #fff !important; }
.tree__item.is-active small { color: #c0c0ff; }

.cat-icons { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px 2px; }
.cat-icons a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 2px; color: #000 !important; text-decoration: none; text-align: center; font-size: 11px; }
.cat-icons a:hover span { background: var(--select); color: #fff; }

.pick { display: grid; gap: 4px; color: #000 !important; text-decoration: none; margin-bottom: 8px; }
.pick img { width: 100%; height: auto; aspect-ratio: 16/10; object-fit: cover; box-shadow: 0 0 0 1px #000, 2px 2px 0 1px #808080; }
.pick b { font-size: 14px; margin-top: 4px; }
.pick span { color: #333; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- buttons on the site ------------------------------------------------- */

.btn--play {
  background: #ffd84a; font: 400 12px/1 var(--pixel); padding: 10px 16px 9px; min-height: 34px; color: #000;
}
.btn--play:active { padding: 11px 15px 8px 17px; }
.btn--small { font-size: 9px; min-height: 28px; padding: 8px 12px 7px; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.site .btn { color: #000; text-decoration: none; }

/* ---- hero ---------------------------------------------------------------- */

.hero { position: relative; aspect-ratio: 16 / 6.2; min-height: 220px; overflow: hidden; background: #000; padding: 0; border: 2px solid transparent; }
.hero__slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s; }
.hero__slide.is-on { opacity: 1; visibility: visible; }
.hero__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero__text {
  position: absolute; inset: 0 40% 0 0; display: flex; flex-direction: column; justify-content: center; gap: 8px;
  padding: 18px 26px 30px 52px; color: #fff;
  background: linear-gradient(90deg, rgba(0,0,40,.92), rgba(0,0,40,.75) 70%, transparent);
}
.hero__kicker { font: 400 9px/1 var(--pixel); color: #ffd84a; margin: 0 !important; }
.hero__title {
  font: 400 24px/1.25 var(--pixel); color: #fff;
  text-shadow: 2px 0 #000, -2px 0 #000, 0 2px #000, 0 -2px #000, 3px 3px 0 #000080;
}
.hero__blurb { margin: 0 !important; max-width: 46ch; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero__actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.hero__arrow { position: absolute; top: 50%; translate: 0 -50%; min-width: 0; width: 26px; height: 40px; padding: 0; z-index: 2; }
.hero__arrow:active { padding: 0; }
.hero__arrow--prev { left: 10px; }
.hero__arrow--next { right: 10px; }
.hero__dots { position: absolute; left: 50%; bottom: 10px; translate: -50% 0; display: flex; gap: 6px; z-index: 2; }
.hero__dots button { width: 12px; height: 12px; padding: 0; border: 0; border-radius: 50%; background: #c0c0c0; box-shadow: var(--raised); }
.hero__dots button.is-on { background: #ffd84a; }
@container (max-width: 640px) {
  .hero { aspect-ratio: 16 / 10; }
  .hero__text { inset: auto 0 0 0; padding: 40px 14px 34px; background: linear-gradient(transparent, rgba(0,0,40,.92) 35%); }
  .hero__title { font-size: 15px; }
  .hero__blurb { display: none; }
  .hero__arrow { top: 30%; }
}

/* ---- sections and cards -------------------------------------------------- */

.section { background: #fff; box-shadow: var(--sunken); padding: 10px 12px 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-head h1, .section-head h2 { display: flex; align-items: center; gap: 8px; font: 700 15px/1.2 var(--ui); text-transform: uppercase; letter-spacing: .5px; }
.site-main > .section-head { background: #fff; box-shadow: var(--sunken); padding: 10px 12px; margin: 0; }
.section-head__count { color: #808080; font-weight: 400; }
.section-head__link { flex: none; font-weight: 700; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 12px; }
.card { position: relative; }
.card__link { display: grid; gap: 2px; color: #000 !important; text-decoration: none; }
.card__art { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #000; box-shadow: 0 0 0 1px #000, 3px 3px 0 1px #808080; margin-bottom: 6px; }
.card__art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__title { font-weight: 700; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.card__meta { color: #555; font-size: 11px; }
.card__link:hover .card__title { color: #0000ee; text-decoration: underline; }
.card__link:focus-visible { outline: 1px dotted #000; outline-offset: 3px; }
.card__play {
  position: absolute; right: 6px; bottom: 46px;
  width: 30px; height: 26px; border: 0; padding: 0; background: #ffd84a; box-shadow: var(--raised);
  font-size: 11px; opacity: 0; transition: opacity .12s; cursor: pointer;
}
.card:hover .card__play, .card__play:focus-visible { opacity: 1; }
.card__play:active { box-shadow: var(--pressed); }
@media (hover: none) { .card__play { opacity: 1; } }

.burst {
  position: absolute; left: -6px; top: -8px; z-index: 1; display: grid; place-items: center;
  width: 44px; height: 44px; rotate: -14deg;
  background: #ff2a2a; color: #ffef3a; font: 400 7px/1 var(--pixel);
  clip-path: polygon(50% 0, 61% 18%, 82% 10%, 79% 32%, 100% 38%, 84% 54%, 96% 74%, 74% 74%, 70% 96%, 52% 82%, 34% 98%, 28% 76%, 6% 78%, 16% 58%, 0 42%, 20% 32%, 16% 10%, 38% 16%);
}

.soon { display: flex; gap: 12px; align-items: flex-start; background: #ffffe1; box-shadow: 0 0 0 1px #000; padding: 10px 12px; }
.soon__title { font-weight: 700; font-size: 13px; margin-bottom: 4px !important; }
.soon p { margin: 0; }

.crumbs { background: #fff; box-shadow: var(--sunken); padding: 5px 8px; font-size: 11px; }

/* ---- game page ----------------------------------------------------------- */

.game-hero__body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; }
.game-hero__art { position: relative; display: block; border: 0; padding: 2px; cursor: pointer; aspect-ratio: 16 / 10; background: #000; }
.game-hero__art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-hero__play {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 64px; height: 52px; display: grid; place-items: center;
  background: #ffd84a; box-shadow: var(--raised); font-size: 22px; transition: transform .12s;
}
.game-hero__art:hover .game-hero__play { transform: scale(1.08); }
.game-hero__lead { font-size: 13px; }
.props { border-collapse: collapse; margin: 4px 0; }
.props th { text-align: left; font-weight: 400; color: #444; padding: 2px 10px 2px 0; vertical-align: top; white-space: nowrap; }
.props td { padding: 2px 0; }
@container (max-width: 760px) { .game-hero__body { grid-template-columns: minmax(0, 1fr); } }

.controls { border-collapse: collapse; width: 100%; background: #fff; box-shadow: var(--sunken); }
.controls th, .controls td { padding: 5px 8px; text-align: left; border-bottom: 1px solid #e0e0e0; }
.controls th { font-weight: 400; width: 50%; }
kbd { display: inline-block; padding: 1px 6px; background: #c0c0c0; box-shadow: var(--raised); font: 11px var(--ui); }

.mini-list { list-style: none; margin: -4px; padding: 0; background: #fff; box-shadow: var(--sunken); }
.mini { display: flex; gap: 8px; align-items: center; padding: 5px 6px; color: #000 !important; text-decoration: none; }
.mini:hover { background: var(--select); color: #fff !important; }
.mini img { width: 64px; height: 40px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px #000; }
.mini span { display: grid; min-width: 0; }
.mini b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mini small { opacity: .75; }

/* ---- search, text, 404 --------------------------------------------------- */

.find { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.find .field { flex: 1; min-width: 160px; height: 25px; font-size: 12px; }
#search-results:empty { display: none; }
#search-results { background: #fff; box-shadow: var(--sunken); padding: 12px; }

.prose .panel__body { background: #fff; box-shadow: var(--sunken); margin: 4px; padding: 14px 18px; font-size: 13px; line-height: 1.55; }
.prose h2 { font-size: 13px; margin: 14px 0 6px; }

.not-found { background: #fff; padding: 20px 26px 30px; max-width: 640px; font: 12px/1.5 Verdana, Tahoma, sans-serif; }
.not-found__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.not-found h1 { font: 700 17px/1.2 Verdana, Tahoma, sans-serif; }
.not-found hr { border: 0; border-top: 1px solid #c0c0c0; margin: 14px 0; }
.site:has(.not-found) { background: #fff; }

/* ---- footer -------------------------------------------------------------- */

.site-foot { margin: 8px -6px 0; padding: 12px 10px 14px; text-align: center; background: #a8a8a8; box-shadow: inset 0 1px #808080; }
.site-foot__links { margin-bottom: 10px; }
.site-foot__legal { color: #222; font-size: 11px; margin: 8px auto 0 !important; max-width: 70ch; }
.badges { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.badge88 {
  width: 88px; height: 31px; display: grid; place-content: center; text-align: center; line-height: 1.05;
  font: 9px/1.1 var(--ui); color: #fff; box-shadow: 0 0 0 1px #000, inset 1px 1px rgba(255,255,255,.5);
}
.badge88 b { display: block; font: 400 6px/1.3 var(--pixel); text-transform: uppercase; }
.badge88--ie { background: linear-gradient(#1060c0, #003090); }
.badge88--free { background: linear-gradient(#20a020, #006000); }
.badge88--html { background: linear-gradient(#e05010, #902000); }

/* ---- ads ----------------------------------------------------------------- */

.ad { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; margin: 0 auto; width: 100%; }
.ad:not([data-fluid]) { max-width: var(--ad-w); min-height: var(--ad-h); }
.ad--placeholder {
  border: 2px dashed #808080; background: repeating-linear-gradient(45deg, #fff 0 8px, #f2f2f2 8px 16px); color: #444; font-size: 11px; text-align: center;
}
.ad__label { font-weight: 700; }
.ad--tile { aspect-ratio: 16 / 13; }
@container (max-width: 640px) {
  .ad:not([data-fluid]) { max-width: var(--ad-mw, var(--ad-w)); min-height: var(--ad-mh, var(--ad-h)); }
  .ad[data-mobile-off] { display: none; }
}
