html,
body {
  background: #101b2b;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.middle::-webkit-scrollbar {
  display: none;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url('../assets/wallpaper.webp') center / cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

body.wallpaper-ready::before {
  opacity: .42;
}

body.wallpaper-cached::before {
  opacity: .42;
  transition: none;
}

#shark-background {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  font-family: ui-monospace, Menlo, monospace;
  transition: opacity 240ms ease;
}

#shark-background.is-ready {
  opacity: .78;
}

#shark-background.is-cached {
  transition: none;
}

body > .container {
  position: relative;
  z-index: 2;
}

.middle {
  background: rgba(36, 40, 59, .74);
  border: 2px solid rgba(125, 207, 255, .8);
  border-radius: 0;
  box-shadow: 0 18px 50px rgba(4, 11, 25, .45), inset 0 1px rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}

html:has(.middle) {
  display: block;
  min-height: 100vh;
  height: auto;
}

body:has(.middle) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  height: auto;
}

body:has(.middle) .container {
  min-height: 0;
  height: auto;
  width: 100%;
  padding: 0 16px;
  box-sizing: border-box;
  align-items: center;
}

.middle {
  width: min(100%, 530px);
  min-width: 0;
  max-width: min(100%, 530px);
  max-height: min(900px, calc(100vh - 130px));
  height: auto;
  overflow-y: auto;
  scrollbar-width: none;
}

.middle > .content {
  width: 100%;
  min-width: 0;
}

html:has(link[href$="css/main.css"]) .middle {
  width: min(100%, 820px);
  max-width: min(100%, 820px);
}

pre,
.image-container,
.math-block,
.problem-statement,
.problem-hint div {
  background: rgba(26, 27, 38, .74);
  border-radius: 0;
}

::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb:hover,
.solution-card,
.problem-entry {
  border-radius: 0;
}

body pre { background-color: rgba(26, 27, 38, .74); }
