@font-face {
  font-family: "Scim Display";
  src: url("/assets/fonts/RuneScape-UF.woff2") format("woff2"),
       url("/assets/fonts/RuneScape-UF.woff") format("woff");
  font-display: swap;
}

@font-face {
  font-family: "Scim Text";
  src: url("/assets/fonts/RuneScape-Plain-12.woff2") format("woff2"),
       url("/assets/fonts/RuneScape-Plain-12.woff") format("woff");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --gold: #d4a54a;
  --gold-bright: #efd385;
  --gold-muted: #8d713d;
  --ink: #0a0805;
  --surface: #14100c;
  --surface-raised: #211a13;
  --edge: #3c3225;
  --edge-light: #64533a;
  --text: #d9c7aa;
  --muted: #8f816d;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 50% 42%, rgba(94, 61, 25, .14), transparent 34%),
    radial-gradient(circle at 14% 10%, rgba(115, 54, 28, .08), transparent 30%),
    linear-gradient(145deg, #0b0907 0%, #12100d 48%, #080706 100%);
  font-family: "Scim Text", Georgia, serif;
  overscroll-behavior: none;
}

body::before {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .01) 1px, transparent 1px);
  background-size: 4px 4px;
  mask-image: radial-gradient(circle at center, #000 5%, transparent 74%);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-rows: 56px minmax(0, 1fr) 30px;
}

.client-toolbar {
  position: relative;
  display: grid;
  width: min(1950px, calc(100% - 32px));
  margin: 0 auto;
  align-items: center;
  grid-template-columns: 1fr auto 1fr;
  border-bottom: 1px solid rgba(212, 165, 74, .16);
}

.client-toolbar::after {
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 240px;
  height: 1px;
  content: "";
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(212, 165, 74, .72), transparent);
}

.toolbar-button {
  display: inline-flex;
  width: max-content;
  height: 34px;
  padding: 0 12px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--edge);
  border-radius: 3px;
  color: #b8a991;
  background: linear-gradient(#211b15, #15110d);
  box-shadow: inset 0 1px rgba(255, 255, 255, .025), 0 3px 12px rgba(0, 0, 0, .25);
  font: 16px "Scim Display", Georgia, serif;
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, transform .15s ease;
}

.toolbar-button:hover,
.toolbar-button:focus-visible {
  border-color: var(--gold-muted);
  color: var(--gold-bright);
  outline: 0;
}

.toolbar-button:active {
  transform: translateY(1px);
}

.toolbar-back > span:first-child {
  margin-top: -2px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 26px;
  line-height: .6;
}

.encounter-heading {
  align-self: center;
  text-align: center;
}

.encounter-heading h1 {
  margin: -1px 0 0;
  color: #e7d7bb;
  font: 21px/1 "Scim Display", Georgia, serif;
  font-weight: 400;
  letter-spacing: .035em;
  text-shadow: 0 2px 2px #000;
}

.encounter-kicker {
  display: block;
  margin-bottom: 3px;
  color: var(--gold-muted);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.toolbar-actions svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-width: 1.7;
}

.performance-pill {
  display: inline-flex;
  height: 28px;
  padding: 0 10px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(89, 119, 70, .24);
  border-radius: 20px;
  color: #8fa27f;
  background: rgba(25, 36, 20, .36);
  font-size: 11px;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.performance-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #75a85b;
  box-shadow: 0 0 8px rgba(117, 168, 91, .55);
}

.client-stage {
  display: grid;
  min-height: 0;
  place-items: center;
  padding: 10px 16px;
}

.client-size {
  position: relative;
}

.game-client {
  position: absolute;
  top: 0;
  left: 0;
  width: 1000px;
  height: 650px;
  overflow: hidden;
  transform-origin: top left;
  border: 0;
  border-radius: 4px;
  background: #050403;
  box-shadow:
    0 0 0 1px #5b4a32,
    0 0 0 4px #19130e,
    0 0 0 5px #312719,
    0 22px 80px rgba(0, 0, 0, .72),
    0 0 52px rgba(122, 79, 28, .09);
}

.game-client::before {
  position: absolute;
  z-index: 8;
  inset: 0;
  border: 1px solid rgba(218, 180, 98, .13);
  content: "";
  pointer-events: none;
}

.client-rivet {
  position: absolute;
  z-index: 9;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #665139;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .25), 0 1px 2px #000;
  pointer-events: none;
}

.client-rivet--tl { top: 5px; left: 5px; }
.client-rivet--tr { top: 5px; right: 5px; }
.client-rivet--bl { bottom: 5px; left: 5px; }
.client-rivet--br { right: 5px; bottom: 5px; }

#trainer_frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.loading-screen,
.load-error {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 42%, rgba(127, 78, 28, .2), transparent 35%),
    linear-gradient(#060503, #090705);
  opacity: 1;
  transition: opacity .45s ease, visibility .45s ease;
}

.loading-screen::before {
  position: absolute;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(212, 165, 74, .055);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 80px rgba(153, 91, 28, .08);
}

