@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/poppins-600.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/poppins-700.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("./fonts/poppins-800.woff2") format("woff2");
}

:root {
  --bg: #000000;
  --surface: #17191c;
  --surface-2: #22252a;
  --text: #ffffff;
  --muted: #bfc3ca;
  --soft: #d7eefb;
  --blue: #2a8fd8;
  --blue-2: #8bd8ff;
  --blue-3: #bfefff;
  --cyan: #62d7ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 600px;
  height: 600px;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

.app-root {
  position: relative;
  width: 600px;
  height: 600px;
  padding: 18px 20px 16px;
  display: grid;
  grid-template-rows: 62px 482px 26px;
  gap: 6px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  min-width: 0;
}

h1 {
  margin: 0;
  font-size: 27px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.topbar p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
}

.depth-dots {
  position: absolute;
  left: 16px;
  top: 78px;
  bottom: 78px;
  z-index: 3;
  width: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.depth-dots::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 50%;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(to bottom, rgba(139, 216, 255, 0.55), rgba(255, 208, 79, 0.5));
  opacity: 0.36;
  transform: translateX(-50%);
}

.dot {
  position: relative;
  z-index: 1;
  width: 3px;
  height: 3px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(215, 238, 251, 0.76);
  opacity: 0.58;
  transition:
    width 180ms cubic-bezier(0.4, 0.04, 0.5, 1),
    height 180ms cubic-bezier(0.4, 0.04, 0.5, 1),
    opacity 180ms cubic-bezier(0.4, 0.04, 0.5, 1);
}

.dot.active {
  width: 11px;
  height: 11px;
  opacity: 1;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(139, 216, 255, 0.32);
}

.dot-bedrock {
  background: #67c9ff;
}

.dot-evaporite {
  background: #7ff0ff;
}

.dot-common-crystal {
  background: #aeb7ff;
}

.dot-common-mineral {
  background: #67e0a0;
}

.dot-possible-crystal {
  background: #ffe873;
}

.dot-possible-gem {
  background: #f2a3ff;
}

.dot-rare-possible {
  background: #ffd04f;
}

.material-card {
  position: relative;
  display: grid;
  grid-template-rows: 218px 1fr;
  min-height: 0;
  padding: 34px 38px 16px 50px;
  border: 4px solid rgba(98, 215, 255, 0.42);
  border-radius: 38px;
  background:
    radial-gradient(circle at 50% 32%, rgba(98, 215, 255, 0.18), rgba(42, 143, 216, 0.08) 28%, transparent 54%),
    linear-gradient(160deg, rgba(34, 37, 42, 0.92), rgba(16, 17, 20, 0.88));
  outline: none;
  overflow: hidden;
}

.material-card::before,
.material-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;
}

.material-card::before {
  top: 0;
  height: 78px;
  background: linear-gradient(to bottom, rgba(16, 17, 20, 0.98), rgba(16, 17, 20, 0));
}

.material-card::after {
  bottom: 0;
  height: 66px;
  background: linear-gradient(to top, rgba(16, 17, 20, 0.98), rgba(16, 17, 20, 0));
}

.material-card:focus {
  border-color: var(--blue-3);
}

.viewer-shell {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

#materialCanvas {
  display: block;
  width: 380px;
  height: 250px;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    transform 260ms cubic-bezier(0.4, 0.04, 0.5, 1),
    opacity 210ms cubic-bezier(0.4, 0.04, 0.5, 1);
}

#materialCanvas.stone-exit-up {
  opacity: 0;
  transform: translateY(-112px) scale(0.92);
}

#materialCanvas.stone-exit-down {
  opacity: 0;
  transform: translateY(112px) scale(0.92);
}

#materialCanvas.stone-enter-up {
  opacity: 0;
  transform: translateY(-112px) scale(0.92);
  transition: none;
}

#materialCanvas.stone-enter-down {
  opacity: 0;
  transform: translateY(112px) scale(0.92);
  transition: none;
}

