:root {
  --paper: #ffffff;
  --ink: #181817;
  --muted: #77756f;
  --faint: #a9a69e;
  --ghost: #dbdbdb;
  --media: #e9e7e1;
  --hairline: rgba(24, 24, 23, 0.12);
  --card-outline: rgba(24, 24, 23, 0.1);
  --shell-dim: rgba(255, 255, 255, 0.62);
  --pill: rgba(255, 255, 255, 0.14);
  --radius-card: 7px;
  --radius-viewer: 9px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  /* --k is the slow-motion multiplier. Every duration goes through it. */
  --k: 1;
  --dur-in: calc(var(--k) * 300ms);
  --dur-out: calc(var(--k) * 200ms);
  --dur-fade: calc(var(--k) * 140ms);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000;
  color: var(--ink);
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 2px;
}

.no-anim,
.no-anim * {
  transition: none !important;
}

/* Shell */

.shell {
  display: flex;
  height: 100dvh;
  padding: 8px 8px 8px 0;
}

.side {
  display: flex;
  flex: none;
  flex-direction: column;
  justify-content: space-between;
  width: 216px;
  padding: 24px 12px 16px;
  color: var(--paper);
}

.brand {
  padding: 0 12px;
  font-size: 15px;
  font-weight: 700;
  line-height: 15px;
  letter-spacing: -0.3px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 28px;
}

.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--shell-dim);
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.01em;
  text-align: left;
  transition: background-color 120ms ease, color 120ms ease;
}

.nav-item.is-active {
  background: var(--pill);
  color: var(--paper);
}

.side-bottom {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.gear-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--paper);
  transition: background-color 120ms ease, transform 160ms var(--ease-out);
}

.gear-btn:active {
  transform: scale(0.97);
}

.gear-btn.is-active {
  background: var(--pill);
}

.footer {
  padding: 0 12px;
  color: var(--faint);
  font-size: 10px;
  line-height: 16px;
}

/* Rounded with clip-path, not border-radius. With border-radius the white
   background and a dark layer on top (Pause, TV) were each smoothed separately,
   so a thin white rim showed around the corners. clip-path rounds them once. */
.frame {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background: var(--paper);
  clip-path: inset(0 round 16px);
  isolation: isolate;
}

.scroller {
  position: absolute;
  inset: 0;
  padding: 32px;
  overflow: hidden auto;
  scrollbar-width: none;
}

.scroller::-webkit-scrollbar {
  display: none;
}

.frame.is-tv .scroller {
  padding: 0;
  overflow: hidden;
}

/* Feed */

.grid {
  position: relative;
}

.tile {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  color: var(--ink);
  cursor: pointer;
}

.tile-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--card-outline);
  border-radius: var(--radius-card);
  background: var(--media);
  transition: transform 160ms var(--ease-out);
}

.tile:active .tile-inner {
  transform: scale(0.985);
}

.tile img,
.tile-clip {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 220ms var(--ease-out), filter 220ms var(--ease-out);
}

/* The moving preview sits over the poster and fades in once it plays. */
.tile-clip {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: transform 220ms var(--ease-out), filter 220ms var(--ease-out), opacity 200ms ease;
}

.tile-clip.is-ready {
  opacity: 1;
}

.tile.is-lifted {
  visibility: hidden;
}

.grid.is-moving .tile {
  transition: transform var(--t) var(--c);
  will-change: transform;
}

/* Page type */

.page-title {
  margin: 0;
  font-size: 44px;
  font-weight: 700;
  line-height: 48px;
  letter-spacing: -0.025em;
}

.page-count {
  margin-left: 0.45em;
  color: var(--ghost);
  font-weight: 400;
}

/* "Browse /" in front of a category or game name. Browse is the way back. */
.crumb {
  color: var(--ghost);
  letter-spacing: inherit;
  transition: color 120ms ease;
}

.crumb:active {
  color: var(--muted);
}

.page-name {
  display: inline-block;
}

.collection {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.browse {
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  line-height: 32px;
  letter-spacing: -0.02em;
}

/* The circles grow to fill the row edge to edge with a 24px gap: seven
   144px circles at 1440 wide. Narrower windows wrap at 128px. */
.cat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 24px;
}

.cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.cat-circle {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--card-outline);
  border-radius: 50%;
  background-color: var(--media);
  background-repeat: no-repeat;
  transition: transform 160ms var(--ease-out), filter 220ms var(--ease-out);
}

