/* Shared lobby UI. */

:root {
  --red: rgb(203, 95, 93);
  --white: #fff;
  --dark: rgb(26, 26, 26);
  --dark-gray: rgb(52, 52, 52);
  --blue: rgb(58, 175, 255);
  --pink: rgb(187, 125, 191);
  --green: rgb(34, 255, 169);
  --lavender: rgb(170, 175, 219);
  --yellow: rgb(189, 190, 130);
  --teal: rgb(143, 194, 187);
  --gray: rgb(173, 174, 178);
  --red2: rgb(255, 67, 119);
  --pink2: rgb(239, 106, 167);
  --purple: rgb(139, 108, 207);
  --brown: rgb(161, 120, 76);
}

*, ::before, ::after {
  box-sizing: border-box;
  cursor: url('/assets/cursor-default.png') 4 3, auto;
}

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

button:not(:disabled) { cursor: pointer; }
button:focus:not(:focus-visible) { outline: 0; }
img { vertical-align: middle; }
small { font-size: .875em; }
a, a:hover { color: var(--blue); }
a,
.pointer,
.btn:hover { cursor: url('/assets/cursor-pointer.png') 14 3, pointer; }
::selection { color: #fff; background: var(--red2); }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--dark-gray); }
::-webkit-scrollbar-thumb:hover { background: var(--red2); }

.btn {
  display: inline-block;
  color: inherit;
  line-height: 1.5;
  text-align: center;
  vertical-align: middle;
  border: 0;
  background: transparent;
  user-select: none;
}
.btn-dark { color: #fff; }
.btn:disabled { pointer-events: none; }
.boxshadow { box-shadow: 5px 5px 10px #000; }
.noshadow,
.noshadow div,
.noshadow .btn { box-shadow: none; }

.site-header {
  --header-height: 52px;
  position: fixed;
  z-index: 1030;
  inset: 0 0 auto;
  height: var(--header-height);
  color: #edf2f8;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: rgba(3, 5, 8, .84);
  border-bottom: 0;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .58), 0 5px 12px rgba(0, 0, 0, .4), inset 0 1px rgba(255, 255, 255, .05);
  backdrop-filter: blur(20px) saturate(155%);
  -webkit-backdrop-filter: blur(20px) saturate(155%);
  isolation: isolate;
  overflow: visible;
}


.site-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: min(440px, 52vw);
  height: 1px;
  transform: translateX(-50%);
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(58, 175, 255, .18) 24%, rgba(190, 120, 255, .3) 50%, rgba(255, 67, 119, .18) 76%, transparent);
  box-shadow: 0 2px 8px rgba(174, 104, 240, .08);

}

.site-header__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(0, auto) minmax(130px, 1fr);
  align-items: center;
  gap: 16px;
  width: 100%;
  height: 100%;
  padding: 0 16px;
  overflow: visible;
}

.site-brand,
.site-brand * {
  cursor: url('/assets/cursor-pointer.png') 14 3, pointer;
}

.site-brand {
  justify-self: start;
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
  color: #fff !important;
  text-decoration: none;
  outline: none;
}

.site-brand__wordmark {
  font-family: gamefont, Consolas, monospace;
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
}
.site-brand__wordmark em { font-style: normal; }
.site-brand__action {
  color: #788393;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.site-brand__action--rejoin { color: #6edcf6; }
.site-brand:hover .site-brand__wordmark { color: #fff; }
.site-brand:focus-visible { opacity: .78; }

.site-header__roster {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: min(760px, calc(100vw - 400px));
  min-width: 0;
  padding: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.site-header__roster::-webkit-scrollbar { display: none; }

.replay-header-controls {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  color: #fff;
  font: 400 14px/1.5 gamefont, Consolas, monospace;
  white-space: nowrap;
}
.replay-header-controls .replay-version-warning {
  color: #ffc45c;
  font-weight: 700;
}
.replay-header-controls > span + span {
  position: relative;
  padding-left: 12px;
}
.replay-header-controls > span + span::before {
  content: "";
  position: absolute;
  top: 1px;
  bottom: 1px;
  left: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, .22), transparent);
}

.roster-team {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  margin: 0;
  overflow: visible;
}

.roster-vs {
  flex: 0 0 auto;
  padding: 0 4px;
  color: #626d7c;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.player-chip,
.player-chip *,
.header-action,
.header-action *,
.header-account,
.header-account * {
  cursor: url('/assets/cursor-pointer.png') 14 3, pointer;
}

.player-chip,
.header-action,
.header-stat {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  margin: 0;
  padding: 5px 9px;
  color: #dce3ec;
  font: 600 11px/1 ui-sans-serif, system-ui, sans-serif;
  white-space: nowrap;
  border: 0;
  border-radius: 3px;
  background: rgba(255, 255, 255, .045);
  box-shadow: none;
  transition: background 130ms ease, color 130ms ease;
  overflow: visible;
}

.player-chip img {
  flex: 0 0 18px;
  width: 18px;
  height: 20px;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45));
}