.loading-screen.is-complete {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loading-emblem {
  position: relative;
  z-index: 1;
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 19px;
  place-items: center;
  transform: rotate(45deg);
  border: 1px solid #695432;
  background: linear-gradient(145deg, #251b10, #0e0b07);
  box-shadow: inset 0 0 0 4px #13100b, 0 10px 32px rgba(0, 0, 0, .55);
}

.loading-emblem::after {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(212, 165, 74, .24);
  content: "";
}

.loading-emblem span {
  transform: rotate(-45deg);
  color: var(--gold-bright);
  font: 29px "Scim Display", Georgia, serif;
  text-shadow: 0 2px 3px #000;
}

.loading-emblem--inferno {
  border-color: #6e382c;
  background: linear-gradient(145deg, #2c1510, #0d0806);
}

.loading-emblem--waves span {
  font-size: 25px;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: -1px;
}

.loading-emblem--inferno::after {
  border-color: rgba(207, 91, 53, .3);
}

.loading-kicker {
  position: relative;
  z-index: 1;
  margin: 0 0 5px;
  color: var(--gold-muted);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.loading-screen h2,
.load-error h2 {
  position: relative;
  z-index: 1;
  margin: 0 0 22px;
  color: #ebdcc0;
  font: 30px "Scim Display", Georgia, serif;
  font-weight: 400;
  letter-spacing: .035em;
  text-shadow: 0 2px 3px #000;
}

.loading-track {
  position: relative;
  z-index: 1;
  width: 290px;
  height: 7px;
  overflow: hidden;
  border: 1px solid #352b1f;
  background: #080604;
  box-shadow: inset 0 1px 3px #000, 0 0 0 1px rgba(0, 0, 0, .6);
}

.loading-track span {
  display: block;
  width: 34%;
  height: 100%;
  background: linear-gradient(90deg, #795424, #d4a54a, #f0d68e, #8c622b);
  box-shadow: 0 0 12px rgba(212, 165, 74, .25);
  animation: load-sweep 1.35s ease-in-out infinite;
}

@keyframes load-sweep {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(300%); }
}

.loading-status {
  position: relative;
  z-index: 1;
  min-height: 16px;
  margin: 12px 0 0;
  color: #aa9a82;
  font-size: 13px;
}

.loading-tip {
  position: absolute;
  z-index: 1;
  bottom: 25px;
  margin: 0;
  color: #756a59;
  font-size: 12px;
  letter-spacing: .025em;
}

.loading-tip strong {
  color: #a69476;
  font-weight: 400;
}

.load-error[hidden] {
  display: none;
}

.load-error {
  z-index: 7;
}

.load-error h2 {
  margin-bottom: 7px;
}

.load-error p {
  margin: 0 0 18px;
  color: #9f9079;
  font-size: 14px;
}

.error-mark {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  place-items: center;
  border: 1px solid #85463e;
  border-radius: 50%;
  color: #e49a8c;
  background: #2a1210;
  font: 25px Georgia, serif;
}

.load-error button {
  min-width: 124px;
  height: 36px;
  border: 1px solid #816438;
  border-radius: 2px;
  color: #ead49b;
  background: linear-gradient(#322618, #1d160f);
  font: 16px "Scim Display", Georgia, serif;
  cursor: pointer;
}

.runtime-notice {
  position: absolute;
  z-index: 10;
  bottom: 17px;
  left: 17px;
  display: grid;
  max-width: 330px;
  padding: 10px 13px;
  gap: 2px;
  transform: translateY(14px);
  border: 1px solid rgba(204, 158, 69, .52);
  border-radius: 2px;
  opacity: 0;
  color: #b9aa91;
  background: rgba(20, 15, 10, .94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .48);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.runtime-notice.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.runtime-notice strong {
  color: #e5cb8d;
  font: 16px "Scim Display", Georgia, serif;
  font-weight: 400;
}

.runtime-notice span {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-footer {
  display: flex;
  width: min(1875px, calc(100% - 32px));
  margin: 0 auto;
  align-items: flex-start;
  gap: 22px;
  color: #6f675b;
  font-size: 11px;
  letter-spacing: .025em;
  white-space: nowrap;
}

.client-footer kbd {
  color: #9c8b70;
  background: transparent;
  font: inherit;
}

.client-scale {
  margin-left: auto;
  color: #766a58;
}

.screen-notice {
  display: none;
}

@media (max-width: 920px) {
  .performance-pill {
    display: none;
  }

  .client-toolbar {
    grid-template-columns: 1fr auto 1fr;
  }

  .client-footer span:nth-child(2),
  .client-footer span:nth-child(3) {
    display: none;
  }
}

@media (max-width: 759px) {
  .app-shell {
    display: none;
  }

  .screen-notice {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: grid;
    padding: 24px;
    place-items: center;
    background: #0b0907;
    text-align: center;
  }

  .screen-notice > div {
    width: min(370px, 100%);
    padding: 34px 28px;
    border: 1px solid var(--edge);
    background: #14100c;
    box-shadow: 0 18px 60px #000;
  }

  .notice-mark {
    display: grid;
    width: 46px;
    height: 46px;
    margin: 0 auto 18px;
    place-items: center;
    transform: rotate(45deg);
    border: 1px solid var(--gold-muted);
    color: var(--gold-bright);
    font: 24px "Scim Display", Georgia, serif;
  }

  .notice-mark::first-letter {
    transform: rotate(-45deg);
  }

  .screen-notice h1 {
    margin: 0 0 8px;
    color: #e7d7bb;
    font: 27px "Scim Display", Georgia, serif;
    font-weight: 400;
  }

  .screen-notice p {
    margin: 0 0 20px;
    color: var(--muted);
    line-height: 1.5;
  }

  .screen-notice a {
    color: var(--gold);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-track span {
    width: 58%;
    animation: none;
  }

  .loading-screen,
  .toolbar-button {
    transition: none;
  }
}