.cat:active .cat-circle {
  transform: scale(0.97);
}

.cat-label,
.game-label {
  font-size: 13px;
  line-height: 16px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.count {
  margin-left: 0.55em;
  color: var(--muted);
}

/* Cards about as wide as a feed column (240px or more), and never fewer than
   two across. Wide screens add columns instead of stretching the cards. */
.game-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, calc((100% - 24px) / 2)), 1fr));
  gap: 24px;
}

.game {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  text-align: left;
}

.game-cover {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--card-outline);
  border-radius: var(--radius-card);
  background-color: var(--media);
  background-size: cover;
  transition: transform 160ms var(--ease-out), filter 220ms var(--ease-out);
}

.game:active .game-cover {
  transform: scale(0.985);
}

.game-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Shared focus media: the piece that travels */

.focus-media {
  position: relative;
  flex: none;
  overflow: hidden;
  border-radius: var(--radius-viewer);
  background: #111;
  cursor: pointer;
  transform-origin: 0 0;
  transition: transform var(--dur-out) var(--ease-out), border-radius var(--dur-out) var(--ease-out);
}

.focus-media.is-opening {
  transition-duration: var(--dur-in);
  transition-timing-function: var(--ease-drawer);
}

.focus-media img,
.focus-media video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.focus-media img {
  transition: filter var(--dur-in) var(--ease-out);
}

.focus-media.from-hover img {
  filter: brightness(0.84);
}

.focus-media video {
  opacity: 0;
  transition: opacity calc(var(--k) * 120ms) ease;
}

.focus-media video.is-ready {
  opacity: 1;
}

/* Pause */

.scrim {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-out) var(--ease-out);
}

.scrim.is-on {
  opacity: 1;
  transition-duration: var(--dur-in);
}

.pause {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 56px;
  padding: 0 56px;
  color: var(--paper);
  cursor: pointer;
  transition: opacity var(--dur-fade) ease;
}

.pause.is-closing {
  pointer-events: none;
}

.pause.is-closing .focus-media {
  pointer-events: auto;
}

.pause.is-fading {
  opacity: 0;
}

.pause-menu {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 48px;
  width: 280px;
  cursor: default;
}

.pause-area {
  display: flex;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.pause-in {
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity calc(var(--k) * 100ms) var(--ease-out), transform calc(var(--k) * 100ms) var(--ease-out);
}

.pause.is-on .pause-in {
  opacity: 1;
  transform: none;
  transition-duration: calc(var(--k) * 220ms);
  transition-delay: calc(var(--k) * (70ms + var(--i, 0) * 40ms));
}

.pause-top {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pause-top > :first-child {
  margin-bottom: 24px;
}

.back-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--pill);
  color: var(--paper);
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}

.back-btn:active {
  transform: scale(0.97);
}

.pause-heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pause-title {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
  line-height: 44px;
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
}

.pause-sub {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.01em;
}

.pause-actions {
  display: flex;
  gap: 8px;
  padding-top: 24px;
}

/* Hide until I move the mouse */

.pause-menu,
.hud {
  transition: opacity calc(var(--k) * 240ms) var(--ease-out);
}

.pause-menu.is-quiet,
.hud.is-quiet,
.room-info.is-on.is-quiet {
  opacity: 0;
  transition-delay: 0s;
}

.icon-btn {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--pill);
  color: var(--paper);
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}

.icon-btn:active {
  transform: scale(0.97);
}

.icon-btn.is-saved svg path {
  fill: currentColor;
}

.icon-btn::after {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 1;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  content: attr(data-tip);
  font-size: 11px;
  line-height: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -3px) scale(0.97);
  transform-origin: 50% 0;
  transition: opacity 125ms var(--ease-out), transform 125ms var(--ease-out);
}

.icon-btn:focus-visible::after,
.icon-btn.show-tip::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.credits {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin: 0;
}

.credit {
  display: flex;
  font-size: 13px;
  line-height: 16px;
}

.credit dt {
  flex: none;
  width: 112px;
  color: var(--shell-dim);
}

.credit dd {
  min-width: 0;
  margin: 0;
}

/* Half the strength of a real name, on light and dark views alike. */
.credit-pending {
  opacity: 0.5;
}

.pause.is-tight {
  gap: 32px;
  padding: 0 32px;
}

.pause.is-tight .pause-menu {
  width: 240px;
}

