:root {
  color-scheme: dark;
  --bg: #000;
  --text: #e7e9ea;
  --muted: #71767b;
  --line: #2f3336;
  --blue: #1d9bf0;
  --hover: rgba(231, 233, 234, 0.1);
  --like: #f91880;
  --repost: #00ba7c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: TwitterChirp, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.app {
  display: grid;
  grid-template-columns: 88px minmax(0, 598px);
  justify-content: center;
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
}

.rail a,
.brand {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 50px;
  height: 50px;
  border-radius: 999px;
  color: var(--text);
  padding: 0 12px;
}

.rail a:hover,
.icon-btn:hover,
.brand:hover {
  background: var(--hover);
}

.rail svg,
.icon-btn svg,
.act svg,
.menu svg {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}

.rail a.is-on {
  font-weight: 800;
}

#game-nav {
  display: contents;
}

.rail span {
  display: none;
  font-size: 20px;
}

.brand svg {
  width: 28px;
  height: 28px;
}

.post-btn {
  display: none;
}

.column {
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 53px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-rank {
  min-width: 0;
}

.topbar-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
}

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

.icon-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.post {
  padding: 12px 16px 0;
}

.post-head {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 8px 12px;
  align-items: center;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0f1419;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.avatar svg {
  width: 22px;
  height: 22px;
}

.avatar.tiny {
  width: 40px;
  height: 40px;
}

.who .name {
  font-size: 15px;
  font-weight: 700;
  line-height: 20px;
}

.who .handle {
  color: var(--muted);
  font-size: 15px;
  line-height: 20px;
}

.who .handle:hover {
  color: var(--blue);
  text-decoration: underline;
}

.wallet-chip {
  margin-top: 4px;
  border: 1px solid var(--line);
  background: #16181c;
  color: #9945ff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  cursor: pointer;
}

.follow {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 700;
  background: #fff;
  color: #0f1419;
}

.follow:hover {
  background: #d7dbdc;
}

.copy {
  margin: 12px 0;
  font-size: 17px;
  line-height: 24px;
}

.media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.media,
#stage {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #050608;
  touch-action: none;
}

.chirp-stage,
.chirp-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 16px 0;
  color: var(--muted);
  font-size: 15px;
  border-bottom: 1px solid var(--line);
}

.actions {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}

.menu-wrap {
  position: relative;
}

.act {
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 999px;
}

.act .act-ico {
  width: 34.75px;
  height: 34.75px;
  display: grid;
  place-items: center;
  border-radius: 999px;
}

.act svg {
  width: 18.75px;
  height: 18.75px;
}

.act .on {
  display: none;
}

.act.is-on .off {
  display: none;
}

.act.is-on .on {
  display: block;
}

.act:hover .act-ico {
  background: rgba(29, 155, 240, 0.1);
}

.act:hover {
  color: var(--blue);
}

.act.repost:hover,
.act.repost:hover .act-ico {
  color: var(--repost);
}

.act.repost:hover .act-ico {
  background: rgba(0, 186, 124, 0.1);
}

.act.like:hover,
.act.like.is-on {
  color: var(--like);
}

.act.like:hover .act-ico {
  background: rgba(249, 24, 128, 0.1);
}

.act.bookmark.is-on {
  color: var(--blue);
}

.menu {
  display: none;
  position: absolute;
  left: 0;
  top: 40px;
  z-index: 8;
  min-width: 180px;
  padding: 8px 0;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.6);
}

.menu.open {
  display: block;
}

.menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}

.menu button:hover {
  background: var(--hover);
}

.menu svg {
  width: 18px;
  height: 18px;
}

.composer {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 16px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  border-top: 1px solid var(--line);
}

.placeholder {
  flex: 1;
  color: var(--muted);
  font-size: 20px;
}

.reply-chip {
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 700;
}

.setup {
  display: none;
  margin: 8px 16px 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.setup.is-open {
  display: block;
}

.setup.pulse {
  box-shadow: 0 0 0 2px var(--blue);
}

.setup h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.setup p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 18px;
}

.setup form {
  display: flex;
  gap: 8px;
}

.setup input {
  flex: 1;
  min-width: 0;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  outline: none;
}

.setup input:focus {
  border-color: var(--blue);
}

