/* rbx2017 site: a 2017-era look, written from scratch. */

:root {
  --blue: #00a2ff;
  --blue-hover: #32b5ff;
  --blue-dark: #0084d1;
  --green: #02b757;
  --green-hover: #3fc679;
  --text: #191919;
  --text-secondary: #757575;
  --text-muted: #b8b8b8;
  --page: #f2f2f2;
  --white: #fff;
  --line: #e3e3e3;
  --orange: #f68802;
  --red: #d86868;
  --shadow: 0 1px 4px 0 rgba(25, 25, 25, .3);
  --header: 40px;
  --font: "Source Sans Pro", "Source Sans 3", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--text);
  font: 400 16px/1.4 var(--font);
  padding-top: var(--header);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { font-weight: 400; margin: 0; }
p { margin: 0 0 12px; }
button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
svg.icon { width: 16px; height: 16px; fill: currentColor; flex: none; }

/* ---- header ---- */
.rbx-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--blue);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
.header-row {
  height: var(--header);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
}
.brand {
  display: flex;
  align-items: baseline;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -.5px;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-name { font-weight: 700; }
.brand-year { font-weight: 300; margin-left: 1px; }
.header-nav { display: flex; height: 100%; }
.header-nav a {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: #fff;
  font-size: 16px;
}
.header-nav a:hover { text-decoration: none; background: rgba(25, 25, 25, .1); }
.header-nav a[aria-current="page"] { background: rgba(25, 25, 25, .14); }
.header-search {
  position: relative;
  flex: 0 1 280px;
  margin-left: 6px;
}
.header-search input {
  width: 100%;
  height: 28px;
  border: 0;
  border-radius: 3px;
  padding: 0 32px 0 9px;
  background: #fff;
  font-size: 16px;
  outline: none;
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search input:focus { box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.header-search input::-webkit-search-cancel-button { display: none; }
.header-search button {
  position: absolute;
  right: 0; top: 0;
  width: 30px; height: 28px;
  border: 0;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}
.online-count { font-size: 14px; display: flex; align-items: center; gap: 6px; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #7dff9b; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.online-count.offline .online-dot { background: #ffd27d; }

/* ---- page ---- */
.container-main {
  width: 100%;
  max-width: 994px;
  margin: 0 auto;
  padding: 18px 12px 36px;
  flex: 1;
}
.section { margin-bottom: 24px; }
.container-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.container-header h1, .container-header h2 { font-size: 24px; line-height: 1.3; }
.section-content {
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 12px;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 9px 12px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color .12s, border-color .12s;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-hover); border-color: var(--green-hover); }
.btn-secondary { background: var(--white); border-color: var(--text-muted); color: var(--text); }
.btn-secondary:hover { border-color: var(--text-secondary); }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .8); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); border-color: #fff; }
.btn-lg { font-size: 20px; padding: 12px 24px; }
.btn-sm { font-size: 16px; padding: 6px 12px; }
.btn-xs { font-size: 14px; padding: 4px 9px; }

/* ---- game cards ---- */
.game-card {
  width: 150px;
  flex: none;
  display: block;
  background: var(--white);
  box-shadow: var(--shadow);
  color: var(--text);
  position: relative;
  transition: box-shadow .12s;
}
.game-card:hover { text-decoration: none; box-shadow: 0 3px 8px 0 rgba(25, 25, 25, .35); }
.game-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.game-card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: #d8dde1;
  overflow: hidden;
  position: relative;
}
.game-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-card-thumb .cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  color: #fff;
  font-weight: 600;
  font-size: 18px;
  text-align: center;
  line-height: 1.15;
  word-break: break-word;
}
.game-card-name {
  margin: 6px 6px 0;
  font-size: 16px;
  line-height: 1.25;
  height: 2.5em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
.game-card-players { margin: 2px 6px 0; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-card-players.live { color: var(--green); }
.game-card-vote {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 6px 8px;
  color: var(--text-muted);
}
.game-card-vote svg.icon { width: 14px; height: 14px; }
.vote-bar { flex: 1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.vote-fill { height: 100%; width: 0; background: var(--text-secondary); }
.vote-bar.empty { background: var(--line); }
.game-card-live {
  position: absolute;
  top: 6px; left: 6px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  padding: 1px 5px;
  border-radius: 2px;
}

/* placeholders while loading */
.game-card.skeleton .game-card-thumb { animation: pulse 1.2s ease-in-out infinite; }
.game-card.skeleton .game-card-name { background: var(--line); height: 14px; margin-bottom: 30px; width: 70%; }
@keyframes pulse { 50% { opacity: .55; } }

/* ---- game rows (one sort, scrolls sideways) ---- */
.game-row { position: relative; }
.game-row-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 4px 4px 10px;
  margin: -4px -4px 0;
}
.game-row-track::-webkit-scrollbar { display: none; }
.scroller {
  position: absolute;
  top: 0;
  width: 32px;
  height: 154px;
  border: 0;
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
  z-index: 2;
}
.scroller svg.icon { width: 20px; height: 20px; }
.scroller.prev { left: -6px; }
.scroller.next { right: -6px; }
.game-row:hover .scroller:not([disabled]), .scroller:focus-visible { opacity: 1; }
.scroller[disabled] { pointer-events: none; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.game-grid .game-card { width: auto; }

.empty-state {
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 36px 12px;
  text-align: center;
  color: var(--text-secondary);
}

/* ---- alerts ---- */
.alert {
  padding: 9px 12px;
  margin-bottom: 18px;
  color: #fff;
  background: var(--orange);
  text-align: center;
  font-size: 16px;
}
.alert.info { background: var(--blue); }

/* ---- home ---- */
.home-hero {
  position: relative;
  overflow: hidden;
  background: #232527;
  color: #fff;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  min-height: 340px;
  display: flex;
  align-items: center;
}
.hero-mosaic {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  grid-auto-rows: 110px;
  opacity: .35;
  transform: rotate(-4deg) scale(1.25);
  pointer-events: none;
}
.hero-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(20, 22, 24, .92) 0%, rgba(20, 22, 24, .7) 55%, rgba(20, 22, 24, .35) 100%);
}
.hero-content { position: relative; z-index: 1; padding: 36px; max-width: 560px; }
.hero-content h1 { font-size: 48px; font-weight: 300; line-height: 1.1; margin-bottom: 12px; }
.hero-content h1 b { font-weight: 600; }
.hero-content p { font-size: 20px; color: #d8d8d8; margin-bottom: 24px; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { font-size: 14px !important; color: #b8b8b8 !important; margin: 14px 0 0 !important; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.step {
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 18px;
}
.step-number {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.step h3 { font-size: 20px; margin-bottom: 4px; }
.step p { color: var(--text-secondary); margin: 0; }

/* ---- games page ---- */
.games-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.games-filters h1 { font-size: 32px; margin-right: auto; }
.select-wrap { position: relative; }
.select-wrap select {
  appearance: none;
  height: 36px;
  min-width: 170px;
  padding: 0 34px 0 12px;
  background: var(--white);
  border: 1px solid var(--text-muted);
  border-radius: 3px;
  font-size: 16px;
  cursor: pointer;
}
.select-wrap select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.select-wrap svg.icon { position: absolute; right: 10px; top: 10px; pointer-events: none; }
.search-summary { width: 100%; color: var(--text-secondary); margin: -6px 0 0; }

/* ---- game page ---- */
.game-main {
  display: flex;
  gap: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 12px;
}
.game-media {
  flex: 0 0 576px;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: #232527;
}
.game-media-backdrop {
  position: absolute;
  inset: -30px;
  background-size: cover;
  background-position: center;
  filter: blur(22px) brightness(.55);
}
.game-media img { position: relative; display: block; height: 100%; width: auto; margin: 0 auto; object-fit: contain; }
.game-media .cover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 32px; font-weight: 600; text-align: center; padding: 24px; }
.game-calls { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.game-name { font-size: 32px; line-height: 1.15; word-break: break-word; margin-bottom: 4px; }
.game-creator { color: var(--text-secondary); margin-bottom: 12px; }
.game-creator span { color: var(--blue); }
.game-play {
  margin-top: auto;
  width: 100%;
  height: 60px;
  font-size: 0;
}
.game-play svg.icon { width: 30px; height: 30px; }
.game-play.offline { background: var(--text-muted); border-color: var(--text-muted); }
.game-play-note { font-size: 14px; color: var(--text-secondary); margin: 6px 0 0; min-height: 20px; }
.game-votes {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}
.game-votes .vote-bar { height: 6px; }
.game-votes .vote-count { display: flex; align-items: center; gap: 4px; white-space: nowrap; }

.rbx-tabs {
  display: flex;
  background: var(--white);
  box-shadow: var(--shadow);
  margin: 18px 0 12px;
}
.rbx-tab {
  flex: 1;
  border: 0;
  background: none;
  padding: 12px 6px 9px;
  border-bottom: 3px solid transparent;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
}
.rbx-tab:hover { color: var(--text); }
.rbx-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--blue); }
.rbx-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.rbx-tab .count { color: var(--text-muted); font-size: 16px; }