.pause.is-tight .credit dt {
  width: 104px;
}

/* Phone: back button top left, where the logo was, then the piece, then the info */
.pause.is-compact {
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 20px;
  padding: 16px 16px 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pause.is-compact .pause-menu,
.pause.is-compact .pause-top {
  display: contents;
}

.pause.is-compact .pause-back {
  order: -2;
  align-self: flex-start;
  margin-bottom: 0;
}

/* Left-aligned, in line with the back button and the title under it. */
.pause.is-compact .pause-area {
  order: -1;
  flex: none;
  justify-content: flex-start;
}

.pause.is-compact .pause-heading {
  gap: 6px;
  padding-top: 4px;
}

.pause.is-compact .pause-title {
  font-size: 28px;
  line-height: 32px;
}

.pause.is-compact .pause-actions {
  padding-top: 0;
}

/* Glow */

.glow {
  position: fixed;
  inset: 0;
  z-index: 40;
  color: var(--paper);
  cursor: pointer;
  transition: opacity var(--dur-fade) ease;
}

.glow.is-closing {
  pointer-events: none;
}

.glow.is-closing .focus-media {
  pointer-events: auto;
}

.glow.is-fading {
  opacity: 0;
}

.glow-bg {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  transition: opacity var(--dur-out) var(--ease-out);
}

.glow.is-on .glow-bg {
  opacity: 1;
  transition-duration: var(--dur-in);
}

.glow-bloom {
  position: absolute;
  top: 2%;
  left: 17%;
  width: 66%;
  height: 96%;
  opacity: 0;
  pointer-events: none;
  transition: opacity calc(var(--k) * 110ms) var(--ease-out);
  -webkit-mask-image: radial-gradient(closest-side, #000 35%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 35%, transparent 100%);
}

.glow-bloom.is-leaving {
  transition-duration: calc(var(--k) * 340ms);
}

.glow .focus-media {
  position: absolute;
}

.hud {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px;
  pointer-events: none;
}

.hud-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.hud-row.is-bottom {
  align-items: flex-end;
}

.hud-block {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity calc(var(--k) * 100ms) var(--ease-out), transform calc(var(--k) * 100ms) var(--ease-out);
}

.glow.is-on .hud-block {
  opacity: 1;
  transform: none;
  transition-duration: calc(var(--k) * 220ms);
  transition-delay: calc(var(--k) * (140ms + var(--i, 0) * 40ms));
}

.hud-title-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 380px;
}

.hud-title {
  margin: 0;
  font-size: 44px;
  font-weight: 700;
  line-height: 48px;
  letter-spacing: -0.025em;
}

.hud-sub {
  font-size: 15px;
  line-height: 20px;
}

.hud-platform {
  flex: none;
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: -0.3px;
}

.hud-controls {
  cursor: default;
  pointer-events: auto;
}

.glow.is-closing .hud-controls {
  pointer-events: none;
}

.hud-credits {
  width: 380px;
}

.hud-credits .credit {
  font-size: 15px;
  line-height: 20px;
}

.hud-credits .credit dt {
  width: 128px;
  color: rgba(255, 255, 255, 0.76);
}

.hud-actions {
  display: flex;
  flex: none;
  gap: 24px;
}

.hud-action {
  font-size: 26px;
  font-weight: 700;
  line-height: 32px;
  letter-spacing: -0.02em;
  transition: transform 160ms var(--ease-out);
}

.hud-action:active {
  transform: scale(0.97);
}

/* Make Room */

.room-media {
  position: absolute;
  z-index: 3;
}

.room-info {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity calc(var(--k) * 100ms) var(--ease-out), transform calc(var(--k) * 100ms) var(--ease-out);
}

.room-info.is-on {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  transition-duration: calc(var(--k) * 240ms);
  transition-delay: calc(var(--k) * 120ms);
}

.room-top {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.room-game {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  line-height: 32px;
  letter-spacing: -0.02em;
}

.room-moment {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.01em;
}

.room-roles {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

.room-role {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.room-role dt {
  color: var(--muted);
  font-size: 13px;
  line-height: 16px;
}

.room-role dd {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.01em;
}

.room-actions {
  display: flex;
  gap: 8px;
}

.room-btn {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.01em;
  transition: transform 160ms var(--ease-out), background-color 160ms ease;
}

.room-btn:active {
  transform: scale(0.97);
}

.room-btn.is-primary {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
}

.room-btn.is-outline {
  border: 1px solid var(--hairline);
  color: var(--ink);
}

/* Narrow feeds stack the info under the piece: title with Save and Share beside
   it, then the credits in two columns. */
.room-info.is-stacked {
  display: grid;
  grid-template-areas: "title actions" "roles roles";
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px 12px;
}

.room-info.is-stacked .room-top {
  display: contents;
}

.room-info.is-stacked .room-title {
  grid-area: title;
}

.room-info.is-stacked .room-actions {
  grid-area: actions;
}

.room-info.is-stacked .room-roles {
  display: grid;
  grid-area: roles;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.no-credits .room-info.is-stacked .room-roles {
  display: none;
}

.room-info.is-stacked .room-role {
  gap: 2px;
}

.room-info.is-stacked .room-game {
  margin-bottom: 2px;
  font-size: 20px;
  line-height: 24px;
}

.room-info.is-stacked .room-moment {
  font-size: 13px;
  line-height: 16px;
}

.room-info.is-stacked .room-btn {
  flex: none;
  padding: 0 16px;
}

/* Settings */

.settings {
  display: flex;
  flex-direction: column;
  gap: 36px;
  max-width: 1104px;
  padding: 16px 24px;
}

.set-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.set-page-title {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
  line-height: 44px;
  letter-spacing: -0.025em;
}

.set-intro {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.01em;
}

.set-section {
  display: flex;
  gap: 40px;
  padding-top: 28px;
}

.set-section + .set-section {
  border-top: 1px solid var(--hairline);
}

.set-label {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 4px;
  width: 240px;
}

.set-heading,
.style-name {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: -0.01em;
}

.set-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.style-cards {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.style-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  text-align: left;
}

.style-card:focus-visible {
  outline: none;
}

.style-card:focus-visible .pv {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.style-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* The phone layout's check. Desktop marks the picked card on its preview. */
.style-radio {
  display: none;
}

.set-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--faint);
  font-size: 11px;
  line-height: 16px;
}

/* Desktop already shows "Realm 2026" at the bottom of the side menu. */
.set-footer:not(.is-dev) {
  display: none;
}

.set-link {
  color: var(--ink);
  font-size: 13px;
  line-height: 16px;
  text-decoration: underline 1px;
  text-underline-offset: 2px;
}

.set-button {
  display: flex;
  flex: none;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
  line-height: 16px;
  transition: transform 160ms var(--ease-out);
}

.set-button:active {
  transform: scale(0.97);
}

/* Add a piece */

.add {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1104px;
  padding: 16px 24px;
}

.add-key,
.add-link {
  display: flex;
  gap: 8px;
}

.add-key {
  flex-direction: column;
  max-width: 420px;
}

.add-key[hidden] {
  display: none;
}

.add-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.add-label {
  color: var(--muted);
  font-size: 13px;
  line-height: 16px;
}

.add-input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(24, 24, 23, 0.16);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  line-height: 20px;
  outline: none;
  transition: box-shadow 120ms ease;
}

.add-input::placeholder {
  color: var(--faint);
}

.add-input:focus {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.add-link .add-input {
  flex: 1;
}

.add-button {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
  transition: transform 160ms var(--ease-out), opacity 120ms ease;
}

.add-button:active {
  transform: scale(0.98);
}

.add-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.add-button.is-wide {
  width: 100%;
}

.add-status {
  margin: -12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.add-status:empty {
  display: none;
}

.add-status[data-tone="error"] {
  color: #b42318;
}

.add-status[data-tone="ok"] {
  color: var(--ink);
}

.add-link-button {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline 1px;
  text-underline-offset: 2px;
}

/* Media on the left, details on the right. Hidden until a link is read. */
.add-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: start;
  gap: 40px;
}

.add-body:not(.has-found) {
  display: none;
}

.add-found {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.add-preview {
  overflow: hidden;
  border-radius: var(--radius-viewer);
  background: var(--media);
}

.add-preview img,
.add-preview video {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.add-source {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 16px;
}

.add-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.add-pick:empty {
  display: none;
}

.add-thumb {
  width: 72px;
  height: 48px;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px var(--card-outline);
}

.add-thumb[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--ink);
}

.add-thumb img,
.add-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.add-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.add-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 12px;
}

.add-pair.is-even {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.add-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.add-chip {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(24, 24, 23, 0.16);
  color: var(--ink);
  font-size: 13px;
  line-height: 16px;
  transition: background-color 120ms ease, color 120ms ease;
}

.add-chip[aria-pressed="true"] {
  background: var(--ink);
  box-shadow: none;
  color: var(--paper);
  font-weight: 700;
}

.add-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  color: var(--ink);
  font-size: 13px;
  line-height: 16px;
  cursor: pointer;
}

.add-checkbox {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ink);
}

.add-save {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
}

.add-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.style-name {
  display: block;
}

/* Previews: small drawings of each focus style */

.pv {
  position: relative;
  display: flex;
  height: 156px;
  overflow: hidden;
  border-radius: var(--radius-card);
  box-shadow: inset 0 0 0 1px var(--card-outline);
  transition: box-shadow 160ms var(--ease-out), filter 160ms ease;
}

.style-card[aria-pressed="true"] .pv {
  box-shadow: 0 0 0 2px var(--ink);
}

.pv-check {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.pv.is-dark .pv-check {
  background: var(--paper);
  color: var(--ink);
}

.style-card[aria-pressed="true"] .pv-check {
  opacity: 1;
  transform: none;
}

.pv-bar {
  display: block;
  flex: none;
  height: 5px;
  border-radius: 2px;
}

.pv-shot,
.pv-bloom,
.pv-cover {
  display: block;
  background-position: 50%;
  background-size: cover;
}

.pv-pause {
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: #2e2e2d;
}

.pv-menu {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 6px;
  width: 64px;
}

.pv-pause .is-title {
  width: 56px;
  height: 7px;
  background: var(--paper);
}

.pv-pause .is-sub {
  width: 36px;
  background: rgba(255, 255, 255, 0.5);
}

.pv-pause .is-button {
  width: 64px;
  height: 10px;
  margin-top: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
}

.pv-pause .is-line {
  width: 30px;
  margin-left: 4px;
  background: rgba(255, 255, 255, 0.4);
}

.pv-pause .is-line.is-long {
  width: 34px;
}

.pv-pause .pv-shot {
  flex: 1;
  height: 86px;
  border-radius: 4px;
}

.pv-glow {
  align-items: center;
  justify-content: center;
  background: #000;
}

.pv-bloom {
  position: absolute;
  top: calc(50% - 55px);
  left: calc(50% - 85px);
  width: 200px;
  height: 150px;
  filter: blur(26px);
}

.pv-cover {
  position: relative;
  width: 66px;
  height: 92px;
  border-radius: 3px;
}

.pv-glow .pv-bar {
  position: absolute;
  height: 6px;
  background: var(--paper);
}

.pv-glow .is-corner-top {
  top: 12px;
  left: 12px;
  width: 44px;
}

.pv-glow .is-corner-bottom {
  right: 12px;
  bottom: 12px;
  width: 32px;
}

.pv-room {
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--paper);
}

.pv-room-top {
  display: flex;
  flex: none;
  gap: 10px;
}

.pv-room .pv-shot {
  flex: none;
  width: 132px;
  max-width: 60%;
  height: 82px;
  border-radius: 3px;
}

.pv-room-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 2px;
}

.pv-room .is-title {
  width: 48px;
  height: 7px;
  background: var(--ink);
}

.pv-room .is-sub {
  width: 32px;
  background: #dbdbdb;
}

.pv-room .is-line {
  width: 40px;
  height: 4px;
  margin-top: 6px;
  background: #f3f3f3;
}

.pv-room .is-line.is-short {
  width: 36px;
  margin-top: 0;
}

.pv-room-feed {
  display: flex;
  flex: 1;
  gap: 8px;
}

.pv-room-feed span {
  flex: 1;
  border-radius: 3px;
  background: #f3f3f3;
}

/* Rows with a switch or a segmented control */

.set-rows {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.set-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  min-height: 52px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}

.set-row:first-child {
  padding-top: 0;
}

.set-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.set-text {
  display: flex;
  flex: 1 1 220px;
  flex-direction: column;
  gap: 2px;
}

.set-title {
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.01em;
}

.switch {
  display: flex;
  flex: none;
  align-items: center;
  width: 40px;
  height: 24px;
  padding: 2px;
  border-radius: 12px;
  background: #dbdbdb;
  transition: background-color 160ms ease;
}

.switch[aria-checked="true"] {
  background: var(--ink);
}

.switch-knob {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: transform 200ms var(--ease-out);
}

.switch[aria-checked="true"] .switch-knob {
  transform: translateX(16px);
}

.seg {
  display: flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: #f6f6f5;
}

.seg-item {
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  line-height: 16px;
  white-space: nowrap;
  transition: background-color 120ms ease;
}

.seg-item[aria-pressed="true"] {
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--card-outline);
  font-weight: 700;
}

.seg-item:focus-visible,
.switch:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.reduce-motion .switch-knob,
.reduce-motion .pv-check {
  transition: none;
}

/* TV */

.tv {
  position: absolute;
  inset: 0;
  background: #000;
  cursor: pointer;
}

.tv img,
.tv video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tv-poster {
  transition: opacity 200ms ease;
}

.tv-poster.is-hidden {
  opacity: 0;
}

.tv-caption {
  position: absolute;
  bottom: 32px;
  left: 32px;
  color: var(--paper);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.tv-game {
  font-size: 15px;
  font-weight: 700;
  line-height: 15px;
  letter-spacing: -0.3px;
}

.tv-moment {
  margin-top: 8px;
  font-size: 13px;
  line-height: 13px;
  letter-spacing: -0.13px;
}

/* Phone menu: one glass surface, clipped to the pill until it opens */

.bar {
  --inset: 4px;
  --pad: 12px;
  --radius-open: 32px; /* pill radius + --pad, so the corners stay concentric */
  --pill-h: 40px;
  --pill-w: 100px;
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Pages scroll freely under the pill. Only TV keeps a shade, so the white logo
   reads over the video. */
.bar-veil {
  display: none;
}

.frame.is-tv .bar-veil {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: block;
  height: 72px;
  background: linear-gradient(rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0));
}

.bar-dim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  touch-action: none;
  transition: opacity var(--dur-out) var(--ease-out);
}

.bar-dim.is-on {
  opacity: 1;
  pointer-events: auto;
  transition-duration: var(--dur-in);
}

.bar-logo,
.sheet-logo {
  position: absolute;
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 20px;
  letter-spacing: -0.02em;
  touch-action: manipulation;
}

/* Sits in the scroller at the pill's height, so it scrolls away with the page. */
.bar-logo {
  top: 16px;
  left: 4px;
  z-index: 1;
  display: none;
  color: var(--ink);
}

.frame.is-tv .bar-logo {
  color: var(--paper);
}

.sheet-logo {
  top: var(--pad);
  left: calc(var(--pad) - 12px);
  visibility: hidden;
  transition: visibility 0s linear var(--dur-out);
}

.sheet {
  position: absolute;
  top: var(--inset);
  right: var(--inset);
  left: var(--inset);
  padding: calc(var(--pad) + var(--pill-h) + 16px) var(--pad) var(--pad);
  border-radius: var(--radius-open);
  background: rgba(18, 18, 17, 0.72);
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.16);
  color: var(--paper);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  backdrop-filter: blur(24px) saturate(1.8);
  clip-path: inset(
    var(--pad) var(--pad) calc(100% - var(--pad) - var(--pill-h)) calc(100% - var(--pad) - var(--pill-w))
      round calc(var(--pill-h) / 2)
  );
  transform-origin: calc(100% - var(--pad) - var(--pill-w) / 2) calc(var(--pad) + var(--pill-h) / 2);
  transition: clip-path var(--dur-out) var(--ease-out), transform 160ms var(--ease-out);
}

