/* main menu */

body.channel-splash {
  background-color: black;
}

.main-menu {
  margin: 0;
  transition: transform 900ms, opacity 400ms, background-color 900ms, visibility 900ms;
  opacity: 1;
  visibility: visible;
  background-image: url(../images/bg-pattern.png);
  background-color: lightgrey;
  width: 100%;
  height: 100vh;
}

.main-menu.channel-splash {
  transform: scale(4);
  opacity: 0;
  background-color: black;
  background-image: none !important;
  visibility: hidden;
}

.top-section {
  height: calc(100% - 219px);
  padding: 80px;
  padding-top: 3vh;
  padding-bottom: 0;
  box-sizing: border-box;
}

.bottom-section {
  height: 219px;
  background: #d2d6db;
  background-image: url(../images/bottom-bg.png);
}

.col {
  width: 24%;
  height: 100%;
  display: inline-block;
  box-sizing: border-box;
}

.col.first {
  margin-left: 20px;
}

.channel-icon {
  display: block;
  width: 20.2vw;
  height: 11.1vw;
  margin-top: 2vh;
  position: relative;
  margin-left: auto;
  margin-right: auto;
  transform-origin: center;
  transition: transform 180ms ease;
}

.channel-icon.occupied:hover,
.channel-icon.occupied:focus-within {
  transform: scale(1.015);
  z-index: 1;
}

.channel-icon:after {
  position: absolute;
  top: 0;
  left: 0;
  width: 20.2vw;
  height: 11.1vw;
  content: '';
  background-image: url(../images/channel-border.png);
  background-size: 100% 100%;
}

.channel-icon.occupied .hover {
  position: absolute;
  top: 0;
  left: 0;
  width: 20.2vw;
  height: 11.1vw;
  content: '';
  z-index: 99;
  background-image: url(../images/channel-hover.png);
  background-size: 100% 100%;
  background-color: transparent;
  opacity: 0;
  transition: background-color 180ms ease, opacity 180ms ease;
}

.channel-splash .channel-icon.occupied .hover {
  display: none !important;
}

.channel-icon img {
  display: inherit;
  width: inherit;
  height: inherit;
  /* TODO: does not work in Edge/IE11 and has shoddy browser support */
  -webkit-clip-path: polygon(2% 7%, 6% 2%, 52% 1%, 95% 3%, 98% 8%, 100% 49%, 98% 92%, 95% 97%, 50% 99%, 5% 97%, 2% 93%, 0 50%);
  clip-path: polygon(2% 7%, 6% 2%, 52% 1%, 95% 3%, 98% 8%, 100% 49%, 98% 92%, 95% 97%, 50% 99%, 5% 97%, 2% 93%, 0 50%);
}

.left-button {
  position: absolute;
  bottom: 42px;
  left: 0;
  background-image: url(../images/left-button.png);
  width: 185px;
  height: 135px;
  background-size: 100% 100%;
}

.wii-button {
  background-image: url(../images/wii-button.png);
  width: 144px;
  height: 144px;
  position: absolute;
  bottom: 40px;
  left: 38px;
  background-size: 100% 100%;
}

.right-button {
  position: absolute;
  bottom: 42px;
  right: 0;
  background-image: url(../images/right-button.png);
  width: 185px;
  height: 135px;
  background-size: 100% 100%;
}

.mail-button {
  background-image: url(../images/mail-button.png);
  width: 100px;
  height: 105px;
  position: absolute;
  bottom: 60px;
  right: 60px;
  background-size: 100% 100%;
  z-index: 999;
}

.corner-button {
  cursor: url(../images/cursor.png), auto;
  transition: 300ms;
}

.date {
  position: absolute;
  color: #84868a;
  font-family: 'Asap', sans-serif;
  bottom: 32px;
  left: 50%;
  transform: translate(-50%, 0);
  font-size: 40px;
  letter-spacing: -1px;
  pointer-events: none;
}

/* channel splash screen */

.splash-screen {
  position: absolute;
  box-sizing: border-box;
  height: 80vh;
  width: 100%;
  position: absolute;
  top: -80vh;
  left: 0;
  background-size: cover;
  transition: opacity 500ms ease, transform 500ms ease;
  opacity: 0;
  transform: scale(0.3);
}

.channel-splash .splash-screen {
  top: 0;
  opacity: 1;
  transform: scale(1);
}

/* TODO: splash bar animation comes from top for some reason in IE11 */

.splash-bar {
  height: 20vh;
  box-sizing: border-box;
  background-color: lightgrey;
  transition: bottom 500ms ease, opacity 500ms ease;
  border-top: solid 2px black;
  background-image: url(../images/splash-bar.png);
  position: fixed;
  z-index: 99;
  width: 100%;
  bottom: -20vh;
  left: 0;
  opacity: 0;
}

