/* A room game's own page (/games/<slug>, lib/views.js gameInfoPage, public/game-page.js).
   Two columns that line up all the way down: the clip over what the game is, the leaderboard over the discussion. */
.gp { --side: 400px; display: flex; flex-direction: column; gap: 20px; padding-top: 4px; }
.gp ::selection { background: color-mix(in srgb, var(--brand) 55%, transparent); color: #fff; }
.gp :focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; }

.gp-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-bottom: -6px; padding: 4px 8px 4px 4px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.gp-back svg { width: 18px; height: 18px; }
.gp-back:hover { color: var(--ink); background: var(--panel-2); text-decoration: none; }

/* title, what it is, the numbers, ▶ Play */
.gp-head { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: 16px 24px; align-items: end; }
.gp-author { display: flex; align-items: center; gap: 4px; margin: -4px 0 12px; font-size: 15px; color: var(--muted); }
.gp-author a { display: inline-flex; align-items: center; gap: 6px; margin-left: 2px; color: var(--ink); }
.gp-author a svg { color: #a970ff; }
.gp-author a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.gp-author a:hover { text-decoration: none; }
.gp-id h1 { font-family: "Bricolage Grotesque", Inter, sans-serif; font-size: clamp(36px, 5vw, 56px); letter-spacing: -0.03em; line-height: 1; margin-bottom: 12px; text-wrap: balance; }
.gp-summary { max-width: 68ch; font-size: 17px; line-height: 1.5; color: #cfcbe9; margin-bottom: 14px; text-wrap: pretty; }
.gp-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; font-size: 14px; color: var(--muted); }
.gp-facts li { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.gp-facts svg { width: 18px; height: 18px; flex: none; }
.gp-facts b { color: var(--ink); font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.gp-fact-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #5d5a7e; }
.gp-fact-live.on::before { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.gp-fact-crown { color: #ffd84d; }
.gp-fact-crown svg { color: #ffd84d; }

.gp-cta { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.gp-play { gap: 10px; padding: 16px 28px; font-size: 19px; font-weight: 800; border-radius: 14px; box-shadow: 0 10px 28px -8px color-mix(in srgb, var(--brand) 80%, transparent); transition: background 0.15s, box-shadow 0.15s, transform 0.15s; }
.gp-play:hover { box-shadow: 0 14px 34px -8px color-mix(in srgb, var(--brand) 95%, transparent); transform: translateY(-1px); }
.gp-play svg { width: 22px; height: 22px; }

/* the clip and the leaderboard, side by side, the same height */
.gp-stage { display: grid; grid-template-columns: minmax(0, 1fr) var(--side); gap: 24px; align-items: stretch; }
.gp-video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line); box-shadow: 0 24px 60px -24px #000; }
.gp-video video, .gp-video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.gp-video-icon { position: absolute; inset: 0; display: grid; place-items: center; font-size: 96px; background: linear-gradient(135deg, #1c1640, #3b1631); }
/* the whole clip opens the room; the round button shows on hover and keyboard focus */
.gp-video-cta { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #fff; background: radial-gradient(closest-side, #0007, transparent); opacity: 0; transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
.gp-video-cta:hover, .gp-video-cta:focus-visible { opacity: 1; text-decoration: none; }
.gp-video-cta:focus-visible { outline-offset: -4px; }
.gp-video-btn { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--brand); box-shadow: 0 12px 30px #0009; transform: scale(0.92); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.gp-video-btn svg { width: 36px; height: 36px; margin-left: 4px; }
.gp-video-cta:hover .gp-video-btn { transform: scale(1); }
.gp-video-label { font-weight: 800; font-size: 16px; text-shadow: 0 2px 10px #000; }
.gp-video-toggle { position: absolute; right: 12px; bottom: 12px; z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid #ffffff26; background: #0d0c16b3; color: #fff; cursor: pointer; backdrop-filter: blur(6px); }
.gp-video-toggle:hover { background: #0d0c16e6; }
@media (hover: none) { .gp-video-cta { opacity: 1; background: none; } .gp-video-label { display: none; } .gp-video-btn { width: 64px; height: 64px; } .gp-video-btn svg { width: 28px; height: 28px; } }

.gp-board { display: flex; flex-direction: column; min-height: 0; contain: size; /* the clip sets the row's height; the list scrolls */ background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 12px 12px; }
.gp-board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 0 4px 12px; }
.gp-board-head h2 { margin: 0; font-size: 18px; }
.gp-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.gp-tabs button { border: 0; background: none; color: var(--muted); font: 600 12.5px/1 Inter, sans-serif; padding: 7px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.gp-tabs button:hover { color: var(--ink); }
.gp-tabs button[aria-selected="true"] { background: var(--panel-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--brand); }
.gp-board-cols, .gp-board-list li:not(.gp-board-empty) { display: grid; grid-template-columns: 34px minmax(0, 1fr) 48px 56px; align-items: center; gap: 6px; }
.gp-board-cols { padding: 0 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.gp-board-cols span:nth-child(n + 3) { text-align: right; }
.gp-board.empty .gp-board-cols { display: none; }
.gp-board-list { list-style: none; margin: 6px 0 0; padding: 0; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; transition: opacity 0.15s; }
.gp-board-list[aria-busy="true"] { opacity: 0.5; }
.gp-board-list li:not(.gp-board-empty) { padding: 8px 10px; border-radius: 10px; font-weight: 600; font-size: 14.5px; }
.gp-board-list li:nth-child(even):not(.me) { background: #ffffff05; }
.gp-board-list .rank { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.gp-board-list .top .rank { color: #1a1230; }
.gp-board-list .top-1 .rank { background: #ffd84d; }
.gp-board-list .top-2 .rank { background: #d5d8ea; }
.gp-board-list .top-3 .rank { background: #e7a46a; }
.gp-board-list .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-board-list .wins, .gp-board-list .played { text-align: right; font-variant-numeric: tabular-nums; }
.gp-board-list .wins { color: #ffd84d; font-weight: 800; }
.gp-board-list .played { color: var(--muted); }
.gp-board-list li.me { background: color-mix(in srgb, var(--brand) 26%, transparent); box-shadow: inset 0 0 0 1px var(--brand); }
.gp-board-list li.pinned { margin-top: 10px; position: relative; }
.gp-board-list li.pinned::before { content: "⋯"; position: absolute; top: -14px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 12px; line-height: 1; }
.gp-board-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 24px 16px; color: var(--muted); font-size: 14px; }
.gp-board-empty b { color: var(--ink); font-size: 15px; }
.gp-board-empty .btn { margin-top: 8px; }
.gp-board-foot { margin: 8px 4px 0; font-size: 12.5px; color: var(--muted); }
.gp-board-foot:empty { display: none; }

/* how to play: a key-bindings list, two columns wide */
.gp-howto { margin-top: 12px; }
.gp-howto h2 { font-size: 22px; margin-bottom: 14px; }
.gp-keys { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.gp-key-row { display: grid; grid-template-columns: minmax(120px, 30%) minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 13px 2px; border-top: 1px solid var(--line); }
.gp-key-row dt { font-weight: 700; font-size: 14.5px; color: var(--ink); }
.gp-key-row dd { margin: 0; font-size: 14.5px; line-height: 1.75; color: #cfcbe9; text-wrap: pretty; }
.gp-keys kbd { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; margin: 0 1px; border-radius: 7px; border: 1px solid #3d3868; border-bottom-width: 3px; background: var(--panel-2); color: var(--ink); font: 700 12.5px/1 Inter, sans-serif; vertical-align: 1px; }
.gp-keys .keys { white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .gp-key-row.touch-only { display: none; } }

/* the discussion, full width */

.gp-talk { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.rc-inline .rc-msg { padding-left: 20px; padding-right: 20px; }
.rc-inline .rc-msg .rc-text { max-width: 90ch; }
.rc.rc-inline { width: auto; height: 560px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rc.rc-inline .rc-picker { overflow: hidden; }
/* in the page's flow: at the end of the messages the wheel goes on scrolling the page */
.rc-inline .rc-scroll { overscroll-behavior: auto; }
.gp-talk-note { margin: 0 4px; font-size: 12.5px; color: var(--muted); }

@media (max-width: 1180px) { .gp { --side: 340px; } }
@media (max-width: 960px) {
  .gp-head, .gp-stage { grid-template-columns: minmax(0, 1fr); }
  .gp-keys { grid-template-columns: minmax(0, 1fr); }
  .gp-cta { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .gp-play { flex: 1 1 220px; }
  .gp-board { contain: none; }
  .gp-board-list { max-height: none; }
  .gp-board-empty { padding: 28px 16px; }
  .rc.rc-inline { height: 70vh; min-height: 420px; border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .gp { gap: 16px; }
  .gp-facts { gap: 6px 16px; }
  .gp-facts li { white-space: normal; }
  .gp-key-row { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px 2px; }
  .gp-video { border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .gp-play, .gp-video-cta, .gp-video-btn, .gp-board-list { transition: none; }
}