.sheet:not(.is-open):has(.pill:active) {
  transform: scale(0.97);
}

.sheet.is-open {
  clip-path: inset(0 0 0 0 round var(--radius-open));
  pointer-events: auto;
  transition-duration: var(--dur-in), 160ms;
  transition-timing-function: var(--ease-drawer), var(--ease-out);
}

.sheet.is-open .sheet-logo {
  visibility: visible;
  transition-delay: 0s;
}

.pill {
  position: absolute;
  top: var(--pad);
  right: var(--pad);
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--pill-h);
  padding: 0 14px 0 16px;
  border-radius: calc(var(--pill-h) / 2);
  font-size: 15px;
  line-height: 20px;
  letter-spacing: -0.01em;
  pointer-events: auto;
  touch-action: manipulation;
}

.pill:focus-visible {
  outline-offset: -4px;
}

.pill::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.2);
  content: "";
  transition: opacity 120ms ease;
}

.sheet.is-open .pill::after {
  opacity: 0;
}

.pill-label {
  white-space: nowrap;
  transition: opacity calc(var(--k) * 140ms) var(--ease-out) calc(var(--k) * 60ms),
    filter calc(var(--k) * 140ms) var(--ease-out) calc(var(--k) * 60ms);
}

.sheet.is-open .pill-label {
  opacity: 0;
  filter: blur(4px);
  transition-delay: 0s;
  transition-duration: calc(var(--k) * 100ms);
}