.game-description { white-space: pre-wrap; word-break: break-word; margin: 6px 0 0; }
.game-description.collapsed { max-height: 220px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.read-more { margin-top: 6px; }
.game-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}
.game-stat { text-align: center; padding: 0 6px; }
.game-stat .label { color: var(--text-muted); font-size: 14px; }
.game-stat .value { font-size: 20px; }

.item-list { list-style: none; margin: 0; padding: 0; }
.badge-row { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.badge-row:first-child { border-top: 0; padding-top: 0; }
.badge-row img, .badge-row .icon-blank { width: 75px; height: 75px; flex: none; border-radius: 50%; object-fit: cover; background: var(--line); }
.badge-row h4 { font-size: 18px; }
.badge-row p { color: var(--text-secondary); margin: 2px 0 0; font-size: 14px; word-break: break-word; }
.pass-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pass-card { background: var(--white); box-shadow: var(--shadow); padding-bottom: 8px; }
.pass-card img, .pass-card .icon-blank { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; background: var(--line); }
.pass-card h4 { font-size: 16px; margin: 6px 6px 2px; line-height: 1.25; height: 2.5em; overflow: hidden; }
.pass-card .price { margin: 0 6px; color: var(--green); font-weight: 600; font-size: 14px; }
.pass-card .was { color: var(--text-muted); text-decoration: line-through; font-weight: 400; margin-left: 4px; }
.server-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.server-row:first-child { border-top: 0; padding-top: 0; }
.server-row .server-info { flex: 1; min-width: 0; }
.server-row .vote-bar { max-width: 260px; margin-top: 6px; }
.server-row .vote-fill { background: var(--green); }

/* ---- download / help ---- */
.download-hero {
  display: flex;
  align-items: center;
  gap: 36px;
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 36px;
  margin-bottom: 24px;
}
.download-hero h1 { font-size: 40px; font-weight: 300; line-height: 1.1; margin-bottom: 12px; }
.download-hero p { font-size: 18px; color: var(--text-secondary); }
.download-art {
  flex: 0 0 220px;
  height: 220px;
  border-radius: 24px;
  background: var(--blue);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, .12);
}
.download-art .art-name { font-size: 44px; font-weight: 700; letter-spacing: -1px; line-height: 1; }
.download-art .art-year { font-size: 44px; font-weight: 300; line-height: 1; }
.release-info { font-size: 14px !important; margin: 12px 0 0 !important; }
.faq { background: var(--white); box-shadow: var(--shadow); }
.faq details { border-top: 1px solid var(--line); }
.faq details:first-child { border-top: 0; }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  font-size: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--text-muted); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.faq .answer { padding: 0 18px 14px; color: var(--text-secondary); }
.faq .answer p:last-child { margin-bottom: 0; }

