#public-home {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: clamp(58px, 8vw, 112px) 1fr;
  grid-template-rows: clamp(52px, 10.5vh, 96px) 1fr;
  background: radial-gradient(ellipse at 70% 10%, #063148, #001527 70%);
  color: #f7f6ef;
  font-family: Arial, sans-serif;
  overflow: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom)
    env(safe-area-inset-left);
  box-sizing: border-box;
}
#public-home[hidden],
.game-layout[hidden] {
  display: none !important;
}
#public-home h1,
#public-home h2,
#public-home h3,
#public-home p {
  margin: 0;
  font-family: inherit;
}
#public-home button {
  font-family: inherit;
  cursor: pointer;
  color: inherit;
}
#public-home button:disabled {
  cursor: default;
  opacity: 0.6;
}
#public-home button:focus-visible,
#lobby-info button:focus-visible,
#public-auth button:focus-visible,
.game-brand:focus-visible {
  outline: 3px solid #fff1a8;
  outline-offset: 2px;
}
#public-home svg:where(:not(.cd-art)) {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
.arena-lobby-header {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 24px);
  padding: 6px 18px;
  border-bottom: 1px solid #8b7a45;
  min-width: 0;
}
.lobby-wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  color: #ffe18b;
}
.lobby-wordmark > span {
  border: 2px solid #f5d779;
  width: clamp(32px, 5vw, 66px);
  height: clamp(32px, 5vw, 66px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: clamp(26px, 4.5vw, 54px);
}
.lobby-wordmark img {
  display: block;
  width: clamp(120px, 20vw, 260px);
  height: auto;
  max-height: 70px;
  object-fit: contain;
}
#public-home .lobby-wordmark h1 {
  font-weight: 900;
  font-size: clamp(16px, 2.8vw, 38px);
  line-height: 0.95;
  letter-spacing: 0.03em;
  color: #ffe18b;
}
.lobby-currencies {
  display: flex;
  gap: 12px;
}
.public-wallet,
.gem-wallet {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 110px;
  padding: 4px 16px 12px;
  border: 1px solid #f5d779;
  border-radius: 30px;
  background: #001019;
}
.public-wallet > span {
  color: #ffc63b;
  font-size: 28px;
}
.gem-wallet > span {
  color: #16c8ff;
  font-size: 28px;
}
.public-wallet strong,
.gem-wallet strong {
  font-size: clamp(16px, 2.3vw, 30px);
}
.public-wallet {
  width: clamp(110px, 14vw, 180px);
  flex-shrink: 0;
}
#public-credits {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#public-credits[data-long-balance='true'] {
  font-size: clamp(15px, 1.9vw, 25px);
}
.public-wallet small,
.gem-wallet small {
  position: absolute;
  bottom: 3px;
  font-size: 8px;
  letter-spacing: 0.07em;
}
.lobby-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  text-align: left;
  min-width: 0;
}
.lobby-identity > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.lobby-identity strong {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(12px, 1.6vw, 22px);
}
.lobby-identity small {
  width: max-content;
  border-radius: 20px;
  padding: 2px 12px;
  background: #f3cf64;
  color: #001527;
  font-size: 11px;
}
.jockey-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #c9ac5f;
  background: linear-gradient(#10a468, #01473d);
  color: #ffdf88;
  font-size: 34px;
}
.lobby-icon {
  position: relative;
  border: 0;
  background: none;
  padding: 4px;
}
.lobby-icon i {
  position: absolute;
  right: 2px;
  top: 0;
  border-radius: 50%;
  width: 8px;
  height: 8px;
  background: #ffdb5c;
}
.account-control {
  font-size: 11px;
  border: 1px solid #8f7842;
  background: none;
  border-radius: 6px;
  padding: 6px 8px;
  max-width: 95px;
}
.lobby-nav {
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 2vh, 22px);
  padding: clamp(10px, 3vh, 30px) 6px;
  border-right: 1px solid #476376;
}
.lobby-nav button {
  display: flex;
  flex: 1;
  max-height: 110px;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  font-weight: 700;
  font-size: clamp(11px, 1.5vw, 20px);
}
.lobby-nav button.selected {
  border-color: #ffe18b;
  background: linear-gradient(#087149, #00372f);
  box-shadow:
    inset 0 0 8px #d3e18560,
    0 0 12px #64c79030;
}
.lobby-nav svg {
  width: clamp(24px, 3vw, 42px) !important;
  height: clamp(24px, 3vw, 42px) !important;
}
.lobby-main {
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: clamp(8px, 1.8vh, 18px);
  padding: clamp(8px, 1.5vw, 22px);
}
#public-home .lobby-greeting {
  font-size: clamp(19px, 2.7vw, 36px);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 20px;
}
.lobby-greeting:after {
  content: '';
  height: 1px;
  background: linear-gradient(90deg, #caaa5b, #72502e);
  flex: 1;
}
.public-content {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(10px, 1.6vw, 24px);
  min-height: 0;
}
.public-race {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #557481;
  border-radius: 18px;
  background:
    linear-gradient(0deg, #001c28 0%, #001d2cdc 22%, transparent 65%),
    url('/branding/welcome-reference.png') 0 42% / 190% auto no-repeat;
}
.quick-race-copy {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: clamp(10px, 1.6vw, 24px);
}
#public-home .quick-race-copy h2 {
  font-size: clamp(24px, 3.6vw, 50px);
  line-height: 1;
  color: #ffdf7d;
  font-style: italic;
  font-weight: 900;
  text-shadow: 0 2px 3px #000;
}
#public-home .quick-race-copy h3 {
  font-size: clamp(16px, 2.2vw, 30px);
  font-style: italic;
  margin: 5px 0;
}
.quick-race-copy p {
  font-size: clamp(10px, 1.4vw, 17px);
}
.race-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}
#public-live {
  font-size: clamp(9px, 1.05vw, 14px);
  color: #b6ff9b;
  line-height: 1.5;
}
#public-home #play-public,
#claim-daily {
  background: linear-gradient(#ffe98f, #f6c741 60%, #cf8e14);
  color: #161300;
  border: 1px solid #ffeaa2;
  box-shadow: inset 0 -3px 0 #b77b16;
  border-radius: 9px;
  padding: 12px 20px;
  font-size: clamp(15px, 2vw, 27px);
  font-weight: 900;
  white-space: nowrap;
}
.club-preview {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.2vh, 16px);
}
#public-home .club-preview > h2 {
  font-size: clamp(17px, 2.3vw, 30px);
  color: #ffe18b;
}
.club-actions {
  display: flex;
  gap: 10px;
}
.club-actions button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #d1b95f;
  border-radius: 12px;
  background: linear-gradient(#086341, #002b24);
  padding: clamp(8px, 1.6vh, 20px) 8px;
  font-size: clamp(11px, 1.5vw, 21px);
  font-weight: 700;
}
.club-actions small {
  display: block;
  font-size: 0.75em;
  font-weight: 400;
  margin-top: 5px;
}
.club-actions svg {
  color: #ffe18b;
}
.club-empty {
  border: 1px solid #426475;
  border-radius: 10px;
  padding: clamp(8px, 1.4vw, 18px);
  background: #05253880;
}
.club-empty strong {
  font-size: clamp(12px, 1.5vw, 20px);
}
.club-empty p {
  font-size: clamp(10px, 1.2vw, 15px);
  color: #bdd1dc;
  line-height: 1.5;
  margin-top: 6px !important;
}
.streak-panel {
  margin-top: auto;
}
#public-home .streak-panel h3 {
  font-size: clamp(10px, 1.1vw, 15px);
  color: #f6d77e;
}
#reward-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin: 8px 0;
}
#reward-days > div {
  text-align: center;
  padding: 8px 1px;
  border: 1px solid #496979;
  border-radius: 5px;
  background: #001925;
}
#reward-days small {
  display: block;
  font-size: 8px;
  color: #bed3dd;
}
#reward-days strong {
  display: block;
  font-size: clamp(11px, 1.2vw, 17px);
  margin-top: 3px;
}
#reward-days .current-day {
  background: #045540;
  border-color: #f1cc62;
  color: #ffde7a;
}
.refill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
}
.refill-row small {
  display: block;
  font-size: 9px;
  color: #a8c0cd;
  margin-top: 3px;
}
#claim-refill {
  padding: 7px;
  border: 1px solid #8b9d87;
  border-radius: 6px;
  background: #092f38;
  font-size: 10px;
  white-space: nowrap;
}
.lobby-bonus-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.lobby-bonus-row section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(10px, 1.8vh, 24px) 14px;
  border: 1px solid #c3b16f;
  border-radius: 13px;
  background: linear-gradient(120deg, #083143, #001722);
}
.lobby-bonus-row svg {
  width: clamp(28px, 4vw, 56px) !important;
  height: clamp(28px, 4vw, 56px) !important;
  color: #ffde7a;
}
.lobby-bonus-row section > div {
  flex: 1;
}
#public-home .lobby-bonus-row h2 {
  font-size: clamp(12px, 1.6vw, 22px);
  color: #ffe18b;
}
.lobby-bonus-row p {
  font-size: clamp(10px, 1.2vw, 16px);
  margin-top: 4px !important;
}
#public-home #claim-daily {
  font-size: clamp(12px, 1.4vw, 20px);
  padding: 10px 16px;
}
#welcome-reward {
  padding: 9px 12px;
  border: 1px solid #ffe18b;
  border-radius: 9px;
  background: #001926;
  font-size: clamp(10px, 1.2vw, 16px);
  font-weight: 700;
}
#public-home footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #8e7945;
  padding-top: 8px;
  font-size: clamp(9px, 1.1vw, 14px);
}
#lobby-help {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
}
#lobby-help svg {
  width: 22px;
  height: 22px;
}
#public-message {
  color: #ffdf7c;
  text-align: center;
}
#public-auth,
#lobby-info {
  width: min(440px, 90vw);
  box-sizing: border-box;
  padding: 18px;
  border: 1px solid #f5d779;
  border-radius: 12px;
  background: #032236;
  color: #f6f3e5;
  max-height: 92dvh;
}
#public-auth::backdrop,
#lobby-info::backdrop {
  background: #000b;
}
.auth-heading,
.info-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#public-auth h2,
#lobby-info h2 {
  margin: 0;
  color: #ffe18b;
  font-size: 23px;
}
#public-auth form {
  display: grid;
  gap: 9px;
}
#public-auth label {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  font-size: 13px;
}
#public-auth input {
  min-width: 0;
  padding: 8px;
  border: 1px solid #8fb3c1;
  border-radius: 5px;
  color: white;
  background: #00131f;
}
#public-auth p {
  margin: 0;
  font-size: 12px;
}
#public-auth button,
#lobby-info button {
  border: 1px solid #d6be74;
  border-radius: 6px;
  background: #083d48;
  color: #fff1c5;
  padding: 8px 12px;
  min-height: 32px;
  cursor: pointer;
}
#auth-error:empty {
  display: none;
}
#auth-error {
  color: #ffc396;
}
#auth-submit {
  background: linear-gradient(#ffe58a, #d99d26) !important;
  color: #10202a !important;
  font-weight: 700;
}
#info-body {
  font-size: 14px;
  line-height: 1.5;
}
#info-action {
  margin-top: 10px;
}
@media (max-height: 500px) {
  .lobby-wordmark img {
    max-height: 40px;
    object-position: left center;
  }
  .arena-lobby-header {
    padding: 4px 10px;
    gap: 10px;
  }
  .lobby-main {
    gap: 7px;
    padding: 8px 10px;
  }
  .lobby-wordmark {
    gap: 7px;
  }
  .public-wallet,
  .gem-wallet {
    min-width: 68px;
    padding: 2px 10px 11px;
    gap: 7px;
  }
  .public-wallet > span,
  .gem-wallet > span {
    font-size: 20px;
  }
  .jockey-avatar {
    width: 30px;
    height: 30px;
    font-size: 25px;
  }
  .lobby-icon svg {
    width: 23px !important;
    height: 23px !important;
  }
  .club-empty {
    display: none;
  }
  .club-actions button {
    padding: 7px 4px;
  }
  .club-actions svg {
    width: 22px !important;
    height: 22px !important;
  }
  .club-preview {
    gap: 6px;
  }
  .quick-race-copy {
    padding: 10px;
  }
  .race-card-bottom {
    margin-top: 6px;
  }
  #public-home #play-public {
    padding: 9px 13px;
  }
  #reward-days {
    margin: 5px 0;
  }
  #reward-days > div {
    padding: 5px 0;
  }
  .lobby-bonus-row {
    gap: 10px;
  }
  .lobby-bonus-row section {
    padding: 8px;
    gap: 8px;
  }
  #public-home footer {
    padding-top: 5px;
  }
  .lobby-nav {
    padding: 10px 5px;
    gap: 7px;
  }
  .lobby-bonus-row p {
    font-size: 10px;
  }
  .lobby-identity strong {
    max-width: 110px;
  }
  .account-control {
    font-size: 9px;
    max-width: 70px;
    padding: 4px;
  }
}
@media (max-width: 700px) {
  #public-home {
    grid-template-columns: 55px 1fr;
  }
  .gem-wallet {
    display: none;
  }
  .lobby-wordmark > span {
    display: none;
  }
  .lobby-wordmark h1 {
    font-size: 17px !important;
  }
  .lobby-identity {
    gap: 4px;
    padding: 0;
  }
  .jockey-avatar {
    display: none;
  }
  .lobby-identity strong {
    max-width: 95px;
  }
  .lobby-currencies {
    margin-left: auto;
  }
  .lobby-identity small {
    font-size: 9px;
    padding: 1px 7px;
  }
  .arena-lobby-header {
    gap: 8px;
  }
  .lobby-main {
    padding: 7px;
  }
  .public-content {
    grid-template-columns: 1.1fr 1fr;
    gap: 8px;
  }
  .club-actions {
    gap: 5px;
  }
  .club-actions svg {
    display: none;
  }
  .club-actions button {
    font-size: 10px;
  }
  .club-actions small {
    font-size: 8px;
    margin-top: 3px;
  }
  .refill-row > span {
    font-size: 9px;
  }
  .refill-row small {
    max-width: 90px;
    font-size: 8px;
  }
  #claim-refill {
    font-size: 8px;
    padding: 5px;
  }
  .quick-race-copy {
    padding: 8px;
  }
  #public-home .quick-race-copy h2 {
    font-size: 24px;
  }
  #public-home .quick-race-copy h3 {
    font-size: 15px;
  }
  .quick-race-copy p {
    font-size: 9px;
  }
  .race-card-bottom {
    flex-wrap: wrap;
    gap: 4px;
  }
  #public-home #play-public {
    font-size: 14px;
    padding: 6px 10px;
  }
  #public-live {
    font-size: 8px;
  }
  #reward-days {
    gap: 2px;
  }
  #reward-days small {
    font-size: 7px;
  }
  #reward-days strong {
    font-size: 10px;
  }
  .lobby-bonus-row {
    gap: 7px;
  }
  .lobby-bonus-row svg {
    display: none;
  }
  .lobby-bonus-row section {
    gap: 5px;
    padding: 7px;
  }
  .lobby-bonus-row h2 {
    font-size: 11px !important;
  }
  .lobby-bonus-row p {
    font-size: 9px;
  }
  #welcome-reward {
    font-size: 9px;
    padding: 6px;
  }
  #public-home #claim-daily {
    font-size: 11px;
    padding: 7px;
  }
  #public-home footer {
    font-size: 8px;
  }
  #lobby-help {
    gap: 4px;
  }
  #lobby-help svg {
    width: 17px;
    height: 17px;
  }
  #public-message {
    max-width: 170px;
  }
  .lobby-nav svg {
    width: 24px !important;
    height: 24px !important;
  }
  .lobby-nav button {
    gap: 3px;
    font-size: 10px;
    border-radius: 8px;
  }
  #public-auth {
    padding: 12px;
  }
  #public-auth form {
    gap: 6px;
  }
}

@media (max-height: 350px) {
  .club-preview {
    gap: 3px;
  }
  .club-actions button {
    padding: 4px;
  }
  .club-actions small {
    font-size: 7px;
    margin-top: 2px;
  }
  #public-home .streak-panel h3 {
    font-size: 9px;
  }
  #reward-days {
    margin: 4px 0;
  }
  #reward-days > div {
    padding: 3px 0;
  }
  .refill-row small {
    display: none;
  }
  .refill-row {
    font-size: 9px;
  }
  #claim-refill {
    padding: 4px;
    font-size: 8px;
  }
}