.channel-splash .splash-bar {
  bottom: 0;
  opacity: 1;
}

.border-topleft {
  background-image: url(../images/border-topleft.png);
  width: 306px;
  height: 230px;
  top: 0;
  left: 0;
  position: absolute;
  z-index: 9991;
}

.border-topright {
  background-image: url(../images/border-topright.png);
  width: 306px;
  height: 230px;
  top: 0;
  right: 0;
  position: absolute;
  z-index: 9992;
}

.border-bottomleft {
  background-image: url(../images/border-bottomleft.png);
  width: 306px;
  height: 230px;
  bottom: 0;
  left: 0;
  position: absolute;
  z-index: 9993;
}

.border-bottomright {
  background-image: url(../images/border-bottomright.png);
  width: 306px;
  height: 230px;
  bottom: 0;
  right: 0;
  position: absolute;
  z-index: 9994;
}

.border {
  display: none;
}

.channel-splash .border {
  display: block;
}

.splash-buttons {
  width: 50%;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  padding-top: 4.1vh;
  height: 20vh;
  box-sizing: border-box;
}

/* changes for channel -> menu transition */

.splash-switch .main-menu {
  transition: transform 400ms;
}

.splash-switch .splash-screen {
  top: 0;
}

/* buttons */

.btn {
  background-image: url(../images/btn-texture.png);
  background-size: auto 100%;
  height: 5vw;
  width: 15vw;
  display: inline-block;
  position: relative;
  margin-left: 4.5vw;
  margin-right: 4.5vw;
  text-decoration: none;
  line-height: 100%;
  font-family: 'Asap', sans-serif;
  color: #474747 !important;
  font-size: 2.2vw;
  line-height: calc(4.5vw + 5px);
  cursor: url(../images/cursor.png), auto !important; /* TODO: does not work in IE11, buggy in Chrome OS */
  transform: scale(1);
  transition: 150ms ease;
}

.btn:before {
  background-image: url(../images/btn-left.png);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  height: 5vw;
  width: 2.2vw;
  display: inline-block;
  content: '';
  position: absolute;
  left: -2.2vw;
}

.btn:after {
  background-image: url(../images/btn-right.png);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  height: 5vw;
  width: 2.2vw;
  display: inline-block;
  content: '';
  position: absolute;
  right: -2.2vw;
}


/* SFX */

.sfx {
  display: none;
}

/* mini mode */

@media only screen and (max-height: 718px) {
  .top-section {
    height: calc(100% - 130px);
  }

  .bottom-section {
    height: 130px;
    background-image: url(../images/mini-bottom-bg.png);
  }

  .left-button-container {
    transform: scale(0.6);
    transform-origin: left;
  }

  .right-button-container {
    transform: scale(0.6);
    transform-origin: right;
  }

  .left-button, .right-button {
    bottom: 180px;
  }

  .corner-button {
    bottom: 197px;
	}

  .bottom-title {
    transform-origin: top;
    transform: scale(0.65);
  }

  .date {
    font-size: 22px;
    bottom: 17px;
  }
}

@media only screen and (max-height: 826px) {
  .top-section {
    padding-top: 1em !important;
  }
}

@media only screen and (max-height: 640px) {
  .channels {
    transform: scale(0.9);
  }
}

/*
@media only screen and (max-height: 600px) {
  .channels {
    transform: scale(0.8);
		transform-origin: top;
  }
}

@media only screen and (max-height: 524px) {
  .channels {
    transform: scale(0.7);
		transform-origin: top;
  }
} */

/* widescreen fixes */

@media only screen and (min-width: 1720px) {
  .top-section {
    transform: scale(0.9);
    padding-top: 0em !important;
  }
}

/******************/
/*    testing     */
/* needs 2b moved */
/******************/

.channels {
  max-width: 1920px;
  margin-left: auto;
  margin-right: auto;
}

@media only screen and (min-width: 1920px) {
  .channel-icon, .channel-icon *, .channel-icon:after, .channel-icon:before {
    width: 387px !important;
    height: 213px !important;
  }
}

@media only screen and (max-height: 47vw) {
  .channel-icon, .channel-icon *, .channel-icon:after, .channel-icon:before {
    width: 40vh !important;
    height: 22.5vh !important;
    max-width: 439px !important;
    max-height: 247px !important;
  }

  .channels-container {

  }
}

/* Pons launchpad and live Dexscreener channels */

.pons-channel,
.dex-chart-channel {
  overflow: hidden;
  background: #fff;
  -webkit-clip-path: polygon(2% 7%, 6% 2%, 52% 1%, 95% 3%, 98% 8%, 100% 49%, 98% 92%, 95% 97%, 50% 99%, 5% 97%, 2% 93%, 0 50%);
  clip-path: polygon(2% 7%, 6% 2%, 52% 1%, 95% 3%, 98% 8%, 100% 49%, 98% 92%, 95% 97%, 50% 99%, 5% 97%, 2% 93%, 0 50%);
}

