html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}

:root {
  --blue: #01b3fe;
  --yellow: #FFD300;
}

body {
  font-family: Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif;
  /* font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; */
  margin: 0;
  accent-color: var(--blue);
}

html .no-js { display: none; }
html.no-js .no-js { display: revert; }

/* TODO: try out DVH with this */
.pageBackground {
  background-repeat: no-repeat;
  background-size: cover;
  /* background-attachment: fixed; */
  position: fixed;
  width: 100vw;
  height: 100vh;
  top: 0;
  left: 0;
  background-position: center;
  z-index: -1;
}

h2, h3, h4, p {
  margin: 0;
  padding-bottom: 10px;
}

nav {
  margin-left: 1rem;
  height: 80px;
  display: flex;
  flex-wrap: wrap;
}

nav a {
  display: block;
  margin: 20px 10px 10px 0;
  padding: 1rem;
  padding-right: 5rem;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
}

nav a:hover {
  background: white;
  color: black;
}

body.featured nav,
.catalog_details nav {
  position: sticky;
  top: 0;
  z-index: 1;
  backdrop-filter: blur(5px);
}

.catalog_details nav {
  width: 60vw;
  margin: 0 auto;
}

body.catalog main {
  display: grid;
  grid-template-columns: 300px 1fr;
  backdrop-filter: blur(5px);
}

body.catalog aside {
  position: sticky;
  display: flex;
  flex-direction: column;
  top: 0;
  margin: 1rem;
  margin-top: 10px;
  /* padding: 1rem; */
  background-color: #4b545d;
  color: white;
  overflow-y: auto;
  scrollbar-width: thin;
  max-height: calc(calc(100vh - 2rem) - 80px);
}

body.catalog aside footer {
  margin-top: auto;
  padding: 1rem;
  text-align: center;
}

body.catalog aside a {
  color: inherit;
}

body.index {
  display: grid;
  place-items: center;
}

body.index nav a:last-of-type { margin-right: 0; }

body.index main {
  width: 100%;
  max-width: 1080px;
  margin: 10vh 0 0 1rem;
  padding: 2rem;
  color: white;
  font-size: 120%;
  line-height: 1.8rem;
  backdrop-filter: blur(50px);
  border: 5px solid #949394;
  background-color: #46464691;
}

body.index main h1 {
  text-align: center;
  line-height: 2.8rem;
}

body.index main a {
  color: inherit;
}

body.index .sponsor_pimax {
  margin-bottom: 1rem;
}

body.index .sponsor_pimax p {
  font-size: 95%;
  text-align: center;
}

body.index .sponsor_pimax img {
  width: 100%;
}

body.index p.highlight {
  border-block: var(--yellow) 2px solid;
  padding-block: 10px;
  margin-block: 1rem;
  text-align: center;
}

body.index main > p:last-of-type {
  width: 100%;
  text-align: right;
  margin-top: 2rem;
}

aside .developer_details {
  text-align: center;
  padding: 0 10px;
  background: var(--blue);
  color: #252525;
  border: 3px solid #4b545d;
}

aside .developer_details h2 {
  font-size: 125%;
}

aside h1 { margin: 1rem 0; }
aside h2 + .results { margin-top: 1rem; }

.results {
  width: 100%;
  display: block;
  text-align: center;
  font-size: 2rem;
  margin: 1rem 0;
}

aside details {
  /* margin: 1rem 0; */
  border: 0;
  padding: 1rem;
}

input[type="search"] {
  padding: 1rem;
  margin: 0 1rem;
  width: calc(100% - 2rem);
  font-size: 110%;
}

.noResults {
  text-align: center;
  margin-top: 1rem;
  font-size: 2rem;
}

aside details summary {
  position: relative;
  padding: 10px;
  border: 1px solid white;
  background: white;
  color: black;
  text-transform: uppercase;
  cursor: pointer;
}

aside details summary:after {
  content: url(/assets/icons/arrows-right.svg);
  position: absolute;
  top: .5rem;
  right: 1rem;
  width: 24px;
  color: black;
  transition: .1s ease-in-out;
}

aside details[open] summary:after {
  transform: rotateZ(90deg)
}

aside details summary::-webkit-details-marker,
aside details summary::marker {
  display: none;
  content: '';
}

aside details summary span {
  vertical-align: middle;
}

aside details summary svg {
  height: 1rem;
  margin-right: 5px;
}

aside details > fieldset {
  margin: 0;
  padding: 1rem 0;
  border: 1px solid white;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
}

fieldset.actions + fieldset {
  border-top: 0;
}

fieldset.actions {
  display: flex;
  padding: 0;
  border-block: 2px solid #4b545d;
}

fieldset.actions button {
  cursor: pointer;
  background: white;
  padding: .5rem;
  width: 50%;
  border: none;
}

fieldset.actions button:hover {
  background: gray;
  color: white;
}

fieldset.actions button:first-of-type {
  border-right: 2px solid #4b545d;
}