.layer-peek {
  position: absolute;
  left: 58px;
  right: 38px;
  z-index: 4;
  height: 38px;
  border: 3px solid rgba(139, 216, 255, 0.3);
  border-radius: 24px;
  background:
    linear-gradient(160deg, rgba(38, 42, 48, 0.62), rgba(11, 12, 15, 0.34));
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition:
    opacity 210ms cubic-bezier(0.4, 0.04, 0.5, 1),
    transform 210ms cubic-bezier(0.4, 0.04, 0.5, 1);
}

.layer-peek.visible {
  opacity: 1;
}

.layer-peek-prev {
  top: -26px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 16px 8px;
  transform: translateY(-4px);
}

.layer-peek-next {
  bottom: -26px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8px 16px 0;
  transform: translateY(4px);
}

.copy-panel {
  position: relative;
  z-index: 3;
  min-height: 0;
  padding: 0;
  text-align: center;
  opacity: 1;
  transform: translateY(0);
  transition:
    transform 260ms cubic-bezier(0.4, 0.04, 0.5, 1),
    opacity 210ms cubic-bezier(0.4, 0.04, 0.5, 1);
}

.copy-panel.copy-exit {
  opacity: 0;
  transform: translateY(-36px);
}

.copy-panel.copy-enter {
  opacity: 0;
  transform: translateY(36px);
  transition: none;
}

.copy-panel.copy-exit-up {
  transform: translateY(-36px);
}

.copy-panel.copy-exit-down {
  transform: translateY(36px);
}

.copy-panel.copy-enter-up {
  transform: translateY(-36px);
}

.copy-panel.copy-enter-down {
  transform: translateY(36px);
}

.depth-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  max-width: 320px;
  height: 27px;
  margin: 0 auto 6px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #111419;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  height: 30px;
  padding: 0 16px;
  border: 2px solid rgba(139, 216, 255, 0.54);
  border-radius: 999px;
  background: rgba(42, 143, 216, 0.16);
  color: var(--blue-2);
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
}

h2 {
  margin: 10px 0 7px;
  color: var(--text);
  font-size: 32px;
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: 0;
}

.sentence,
.where {
  max-width: 520px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
  color: #e7e9ed;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.where {
  margin-top: 7px;
  color: var(--muted);
  font-size: 15px;
}

.hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.05;
  font-style: italic;
  font-weight: 600;
}

.hint span {
  white-space: nowrap;
}

.hint .mode {
  color: var(--blue-2);
  max-width: 128px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
}

.loading-screen,
.error-screen {
  position: absolute;
  inset: 86px 20px 42px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  border: 4px solid rgba(139, 216, 255, 0.44);
  border-radius: 38px;
  background:
    radial-gradient(circle at 50% 42%, rgba(98, 215, 255, 0.18), transparent 44%),
    linear-gradient(160deg, rgba(34, 37, 42, 0.96), rgba(16, 17, 20, 0.94));
  text-align: center;
}

.hidden {
  display: none;
}

.dig-mark {
  width: 118px;
  height: 118px;
  border: 4px solid rgba(139, 216, 255, 0.58);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.dig-mark div {
  width: 48px;
  height: 70px;
  border-left: 8px solid var(--blue-2);
  border-bottom: 8px solid var(--blue-2);
  transform: rotate(-24deg);
  animation: dig 900ms cubic-bezier(0.6, 0, 0.4, 1) infinite alternate;
}

.loading-screen h2,
.error-screen h2 {
  margin: 0 0 12px;
  font-size: 33px;
}

.loading-screen p,
.error-screen p {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.3;
}

@keyframes dig {
  from {
    transform: rotate(-34deg) translateY(-4px);
  }

  to {
    transform: rotate(-12deg) translateY(6px);
  }
}

.focusable {
  transition:
    transform 475ms cubic-bezier(0.6, 0, 0.4, 1),
    opacity 300ms cubic-bezier(0.4, 0.04, 0.5, 1),
    border-color 300ms cubic-bezier(0.4, 0.04, 0.5, 1);
}

.focusable:focus {
  transform: scale(0.97);
}

@media (prefers-reduced-motion: reduce) {
  .focusable {
    transition: none;
  }

  .dig-mark div {
    animation: none;
  }

  #materialCanvas,
  .copy-panel {
    transition: none;
  }
}
