/* The approved play-entry composition only. Gameplay and auxiliary menus retain their skin. */
#homeScreen {
  /* Auth already transitioned; don't fade an otherwise complete shell in. */
  animation: none;
  --entry-header-height: clamp(68px, 8.53dvh, 76px);
  padding: calc(2.01dvh + env(safe-area-inset-top)) 3.85% calc(12dvh + env(safe-area-inset-bottom));
  place-items: start stretch;
  background: linear-gradient(transparent 85%, #28104d70 94%, #251047 100%),
    #70b7ff url('assets/bubble-candy/play-entry/world.webp') center / cover;
}
#homeScreen, #homeScreen *, #homeScreen *::before, #homeScreen *::after { box-sizing: border-box; }
#homeScreen .home-content { width: 100%; height: auto; min-height: 0; max-height: none; display: flex; align-items: stretch; gap: 0; margin: 0 auto; }
#homeScreen .home-topline { flex: none; width: 100%; height: var(--entry-header-height); min-height: 0; align-items: stretch; padding: 0; }
#homeScreen .bc-brand-button,
#homeScreen .home-balance {
  border: 1px solid #af83dc;
  border-radius: 19px;
  background: linear-gradient(120deg, #312248ed, #292043ed 60%, #271d43ef);
  box-shadow: inset 0 1px 2px #e1bdff5c, 0 3px 8px #58255830;
}
#homeScreen .bc-brand-button { display: flex; align-items: center; justify-content: center; width: 88px; height: var(--entry-header-height); min-height: 0; padding: 4px; overflow: hidden; }
#homeScreen .bc-brand-button img { display: block; flex: none; width: calc(var(--entry-header-height) - 10px); height: calc(var(--entry-header-height) - 10px); min-width: 0; min-height: 0; max-width: 100%; object-fit: contain; margin: 0; transform: none; }
#homeScreen .home-balance { min-width: 112px; height: var(--entry-header-height); min-height: 0; padding: 8px 12px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
#homeScreen .home-balance .field-label { font: 900 10px/1.1 'Nunito Sans', sans-serif; letter-spacing: 1.6px; color: #f3e7ff; }
#homeScreen .home-balance strong { margin: 0; font: 900 clamp(20px, 6.1vw, 27px)/1 'Nunito Sans', sans-serif; letter-spacing: -.35px; color: #fff0ba; text-shadow: 0 2px 1px #433047; white-space: nowrap; }
#homeScreen .home-hero {
  flex: none; width: 100%; min-height: 0; height: auto; aspect-ratio: 1400 / 472; margin: 12px 0 0; padding: 0; display: block;
  overflow: hidden; position: relative; border: 2px solid #ffa2f4; border-radius: 24px;
  background: #8fd4fc; box-shadow: inset 0 0 0 1px #ffffffb3, 0 0 7px #ff65e8c4, 0 3px 6px #861a8f4f;
  mask-image: none;
}
#homeScreen .home-hero::before { display: none; }
#homeScreen .home-hero-art { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
#homeScreen .home-online-counter { position: absolute; top: 8px; right: 8px; display: flex; align-items: center; gap: 4px; border: 1px solid #a677c48c; border-radius: 18px; padding: 5px 8px; color: #f5e9ff; background: #25143ded; box-shadow: inset 0 1px #c79de253; font: 700 11px/1 'Nunito Sans', sans-serif; }
#homeScreen .home-online-counter i { width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 25%, #d4ffc3, #50f631 58%, #1ba823); }
#homeScreen .home-online-counter strong { color: #ffda65; }
#homeScreen .round-card {
  position: relative;
  flex: none; width: 100%; height: auto; min-height: 0; margin: 12px 0 0; padding: 14px 12px;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-auto-rows: auto; gap: 12px; align-items: stretch;
  border: 2px solid #9663d6; border-radius: 25px;
  background: radial-gradient(ellipse at 9% 0%, #8544ab41, transparent 58%), linear-gradient(135deg, #3a2157f0, #2e1c52f5 52%, #21163cee);
  box-shadow: inset 0 1px 3px #f4b9ff9e, inset 0 -2px 4px #7540b882, 0 0 8px #e06af773, 0 4px 12px #631d5929;
}
#homeScreen .entry-row { display: flex; align-items: center; justify-content: flex-start; gap: 9px; min-height: 40px; margin: 0; position: relative; text-align: left; }
#homeScreen .home-entry-candy { display: block; width: 32px; height: 32px; flex: none; border-radius: 50%; background: url('assets/candy-kingdom/orbs.png') -108px 0 / 144px 72px; filter: hue-rotate(45deg) drop-shadow(0 1px 2px #f86de880); }
#homeScreen .entry-label { display: block; font: 900 clamp(12px, 3.7vw, 16px)/1.1 'Nunito Sans', sans-serif; letter-spacing: .95px; color: #fff5ff; }
#homeScreen .entry-row p { margin: 3px 0 0; color: #ad83ee; font: 800 clamp(11px, 3.1vw, 13px)/1.1 'Nunito Sans', sans-serif; }
#homeScreen .bet-tiles { display: grid; width: 100%; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: clamp(54px, 7dvh, 64px); gap: 8px; min-height: 0; margin: 0; }
/* Keep the current five allowed entries balanced without inventing a sixth bet. */
#homeScreen .bet-tiles button { grid-column: span 2; }
#homeScreen .bet-tiles:has(> button:last-child:nth-child(5)) > button:nth-child(4) { grid-column: 2 / span 2; }
#homeScreen .bet-tiles:has(> button:last-child:nth-child(5)) > button:nth-child(5) { grid-column: 4 / span 2; }
#homeScreen .bet-tiles button {
  position: relative; min-height: 44px; padding: 0 2px; border: 2px solid #9b68d7; border-radius: 14px;
  font: 900 clamp(18px, 5.25vw, 23px)/1 'Nunito Sans', sans-serif; color: #f2ddff; letter-spacing: -.2px; white-space: nowrap;
  background: radial-gradient(ellipse at 22% 0%, #734bb546, transparent 65%), linear-gradient(#493071, #392461 75%);
  box-shadow: inset 0 2px 2px #d4a4ff4d, inset 0 -2px 6px #9e63d033, 0 3px 4px #170e345f;
  text-shadow: 0 2px 2px #392050; transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}
#homeScreen .bet-tiles button::before { content: ''; position: absolute; top: 4px; left: 5px; width: 9px; height: 5px; border-radius: 70%; transform: rotate(-40deg); background: #deb1ff4f; pointer-events: none; }
#homeScreen .bet-tiles button[aria-pressed='true'] { border-color: #fff6a6; color: #fff9df; background: linear-gradient(#fb31e7, #d309b6 50%, #ae079a); box-shadow: inset 0 2px 3px #ffcaf4d9, inset 0 -2px 6px #ed53d988, 0 0 0 2px #ffb23b, 0 0 10px 3px #ffaf4675, 0 4px 5px #25103c99; text-shadow: 0 2px 2px #7b216d; }
#homeScreen .bet-tiles button[aria-pressed='true']::before { background: #fff0ffb0; }
#homeScreen .bet-tiles button:active:not(:disabled) { transform: scale(.97); }
#homeScreen .home-entry-field { position: relative; width: 100%; display: flex; align-items: center; height: 54px; min-height: 54px; margin: 0; border: 1.5px solid #8054b9; border-radius: 15px; background: linear-gradient(110deg, #201539f5, #211741e8); box-shadow: inset 0 2px 6px #180d3838; }
#homeScreen .home-entry-field > span { width: 47px; flex: none; text-align: center; font: 700 18px/1 'Fredoka', sans-serif; color: #dcb9ff; border-right: 1px solid #8054b9; padding: 8px 0; }
#homeScreen #homeBetInput { width: 100%; min-width: 0; height: 100%; padding: 0 12px; outline-offset: -4px; border: 0; border-radius: 0 14px 14px 0; color: #fffaff; background: transparent; font: 900 26px/1 'Nunito Sans', sans-serif; caret-color: #ffc4f2; touch-action: manipulation; }
#homeScreen #homeBetInput:focus-visible { outline: 2px solid #ffc6f3; }
#homeScreen #homeBetError { position: absolute; bottom: 1px; left: 58px; right: 6px; margin: 0; font: 700 9px/1.15 'Nunito Sans', sans-serif; color: #ffb4d3; pointer-events: none; }
#homeScreen .home-entry-field:has(#homeBetError:not([hidden])) input { padding-bottom: 12px; }
#homeScreen .home-reward {
  width: 100%; height: 96px; min-height: 96px; margin: 0; padding: 0; display: block; position: relative; isolation: isolate; overflow: hidden;
  border: 1.5px solid #ed9cfa; border-radius: 19px;
  background: radial-gradient(ellipse at 40% 100%, #a723c499, transparent 68%), linear-gradient(110deg, #390c75, #4c0b82 60%, #66159a);
  box-shadow: inset 0 1px 2px #fff0b8a0, 0 0 6px #ee66cb66;
}
#homeScreen .home-reward::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: url('assets/bubble-candy/play-entry/reward.webp') center / cover; mask-image: linear-gradient(to right, transparent 34%, #000 44%, #000 66%, transparent 76%); }
#homeScreen .home-reward::after { content: ''; position: absolute; right: 0; bottom: -1px; width: 17%; height: 72%; z-index: -1; pointer-events: none; background: url('assets/bubble-candy/play-entry/reward-orbs-v2.webp') right bottom / contain no-repeat; }
#homeScreen .home-reward-art { position: absolute; left: 1%; bottom: 0; width: 32%; height: 100%; object-fit: contain; object-position: center bottom; pointer-events: none; }
#homeScreen .home-reward-copy { position: absolute; left: 30%; right: 12%; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; min-width: 0; text-align: center; }
#homeScreen .home-reward-copy > span { color: #ffe9ff; font: 900 clamp(12px, 4vw, 17px)/1.2 'Nunito Sans', sans-serif; letter-spacing: -.2px; text-shadow: 0 2px 2px #4a164a; }
#homeScreen .home-reward strong { min-width: 0; text-align: center; background: linear-gradient(#fffac9 2%, #fff279 20%, #ffd53d 48%, #ffb90c 80%, #f79a07); background-clip: text; -webkit-background-clip: text; color: transparent; font: 600 clamp(28px, 9.8vw, 40px)/1.1 'Fredoka', sans-serif; letter-spacing: -.7px; white-space: nowrap; -webkit-text-stroke: .65px #ffed70; paint-order: stroke fill; text-shadow: none; filter: drop-shadow(0 2px #c47313) drop-shadow(0 2px 1px #6d2c27); }
#homeScreen .play-btn {
  align-self: stretch; position: relative; display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; height: 62px; margin: 0; min-height: 62px; padding: 0 34px; border: 2px solid #c6ff9b; border-radius: 32px;
  background: linear-gradient(#9dff71, #70ff2c 36%, #3de804 75%, #27c800);
  box-shadow: inset 0 3px 1px #efffd9d9, inset 0 -4px 4px #0294078f, 0 0 0 2px #31be24, 0 0 10px #49ff5266, 0 5px 8px #0a221676;
  color: #053503; font: 900 clamp(18px, 5.35vw, 24px)/1.05 'Nunito Sans', sans-serif; letter-spacing: -.45px; text-shadow: 0 1px #bbff7c;
}
#homeScreen .play-btn::before { content: ''; position: absolute; top: 6px; left: 9px; width: 17px; height: 9px; border-radius: 70%; transform: rotate(-35deg); background: #f6ffddd1; pointer-events: none; }
#homeScreen .play-btn::after { display: none; }
#homeScreen #playBtnText { position: static; font: inherit; color: inherit; }
#homeScreen .home-play-chevron { position: absolute; right: 13px; width: 16px; height: 24px; filter: drop-shadow(0 1px #c4ff91); }
#homeScreen .play-btn:active:not(:disabled) { transform: scale(.98); }
/* The retry occupies the existing CTA slot, never space behind bottom nav. */
#homeScreen #homeLoadError:not([hidden]) { position: absolute; left: 12px; right: 12px; bottom: 14px; min-height: 62px; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #d18eff; border-radius: 20px; background: #291642; }
#homeScreen #homeLoadMessage { flex: 1; min-width: 0; max-height: 3.8em; overflow: hidden; margin: 0; font: 700 11px/1.25 'Nunito Sans', sans-serif; }
#homeScreen #homeRetry { flex: none; min-height: 44px; padding: 8px; font-size: 10px; }
#homeScreen :is(button, input):focus-visible { outline: 3px solid #fff0a5; outline-offset: 3px; }

/* Do not carry this navigation treatment into Depositar, Sacar, Indicar or Perfil. */
.bc-nav .home-nav-icon { display: none; }
.bubble-candy.is-home:has(#homeScreen:not([hidden])):has(#appShell[hidden]) #appNav button:has(.home-nav-icon) > .ui-icon:not(.home-nav-icon) { display: none; }
.bubble-candy.is-home:has(#homeScreen:not([hidden])):has(#appShell[hidden]) #appNav .home-nav-icon { display: block; }
.bubble-candy.is-home:has(#homeScreen:not([hidden])):has(#appShell[hidden]) #appNav {
  left: 2px; right: 2px; bottom: calc(2.13dvh + env(safe-area-inset-bottom)); height: 9.83dvh; min-height: 78px; padding: 7px 5px 8px;
  border: 1.5px solid #6940ac; border-radius: 31px; gap: 1px;
  background: radial-gradient(ellipse at 50% 0%, #4a238379, transparent 48%), linear-gradient(#251445f7, #211340fa);
  box-shadow: inset 0 2px #b986ef35, 0 -3px 12px #ba71f73b;
}
.bubble-candy.is-home:has(#homeScreen:not([hidden])):has(#appShell[hidden]) #appNav button { min-height: 0; padding: 4px 0 2px; gap: 7px; border-radius: 15px; font: 500 clamp(10px, 2.85vw, 13px)/1 'Fredoka', sans-serif; color: #c8adf5; background: none; }
.bubble-candy.is-home:has(#homeScreen:not([hidden])):has(#appShell[hidden]) #appNav .ui-icon { width: 25px; height: 25px; color: #dfc9ff; stroke-width: 1.7; }
.bubble-candy.is-home:has(#homeScreen:not([hidden])):has(#appShell[hidden]) #appNav button[aria-current='page']::after { display: none; }
.bubble-candy.is-home:has(#homeScreen:not([hidden])):has(#appShell[hidden]) #appNav .bc-nav-play { justify-content: flex-end; gap: 6px; }
/* Center the visible fourth orb (atlas center 890,128.5 in 1024x512),
   not its padded sprite cell. The 48px wrapper and approved sprite scale stay fixed. */
.bubble-candy.is-home:has(#homeScreen:not([hidden])):has(#appShell[hidden]) #appNav .bc-nav-play-orb { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); width: 48px; height: 48px; margin: 0; border: 1px solid #ffd9ff; background: url('assets/candy-kingdom/orbs.png') no-repeat -164.75px -4.1px / 216px 108px; box-shadow: 0 0 0 4px #a443da88, 0 0 0 6px #7d30b48c, 0 0 17px #ee70ffd6, inset 0 0 5px #ffefff80; filter: hue-rotate(30deg); }
.bubble-candy.is-home:has(#homeScreen:not([hidden])):has(#appShell[hidden]) #appNav .bc-nav-play > span:last-child { font: 600 15px/1 'Fredoka', sans-serif; color: #ffe359; text-shadow: 0 1px #6a3c57; }

@media (max-height: 720px) and (orientation: portrait) {
  #homeScreen { padding-top: max(8px, env(safe-area-inset-top)); overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; }
  #homeScreen .home-hero { height: auto; margin-top: 10px; }
  #homeScreen .round-card { min-height: 0; }
  #homeScreen .home-content { padding-bottom: 90px; }
}
@media (prefers-reduced-motion: reduce) { #homeScreen, #homeScreen * { animation: none !important; transition: none !important; } }