.not-found { text-align: center; padding: 60px 12px; }
.not-found .big { font-size: 96px; font-weight: 300; color: var(--text-muted); line-height: 1; }
.not-found h1 { font-size: 28px; margin: 12px 0 18px; }
.not-found .buttons { display: flex; gap: 12px; justify-content: center; }

/* ---- play dialog ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border-radius: 3px;
  box-shadow: 0 6px 30px rgba(0, 0, 0, .35);
  text-align: center;
  padding: 24px;
}
.modal h2 { font-size: 24px; margin-bottom: 6px; }
.modal p { color: var(--text-secondary); }
.modal .buttons { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }
.spinner {
  width: 44px; height: 44px;
  margin: 4px auto 14px;
  border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--blue);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- footer ---- */
.site-footer {
  background: var(--white);
  border-top: 1px solid var(--line);
  padding: 24px 12px;
  text-align: center;
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 28px; margin-bottom: 12px; }
.footer-links a { color: var(--text-secondary); font-size: 18px; }
.footer-note { color: var(--text-muted); font-size: 13px; margin: 0; }

/* ---- smaller screens ---- */
@media (max-width: 991px) {
  .game-main { flex-direction: column; }
  .game-media { flex: none; width: 100%; }
  .download-art { display: none; }
}
@media (max-width: 767px) {
  :root { --header: 76px; }
  .header-row { flex-wrap: wrap; height: auto; padding: 0 16px; row-gap: 0; }
  .brand { height: 40px; align-items: center; font-size: 22px; }
  .header-search { order: 2; flex: 1 1 0; min-width: 0; margin-left: 0; }
  .header-right { display: none; }
  .header-nav { order: 3; width: calc(100% + 32px); margin: 0 -16px; height: 36px; background: var(--blue-dark); }
  .header-nav a { flex: 1; justify-content: center; padding: 0 6px; }
  .container-main { padding: 14px 16px 28px; }
  .home-hero { min-height: 0; }
  .hero-content { padding: 28px 18px; }
  .hero-content h1 { font-size: 36px; }
  .hero-content p { font-size: 18px; }
  .steps { grid-template-columns: 1fr; }
  .game-stats { grid-template-columns: repeat(3, 1fr); row-gap: 12px; }
  .game-name { font-size: 26px; }
  .rbx-tab { font-size: 17px; }
  .download-hero { padding: 24px 18px; }
  .download-hero h1 { font-size: 32px; }
  .scroller { display: none; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

.loading { animation: pulse 1.2s ease-in-out infinite; }