.header-stat img {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  object-fit: contain;
  image-rendering: auto;
}

.player-chip {
  font-family: gamefont, Consolas, monospace;
  font-size: 12px;
  font-weight: 400;
}
.player-chip small {
  color: #7e8998 !important;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 9px;
}
.player-chip--self {
  padding-inline: 7px;
  color: #f4f7fb;
  background: transparent;
  box-shadow: none;
}
.player-chip--party { background: transparent; }
.player-chip--pending { color: #838e9c; border-style: dashed; }

.player-chip:hover,
.player-chip:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, .085);
  outline: none;
}
.player-chip--self:hover,
.player-chip--self:focus-visible { background: rgba(255, 255, 255, .045); }

.header-action {
  color: #b6c2cc;
  font-family: gamefont, Consolas, monospace;
  font-weight: 400;
  background: rgba(255, 255, 255, .045);
}
.header-action:hover,
.header-action:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, .085);
  outline: none;
}
.header-action--party-invite,
.header-action--party-invite:hover,
.header-action--party-invite:focus-visible {
  color: #fff;
  background: var(--blue);
}
.header-action--quiet { color: #8994a0; background: transparent; }
.site-header .header-action--invite,
.site-header .header-action--invite::before {
  cursor: url('/assets/cursor-pointer.png') 14 3, pointer !important;
}

.header-action--invite {
  min-height: 30px;
  padding: 6px 7px 4px;
  color: #9aa8b7;
  background: transparent;
}
.header-action--invite::before {
  content: "+";
  position: relative;
  top: -1px;
  color: inherit;
  font: 400 15px/1 ui-sans-serif, system-ui, sans-serif;
}
.header-action--invite:hover,
.header-action--invite:focus-visible {
  color: #e7edf4;
  background: rgba(255, 255, 255, .045);
}

.header-account {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 3px 2px;
  color: inherit;
  font: inherit;
  border: 0;
  border-radius: 3px;
  background: transparent;
  transition: background 130ms ease;
  overflow: visible;
}
.header-account:hover { background: rgba(255, 255, 255, .035); }
.header-account:focus-visible {
  background: rgba(255, 255, 255, .06);
  outline: none;
}

.header-stat {
  min-width: 0;
  min-height: 24px;
  gap: 5px;
  padding: 3px 8px;
  font-family: gamefont, Consolas, monospace;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.header-stat + .header-stat { border-left: 1px solid rgba(255, 255, 255, .09); }
.header-stat strong {
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  transition: color 130ms ease;
}
.header-stat--tokens strong { color: #d8c77f; }
.header-stat--rating strong { color: #d98aaa; }
.header-account:hover .header-stat--tokens strong { color: #f0dc8b; }
.header-account:hover .header-stat--rating strong { color: #ef9abb; }
#token-bank {
  transform-origin: center;
  will-change: transform, filter;
}

.header-account .header-stat__pp { font-size: 10px; }

.header-stat__pp {
  display: inline-block;
  width: auto;
  height: auto;
  flex: 0 0 auto;
  color: #9b7d8a;
  font: 700 8px/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .06em;
  background: transparent;
}

@media (max-width: 900px) {
  .site-header__inner { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding-inline: 12px; }
  .site-header__roster { justify-self: stretch; max-width: none; }
  .site-brand__action { display: none; }
}

@media (max-width: 620px) {
  .site-header::after { width: min(420px, 72vw); }
  .site-header__inner { gap: 7px; padding-inline: 8px; }
  .site-brand__wordmark { font-size: 14px; }
  .player-chip, .header-action { padding-inline: 7px; }
  .header-stat { padding-inline: 6px; }
  .replay-header-controls { gap: 8px; font-size: 12px; }
  .replay-header-controls > span + span { padding-left: 8px; }
}


.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3;
  background: rgba(0, 0, 0, .3);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}
.menu-backdrop.interaction-backdrop { z-index: 1; background: rgba(0, 0, 0, .18); }
.profile-layer.menu-backdrop { z-index: 1040; }
.profile-layer.menu-panel { z-index: 1041; }

.menu-panel {
  position: relative;
  z-index: 4;
  padding: 18px;
  overflow: visible;
  color: #d3d9e0;
  border: 0;
  outline: none;
  border-radius: 4px;
  background: rgba(3, 5, 8, .84);
  box-shadow: 0 22px 58px rgba(0, 0, 0, .72), 0 6px 16px rgba(0, 0, 0, .56), inset 0 1px rgba(255, 255, 255, .07);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}


.menu-center {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.menu-panel strong {
  color: #f2f5f9;
  font-weight: 400;
}
.menu-panel > strong:first-child {
  display: block;
  margin-bottom: 14px;
  color: #fff;
  font-size: 14px;
}
.menu-panel small { line-height: 1.65; }

/* Popup controls. */
.menu-panel .btn {
  min-height: 32px;
  padding: 7px 11px;
  color: #aeb8c3;
  font-family: gamefont, Consolas, monospace;
  font-size: 12px !important;
  line-height: 1.15;
  border: 0 !important;
  border-radius: 3px !important;
  background: rgba(255, 255, 255, .055);
  box-shadow: none !important;
  transition: color 120ms ease, background 120ms ease;
  cursor: url('/assets/cursor-pointer.png') 14 3, pointer;
}
.menu-panel .btn:hover,
.menu-panel .btn:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, .1);
  outline: none;
}
.menu-panel .btn-primary {
  color: #effcff;
  background: var(--blue);
}
.menu-panel .btn-primary:hover,
.menu-panel .btn-primary:focus-visible {
  color: #fff;
  background: var(--blue);
}
.menu-panel .btn-secondary {
  color: #929daa;
  background: transparent;
}
.menu-panel .btn:disabled,
.menu-panel .btn.disabled {
  opacity: .38;
  filter: saturate(.4);
}

.menu-panel .btn-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 5px 0;
  box-shadow: none !important;
  overflow: visible;
}
.menu-panel .btn-group > .btn {
  position: relative;
  flex: 0 0 auto;
  margin: 0 !important;
  border-radius: 3px !important;
}

/* Game and social pickers. */
#drop_arcade_menu,
#emote_menu {
  width: min(520px, calc(100vw - 24px));
  text-align: center;
}
#drop_arcade_menu [data-menu-row] {
  display: flex !important;
  justify-content: center;
  margin: 4px 0 14px;
}
#drop_arcade_menu .arcade-selected {
  color: #fff;
  background: var(--blue);
}
#drop_arcade_menu .arcade-selected:hover,
#drop_arcade_menu .arcade-selected:focus-visible {
  color: #fff;
  background: var(--blue);
}
#drop_arcade_menu .arcade-option:focus,
#emote_menu .social-option:focus {
  color: #fff !important;
  background: rgba(255, 255, 255, .11) !important;
  box-shadow: none !important;
}
#emote_menu [data-menu-row] {
  margin: 0 !important;
  padding: 12px 0;
}
#emote_menu [data-menu-row]:first-child { padding-top: 0; }
#emote_menu [data-menu-row]:last-child { padding-bottom: 0; }
#drop_arcade_menu > strong,
#emote_menu [data-menu-row] > strong {
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}
#emote_menu [data-menu-row] > strong { margin-bottom: 7px !important; }

