/* master.css */

/* Base reset */
* {
  padding: 0;
  list-style: none;
  text-decoration: none;
  height: 100%;
  margin: 0;
}

html{
  background-color: black;
}

/* Fonts */
@font-face {
  font-family: SanFrancisco-T;
  src: url('../fonts/SF-Pro-Display-Thin.otf');
}

@font-face {
  font-family: SanFrancisco-L;
  src: url('../fonts/SF-Pro-Display-Light.otf');
}

@font-face {
  font-family: SanFrancisco-M;
  src: url('../fonts/SF-Pro-Display-Medium.otf');
}

@font-face {
  font-family: SanFrancisco-SB;
  src: url('../fonts/SF-Pro-Display-SemiBold.otf');
}

@font-face {
  font-family: SanFrancisco-B;
  src: url('../fonts/SF-Pro-Display-Bold.otf');
}

.icon {
  color: #fff;
  display: block;
}

/* Make modal contents not inherit the global height:100% */
.setting_modal *,
.welcome_modal * {
  height: auto;
}

/* Welcome modal (Cookie banner) — smaller like the old layout */
.welcome_modal {
  position: absolute;
  display: none;
  z-index: 2000;
  width: 380px;
  /* smaller */
  height: 460px;
  /* smaller to remove empty space */
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.45), rgba(20, 20, 20, 0.28));
  backdrop-filter: blur(10px) saturate(115%);
  -webkit-backdrop-filter: blur(10px) saturate(115%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
}

.welcome_modal h1 {
  position: absolute;
  top: 44px;
  /* slightly tighter */
  left: 50%;
  width: 100%;
  transform: translate(-50%, 0%);
  color: white;
  font-size: 28px;
  font-family: SanFrancisco-T;
  text-align: center;
}

.welcome_modal h1 b {
  font-family: SanFrancisco-B;
}

.welcome_modal h2 {
  position: absolute;
  top: 80px;
  /* pulled a bit up */
  left: 50%;
  width: 100%;
  transform: translate(-50%, 0%);
  color: white;
  font-size: 15px;
  font-family: SanFrancisco-T;
  text-align: center;
  opacity: 0.55;
}

/* Center block with icon-left and label centered vertically */
.modal_launch_center_cont {
  position: absolute;
  left: 50%;
  top: 128px;
  /* starts closer to title */
  transform: translateX(-50%);
  width: 250px;
  height: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal_launch_span_item {
  display: grid;
  grid-template-columns: 22px 1fr;
  /* icon + label */
  align-items: center;
  /* vertically center text with icon */
  column-gap: 12px;
  height: 28px;
  /* consistent row height */
}

.modal_launch_span_item p {
  font-size: 16px;
  font-family: SanFrancisco-L;
  color: white;
  line-height: 1.2;
}

/* Action button with a bit less bottom space */
.modal_launch_btn {
  position: absolute;
  bottom: 24px;
  /* reduced from 32 to save space */
  left: 50%;
  transform: translate(-50%, 0%);
  background: linear-gradient(135deg, rgba(20, 115, 183, 0.92), rgba(86, 204, 242, 0.92));
  padding: 16px 18px;
  height: auto;
  width: 300px;
  /* slightly narrower */
  color: white;
  font-family: SanFrancisco-M;
  font-size: 16px;
  border: none;
  border-radius: 44px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(20, 115, 183, 0.28);
}

/* Settings modal */
.setting_modal {
  position: absolute;
  display: none;
  z-index: 2000;
  width: 450px;
  height: 700px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.45), rgba(20, 20, 20, 0.28));
  backdrop-filter: blur(10px) saturate(115%);
  -webkit-backdrop-filter: blur(10px) saturate(115%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
}

.setting_modal h1 {
  position: absolute;
  top: 48px;
  left: 50%;
  width: 100%;
  transform: translate(-50%, 0%);
  color: white;
  font-size: 26px;
  font-family: SanFrancisco-T;
  text-align: center;
}

.setting_modal h1 b {
  font-family: SanFrancisco-B;
}

.setting_modal h2 {
  position: absolute;
  top: 84px;
  left: 50%;
  width: 100%;
  transform: translate(-50%, 0%);
  color: white;
  font-size: 14px;
  font-family: SanFrancisco-T;
  text-align: center;
  opacity: 0.55;
}