fieldset .field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
}

fieldset .field:hover {
  background: gray
}

fieldset .field label {
  flex-grow: 1;
  padding: 1rem 0 1rem 1rem;
  max-width: 140px;
}

fieldset .field input {
  margin: 0 1rem;
}

fieldset input[type="radio"],
fieldset input[type="checkbox"] {
  transform: scale(1.5);
}

fieldset select {
  width: calc(100% - 4rem);
  margin: 10px auto;
  display: block;
  padding: 10px;
  text-transform: uppercase;
}

ul.items {
  padding: 1rem;
  padding-top: 0;
  margin: 0;
  list-style-type: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  overflow-y: auto;
  /* wow i don't like this */
  min-height: calc(100vh - 80px);
  height: calc(100vh - 80px);
}

.items_map {
  margin-top: 10px;
  margin-right: 1rem;
  margin-bottom: 1rem;
  height: calc(calc(100vh - 90px) - 1rem);
}

@media screen and (min-width: 1024px) {
  ul.items { grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); }
}

@media screen and (max-width: 800px) {
  nav { height: auto; justify-content: space-evenly; margin: 0; }
  nav a { padding: 1rem; margin: 5px; }
  body.catalog main { grid-template-columns: 1fr; }
  body.catalog aside { position: relative;}
  body.catalog ul.items { height: auto; }
  body.index main { margin: 1rem 0; }
  .leaflet-popup-content { max-width: 300px; }
  .items_map { margin-left: 1rem; }
}

.leaflet-popup-content .item,
ul.items .item {
  position: relative;
  display: flex;
  max-width: 600px;
  max-height: 650px;
  font-weight: 200;
  border: 1px solid black;
  background: #4b545d;
  color: white;
  text-transform: uppercase;
  cursor: pointer;
  border: 10px solid #7b242400;
  transition: border .2s ease-in-out;
  background-clip: padding-box;
}

.no-js ul.items .item {
  cursor: revert;
}

.item a:any-link {
  color: inherit;
  text-decoration: none;
}

.item a:any-link:hover {
  text-decoration: underline;
}

li.item:hover {
  border: 10px solid white;
}