/* Player, machine, confirmations, and ready check. */
.town-interact-prompts .btn {
  border: 0 !important;
  background: rgba(3, 5, 8, .78) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .07), 0 5px 16px rgba(0, 0, 0, .42);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
}
.town-interact-prompts .btn:hover,
.town-interact-prompts .btn:focus-visible {
  background: rgba(3, 5, 8, .88) !important;
}
.interaction-player-menu {
  position: absolute;
  left: 0;
  bottom: 0;
  width: min(680px, calc(100vw - 24px));
  transform: translateX(-50%);
  text-align: left;
}
.interaction-machine-menu {
  width: min(680px, calc(100vw - 24px));
  margin-top: 8px;
  text-align: center;
}
.skeleton-leaderboard-menu {
  position: absolute;
  left: 0;
  top: 0;
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 76px);
  transform: translate(-50%, -50%);
  overflow-x: hidden;
  overflow-y: auto;
  text-align: left;
}
.skeleton-leaderboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.skeleton-leaderboard-heading > div > strong,
.skeleton-leaderboard-heading > div > small { display: block; }
.skeleton-leaderboard-heading > div > strong { color: #fff; font-size: 15px; }
.skeleton-leaderboard-heading > div > small { color: #788391; }
.skeleton-leaderboard-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.skeleton-leaderboard-board > strong {
  display: block;
  margin-bottom: 6px;
  color: #788391;
  font-size: 11px;
  letter-spacing: .12em;
}
.skeleton-leaderboard-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 4px 7px;
  color: #788391;
  font-size: 11px;
}
.skeleton-leaderboard-row b {
  color: #c4cbd3;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.skeleton-leaderboard-row > strong { color: #e5e9ed; }
.skeleton-leaderboard-row .replay-button { margin-left: 0; }
.skeleton-leaderboard-row--self {
  background: rgba(104,219,174,.12);
  box-shadow: inset 2px 0 #68dbae;
}
.skeleton-leaderboard-row--self b,
.skeleton-leaderboard-row--self > strong { color: #68dbae; }
.skeleton-leaderboard-status {
  display: block;
  padding: 12px 7px;
  color: #788391;
}
@media (max-width: 620px) {
  .skeleton-leaderboard-menu { transform: translate(-50%, -45%); }
  .skeleton-leaderboard-columns { grid-template-columns: 1fr; }
}
.interaction-player-menu > div:last-child,
.interaction-machine-menu {
  overflow: visible;
}
.machine-roster-list {
  display: grid;
  gap: 4px;
  max-width: 320px;
  margin: 10px auto 14px;
  text-align: left;
}
.machine-roster-player {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 5px 8px;
  color: #dce3ec;
  background: rgba(255,255,255,.04);
  border-radius: 3px;
}
.machine-roster-player small { white-space: nowrap; }
.confirmation-menu {
  z-index: 5;
  width: min(420px, calc(100vw - 24px));
  text-align: center;
}
.confirmation-menu > strong:first-child { line-height: 1.55; }
.ready-check-menu {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: calc(50% + 70px);
  width: min(620px, calc(100vw - 24px));
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
}
.ready-check-menu > div {
  margin: 12px 0 !important;
  padding: 9px;
  color: #8995a4 !important;
  border: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, .035);
}

.bottom-status-hud {
  position: absolute;
  left: 50%;
  bottom: 30px;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 8px 12px;
  transform: translateX(-50%);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}
.bottom-status-hud__label { color: #fff; }
.bottom-status-hud__meta { color: var(--gray); }

.action-notice {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 150px;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 9px 13px;
  transform: translateX(-50%);
  color: #f2f5f9;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
}

/* Profile/settings popup. */
#profile_menu {
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 80px);
  padding: 22px;
  overflow-x: hidden;
  overflow-y: auto;
  text-align: left;
}
#profile_menu > div:first-child {
  margin-bottom: 16px !important;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
#profile_menu > div:first-child > strong { color: #fff; }
.profile-summary { color: var(--gray); }
.profile-game-scores {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  margin: 0 0 14px;
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.025);
  color: var(--gray);
  font-size: 12px;
}
.profile-game-scores > strong { color: var(--white); }
.profile-game-scores > .profile-game-scores__title {
  grid-column: 1 / -1;
  color: #788391;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.profile-game-scores b { margin-left: 4px; color: var(--green); font-weight: 400; }
.profile-game-scores__primary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}
.profile-game-scores__primary > strong { color: var(--white); }
.profile-game-scores__primary small { color: var(--gray); }
.profile-game-scores__primary .replay-button { flex: 0 0 auto; }
.menu-panel .btn.replay-button {
  min-height: 18px;
  margin-left: 4px;
  padding: 2px 5px;
  align-self: center;
  vertical-align: 1px;
  color: var(--blue);
  font-size: 9px !important;
  line-height: 1;
  border-radius: 2px !important;
}
.menu-panel .btn.replay-button.replay-button--outdated { color: var(--yellow); }
.profile-rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  vertical-align: middle;
  font-family: gamefont, Consolas, monospace;
}
.profile-rating__value {
  color: #d98aaa;
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
}
.menu-panel input.form-control {
  min-height: 34px;
  padding: 7px 8px;
  color: #f1f4f8;
  border: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, .18) !important;
  border-radius: 0;
  background: rgba(0, 0, 0, .18) !important;
  box-shadow: none !important;
}
.menu-panel input.form-control:focus { border-bottom-color: #45bad7 !important; }
#profile_menu .dino-color-btn {
  display: inline-flex;
  min-width: 70px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
}
.dino-option-sprite {
  width: 40px;
  height: 40px;
  background-position: 0 0;
  background-repeat: no-repeat;
  background-size: 960px 40px;
  image-rendering: pixelated;
  animation: profile-dino-idle .7s steps(4, end) infinite;
}
@keyframes profile-dino-idle {
  from { background-position: 0 0; }
  to { background-position: -160px 0; }
}
.dino-lock {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  color: var(--yellow);
  transform-origin: center;
}
.dino-lock-placeholder { visibility: hidden; }
.dino-lock img,
.inline-price img {
  width: 13px;
  height: 13px;
  image-rendering: pixelated;
}
.inline-price {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
  color: var(--yellow);
}
.pp-requirement {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 5px;
  color: var(--pink2);
}
.pp-requirement b {
  padding: 1px 2px;
  font-size: 8px;
  border: 1px solid currentColor;
  border-radius: 3px;
}
#profile_menu button,
#profile_menu button *,
#confirm-accept,
#confirm-accept * {
  cursor: url('/assets/cursor-pointer.png') 14 3, pointer !important;
}

