/* Toy-bright arcade lobby. Scoped and deliberately specific so cast.js and
   kenney_pass.js can continue to own their behavior without recoloring it. */
body.arcade-fun {
  --fun-blue: #1479ff;
  --fun-red: #ff4057;
  --fun-yellow: #ffd52f;
  --fun-green: #35c76f;
  --fun-orange: #ff8a2b;
  --fun-violet: #8d55e8;
  --fun-ink: #17315b;
  overflow: hidden !important;
  color: var(--fun-ink) !important;
  background:
    radial-gradient(circle at 10% 12%, rgba(255,255,255,.92) 0 4.5%, transparent 4.7%),
    radial-gradient(circle at 84% 8%, rgba(255,255,255,.8) 0 6%, transparent 6.2%),
    radial-gradient(circle at 18% 72%, rgba(255,213,47,.38) 0 11%, transparent 11.2%),
    linear-gradient(180deg, #69c9ff 0%, #b8e9ff 48%, #8de17b 48.2%, #42c76a 100%) !important;
}

body.arcade-fun::before,
body.arcade-fun::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: none;
}
body.arcade-fun::before {
  width: 240px;
  height: 240px;
  left: -76px;
  bottom: -86px;
  background: var(--fun-yellow);
  border: 12px solid #fff3a5;
}
body.arcade-fun::after {
  width: 185px;
  height: 185px;
  right: -50px;
  top: 25%;
  background: var(--fun-red);
  border: 11px solid #ff9aab;
}

body.arcade-fun .wrap {
  z-index: 1;
  padding: 10px !important;
}

body.arcade-fun .panel {
  width: min(100%, 1880px) !important;
  max-width: 1880px !important;
  max-height: calc(100vh - 20px) !important;
  padding: 10px 14px 24px !important;
  border: 5px solid var(--fun-blue) !important;
  border-radius: 28px !important;
  background: rgba(255, 255, 255, .985) !important;
  box-shadow: 0 10px 0 #0958bd, 0 22px 45px rgba(23,49,91,.25) !important;
  scrollbar-color: var(--fun-blue) #fff0a8;
}

body.arcade-fun .arcade-header {
  position: relative;
  margin: 0 auto 2px;
  text-align: center;
}

body.arcade-fun .arcade-kicker {
  display: inline-block;
  margin: 0 auto 2px;
  padding: 5px 14px 4px;
  color: #fff;
  background: var(--fun-violet);
  border: 3px solid #5931a7;
  border-radius: 999px;
  box-shadow: 0 4px 0 #5931a7;
  font-size: clamp(9px, .8vw, 13px);
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

body.arcade-fun #selected-player-status {
  width: max-content;
  max-width: 92vw;
  margin: 8px auto 2px;
  padding: 8px 22px 7px;
  color: var(--fun-ink);
  background: var(--fun-yellow);
  border: 3px solid #d39f00;
  border-radius: 999px;
  box-shadow: 0 5px 0 #a97f00, 0 10px 20px rgba(23,49,91,.15);
  font-size: clamp(14px, 1.05vw, 18px);
  font-weight: 1000;
  letter-spacing: .055em;
  text-transform: uppercase;
}
body.arcade-fun #selected-player-status.has-player {
  color: #fff;
  background: var(--fun-green);
  border-color: #16894a;
  box-shadow: 0 5px 0 #16894a, 0 10px 20px rgba(23,49,91,.16);
}

body.arcade-fun h1 {
  margin: 0 !important;
  color: var(--fun-ink) !important;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif !important;
  font-size: clamp(34px, 4.15vw, 66px) !important;
  line-height: .98 !important;
  letter-spacing: -.055em !important;
  text-transform: uppercase;
  text-shadow: 0 3px 0 #fff, 0 6px 0 rgba(23,49,91,.14) !important;
}

body.arcade-fun h1 span {
  display: inline-block;
  transform: rotate(-2deg);
}
body.arcade-fun h1 span:nth-child(6n + 1) { color: var(--fun-red); }
body.arcade-fun h1 span:nth-child(6n + 2) { color: var(--fun-blue); transform: rotate(2deg); }
body.arcade-fun h1 span:nth-child(6n + 3) { color: var(--fun-yellow); -webkit-text-stroke: 1px #c89100; }
body.arcade-fun h1 span:nth-child(6n + 4) { color: var(--fun-green); transform: rotate(2deg); }
body.arcade-fun h1 span:nth-child(6n + 5) { color: var(--fun-orange); }
body.arcade-fun h1 span:nth-child(6n) { color: var(--fun-violet); transform: rotate(1deg); }

body.arcade-fun #cast-grid {
  --cast-cols: 7 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  justify-content: center !important;
  gap: 7px !important;
  max-width: 1620px !important;
  margin: 5px auto 10px !important;
}

