.jp-page {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  touch-action: none;
}

.jp-shell {
  width: min(1100px, calc(100% - 1.25rem));
  height: 100%;
  margin: 0 auto;
  padding: 0.45rem 0 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-sizing: border-box;
  overflow: hidden;
}

.jp-top {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 1rem;
  min-width: 0;
}

.jp-top .item-back {
  margin: 0;
  flex: 0 0 auto;
}

.jp-top__title {
  margin: 0;
  font-family: "Unbounded", sans-serif;
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  font-weight: 750;
  line-height: 1.1;
}

.jp-top__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
  min-width: 0;
}

.jp-view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.jp-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(190px, 250px) minmax(0, 1fr);
  gap: 0.55rem 0.75rem;
  align-items: stretch;
}

.jp-side {
  display: grid;
  grid-auto-rows: auto;
  gap: 0.4rem;
  min-height: 0;
  overflow: auto;
  align-content: start;
  align-self: start;
}

.jp-stat {
  display: grid;
  gap: 0.05rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--control-border, var(--line));
  border-radius: var(--btn-radius, var(--radius));
  background: var(--panel-surface, var(--panel));
}

.jp-stat--score {
  border-color: color-mix(in srgb, #ffb84d 45%, var(--control-border, var(--line)));
  background:
    linear-gradient(145deg, color-mix(in srgb, #ffb84d 14%, transparent), transparent 60%),
    var(--panel-surface, var(--panel));
}

.jp-stat span {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.jp-stat strong {
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  line-height: 1.1;
}

.jp-stat--score strong {
  font-size: 1.4rem;
  color: #ffb84d;
}

.game-vol {
  display: grid;
  gap: 0.35rem;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--control-border, var(--line));
  border-radius: var(--btn-radius, var(--radius));
  background: var(--panel-surface, var(--panel));
}

.game-vol__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--ink);
}

.game-vol__row strong {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.78rem;
}

.game-vol input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.jp-media-title {
  margin: 0;
  min-height: 1.1em;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.jp-stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
}

.jp-board-wrap {
  position: relative;
  width: fit-content;
  height: fit-content;
  max-width: 100%;
  max-height: 100%;
  display: grid;
}

#jp-board {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(72vh, 100%);
  border-radius: calc(var(--btn-radius, var(--radius)) * 0.6);
  cursor: pointer;
  touch-action: none;
  background: #0a1018;
  box-shadow: 0 0 0 2px color-mix(in srgb, #ffb84d 55%, transparent);
}

.jp-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.55rem;
  padding: 1rem;
  text-align: center;
  background: color-mix(in srgb, #05080e 74%, transparent);
  backdrop-filter: blur(4px);
  border-radius: inherit;
}

.jp-overlay.hidden {
  display: none;
}

.jp-overlay__title {
  margin: 0;
  font-family: "Unbounded", sans-serif;
  font-size: clamp(1.1rem, 3vw, 1.55rem);
  font-weight: 750;
}

.jp-overlay__text {
  margin: 0;
  max-width: 24rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

@media (max-width: 860px) {
  .jp-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .jp-side {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    overflow: visible;
  }

  .jp-stat,
  .game-vol,
  .jp-actions {
    flex: 1 1 auto;
  }

  .jp-media-title,
  .lb-panel {
    flex: 1 1 100%;
  }

  #jp-board {
    max-height: min(48vh, 100%);
  }
}