.modal_close_btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Settings content layout */
.setting_span_cont {
  position: absolute;
  width: 360px;
  left: 50%;
  top: 132px;
  transform: translate(-50%, 0%);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.setting_span_it {
  display: grid;
  grid-template-areas:
    "label value"
    "slider slider";
  grid-template-columns: 1fr auto;
  align-items: center;
  row-gap: 10px;
}

/* Captions use the same light font as the rest */
.st_s_cap {
  grid-area: label;
  font-size: 16px;
  font-family: SanFrancisco-L;
  color: white;
  opacity: 0.95;
}

.st_s_var {
  grid-area: value;
  font-size: 12px;
  font-family: SanFrancisco-L;
  color: rgba(255, 255, 255, 0.9);
  text-align: right;
}

.setting_span_it input {
  grid-area: slider;
  width: 100%;
}

/* Range sliders — visible track */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
}

input[type="range"]:hover::-webkit-slider-runnable-track {
  background: rgba(255, 255, 255, 0.30);
}

input[type="range"]:focus-visible::-webkit-slider-runnable-track {
  background: rgba(255, 255, 255, 0.36);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

input[type="range"]::-moz-range-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
}

input[type="range"]::-moz-range-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

/* Footer actions */
.settings_footer {
  position: absolute;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0));
  display: flex;
  gap: 10px;
}

.settings_footer .btn {
  position: static;
}

/* Buttons */
.btn {
  display: none;
  position: absolute;
  width: auto;
  height: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(19, 19, 19, 0.38);
  backdrop-filter: blur(6px) saturate(110%);
  -webkit-backdrop-filter: blur(6px) saturate(110%);
  color: white;
  font-family: SanFrancisco-L;
  font-size: 13px;
  transform: translate(0%, 0%);
  padding: 8px 12px 8px 10px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.btn.small {
  font-size: 13px;
  padding: 8px 12px 8px 10px;
  border-radius: 12px;
}

.btn.small.primary {
  background: rgba(20, 115, 183, 0.90);
  border-color: rgba(255, 255, 255, 0.0);
}

.btn.small.secondary {
  background: rgba(19, 19, 19, 0.30);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.reload_btn {
  left: 50px;
  bottom: 45px;
}

.screenshot_btn {
  right: 50px;
  bottom: 45px;
}

#burger_btn {
  top: 45px;
  right: 50px;
  padding: 8px;
  background: rgba(19, 19, 19, 0.38);
  backdrop-filter: blur(6px) saturate(110%);
  -webkit-backdrop-filter: blur(6px) saturate(110%);
  width: 38px;
  height: 38px;
  justify-content: center;
}

.perlin_app_topimg {
  position: absolute;
  left: 100px;
  top: 52.5px;
  width: auto;
  height: 30px;
}

.perlin_app_topcap {
  position: absolute;
  left: 140px;
  top: 52.5px;
  font-size: 25px;
  font-family: SanFrancisco-T;
  color: white;
  height: auto;
}

.perlin_app_topcap b {
  font-family: SanFrancisco-B;
}

.progress_line_cont {
  position: absolute;
  left: 140px;
  top: 90px;
  width: 225px;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.151);
}

.progress_line {
  position: absolute;
  top: 0px;
  left: 0px;
  height: 100%;
  width: 50px;
  background-color: white;
}

main {
  background-color: black;
}

.performance_text {
  position: absolute;
  display: none;
  left: 50%;
  bottom: 20px;
  font-size: 12px;
  font-family: SanFrancisco-L;
  color: red;
  transform: translate(-50%, 0%);
  text-align: center;
  width: auto;
  height: auto;
  opacity: 0.65;
}

/* Responsive */
@media screen and (max-width: 1000px) {
  .btn {
    bottom: 25px;
    border-radius: 12px;
    font-size: 12px;
    padding: 7px 10px 7px 9px;
  }

  #burger_btn {
    top: 36px;
    right: 30px;
    width: 34px;
    height: 34px;
  }

  .reload_btn {
    left: 20px;
  }

  .screenshot_btn {
    right: 20px;
  }

  .perlin_app_topimg {
    left: 42.5px;
    top: 38px;
    height: 30px;
  }

  .perlin_app_topcap {
    left: 50%;
    top: 38px;
    font-size: 25px;
    font-family: SanFrancisco-T;
    color: white;
    height: auto;
    width: 250px;
    transform: translate(-50%, 0%);
    text-align: center;
  }

  .progress_line_cont {
    left: 50%;
    top: 80px;
    width: 225px;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.151);
    transform: translate(-50%, 0%);
  }

  /* Smaller cookie banner on mobile as well */
  .welcome_modal {
    width: 340px;
    height: 420px;
    top: 50%;
  }

  .modal_launch_center_cont {
    width: 300px;
    gap: 14px;
    top: 116px;
  }

  .modal_launch_btn {
    width: 260px;
    bottom: 18px;
  }

  .setting_modal {
    width: 360px;
    height: 560px;
  }

  .setting_span_cont {
    width: 310px;
    top: 116px;
    gap: 18px;
  }

  .settings_footer {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0));
  }
}