body.arcade-fun #cast-grid .cast-card {
  flex: 0 1 calc((100% - (var(--cast-cols) - 1) * 7px) / var(--cast-cols)) !important;
  min-width: 0 !important;
  gap: 2px !important;
  padding: 5px !important;
  border: 3px solid var(--fun-blue) !important;
  border-radius: 18px !important;
  background: #e9f7ff !important;
  box-shadow: 0 5px 0 #9ec9e7 !important;
  color: var(--fun-ink) !important;
  transition: transform .16s ease, box-shadow .16s ease !important;
  font: inherit !important;
  text-align: left !important;
  cursor: pointer !important;
}
body.arcade-fun #cast-grid .cast-card:nth-child(6n + 2) { border-color: var(--fun-red) !important; background: #fff0f2 !important; box-shadow: 0 5px 0 #f4a8b2 !important; }
body.arcade-fun #cast-grid .cast-card:nth-child(6n + 3) { border-color: #e5ae00 !important; background: #fff8c9 !important; box-shadow: 0 5px 0 #e6c960 !important; }
body.arcade-fun #cast-grid .cast-card:nth-child(6n + 4) { border-color: var(--fun-green) !important; background: #e9ffef !important; box-shadow: 0 5px 0 #a5dbb6 !important; }
body.arcade-fun #cast-grid .cast-card:nth-child(6n + 5) { border-color: var(--fun-orange) !important; background: #fff0df !important; box-shadow: 0 5px 0 #eac09a !important; }
body.arcade-fun #cast-grid .cast-card:nth-child(6n) { border-color: var(--fun-violet) !important; background: #f3edff !important; box-shadow: 0 5px 0 #c4b0e6 !important; }
body.arcade-fun #cast-grid .cast-card:hover,
body.arcade-fun #cast-grid .cast-card:focus-visible {
  position: relative;
  z-index: 10;
  transform: translateY(-5px) rotate(-1deg) scale(1.2) !important;
  box-shadow: 0 9px 0 #9ec9e7, 0 18px 30px rgba(23,49,91,.28) !important;
}
body.arcade-fun #cast-grid .cast-card:focus-visible {
  outline: 5px solid var(--fun-yellow) !important;
  outline-offset: 3px !important;
}
body.arcade-fun #cast-grid .cast-card.is-selected {
  position: relative;
  z-index: 2;
  outline: 5px solid var(--fun-yellow) !important;
  outline-offset: 2px !important;
  box-shadow: 0 7px 0 var(--fun-blue), 0 13px 24px rgba(23,49,91,.24) !important;
  transform: translateY(-3px) scale(1.025) !important;
}
body.arcade-fun #cast-grid .cast-card.is-selected:hover,
body.arcade-fun #cast-grid .cast-card.is-selected:focus-visible {
  z-index: 11;
  transform: translateY(-5px) rotate(-1deg) scale(1.2) !important;
}
body.arcade-fun #cast-grid .cast-card.is-selected::after {
  content: "✓";
  position: absolute;
  right: 5px;
  top: 4px;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: #fff;
  background: var(--fun-green);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 0 #16894a;
  font-size: 14px;
  font-weight: 1000;
}
body.arcade-fun #cast-grid.needs-player { animation: castNeedsPlayer .48s ease-in-out 2; }
@keyframes castNeedsPlayer { 50% { transform: scale(1.012); filter: saturate(1.3); } }
body.arcade-fun #cast-grid .cast-face {
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 50% !important;
  box-shadow: none !important;
  filter: drop-shadow(0 5px 6px rgba(23,49,91,.2)) !important;
  animation: lobby-head-float var(--head-float-duration, 2.8s) ease-in-out var(--head-float-delay, 0s) infinite alternate !important;
  will-change: transform;
}
body.arcade-fun #cast-grid .cast-name {
  color: var(--fun-ink) !important;
  font-size: clamp(15px, 1vw, 19.5px) !important;
  line-height: 1 !important;
  font-weight: 900 !important;
  text-shadow: none !important;
  white-space: nowrap !important;
}
body.arcade-fun #cast-grid .cast-name.two-line {
  line-height: .92 !important;
  text-align: center !important;
  white-space: normal !important;
}

@keyframes lobby-head-float {
  0% { transform: translateY(-7px) rotate(-1.2deg); }
  100% { transform: translateY(8px) rotate(1.2deg); }
}

body.arcade-fun .grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 15px !important;
  max-width: 1840px;
  margin: 14px auto 0 !important;
}

