#mainLobbyModal .lobby-panel { max-width: 950px; border: 1px solid #bfe1db; border-radius: 24px; background: #143340; box-shadow: 0 16px 50px #0008; }
#mainLobbyModal .lobby-header { margin-bottom: 10px; border-color: #ffffff24; }
#mainLobbyModal .lobby-header h1 { color: #ffedb5; font-size: 1.45rem; }
#familyGarageHero { --kart-paint: #fb7185; position: relative; min-height: 220px; border-radius: 18px; overflow: hidden; background: linear-gradient(#f9e6bd 0 62%, #a1c9bc 62% 68%, #789a91 68%); isolation: isolate; margin-bottom: 12px; }
#familyGarageHero::before { content: ''; position: absolute; inset: 15% 12% 36%; border: 7px solid #fdf3da; background: repeating-linear-gradient(90deg, #f3c887 0 4px, #e9bb7e 4px 40px); border-radius: 12px 12px 0 0; z-index: -1; }
#artLobbyScene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; pointer-events: none; }
#familyGarageHero.art-scene-ready::before { display: none; }
#familyGarageHero.art-scene-ready::after { content: ''; position: absolute; inset: 0; background: linear-gradient(#fff4d455, transparent 30% 75%, #25475199); z-index: -1; pointer-events: none; }
.family-hero-kicker { position: absolute; top: 12px; left: 16px; color: #5f746b; letter-spacing: .12em; font-size: .6875rem; font-weight: 900; }
.family-hero-toys { position: absolute; inset: auto 0 21% 0; display: flex; justify-content: space-between; padding: 0 6%; color: #f9e8c3; font-size: 2.4rem; pointer-events: none; }
#familyHelloBtn { position: absolute; bottom: 28px; left: 50%; width: 230px; height: 164px; transform: translateX(-50%); background: none; border: 0; cursor: pointer; }
#familyHelloBtn::before { content: ''; position: absolute; bottom: 7px; left: 10%; width: 80%; height: 20px; background: #294e5155; border-radius: 50%; }
#familyHeroDriver { position: absolute; width: 94px; height: 94px; object-fit: contain; left: 68px; top: 0; z-index: 1; }
#familyHeroKart { position: absolute; width: 224px; height: 150px; object-fit: contain; left: 3px; bottom: 4px; z-index: 2; }
#familyHeroStripe { position: absolute; left: 64px; bottom: 31px; width: 104px; height: 9px; border-radius: 4px; background: var(--kart-paint); z-index: 3; }
#familyHeroSticker { position: absolute; left: 101px; bottom: 31px; z-index: 4; color: #fffbe7; font-size: 22px; line-height: 28px; }
.family-hero-caption { position: absolute; bottom: 8px; left: 12px; right: 12px; display: flex; justify-content: space-between; gap: 8px; color: #fff9df; font-size: .75rem; }
#familyHeroName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.family-wave #familyHeroDriver { animation: family-wave .7s ease-in-out; }
.family-wave #familyHeroKart { animation: family-roll .7s ease-in-out; }
@keyframes family-wave { 25% { transform: rotate(-10deg) translateY(-8px); } 75% { transform: rotate(10deg) translateY(-5px); } }
@keyframes family-roll { 50% { transform: translateY(-5px) rotate(-3deg); } }
#familyControls { margin-bottom: 12px; }
.family-mode-row, .family-world-row { display: grid; gap: 6px; }
.family-mode-row { grid-template-columns: 1fr 1fr; margin: 4px 0 8px; }
.family-world-row { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 4px 0; }
#familyControls h2 { margin: 0; color: #b5d8d1; font-size: .75rem; font-weight: 700; }
#familyControls button, #familyCustomization button { min-height: 44px; border: 1px solid #6b9699; border-radius: 12px; background: #234955; color: #fff8df; padding: 8px; font-weight: 700; font-size: .8125rem; line-height: 1.35; cursor: pointer; }
#familyControls button[aria-pressed="true"], #familyCustomization button[aria-pressed="true"] { border: 2px solid #ffe5a0; background: #356866; box-shadow: inset 0 0 0 1px #ffe5a033; }
.family-world-row button > span { display: block; font-size: 1.5rem; margin-bottom: 3px; }
#familyControls #familyClassicWorld { min-height: 36px; padding: 4px 9px; font-size: .75rem; background: transparent; }
#familyControls #familyTrainingBtn { margin-top: 6px; background: #eee0b9; color: #294955; width: 100%; }
#familyTrainingBtn:disabled { opacity: .55; }
#familyWorldCaption { color: #f8dda3; font-size: .8125rem; margin: 5px 0; }
.family-help-note { color: #b0cdcd; font-size: .75rem; line-height: 1.45; margin: 6px 0; }
#familyCustomization { border-top: 1px solid #ffffff24; padding: 10px 0; margin-top: 8px; }
#familyCustomization summary { min-height: 36px; color: #ffdea6; font-weight: 700; cursor: pointer; font-size: .875rem; }
.family-custom-options { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
#familyCustomization h3 { color: #bde0d7; font-size: .8125rem; margin-top: 8px; }
.family-paint-swatch { display: inline-block; height: 14px; width: 14px; margin-right: 4px; vertical-align: middle; border: 1px solid #fff8; border-radius: 50%; background: var(--swatch); }
.family-aid-row { display: flex; flex-wrap: wrap; gap: 8px; }
.family-aid-row label { display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 6px 9px; background: #234955; border-radius: 9px; font-size: .8125rem; }
.family-aid-row input { width: 20px; height: 20px; accent-color: #5eead4; }
#familyMedals { color: #f9dc91; font-weight: 700; }
#mainLobbyModal .lobby-preview > div:first-child { display: none; }
html:not([data-family-world="classic"]) #mainLobbyModal .lobby-preview { display: none; }
#mainLobbyModal .lobby-pit-strip { padding: 6px 8px; margin: 8px 0; }
#mainLobbyModal .lobby-pit-brand strong { display: none; }
#mainLobbyModal #mobileGarage > summary { display: list-item; min-height: 36px; }
#mainLobbyModal .lobby-actions { margin-top: 8px; }
#familyParentGate { width: min(460px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; margin: auto; border: 2px solid #a0c9c7; border-radius: 20px; padding: 20px; background: #143340; color: #fff7df; }
#familyParentGate::backdrop { background: #051921d9; }
#familyParentGate h2 { font-size: 1.1rem; font-weight: 700; }
#familyParentGate p { margin: 9px 0; line-height: 1.6; font-size: .875rem; }
#familyParentGate label { display: block; margin-top: 12px; }
#familyParentAnswer { width: 100%; min-height: 44px; margin: 8px 0; padding: 7px 12px; background: #fff8e6; color: #12333e; border: 1px solid #d4ccb9; border-radius: 8px; font-size: 1.125rem; }
.family-gate-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.family-gate-actions button { min-height: 44px; border-radius: 10px; padding: 8px 14px; border: 1px solid #b2d4c9; background: #2b5e61; color: white; }
#familyParentError { color: #ffbaad; }
html[data-family-mode="stroll"] #briefBoostAdBtn { display: none; }
html[data-family-mode="stroll"] #goalBigRankText { color: #fde68a; }
#familyTrainingResult { z-index: 46; }
#familyTrainingResult .glass-panel { width: min(480px, 100%); max-height: calc(100dvh - 24px); overflow: auto; border-radius: 22px; padding: 22px; }
#familyTrainingResult h2 { font-size: 1.5rem; color: #ffe09b; }
#familyTrainingResult p { margin: 12px 0; line-height: 1.6; font-size: .9375rem; }
#familyTrainingResult button { width: 100%; min-height: 44px; margin-top: 8px; border-radius: 12px; background: #cce8cc; color: #163b43; padding: 8px; }
#familyTrainingResult button:last-child { background: #335767; color: #fff6dc; }
@media (min-width: 700px) {
  #mainLobbyModal .lobby-panel { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); column-gap: 16px; }
  #mainLobbyModal .lobby-header { grid-column: 1 / -1; order: 0; }
  #familyGarageHero { grid-column: 1; grid-row: 2 / 4; order: 1; margin: 0; }
  #familyControls { grid-column: 2; grid-row: 2; order: 2; margin: 0; }
  #mainLobbyModal .lobby-actions { grid-column: 2; grid-row: 3; order: 3; position: static; margin: 4px 0 0; padding: 0; background: none; }
  #mainLobbyModal .lobby-pit-strip, #mainLobbyModal .lobby-preview, #mainLobbyModal #mobileGarage, #familyCustomization, #raceFeatureLobby { grid-column: 1 / -1; order: 4; }
  #mainLobbyModal #mobileGarage { order: 5; }
  #familyCustomization { order: 6; }
  #raceFeatureLobby { order: 7; }
}
@media (max-width: 699px) {
  #mainLobbyModal .lobby-panel { display: flex; flex-direction: column; }
  #mainLobbyModal .lobby-header { order: 0; }
  #familyGarageHero { order: 1; min-height: 170px; margin-bottom: 6px; }
  #familyHelloBtn { transform: translateX(-50%) scale(.83); transform-origin: bottom; }
  #familyControls { order: 3; margin: 0; }
  #mainLobbyModal .lobby-actions { order: 2; position: sticky; top: 0; z-index: 3; background: #143340; padding: 4px 0; }
  #mainLobbyModal .lobby-pit-strip, #mainLobbyModal .lobby-preview { order: 4; }
  #mainLobbyModal #mobileGarage { order: 5; }
  #familyCustomization { order: 6; }
  #raceFeatureLobby { order: 7; }
}
@media (orientation: landscape) and (max-height: 500px) {
  #mainLobbyModal .lobby-panel { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 5px 10px; padding: 8px 10px; }
  #mainLobbyModal .lobby-header { grid-column: 1 / -1; grid-row: 1; margin: 0 0 3px; padding-bottom: 3px; }
  #mainLobbyModal .lobby-header h1 { font-size: 1rem; }
  #familyGarageHero { grid-column: 1; grid-row: 2 / 4; min-height: 182px; margin: 0; }
  #familyHelloBtn { transform: translateX(-50%) scale(.85); transform-origin: bottom; bottom: 24px; }
  #familyControls { grid-column: 2; grid-row: 2; margin: 0; }
  #familyControls h2 { font-size: .6875rem; }
  .family-world-row button > span { font-size: 1rem; margin: 0; }
  #familyControls button { padding: 5px; font-size: .75rem; }
  .family-mode-row { margin: 2px 0 5px; }
  #familyControls #familyTrainingBtn { margin-top: 3px; }
  #gameContainer #familyControls #familyClassicWorld, #gameContainer #familyControls #familyTrainingBtn { display: inline-flex; justify-content: center; align-items: center; vertical-align: top; width: calc(50% - 3px); min-height: 44px; margin-top: 3px; padding: 4px; }
  #mainLobbyModal .lobby-actions { grid-column: 2; grid-row: 3; position: static; margin: 0; padding: 0; }
  #mainLobbyModal .lobby-pit-strip, #mainLobbyModal .lobby-preview, #mainLobbyModal #mobileGarage, #familyCustomization, #raceFeatureLobby { grid-column: 1 / -1; }
  .family-help-note { margin: 3px 0; }
  #familyWorldCaption { display: none; }
  .family-hero-caption { font-size: .6875rem; }
}
@media (prefers-reduced-motion: reduce) {
  .family-wave #familyHeroDriver, .family-wave #familyHeroKart { animation: none; }
}