/* Two lines that cross into an X */
.pill-icon {
  position: relative;
  flex: none;
  width: 16px;
  height: 16px;
}

.pill-icon span {
  position: absolute;
  top: 7.125px;
  left: 2px;
  width: 12px;
  height: 1.75px;
  border-radius: 1px;
  background: currentColor;
  transition: transform var(--dur-out) var(--ease-out);
}

.pill-icon span:first-child {
  transform: translateY(-4.5px);
}

.pill-icon span:last-child {
  transform: translateY(4.5px);
}

.sheet.is-open .pill-icon span {
  transition-duration: var(--dur-in);
  transition-timing-function: var(--ease-drawer);
}

.sheet.is-open .pill-icon span:first-child {
  transform: rotate(45deg);
}

.sheet.is-open .pill-icon span:last-child {
  transform: rotate(-45deg);
}

.sheet-list {
  display: flex;
  flex-direction: column;
  visibility: hidden;
  transition: visibility 0s linear var(--dur-out);
}

.sheet.is-open .sheet-list {
  visibility: visible;
  transition-delay: 0s;
}

.sheet-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 52px;
  color: var(--shell-dim);
  font-size: 32px;
  font-weight: 700;
  line-height: 36px;
  letter-spacing: -0.025em;
  text-align: left;
  opacity: 0;
  filter: blur(4px);
  transform: translateY(-10px);
  touch-action: manipulation;
  transition: opacity calc(var(--k) * 100ms) var(--ease-out), filter calc(var(--k) * 100ms) var(--ease-out),
    transform calc(var(--k) * 100ms) var(--ease-out), color 120ms ease;
}

