:root {
  color: #292823;
  background: #c6bbb4;
  font-family: Georgia, "Times New Roman", serif;
  font-synthesis: none;
  --page-width: 498;
  --page-height: 640;
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 12%, rgb(255 255 255 / 46%), transparent 34rem),
    linear-gradient(145deg, #d9d0ca, #ada199);
}

button {
  color: inherit;
  font: inherit;
}

.room {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 100dvh;
  padding: 20px clamp(14px, 3vw, 44px) 17px;
}

.book-header,
.controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  width: min(100%, 1180px);
  margin: 0 auto;
}

.book-header span {
  color: #625e55;
  font: 600 10px/1.2 Arial, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.book-header span:last-child {
  text-align: right;
}

.book-header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.stage {
  position: relative;
  display: grid;
  min-height: 0;
  padding: 17px 0;
  place-items: center;
  perspective: 1800px;
}

.stage::after {
  position: absolute;
  bottom: 7%;
  left: 50%;
  z-index: -1;
  width: min(82vw, 1000px);
  height: 9%;
  border-radius: 50%;
  background: rgb(35 32 28 / 29%);
  content: "";
  filter: blur(28px);
  transform: translateX(-50%);
}

.book-rig {
  display: grid;
  width: min(100%, 1036px);
  height: min(72dvh, 640px);
  place-items: center;
}

.book {
  position: relative;
  isolation: isolate;
  filter: drop-shadow(0 25px 28px rgb(33 30 26 / 24%));
}

.book-page {
  position: relative;
  overflow: hidden;
  background: #eeeae0;
}

.book-page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-page.--left::before,
.book-page.--right::before {
  position: absolute;
  inset-block: 0;
  z-index: 3;
  width: clamp(14px, 4%, 28px);
  content: "";
  pointer-events: none;
}

.book-page.--left::before {
  right: 0;
  background: linear-gradient(to left, rgb(27 24 20 / 28%), rgb(27 24 20 / 7%) 42%, transparent);
}

.book-page.--right::before {
  left: 0;
  background: linear-gradient(to right, rgb(27 24 20 / 28%), rgb(27 24 20 / 7%) 42%, transparent);
}

.controls {
  grid-template-columns: 46px 1fr 46px;
  max-width: 430px;
}

.controls button {
  width: 46px;
  height: 40px;
  border: 1px solid rgb(42 40 35 / 24%);
  border-radius: 999px;
  background: rgb(238 234 224 / 48%);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.controls button:hover:not(:disabled) {
  border-color: rgb(42 40 35 / 46%);
  background: rgb(238 234 224 / 76%);
}

.controls button:focus-visible {
  outline: 2px solid #5a574f;
  outline-offset: 3px;
}

.controls button:disabled {
  cursor: default;
  opacity: 0.28;
}

.status {
  display: grid;
  gap: 4px;
  text-align: center;
}

.status span {
  font: 600 11px Arial, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.status small {
  color: #68635a;
  font: 10px Arial, sans-serif;
}

.music-control {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 7px;
  color: #5e5951;
  font: 10px Arial, sans-serif;
}

.controls .music-control button {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  padding: 0;
  place-items: center;
  font-size: 9px;
}

.music-picker {
  flex: 0 0 auto;
  padding: 5px 7px;
  border: 1px solid rgb(42 40 35 / 20%);
  border-radius: 999px;
  cursor: pointer;
}

.music-picker:hover {
  border-color: rgb(42 40 35 / 42%);
  background: rgb(238 234 224 / 56%);
}

#track-name {
  max-width: 105px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#music-volume {
  width: 64px;
  accent-color: #70484a;
}

@media (max-width: 700px) {
  .room {
    padding: 14px 10px 13px;
  }

  .book-header {
    grid-template-columns: 1fr auto;
  }

  .book-header span:first-child {
    display: none;
  }

  .book-rig {
    height: min(69dvh, 640px);
  }

  .status small {
    display: none;
  }

  #music-volume {
    display: none;
  }

  #track-name {
    max-width: 76px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