.item .details,
.marketplace_details .details {
  container: details / inline-size;
  list-style-type: none;
  padding: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.leaflet-popup-content .details { margin: 0; }

.details li {
  padding: 0px 1rem;
}

.item .details .details_image {
  padding: 0 0 1rem;
}

.item .details .details_image img {
  width: 100%; 
  aspect-ratio: 1.8;
}

.item li:not(.details_image) img {
  width: 24px;
  filter: invert();
}

.item .details svg {
  max-width: 30px;
  vertical-align: bottom;
}
.item .details_title {
  font-size: 120%;
}

.item .details_creator h2 {
  font-weight: 100;
}

.item .details_rating,
.marketplace .details_rating {
  font-size: 1.5rem;
  flex: 1;
  fill: white;
  margin-bottom: 1rem;
}

.item .details_rating span,
.marketplace .details_rating span {
  font-size: 120%;
  font-weight: bold;
}

.item .details .details_category {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding: 5px 1rem;
  background: #363739;
  font-size: 130%;
}

.details .price_store,
.details .price_date {
  background: #383838;
  padding: .5rem 1rem;
}

ul.details_price {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  list-style-type: none;
  font-size: 200%;
  padding: 0;
  background-color: #383838;
  min-height: 50px;
}

ul.details_price.price_regular { display: none; }

ul.details_price li {
  padding: 0;
  margin: 0;
}

ul.details_price.sale .price_current {
  background: linear-gradient(145deg, #383838 0%, #383838 30%, var(--yellow) 31%, var(--yellow) 100%)
}

ul.details_price:not(.sale) .price_current {
  padding-block: 0.5rem;
}

ul.details_price .price_current {
  display: grid;
  align-items: center;
  margin-left: auto;
  text-align: right;
  min-width: 250px;
  grid-column: 1/-1;
  padding-right: 1rem;
  width: 100%;
  background: linear-gradient(145deg, #383838 0%, #383838 50%, #2b2b2d 51%, #252525 100%)
}

ul.details_price.sale .price_current {
  color: #282E34;
  margin-left: revert;
  grid-column: 3;
}

ul.details_price .price_discount {
  position: relative;
  padding-left: 1rem;
  align-self: center;
  font-size: 75%;
  height: 30px;
  max-width: 100px;
  color: #282E34;
  background: var(--yellow);
}

ul.details_price .price_discount:before {
  content: '';
  position: absolute;
  height: 0;
  width: 0;
  right: 0;
  top: 0;
  z-index: 1;
  border-style: solid;
  border-width: 0 15px 15px 0;
  border-color: transparent #383838 transparent;
}

ul.details_price .price_discount:after {
  content: '';
  position: absolute;
  height: 0;
  width: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  border-style: solid;
  border-width: 0 0 15px 15px;
  border-color: transparent transparent #383838 transparent;
}

ul.details_price .price_normal {
  align-self: center;
  font-size: 75%;
  text-align: right;
  opacity: 0.9;
}

ul.details_price .price_normal span {
  position: relative;
}

ul.details_price .price_normal span:after {
  position: absolute;
  content: '';
  left: 0;
  top: 50%;
  right: 0;
  border-top: 1px solid;
  border-color: inherit;
  transform:rotate(15deg);
  opacity: 0.8;
}

.leaflet-popup-content-wrapper { border-radius: 0; }
.leaflet-popup-content { min-height: 400px; margin: 0; }
.leaflet-container a.leaflet-popup-close-button {
  background: white;
  border-radius: 100%;
}

.leaflet-marker-icon {
  border: 0 !important;
  background: transparent !important;
  width: 50px !important;
  height: 50px !important;
}

.leaflet-marker-icon > [data-sales-count]:after,
.leaflet-marker-icon.sale::after {
  content: '%';
  font-family: system-ui, sans-serif;
  font-weight: bold;
  text-align: center;
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--yellow);
  border-radius: 50%;
  right: 0;
  top: 0;
}

.leaflet-marker-icon > [data-sales-count]:after {
  content: attr(data-sales-count);
}

header.corner {
  padding: 1rem;
  right: 0;
  z-index: 1;
  border-radius: 35px;
  background: var(--yellow);
  color: black;
  font-size: 1.2rem;
  text-align: center;
  margin: 2rem 10%;
  line-height: 1.5rem;
}

header.corner a { color: black; }

@media screen and (min-width: 1600px) {
  
  header.corner {
    position: fixed;
    width: auto;
    margin: 0;
    top: 0;
    border-radius: 0 0 0 35px;
  }

}

.zack {
  position: fixed;
  left: 0;
  background: #3287c1;
  color: white;
  padding: 5px 10px 10px 10px;
  border-radius: 0 25% 25% 0;
  bottom: 3rem;
  font-family: Inter, Roboto, 'Helvetica Neue', 'Arial Nova', 'Nimbus Sans', Arial, sans-serif;
  --width: 10ch;
  --padding: 1rem 1rem 1rem 0;
  opacity: 0.7;
}

.zack .zack_header {
  display: flex;
  align-items: center;
}

.zack .zack_z {
  text-decoration: underline;
  font-size: 200%;
}

.zack .zack_boehm {
  font-size: 90%;
}

.zack div span { display: block; }
.zack .zack_boehm {
  opacity: 0;
  width: 0;
  pointer-events: none;
  animation: zOut .2s;
}

.zack a {
  text-decoration: none;
  color: white;
}

.zack_icons {
  display: flex;
  justify-content: space-between;
  height: 0;
  padding: 0;
  width: 0;
  overflow: hidden;
  animation: zIOut .2s;
}

.zack svg {
  width: 150%;
  max-width: 30px;
  height: auto;
}

.zack:hover { opacity: 1; border-radius: 0 15px 15px 0; }
.zack:hover .zack_boehm {
  opacity: 1;
  width: var(--width);
  padding-left: 10px;
  pointer-events: initial;
  animation: z .3s;
}

.zack:hover .zack_icons {
  width: 100%;
  height: 3rem;
  animation: zI .3s;
  padding: var(--padding);
}

@keyframes z {
  0%    { opacity: 0; width: 0; padding-left: 0px; }
  50%   { opacity: 0; }
  100%  { opacity: 1; width: var(--width); padding-left: 10px; }
}

@keyframes zOut {
  0%   { opacity: 1; width: var(--width); padding-left: 10px; }
  50%  { opacity: 0; padding-left: 0px; }
  100% { opacity: 0; width: 0; padding-left: 0px; }
}

@keyframes zI {
  0%    { padding: 0; width: 0; height: 0; }
  50%  { padding: var(--padding); width: 100%; height: 3rem; }
  100%  { padding: var(--padding); width: 100%; height: 3rem; }
}

@keyframes zIOut {
  0%    { padding: var(--padding); width: 100%; height: 3rem; }
  50%  { padding: 0; width: 0; height: 0; }
  100%  { padding: 0; width: 0; height: 0; }
}

@media screen and (max-width: 800px) {
  .zack {
    font-size: 80%;
    --width: 15ch;
    --padding: 1rem 1rem 1rem 0;
    padding-left: calc(env(safe-area-inset-left) + 15px);
  }
}

@container details (max-width: 480px) {
  ul.details_price {
    grid-template-columns: 1fr 1fr;
    height: auto;
  }
  ul.details_price .price_current {
    background: linear-gradient(145deg, #383838 0%, #383838 25%, #2b2b2d 26%, #252525 100%);
  }
  ul.details_price.sale .price_current {
    grid-column: 1/-1;
    margin-top: 1rem;
  }
  ul.details_price .price_normal {
    padding-right: 1rem;
  }
}