.sheet.is-open .sheet-item {
  opacity: 1;
  filter: none;
  transform: none;
  transition-duration: calc(var(--k) * 260ms), calc(var(--k) * 260ms), calc(var(--k) * 260ms), 120ms;
  transition-delay: calc(var(--k) * (60ms + var(--i, 0) * 40ms)), calc(var(--k) * (60ms + var(--i, 0) * 40ms)),
    calc(var(--k) * (60ms + var(--i, 0) * 40ms)), 0s;
}

.sheet-item span {
  transform-origin: 0 50%;
  transition: transform 160ms var(--ease-out);
}

.sheet-item:active span {
  transform: scale(0.97);
}

.sheet-item.is-active {
  color: var(--paper);
}

/* Hover only on devices that really hover */

@media (hover: hover) and (pointer: fine) {
  .nav-item:hover,
  .sheet-item:hover {
    color: var(--paper);
  }

  .back-btn:hover {
    background: rgba(255, 255, 255, 0.24);
  }

  .gear-btn:not(.is-active):hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .style-card:hover .pv {
    filter: brightness(0.96);
  }

  .seg-item[aria-pressed="false"]:hover {
    background: rgba(24, 24, 23, 0.05);
  }

  .crumb:hover {
    color: var(--muted);
  }

  .tile:hover img,
  .tile:hover .tile-clip {
    transform: scale(1.018);
    filter: brightness(0.84);
  }

  .cat:hover .cat-circle,
  .game:hover .game-cover {
    filter: brightness(0.9);
  }

  .icon-btn:hover {
    background: rgba(255, 255, 255, 0.24);
  }

  .icon-btn:hover::after {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  .pause-actions:hover .icon-btn:not(:hover)::after {
    opacity: 0;
  }

  .room-btn.is-outline:hover {
    background: rgba(24, 24, 23, 0.04);
  }
}

/* Reduce motion: set on <html> by the setting or the device preference */

.reduce-motion .pause-in,
.reduce-motion .hud-block,
.reduce-motion .room-info {
  transform: none !important;
}

.reduce-motion .focus-media {
  transition: opacity var(--dur-out) ease;
}

.reduce-motion .sheet,
.reduce-motion .pill-icon span {
  transition: none;
}

.reduce-motion .sheet-item {
  filter: none !important;
  transform: none !important;
}

/* Close with: only surfaces that close on a click show the hand */

:root[data-close="piece"] .pause,
:root[data-close="piece"] .glow,
:root[data-close="esc"] .pause,
:root[data-close="esc"] .glow,
:root[data-close="esc"] .focus-media {
  cursor: default;
}

/* Credits off */

.no-credits .credits,
.no-credits .hud-platform,
.no-credits .room-roles {
  display: none;
}

@media (max-width: 1080px) {
  .set-section {
    flex-direction: column;
    gap: 16px;
  }

  .set-label {
    width: auto;
  }
}

@media (max-width: 760px) {
  .settings {
    gap: 28px;
    padding: 0;
  }

  .set-page-title {
    font-size: 32px;
    line-height: 36px;
  }

  .set-section {
    gap: 8px;
    padding-top: 0;
  }

  .set-section + .set-section {
    padding-top: 0;
    border-top: 0;
  }

  .set-section > .set-label > .set-desc {
    display: none;
  }

  /* Focus style: short rows with a small preview instead of three big cards */
  /* The rows reach 10px past the text on each side so the gray block around the
     picked one has room, while the previews still line up with the heading. */
  .style-cards {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 -10px;
  }

  .style-card {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 10px;
    border-radius: 12px;
    transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
  }

  .style-card[aria-pressed="true"] {
    background: #f4f4f3;
  }

  .style-card:active {
    transform: scale(0.985);
  }

  /* The preview is drawn at 220×150 and shown at 88×60. */
  .style-card .pv {
    flex: none;
    width: 220px;
    height: 150px;
    border-radius: 15px;
    box-shadow: inset 0 0 0 2.5px var(--card-outline);
    zoom: 0.4;
  }

  .style-card[aria-pressed="true"] .pv {
    box-shadow: inset 0 0 0 2.5px var(--card-outline);
  }

  .style-card .pv-check {
    display: none;
  }

  .style-text {
    flex: 1;
    min-width: 0;
  }

  .style-radio {
    display: grid;
    flex: none;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1.5px #dbdbdb;
    color: var(--paper);
    transition: background-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
  }

  .style-radio svg {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
  }

  .style-card[aria-pressed="true"] .style-radio {
    background: var(--ink);
    box-shadow: none;
  }

  .style-card[aria-pressed="true"] .style-radio svg {
    opacity: 1;
    transform: none;
  }

  .style-card:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 0;
  }

  .style-card:focus-visible .pv {
    outline: none;
  }

  .set-row {
    flex-wrap: nowrap;
    gap: 16px;
    min-height: 0;
    padding: 12px 0;
  }

  .set-row:first-child {
    padding-top: 12px;
  }

  .set-text {
    flex: 1 1 auto;
    min-width: 0;
  }

  .seg-item {
    padding: 0 10px;
  }

  .set-footer:not(.is-dev) {
    display: flex;
    justify-content: center;
    padding-top: 12px;
  }
}

