/* ============ Gramophone audiobook player ============ */
.gramo {
  --g-bg: #26215C; --g-ink: #EEEDFE; --g-soft: #AFA9EC; --g-gold: #FAC775;
  background: var(--g-bg); color: var(--g-ink); border-radius: 26px; padding: 18px 20px 20px;
  width: 100%; max-width: 460px; margin: 0 auto; font-family: var(--body);
  box-shadow: 0 18px 50px rgba(20, 10, 60, .35);
}
.gramo-stage { position: relative; }
.gramo-art { display: block; width: 100%; height: auto; cursor: pointer; overflow: visible; }
.gramo-arm { transform-origin: 338px 96px; transform-box: view-box; transform: rotate(-24deg); transition: transform .9s cubic-bezier(.4, 0, .2, 1); }
.gramo.is-playing .gramo-arm { transform: rotate(0deg); }
.gramo-note { opacity: 0; }
.gramo.is-playing .gramo-note { animation: gramoNote 2.6s ease-out infinite; }
.gramo.is-playing .gramo-note.n2 { animation-delay: .85s; }
.gramo.is-playing .gramo-note.n3 { animation-delay: 1.7s; }
@keyframes gramoNote { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-44px, -48px); } }
.gramo-read video { display: block; width: 100%; max-height: 52vh; object-fit: contain; border-radius: 16px; background: #000; cursor: pointer; }
.gramo-sleep {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: rgba(38, 33, 92, .92); border-radius: 18px; text-align: center; animation: fade .6s;
}
.gramo-sleep i { font-size: 3.4rem; color: var(--g-gold); }
.gramo-sleep b { font-family: var(--head); font-size: 1.6rem; }
.gramo-sleep span { color: var(--g-soft); font-weight: 700; }

.gramo-info { text-align: center; margin-top: 8px; }
.gramo-title { display: block; font-family: var(--head); font-size: 1.35rem; line-height: 1.2; color: #fff; }
.gramo-sub { display: block; font-size: .9rem; font-weight: 700; color: var(--g-soft); margin-top: 2px; }

/* thin Spotify-style progress bar with page markers; the knob appears on hover/drag */
.gramo-seek { position: relative; height: 22px; margin: 12px 2px 0; }
.gramo-track { position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: #3C3489; overflow: hidden; }
.gramo-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--g-gold); border-radius: 3px; }
.gramo-marks i { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(238, 237, 254, .35); }
.gramo-range { position: absolute; inset: 0; width: 100%; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.gramo-range::-webkit-slider-runnable-track { background: transparent; height: 22px; }
.gramo-range::-moz-range-track { background: transparent; height: 22px; }
.gramo-range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: #fff; border: 0; opacity: 0; transition: opacity .2s; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.gramo-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 0; opacity: 0; }
.gramo-seek:hover .gramo-range::-webkit-slider-thumb, .gramo-range:focus-visible::-webkit-slider-thumb, .gramo-range:active::-webkit-slider-thumb { opacity: 1; }
.gramo-seek:hover .gramo-range::-moz-range-thumb, .gramo-range:active::-moz-range-thumb { opacity: 1; }
.gramo-times { display: flex; justify-content: space-between; font-size: .8rem; font-weight: 700; color: var(--g-soft); margin: 2px 2px 0; }

/* main controls: big borderless icons, one big round white play button */
.gramo-main { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 3vw, 22px); margin-top: 8px; }
.gramo-btn, .gramo-play, .gramo-opt {
  -webkit-appearance: none; appearance: none; border: 0; background: none; box-shadow: none; padding: 0; margin: 0;
  font: inherit; color: var(--g-ink); cursor: pointer;
}
.gramo-btn { position: relative; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; font-size: 34px; transition: transform .15s, color .15s; }
.gramo-btn small { position: absolute; font-size: 10px; font-weight: 800; top: 50%; left: 50%; transform: translate(-50%, -38%); }
.gramo-btn:hover { color: #fff; transform: scale(1.08); }
.gramo-btn:active { transform: scale(.94); }
.gramo-play {
  width: 76px; height: 76px; border-radius: 50%; background: #fff; color: var(--g-bg); display: grid; place-items: center;
  font-size: 34px; transition: transform .15s; box-shadow: 0 8px 22px rgba(0,0,0,.3);
}
.gramo-play .ph-play { margin-left: 4px; }
.gramo-play:hover { transform: scale(1.06); }
.gramo-play:active { transform: scale(.95); }
.gramo.is-playing .gramo-play { background: var(--g-gold); }

/* secondary row: big icons with a small label under each */
.gramo-extra { display: flex; justify-content: space-around; margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(175, 169, 236, .2); }
.gramo-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 84px; color: var(--g-soft); transition: color .15s, transform .15s; }
.gramo-opt i { font-size: 28px; }
.gramo-opt span { font-size: .78rem; font-weight: 800; white-space: nowrap; }
.gramo-opt:hover { color: #fff; transform: translateY(-2px); }
.gramo-opt.on { color: var(--g-gold); }
.gramo button:focus-visible { outline: 3px solid var(--g-gold); outline-offset: 3px; }

@media (max-width: 420px) {
  .gramo { padding: 14px 12px 16px; border-radius: 22px; }
  .gramo-btn { width: 44px; height: 44px; font-size: 30px; }
  .gramo-play { width: 66px; height: 66px; font-size: 30px; }
  .gramo-opt { min-width: 70px; }
}

/* phone on its side: record on the left, controls on the right, so everything fits without scrolling */
@media (max-height: 520px) and (orientation: landscape) {
  .gramo { max-width: 760px; display: grid; grid-template-columns: minmax(0, 44%) 1fr; column-gap: 20px; align-items: center; padding: 10px 18px 12px; }
  .gramo > .gramo-stage { grid-column: 1; grid-row: 1 / span 5; }
  .gramo > :not(.gramo-stage) { grid-column: 2; }
  .gramo-art { max-height: calc(var(--vh, 100vh) - 110px); }
  .gramo-read video { max-height: calc(var(--vh, 100vh) - 110px); }
  .gramo-info { margin-top: 0; }
  .gramo-title { font-size: 1.1rem; }
  .gramo-main { margin-top: 2px; }
  .gramo-btn { width: 44px; height: 44px; font-size: 28px; }
  .gramo-play { width: 60px; height: 60px; font-size: 28px; }
  .gramo-extra { margin-top: 8px; padding-top: 8px; }
}