/* Invite link uses the same panel and controls as every other menu. */
#invite_menu {
  width: min(480px, calc(100vw - 24px));
  text-align: left;
}
.invite-menu__link {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
#invite_menu .form-control {
  min-width: 0;
  width: 100%;
  color: #cbd3dc;
}
#invite_menu .menu-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 10px;
}


@media (max-width: 620px) {
  .menu-panel { padding: 16px; }
  #profile_menu { max-height: calc(100vh - 24px); padding: 16px; }
  #profile_menu > div:nth-child(2) > div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; gap: 12px !important; }
  .ready-check-menu { white-space: normal; }
}


#chat {
  position: fixed;
  z-index: 20;
  left: 20px;
  bottom: 16px;
  width: min(430px, calc(100vw - 40px));
  color: #d3d9e0;
  font-family: gamefont, Consolas, monospace;
}

.chat-panel { overflow: visible; }

#chat_msg_wrapper {
  max-height: 220px;
  padding: 0 10px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .14) transparent;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 3px 0;
  color: #b7c0ca;
  font: 400 11px/16px gamefont, Consolas, monospace;
}
.chat-message__identity {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 16px;
  color: #7f8b98;
  font: inherit;
  white-space: nowrap;
}
.chat-message__identity img {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  object-fit: contain;
}
.chat-message__identity span {
  display: inline-block;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-message__body {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 16px;
  overflow-wrap: anywhere;
}

.chat-composer {
  display: flex;
  align-items: center;
  margin: 10px 10px 0;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  box-shadow: none;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}
.chat-composer:focus-within {
  border-color: rgba(255, 255, 255, .06);
  background: rgba(0, 1, 3, .68);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .38);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

#chat_input {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  padding: 0;
  color: #eef2f6;
  font: 400 12px/1 gamefont, Consolas, monospace;
  border: 0 !important;
  outline: none;
  background: transparent !important;
  box-shadow: none !important;
  cursor: url('/assets/cursor-text.png') 10 12, text !important;
}
@media (max-width: 620px) {
  #chat { left: 8px; bottom: 8px; width: calc(100vw - 16px); }
  #chat_msg_wrapper { max-height: 170px; }
  .chat-message { gap: 6px; }
  .chat-message__identity span { max-width: 88px; }
}