.pons-channel img {
  box-sizing: border-box;
  object-fit: contain;
  padding: 1vw;
  outline: 1px solid oklch(0 0 0 / 0.1);
  outline-offset: -1px;
}

.channel-icon.occupied .hover {
  appearance: none;
  padding: 0;
  border: 0;
  cursor: url(../images/cursor.png), pointer;
  transition-property: opacity, transform;
}

.channel-icon.occupied .hover:focus-visible {
  background-color: rgb(146 222 247 / 16%);
  opacity: 1;
  outline: 3px solid;
  outline-offset: -5px;
}

.channel-icon.occupied .hover:active {
  transform: scale(0.96);
}

.splash-screen {
  overflow: hidden;
  background: #fff;
}

.splash-image,
.splash-chart,
.splash-placeholder {
  display: none;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.splash-screen.image-channel .splash-image {
  display: block;
}

.splash-screen.chart-channel .splash-chart {
  display: block;
}

.splash-screen.placeholder-channel .splash-placeholder {
  display: flex;
}

.splash-screen.image-channel .splash-image {
  object-fit: cover;
  outline: 1px solid oklch(0 0 0 / 0.1);
  outline-offset: -1px;
}

.splash-placeholder {
  align-items: center;
  color: #555;
  font-family: Asap, sans-serif;
  font-size: clamp(1.5rem, 4vw, 3rem);
  justify-content: center;
}

.corner-button {
  transition-property: transform;
}

.channel-icon.occupied .hover,
.corner-button,
.btn {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .channel-icon.occupied .hover:hover {
    background-color: rgb(146 222 247 / 16%);
    opacity: 1;
  }

  .corner-button:hover,
  .btn:hover {
    transform: scale(1.1);
  }
}

.corner-button:active,
.btn:active {
  transform: scale(0.96);
}

.corner-button:focus-visible,
.btn:focus-visible {
  outline: 3px solid;
  outline-offset: 4px;
}

.btn {
  transition-property: transform, opacity;
}

.btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* Mobile menu: eight channels in a touch-friendly two-column grid. */

@media only screen and (max-width: 48rem) {
  .main-menu {
    height: 100dvh;
  }

  .top-section {
    display: flex;
    align-items: center;
    height: calc(100dvh - 124px - env(safe-area-inset-bottom));
    min-height: 0;
    padding: max(16px, env(safe-area-inset-top)) 16px 16px;
  }

  .channels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(12px, 2vh, 18px) 12px;
    width: min(100%, 34rem);
    margin-inline: auto;
    transform: none;
  }

  .col,
  .col.first {
    display: contents;
    width: auto;
    height: auto;
    margin: 0;
  }

  .channel-icon,
  .channel-icon *,
  .channel-icon::after,
  .channel-icon::before {
    width: 100% !important;
    height: 100% !important;
  }

  .channel-icon {
    aspect-ratio: 340 / 186;
    margin: 0;
  }

  .channel-icon.mobile-overflow {
    display: none;
  }

  .pons-channel img {
    padding: clamp(8px, 3vw, 16px);
  }

  .bottom-section {
    position: relative;
    height: calc(124px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
    background-image: url(../images/mini-bottom-bg.png);
    background-size: auto 100%;
  }

  .left-button-container,
  .right-button-container {
    transform: none;
  }

  .left-button,
  .right-button {
    bottom: 8px;
    width: 111px;
    height: 81px;
  }

  .wii-button {
    bottom: 7px;
    left: 23px;
    width: 86px;
    height: 86px;
  }

  .mail-button {
    right: 30px;
    bottom: 15px;
    width: 60px;
    height: 63px;
  }

  .date {
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: min(42vw, 10rem);
    overflow-wrap: anywhere;
    text-align: center;
    font-size: 16px;
    line-height: 1.15;
    letter-spacing: -0.25px;
    white-space: nowrap;
  }

  .border {
    display: none !important;
  }

  .splash-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 36px;
    width: 100%;
    padding: 0 24px;
  }

  .btn {
    flex: 0 1 120px;
    width: 120px;
    height: 44px;
    margin: 0;
    font-size: 18px;
    line-height: 44px;
  }

  .btn::before,
  .btn::after {
    width: 18px;
    height: 44px;
  }

  .btn::before {
    left: -18px;
  }

  .btn::after {
    right: -18px;
  }
}

@media only screen and (max-width: 22rem) {
  .left-button,
  .right-button {
    width: 100px;
    height: 73px;
  }

  .wii-button {
    left: 20px;
    width: 76px;
    height: 76px;
  }

  .mail-button {
    right: 24px;
    width: 54px;
    height: 57px;
  }

  .date {
    width: calc(100% - 208px);
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