@media (max-width: 760px) {
  /* Same black frame as desktop, with the menu floating inside it. */
  .shell {
    padding: 0 8px 8px;
  }

  .side {
    display: none;
  }

  .bar {
    display: block;
  }

  .bar-logo {
    display: flex;
  }

  .scroller {
    padding: 72px 16px 16px;
  }

  /* Add a piece: one column. 16px text stops iOS from zooming into the fields. */
  .add {
    padding: 0;
  }

  .add-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .add-input {
    font-size: 16px;
  }

  .add-pair.is-even {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  /* Three 96px circles across a phone, spread from the logo's edge to the pill's. */
  .cat-row {
    grid-template-columns: repeat(3, 96px);
    justify-content: space-between;
    gap: 20px 0;
  }

  .tv-caption {
    bottom: 20px;
    left: 20px;
  }

  .page-title {
    font-size: 32px;
    line-height: 36px;
  }

  /* Glow: credits on their own row, Save and Share under them */
  .hud {
    padding: 20px 16px;
  }

  .hud-title {
    font-size: 26px;
    line-height: 32px;
  }

  .hud-title-block {
    gap: 6px;
  }

  .hud-title-block,
  .hud-credits {
    width: auto;
  }

  .hud-row.is-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .hud-credits .credit {
    font-size: 13px;
    line-height: 16px;
  }

  .hud-credits .credit dt {
    width: 112px;
  }

  .hud-action {
    font-size: 20px;
    line-height: 24px;
  }
}