.postgame-pending-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  text-align: center;
  letter-spacing: .15em;
  background: rgba(0, 1, 3, .94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.postgame-pending-screen strong {
  color: #edf2f8;
  font: 400 clamp(20px, 3vw, 30px)/1 gamefont, Consolas, monospace;
  text-shadow: none;
}
.postgame-pending-screen small {
  color: #75808d;
  font-size: 10px;
  letter-spacing: .08em;
}

.postgame-screen {
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 68px 18px 18px;
}

/* The recap uses the shared .menu-panel surface; these rules only size it. */
.postgame-card {
  width: min(860px, 100%);
  max-height: calc(100vh - 86px);
  overflow: auto;
  font-size: 14px;
  text-align: center;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .14) transparent;
}

.result-kicker {
  color: #788391;
  font: 700 16px/1.2 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .12em;
}
.postgame-card h1 {
  margin: 9px 0 5px;
  font: 400 clamp(30px, 5vw, 50px)/1 gamefont, Consolas, monospace;
  letter-spacing: -.025em;
  text-shadow: none;
}
.result-win { color: #68dbae; }
.result-loss { color: #e47591; }
.result-draw { color: #d5ca86; }
.result-meta {
  color: #747f8c;
  font-size: 12px;
}

.result-teams {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  margin: 20px 0 13px;
  text-align: left;
}
.result-team {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .055);
  border-radius: 3px;
  background: rgba(255, 255, 255, .025);
}
.result-team.winner {
  border-color: rgba(104, 219, 174, .24);
  box-shadow: inset 2px 0 rgba(104, 219, 174, .55);
}
.result-team-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  margin-bottom: 4px;
  color: #7f8a97;
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.result-team-heading b {
  color: #e9edf2;
  font: 400 22px/1 gamefont, Consolas, monospace;
}
.result-player {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  border-top-color: rgba(255, 255, 255, .045);
}
.result-player .dino-portrait {
  flex: 0 0 58px;
  width: 58px;
  min-width: 58px;
  max-width: 58px;
  height: 58px;
  overflow: hidden;
  background-position: 0 0;
  background-repeat: no-repeat;
  background-size: 1392px 58px;
  image-rendering: pixelated;
  animation: postgame-dino-idle .7s steps(4, end) infinite;
}

@keyframes postgame-dino-idle {
  from { background-position: 0 0; }
  to { background-position: -232px 0; }
}
.result-player > span:nth-child(2) > b {
  font-size: 15px;
  font-weight: 400;
}
.result-player small {
  display: block;
  margin-top: 4px;
  color: #798491;
  font-size: 12px;
  line-height: 1.5;
}
.result-player .token-reward { color: #cfc27d; font-weight: 400; }
.result-player .token-reward em {
  display: inline;
  color: #727d89;
  font-style: normal;
  font-weight: 400;
}
.winner-mark {
  margin-left: auto;
  color: #68dbae;
  font: 700 10px/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .09em;
}

.postgame-card .btn {
  font-size: 14px !important;
}
.result-leaderboard {
  width: min(520px, 100%);
  margin: 15px auto 0;
  text-align: left;
}
.result-leaderboard > strong {
  display: block;
  margin-bottom: 6px;
  color: #788391;
  font-size: 11px;
  letter-spacing: .12em;
}
.result-leaderboard > div {
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  gap: 10px;
  padding: 5px 9px;
  color: #788391;
  font-size: 12px;
}
.result-leaderboard > div b { color: #c4cbd3; font-weight: 400; }
.result-leaderboard > div > strong { color: #e5e9ed; font-weight: 400; }
.result-leaderboard .replay-button { margin-left: 0; }
.result-leaderboard > .result-leaderboard__self {
  background: rgba(104,219,174,.12);
  box-shadow: inset 2px 0 #68dbae;
}
.result-leaderboard > .result-leaderboard__self b,
.result-leaderboard > .result-leaderboard__self > strong { color: #68dbae; }

.result-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 17px;
}

@media (max-width: 620px) {
  .postgame-screen { padding: 60px 8px 8px; }
  .postgame-card { max-height: calc(100vh - 68px); }
  .result-teams { grid-template-columns: 1fr; margin-top: 16px; }
}
