/* THE PLACE - web player shell, in the fyma.store palette
   ink #08090C / depth #1A2230 / silver #DED6D8 / champagne #E8D3A6 */

@font-face {
  font-family: 'TP Mono';
  src: url('SpaceMono-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #08090C;
  color: #DED6D8;
  font-family: 'TP Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

#tp-root {
  position: fixed;
  inset: 0;
  background: #08090C;
}

#unity-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #08090C;
  outline: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ---------------- loader ---------------- */
#tp-loader {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 600px at 50% 38%, rgba(26, 34, 48, .75), transparent 65%),
    #08090C;
  transition: opacity .6s ease;
}
#tp-loader.is-gone { opacity: 0; pointer-events: none; }

/* stepped film grain, the site's .fy3-grain */
#tp-loader::before {
  content: "";
  position: absolute;
  inset: -50%;
  opacity: .09;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
  animation: tpGrain 640ms steps(3) infinite;
}
@keyframes tpGrain {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-3%, 2%); }
  66% { transform: translate(2%, -3%); }
  100% { transform: translate(0, 0); }
}

.tp-loader-in {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: min(560px, 84vw);
}

.tp-swirl {
  width: 84px;
  height: 84px;
  opacity: .92;
  filter: drop-shadow(0 0 18px rgba(232, 211, 166, .28));
  animation: tpSpin 3.2s linear infinite;
}
@keyframes tpSpin { to { transform: rotate(360deg); } }

.tp-title {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 2px 18px rgba(8, 9, 12, .9));
}

.tp-bar {
  position: relative;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(222, 214, 216, .14);
}
.tp-fill {
  position: absolute;
  inset: 0;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #b9a47a, #E8D3A6 60%, #fff4dc);
  box-shadow: 0 0 14px rgba(232, 211, 166, .55);
  transition: transform .25s ease-out;
}

.tp-status {
  margin: 0;
  font-size: 12px;
  letter-spacing: .3em;
  text-indent: .3em;
  color: #E8D3A6;
  opacity: .9;
}

/* ---------------- error ---------------- */
#tp-error {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: #08090C;
}
#tp-error[hidden] { display: none; }
.tp-error-title {
  margin: 0;
  font-size: 15px;
  letter-spacing: .28em;
  color: #E8D3A6;
}
.tp-error-msg {
  margin: 0;
  max-width: 52ch;
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: .04em;
  opacity: .85;
}
.tp-retry {
  margin-top: 8px;
  padding: 12px 26px;
  border: 1px solid rgba(222, 214, 216, .45);
  border-radius: 999px;
  background: rgba(8, 9, 12, .7);
  color: #DED6D8;
  font: inherit;
  font-size: 13px;
  letter-spacing: .24em;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s, transform .2s;
}
.tp-retry:hover, .tp-retry:focus-visible {
  color: #08090C;
  background: #E8D3A6;
  border-color: #E8D3A6;
  transform: translateY(-2px);
  outline: none;
}

/* ---------------- warnings from the Unity loader ---------------- */
#tp-toast {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  transform: translateX(-50%);
  max-width: 86vw;
  padding: 10px 18px;
  border: 1px solid rgba(232, 211, 166, .5);
  border-radius: 999px;
  background: rgba(8, 9, 12, .85);
  font-size: 11px;
  letter-spacing: .12em;
  color: #DED6D8;
}
#tp-toast[hidden] { display: none; }

@media (max-height: 460px) {
  .tp-loader-in { gap: 14px; width: min(460px, 70vw); }
  .tp-swirl { width: 56px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .tp-swirl, #tp-loader::before { animation: none; }
}