body.arcade-fun .card {
  --card-color: var(--fun-blue);
  --card-shadow: #0a57b8;
  display: flex !important;
  flex-direction: column !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 0;
  padding: 9px 9px 12px !important;
  overflow: visible !important;
  color: var(--fun-ink) !important;
  border: 4px solid var(--card-color) !important;
  border-radius: 20px !important;
  background: #fff !important;
  box-shadow: 0 7px 0 var(--card-shadow), 0 11px 18px rgba(23,49,91,.16) !important;
  transition: transform .18s cubic-bezier(.2,.9,.3,1.25), box-shadow .18s ease !important;
  cursor: pointer !important;
}
body.arcade-fun .card:nth-child(6n + 2) { --card-color: var(--fun-red); --card-shadow: #b51e33; }
body.arcade-fun .card:nth-child(6n + 3) { --card-color: #e2ac00; --card-shadow: #9b7600; }
body.arcade-fun .card:nth-child(6n + 4) { --card-color: var(--fun-green); --card-shadow: #16894a; }
body.arcade-fun .card:nth-child(6n + 5) { --card-color: var(--fun-orange); --card-shadow: #bb5310; }
body.arcade-fun .card:nth-child(6n) { --card-color: var(--fun-violet); --card-shadow: #5d30a9; }
body.arcade-fun .card:hover,
body.arcade-fun .card:focus-visible {
  transform: translateY(-6px) rotate(-.7deg) !important;
  box-shadow: 0 11px 0 var(--card-shadow), 0 18px 28px rgba(23,49,91,.22) !important;
  outline: none !important;
}
body.arcade-fun .card:focus-visible { outline: 4px solid var(--fun-yellow) !important; outline-offset: 4px !important; }
body.arcade-fun .card.last-played { outline: 5px solid var(--fun-yellow) !important; outline-offset: 3px !important; }

body.arcade-fun .thumb {
  border: 3px solid var(--fun-ink) !important;
  border-radius: 13px !important;
  background: #95ddff !important;
  box-shadow: 0 4px 0 rgba(23,49,91,.24) !important;
}
body.arcade-fun .thumb::after {
  background: linear-gradient(135deg, rgba(255,255,255,.38), transparent 32%, transparent 76%, rgba(255,213,47,.16)) !important;
}
body.arcade-fun .card h2 {
  min-height: 0;
  margin: 10px 0 9px !important;
  color: var(--fun-ink) !important;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif !important;
  font-size: clamp(16px, 1.22vw, 22px) !important;
  line-height: 1.05 !important;
  letter-spacing: -.02em !important;
  text-align: center !important;
  text-transform: none !important;
}
body.arcade-fun .card p {
  margin: 0 5px 8px !important;
  color: #526783 !important;
  font-size: clamp(11px, .77vw, 13px) !important;
  line-height: 1.28 !important;
}
body.arcade-fun .card::after {
  content: none !important;
  display: none !important;
}

body.arcade-fun #last-result {
  max-width: 860px;
  margin: 20px auto 4px !important;
  padding: 12px 18px !important;
  color: var(--fun-ink) !important;
  background: #fff7be !important;
  border: 4px solid #e5ae00 !important;
  border-radius: 18px !important;
  box-shadow: 0 6px 0 #a97f00 !important;
}
body.arcade-fun #kenney-cloud-layer,
body.arcade-fun #kenney-grade-layer { display: none !important; }

@media (max-width: 1380px) {
  body.arcade-fun .grid { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
  body.arcade-fun #cast-grid { --cast-cols: 7 !important; }
  body.arcade-fun #cast-grid .cast-face { width: 96px !important; height: 96px !important; flex-basis: 96px !important; }
  body.arcade-fun #cast-grid .cast-name { min-width: 0 !important; font-size: 15px !important; overflow-wrap: normal !important; word-break: normal !important; }
}
@media (max-width: 1080px) {
  body.arcade-fun .grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  body.arcade-fun #cast-grid { --cast-cols: 5 !important; }
}
@media (max-width: 780px) {
  body.arcade-fun .panel { border-width: 4px !important; border-radius: 21px !important; padding: 8px 9px 20px !important; }
  body.arcade-fun .grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 11px !important; }
  body.arcade-fun #cast-grid { --cast-cols: 3 !important; }
}
@media (max-width: 520px) {
  body.arcade-fun .arcade-kicker { display: none; }
  body.arcade-fun h1 { font-size: clamp(29px, 10vw, 43px) !important; }
  body.arcade-fun .grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  body.arcade-fun #cast-grid { --cast-cols: 2 !important; }
  body.arcade-fun .card h2 { font-size: 15px !important; }
  body.arcade-fun .card p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.arcade-fun *, body.arcade-fun *::before, body.arcade-fun *::after { transition: none !important; animation: none !important; }
}