.setup button {
  border: 0;
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

.fine {
  margin-top: 10px !important;
}

code {
  color: var(--text);
}

.aside {
  display: none;
  padding: 12px 0 12px 28px;
}

.card {
  background: #16181c;
  border-radius: 16px;
  padding: 12px 16px 16px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.card button,
.card a {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
}

.legal {
  color: var(--muted);
  font-size: 13px;
  line-height: 16px;
  padding: 16px 4px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.embed .app {
  display: block;
}

body.embed .rail,
body.embed .aside,
body.embed .topbar,
body.embed .post-head,
body.embed .copy,
body.embed .meta-line,
body.embed .actions,
body.embed .composer,
body.embed .setup,
body.embed .ranking-post {
  display: none !important;
}

body.embed .column {
  border: 0;
}

body.embed .post {
  padding: 0;
}

body.embed .media-wrap {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
}

body.embed #stage,
body.embed .media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
}

@media (min-width: 1100px) {
  .app {
    grid-template-columns: 275px minmax(0, 598px) 350px;
  }

  .rail a {
    width: auto;
    padding: 12px;
  }

  .rail span {
    display: inline;
  }

  .post-btn {
    display: block;
    margin-top: 12px;
    width: 234px;
    border: 0;
    background: var(--blue);
    color: #fff;
    border-radius: 999px;
    padding: 14px 0;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
  }

  .aside {
    display: block;
  }
}

body.embed .wallet-gate {
  border-radius: 0;
}

@media (max-width: 520px) {
  .app {
    grid-template-columns: 1fr;
  }

  .rail {
    display: none;
  }

  .column {
    border: 0;
  }
}

.wallet-gate {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.82);
  border-radius: 16px;
}

.wallet-gate.is-off {
  display: none !important;
  pointer-events: none !important;
}

.challenge-gate {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.82);
  border-radius: 16px;
}

.challenge-gate.is-off {
  display: none !important;
  pointer-events: none !important;
}

.challenge-mult {
  color: var(--blue);
  font-size: 36px;
  font-weight: 800;
  line-height: 40px;
}

body.embed .challenge-gate {
  border-radius: 0;
}

.wallet-card {
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallet-card h2 {
  margin: 0;
  font-size: 20px;
}

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

.wallet-card input,
.admin input {
  width: 100%;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  outline: none;
}

.wallet-card input:focus,
.admin input:focus {
  border-color: #9945ff;
}

.wallet-row {
  display: flex;
  gap: 8px;
}

.wallet-play,
.admin button {
  flex: 1;
  border: 0;
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

.wallet-play:disabled,
.wallet-phantom:disabled {
  opacity: 0.6;
  cursor: wait;
}

.game-card-gate {
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  margin-top: 4px;
}

.game-card.is-locked .game-card-gate {
  color: var(--muted);
}

.wallet-error {
  color: #f4212e;
  font-size: 13px;
}

.admin-page {
  min-height: 100vh;
}

.admin {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 32px 16px 64px;
}

.admin h1 {
  margin: 0 0 8px;
}

.lede {
  color: var(--muted);
  margin: 0 0 24px;
}

.admin-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.admin label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.table-wrap {
  overflow: auto;
  margin-top: 16px;
}

.admin table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin th,
.admin td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}

.admin code {
  font-size: 12px;
}

.board {
  padding: 16px;
  border-top: 1px solid var(--line);
}

.ranking-post {
  border-top: 1px solid var(--line);
}

body.embed .lobby {
  display: none !important;
}

.game-post {
  display: none;
}

body.is-game .game-post {
  display: block;
}

body.is-game .lobby {
  display: none;
}

.game-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 4px;
}

.game-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: #16181c;
}

.game-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.game-card-preview {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: #0f1419;
}

.game-card.is-locked .game-card-preview {
  opacity: 0.55;
  filter: grayscale(0.35);
}

.game-card:hover {
  background: var(--hover);
}

.game-card-name {
  font-size: 20px;
  font-weight: 800;
}

.game-card-copy {
  color: var(--muted);
  font-size: 14px;
}

.rank-wallet {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.rank-wallet[hidden] {
  display: none !important;
}

body.is-game .rank-wallet {
  display: none;
}

.rank-wallet input {
  flex: 1;
  min-width: 0;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
}

.rank-wallet button {
  border: 0;
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}

.top-game {
  margin: 0 0 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #16181c;
}

.top-game-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.top-game-name {
  margin-top: 4px;
  font-size: 22px;
  font-weight: 800;
}

.you-rank {
  margin: 4px 0 8px;
  padding: 14px 16px;
  border: 1px solid rgba(29, 155, 240, 0.35);
  border-radius: 16px;
  background: rgba(29, 155, 240, 0.08);
}

.you-place {
  color: var(--blue);
  font-size: 28px;
  font-weight: 800;
  line-height: 32px;
}

.you-rank.is-live .you-place {
  color: var(--blue);
}

.you-meta {
  margin-top: 4px;
  color: var(--blue);
  font-size: 14px;
  line-height: 18px;
}

.tabs {
  display: flex;
  margin: 8px 0 0;
  border-bottom: 1px solid var(--line);
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 16px 12px;
  cursor: pointer;
  position: relative;
}

.tab.is-on {
  color: var(--text);
}

.tab.is-on::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 4px;
  border-radius: 999px;
  background: var(--blue);
}

.board-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.board-list li {
  display: grid;
  grid-template-columns: 52px 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.board-list li.is-you {
  color: var(--blue);
}

.board-rank {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.board-list li.is-you .board-rank,
.board-list li.is-you .board-score {
  color: var(--blue);
}

.board-wallet {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px;
}

.board-game {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.board-score {
  font-weight: 700;
}

.board-list li.empty {
  display: block;
  color: var(--muted);
  border: 0;
}

.board-meta {
  color: var(--muted);
  font-size: 13px;
  margin: 12px 0 8px;
}

.export-row {
  display: flex;
  padding: 8px 0 12px;
}

.export-row button {
  border: 0;
  background: var(--blue);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

