/* v39 UI polish. Scoped to interface elements: no canvas or gameplay scaling. */
.game-shell .menu-button-label{font:inherit;min-width:0;line-height:inherit;color:inherit}
.game-shell .hud-sound-button>span{display:block;font-size:inherit;line-height:1}

@media (hover:hover) and (pointer:fine){
  .game-shell{
    --polish-pause:76.8px;--polish-pause-type:34.8px;
    --polish-sound:67.2px;--polish-sound-type:30px;
    --polish-score:91.2px;--polish-life:40.8px;
    --polish-counter:139.2px;--polish-star:54px;--polish-star-type:24px;
    --polish-caption:18px;--polish-best:16.8px;--polish-best-value:24px;
    --polish-wave-width:21.6px;--polish-wave-height:8.4px;
    --polish-control:69.6px;--polish-control-type:21.6px;
    --polish-balance:64.8px;--polish-balance-type:26.4px;
    --polish-play:100.8px;--polish-play-type:33.6px;
    --polish-tile:100.8px;--polish-tile-type:21.6px;
    --polish-achievement:74.4px;--polish-achievement-art:60px;
    --polish-review:81.6px;--polish-review-inner:44.4px;--polish-review-type:34.8px;
  }
  /* Layout participates in normal flow; enlarged rows cannot overlap each other. */
  .game-shell .hud{display:grid!important;grid-template-columns:auto minmax(0,1fr) auto!important;grid-template-areas:"top top top" "lives wave sound"!important;grid-template-rows:auto auto!important;align-content:start!important;align-items:center!important;gap:14.4px 12px!important;padding:max(21.6px,env(safe-area-inset-top)) 21.6px max(21.6px,env(safe-area-inset-bottom))!important}
  .game-shell .hud-top{grid-area:top!important;grid-template-columns:var(--polish-pause) minmax(0,1fr) var(--polish-counter)!important;align-items:start!important;gap:12px!important;min-height:100.8px!important}
  .game-shell .hud .round-button{width:var(--polish-pause)!important;height:var(--polish-pause)!important;border-radius:25.2px!important;font-size:var(--polish-pause-type)!important}
  .game-shell .hud .score-stack{min-width:0!important;max-width:100%!important;align-self:start!important}
  .game-shell .hud .score-value{font-size:var(--polish-score)!important;line-height:.9!important;font-variant-numeric:tabular-nums;white-space:nowrap;max-width:100%}
  .game-shell .hud .score-caption{font-size:var(--polish-caption)!important;line-height:1.1!important;margin-top:10.8px!important;letter-spacing:.12em!important}
  .game-shell .hud .hud-counters{gap:7.2px!important;min-width:0!important;width:100%!important;max-width:100%!important}
  .game-shell .hud .star-pill{min-height:var(--polish-star)!important;padding:0 12px!important;border-radius:18px!important;font-size:var(--polish-star-type)!important;gap:8.4px!important;max-width:100%!important;min-width:0!important}
  .game-shell .hud .star-pill strong{min-width:0;font-size:inherit;line-height:1.1;overflow-wrap:anywhere}
  .game-shell .hud .best-mini{font-size:var(--polish-best)!important;line-height:1.18!important;margin-top:7.2px!important;letter-spacing:.048em!important;overflow-wrap:anywhere}
  .game-shell .hud .best-mini strong{font-size:var(--polish-best-value)!important;line-height:1.05!important}
  .game-shell .hud .hud-sound-button{grid-area:sound!important;position:relative!important;inset:auto!important;width:var(--polish-sound)!important;height:var(--polish-sound)!important;border-radius:21.6px!important;font-size:var(--polish-sound-type)!important;justify-self:end!important}
  .game-shell .hud .life-row{grid-area:lives!important;position:relative!important;inset:auto!important;padding:7.2px 9.6px!important;gap:4.8px!important;border-radius:22.8px!important;justify-self:start!important}
  .game-shell .hud .life-ball{width:var(--polish-life)!important;height:var(--polish-life)!important;flex-shrink:0!important}
  .game-shell .hud .wave-meter{grid-area:wave!important;position:relative!important;inset:auto!important;transform:none!important;translate:none!important;display:flex!important;flex-wrap:wrap!important;justify-content:center!important;align-content:center!important;gap:8.4px!important;min-width:0!important;max-width:100%!important;width:100%!important}
  .game-shell .hud .wave-meter span{width:var(--polish-wave-width)!important;height:var(--polish-wave-height)!important;flex:0 0 var(--polish-wave-width)!important}

  /* Main menu: +20% metrics and spacing, with a width cap on smaller embeds. */
  .game-shell .menu-screen{padding:max(24px,env(safe-area-inset-top)) 14px max(26.4px,env(safe-area-inset-bottom))!important;gap:28.8px!important;justify-content:flex-start!important;overflow-x:hidden!important;overflow-y:auto!important;scroll-padding-block:20px!important}
  .game-shell .menu-topline{position:relative!important;inset:auto!important;flex:0 0 auto!important;width:100%!important;gap:16.8px!important;padding-inline:8px!important;box-sizing:border-box!important}
  .game-shell .menu-topline .small-control{height:var(--polish-control)!important;min-height:var(--polish-control)!important;min-width:86.4px!important;padding:0 16.8px!important;border-radius:21.6px!important;font-size:var(--polish-control-type)!important;flex:0 1 auto!important;white-space:normal!important}
  .game-shell .menu-topline .star-balance{height:var(--polish-balance)!important;min-height:var(--polish-balance)!important;min-width:122.4px!important;padding:0 18px!important;border-radius:20.4px!important;font-size:var(--polish-balance-type)!important;gap:8.4px!important;flex-shrink:0!important}
  .game-shell .menu-brand{margin: auto 0 0!important;flex:0 0 auto!important;min-height:0!important}
  .game-shell .menu-actions{container-type:inline-size;width:min(528px,100%)!important;flex:0 0 auto!important;margin:0 auto auto!important;padding-inline:2.4px!important;box-sizing:border-box!important}
  .game-shell .play-button{min-height:var(--polish-play)!important;height:auto!important;border-radius:27.6px!important;font-size:var(--polish-play-type)!important;gap:15.6px!important;padding:14.4px 24px!important}
  .game-shell .play-button>span{font-size:26.4px!important;flex-shrink:0!important}
  .game-shell .menu-grid{gap:15.6px!important;margin-top:18px!important}
  .game-shell .menu-tile{min-height:var(--polish-tile)!important;height:auto!important;padding:12px 15.6px!important;border-radius:25.2px!important;font-size:var(--polish-tile-type)!important;line-height:1.16!important;gap:12px!important;white-space:normal!important}
  .game-shell .menu-grid .collection-tile>span{width:48px!important;height:48px!important;min-width:48px!important;min-height:48px!important;flex-basis:48px!important}
  .game-shell .menu-grid .shop-tile>span{width:50.4px!important;height:43.2px!important;min-width:50.4px!important;min-height:43.2px!important;flex-shrink:0!important}
  .game-shell .menu-grid .leaderboard-tile>span{width:54px!important;height:46.8px!important;min-width:54px!important;min-height:46.8px!important;flex-shrink:0!important}
  .game-shell .menu-achievement-shortcut{width:var(--polish-achievement)!important;height:var(--polish-achievement)!important;min-width:var(--polish-achievement)!important;min-height:var(--polish-achievement)!important;border-radius:24px!important;right:9.6px!important;bottom:calc(var(--polish-tile) - var(--polish-achievement) * .6)!important}
  .game-shell .menu-achievement-shortcut img{width:var(--polish-achievement-art)!important;height:var(--polish-achievement-art)!important}
  .game-shell .leaderboard-tile{padding-inline:calc(var(--polish-achievement) + 12px)!important}
  .game-shell .rating-shortcut-menu{width:var(--polish-review)!important;height:var(--polish-review)!important;right:12px!important;top:calc(var(--polish-review) * -.5)!important;border-radius:26.4px!important}
  .game-shell .rating-shortcut-menu>span{width:var(--polish-review-inner)!important;height:var(--polish-review-inner)!important;border-radius:15.6px!important;font-size:var(--polish-review-type)!important}
  .game-shell .rating-shortcut-menu>small{right:-9.6px!important;bottom:-8.4px!important;min-width:69.6px!important;padding:8.4px 9.6px!important;font-size:16.8px!important}
  .game-shell .rating-shortcut-menu>small .rating-bonus-number{font-size:20.4px!important}
  .game-shell .menu-actions:has(.rating-shortcut-menu) .play-button{padding-inline:calc(var(--polish-review) * .82)!important}
  .game-shell .menu-actions:has(.rating-shortcut-menu){margin-top:18px!important}


}

@media (hover:hover) and (pointer:fine) and (min-height:760px){
  .game-shell{
    --polish-pause:91.2px;--polish-pause-type:39.6px;
    --polish-sound:79.2px;--polish-sound-type:33.6px;
    --polish-score:105.6px;--polish-life:46.8px;
    --polish-counter:163.2px;--polish-star:62.4px;--polish-star-type:26.4px;
    --polish-caption:19.2px;--polish-best:18px;--polish-best-value:26.4px;
    --polish-wave-width:25.2px;--polish-wave-height:9.6px;
    --polish-control:76.8px;--polish-control-type:24px;
    --polish-balance:69.6px;--polish-balance-type:27.6px;
    --polish-play:115.2px;--polish-play-type:36px;
    --polish-tile:112.8px;--polish-tile-type:24px;
    --polish-achievement:81.6px;--polish-achievement-art:66px;
    --polish-review:86.4px;--polish-review-inner:46.8px;--polish-review-type:37.2px;
  }
}
/* Decorative branding yields space before interactive controls ever have to shrink. */
@media (hover:hover) and (pointer:fine) and (max-height:850px){
  .game-shell .menu-screen{gap:21.6px!important}
  .game-shell .menu-brand .app-icon{width:108px!important}
  .game-shell .menu-brand h1{font-size:46px!important;margin-top:8px!important;line-height:1!important}
  .game-shell .menu-brand p{font-size:17px!important;line-height:1.3!important;margin-top:7px!important}
}
@container (max-width:455px){
  @media (hover:hover) and (pointer:fine){
    .game-shell .collection-tile,.game-shell .shop-tile{flex-direction:column!important;gap:7.2px!important}
    .game-shell .menu-tile .menu-button-label{overflow-wrap:anywhere}
    .game-shell .leaderboard-tile{padding-inline:calc(var(--polish-achievement) * .78)!important;gap:9px!important}
  }
}

/* Touch devices keep their existing menu dimensions; only the requested details grow. */
@media (hover:none), (pointer:coarse){
  .game-shell .hud-sound-button{width:46px!important;height:46px!important;border-radius:15px!important;font-size:25px!important;right:15px!important}
  .game-shell .hud-sound-button>span{font-size:25px!important;transform:translateY(-1px)!important}
  .game-shell .rating-shortcut-menu{right:2px!important;top:-39px!important}
  .game-shell .menu-actions:has(.rating-shortcut-menu){margin-top:12px!important}
  .game-shell .menu-actions:has(.rating-shortcut-menu) .play-button{padding-inline:68px!important}
  .game-shell .play-button .menu-button-label{overflow-wrap:normal}

  /* Keep avatar, name and score in their own cells as the text grows. */
  .game-shell .lb-panel{max-height:calc(100dvh - 20px)!important;overflow-y:auto!important;overflow-x:hidden!important}
  .game-shell .lb-podium{min-height:190px!important;gap:8px!important}
  .game-shell .lb-podium .lb-avatar{width:62px!important;height:62px!important;flex-shrink:0!important}
  .game-shell .lb-podium .place-1 .lb-avatar{width:74px!important;height:74px!important}
  .game-shell .lb-avatar-fallback{font-size:24px!important}
  .game-shell .lb-podium-name{font-size:14px!important;line-height:1.2!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important}
  .game-shell .lb-podium-score{font-size:16px!important;line-height:1.15!important}
  .game-shell .lb-row{box-sizing:border-box!important;height:auto!important;min-height:66px!important;grid-template-columns:36px 46px minmax(0,1fr) auto!important;gap:8px!important;padding:8px!important}
  .game-shell .lb-row .lb-avatar{width:44px!important;height:44px!important;border-width:2px!important}
  .game-shell .lb-row-name{font-size:15px!important;line-height:1.2!important}
  .game-shell .lb-row-score{font-size:17px!important;line-height:1.1!important;min-width:32px!important}
  .game-shell .lb-row-rank{font-size:14px!important;line-height:1.15!important;overflow-wrap:anywhere!important}
  .game-shell .lb-list-title,.game-shell .lb-your-place>span{font-size:14px!important;line-height:1.2!important}
  .game-shell .lb-your-place>strong{font-size:24px!important}
  .game-shell .lb-header-copy small{font-size:12px!important;line-height:1.2!important}
  .game-shell .lb-header-copy h2{font-size:23px!important;line-height:1.08!important}
  .game-shell .lb-best-badge{font-size:12px!important;line-height:1.2!important;white-space:normal!important}
  .game-shell .lb-auth-copy>strong{font-size:15px!important;line-height:1.2!important}
  .game-shell .lb-auth-copy>p,.game-shell .lb-no-rank>strong{font-size:13px!important;line-height:1.4!important}
  .game-shell .lb-auth-actions button{font-size:14px!important;min-height:44px!important;white-space:normal!important}

  /* Ad removal is a content-sized card, not a fixed-height clipped row. */
  .game-shell .shop-card .ad-free-product{height:auto!important;min-height:114px!important;grid-template-columns:45px minmax(0,1fr) auto!important;gap:10px!important;padding:13px 12px!important;align-items:center!important}
  .game-shell .shop-card .ad-free-copy{gap:6px!important;min-width:0!important}
  .game-shell .shop-card .ad-free-copy strong{font-size:15px!important;line-height:1.15!important;white-space:normal!important}
  .game-shell .shop-card .ad-free-copy small{max-width:none!important;font-size:12px!important;line-height:1.4!important;white-space:normal!important;overflow:visible!important}
  .game-shell .shop-card .ad-free-product .product-price{min-height:36px!important;font-size:13px!important;max-width:88px!important;padding:7px 9px!important}
  .game-shell .shop-card .store-note,.game-shell .shop-card .store-trust{font-size:12px!important;line-height:1.4!important}
}
@media (hover:none) and (max-width:360px), (pointer:coarse) and (max-width:360px){
  .game-shell .lb-row{grid-template-columns:30px 44px minmax(0,1fr) auto!important;gap:6px!important;padding-inline:7px!important}
  .game-shell .lb-header{grid-template-columns:38px minmax(0,1fr)!important;gap:8px!important}
  .game-shell .lb-best-badge{grid-column:2!important;justify-self:start!important}
  .game-shell .rating-shortcut-menu{right:2px!important;top:-36px!important}
  .game-shell .shop-card .ad-free-product{grid-template-columns:40px minmax(0,1fr)!important;gap:9px!important}
  .game-shell .shop-card .ad-free-icon{width:40px!important;height:44px!important}
  .game-shell .shop-card .ad-free-product .product-price{grid-column:2!important;justify-self:start!important;max-width:100%!important}
}
/* Hint position is calculated from live UI and court bounds, including during resizing. */
.game-shell .tutorial-card.tutorial-card-primary.tutorial-layout-primary{left:var(--bank-x,12px)!important;top:var(--bank-y,220px)!important;right:auto!important;bottom:auto!important;width:var(--tutorial-safe-width)!important;transform:none!important;pointer-events:none!important}
.game-shell .tutorial-card-primary.tutorial-layout-compact{grid-template-columns:minmax(0,1fr)!important}
.game-shell .tutorial-card-primary.tutorial-layout-compact .tutorial-hand{display:none!important}
@media (hover:hover) and (pointer:fine){
  .game-shell .menu-grid .menu-achievement-shortcut{top:auto!important;right:14px!important;bottom:calc(var(--polish-tile) - var(--polish-achievement) * .64)!important}
  .game-shell .tutorial-card.tutorial-card-primary{width:min(380px,calc(100% - 24px))!important;grid-template-columns:48px minmax(0,1fr)!important;column-gap:12px!important;padding:14px 16px!important;border-radius:24px!important}
  .game-shell .tutorial-card-primary .tutorial-hand{width:44px!important;height:44px!important;border-radius:15px!important;font-size:30px!important}
  .game-shell .tutorial-card-primary .tutorial-chip{font-size:14px!important;line-height:1.2!important;white-space:normal!important;height:auto!important}
  .game-shell .tutorial-card-primary strong{font-size:20px!important;line-height:1.2!important}
  .game-shell .tutorial-card-primary small{font-size:16px!important;line-height:1.3!important}
  .game-shell .tutorial-card.tutorial-layout-primary{width:var(--tutorial-safe-width)!important}
}
@media (hover:none), (pointer:coarse){
  .game-shell .shop-card .ad-free-product{grid-template-columns:45px minmax(0,1fr)!important;grid-template-rows:auto auto!important;gap:10px 12px!important}
  .game-shell .shop-card .ad-free-product .ad-free-icon{grid-column:1!important;grid-row:1 / 3!important;align-self:center!important}
  .game-shell .shop-card .ad-free-product .ad-free-copy{grid-column:2!important;grid-row:1!important}
  .game-shell .shop-card .ad-free-product .product-price{grid-column:2!important;grid-row:2!important;justify-self:start!important;min-width:88px!important;max-width:100%!important}
}

@media (hover:hover) and (pointer:fine){
  .game-shell .hud .score-stack{position:relative!important;inset:auto!important;transform:none!important;translate:none!important;justify-self:center!important;width:max-content!important;max-width:100%!important;box-sizing:border-box!important}
}
.game-shell .tutorial-card.tutorial-card-primary.tutorial-layout-compact{grid-template-columns:minmax(0,1fr)!important}

@media (hover:hover) and (pointer:fine){
  .game-shell{container-name:court;container-type:inline-size}
  .game-shell .menu-topline{flex-wrap:wrap!important;row-gap:12px!important}
  .game-shell .hud .score-stack{padding:8px!important}
  .game-shell .hud .score-value{font-size:var(--hud-score-fit,var(--polish-score))!important}
  .game-shell .hud .score-caption{max-width:100%!important;box-sizing:border-box!important;letter-spacing:.07em!important;white-space:normal!important;overflow-wrap:anywhere!important}
}
@container court (max-width:420px){
  @media (hover:hover) and (pointer:fine){
    .game-shell .hud{padding-inline:12px!important;column-gap:8px!important}
    .game-shell .hud-top{grid-template-columns:var(--polish-pause) minmax(0,1fr) 128px!important;gap:8px!important}
    .game-shell .hud .star-pill{padding-inline:8px!important;gap:6px!important}
    .game-shell .hud .life-row{padding-inline:7px!important;gap:4px!important}
    .game-shell .hud .wave-meter{column-gap:6px!important}
  }
}

/* A vector note has the same visible size on every installed font. */
.game-shell .hud-sound-button>.music-note-glyph{width:52%!important;height:52%!important;min-width:22px;min-height:22px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M14%203v14M14%203c0%204%206%203%206%208%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222.7%22%20stroke-linecap%3D%22round%22%2F%3E%3Cellipse%20cx%3D%2210.5%22%20cy%3D%2218%22%20rx%3D%224.5%22%20ry%3D%223.5%22%20fill%3D%22black%22%20transform%3D%22rotate%28-20%2010.5%2018%29%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;mask:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M14%203v14M14%203c0%204%206%203%206%208%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%222.7%22%20stroke-linecap%3D%22round%22%2F%3E%3Cellipse%20cx%3D%2210.5%22%20cy%3D%2218%22%20rx%3D%224.5%22%20ry%3D%223.5%22%20fill%3D%22black%22%20transform%3D%22rotate%28-20%2010.5%2018%29%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;font-size:0!important;transform:none!important}

/* Narrow courts keep the large controls, but redistribute their available space. */
@media (hover:hover) and (pointer:fine){
  .game-shell .rating-shortcut-menu{right:2px!important}
  .game-shell .menu-grid .menu-achievement-shortcut{bottom:calc(var(--polish-tile) - var(--polish-achievement) * .94)!important}
  .game-shell .leaderboard-tile{padding-left:22px!important;padding-right:calc(var(--polish-achievement) + 20px)!important}
  .game-shell .menu-tile .menu-button-label{overflow-wrap:normal!important;word-break:normal!important;hyphens:auto}
  .game-shell .shop-card .ad-free-copy{min-width:0!important}
  .game-shell .shop-card .ad-free-copy strong,.game-shell .shop-card .ad-free-copy small{max-width:100%!important;white-space:normal!important;overflow-wrap:anywhere!important}
}
@container court (max-width:420px){
  @media (hover:hover) and (pointer:fine){
    .game-shell .collection-tile,.game-shell .shop-tile{padding-inline:8px!important}
    .game-shell .menu-grid{gap:12px!important}
    .game-shell .tutorial-card.bank-tutorial-card.bank-tutorial-compact strong{font-size:20px!important;line-height:1.15!important}
    .game-shell .tutorial-card.bank-tutorial-card.bank-tutorial-compact small{font-size:16px!important;line-height:1.3!important}
  }
}
/* This variable is also used when a bank lesson fits in a desktop side gutter. */
.game-shell .tutorial-card.bank-tutorial-card.tutorial-layout-sized{width:var(--tutorial-safe-width)!important;max-width:none!important}

/* Mobile HUD remains at its original scale, apart from the requested larger mute.
   Content-sized rows accommodate longer records and translated captions. */
@media (hover:none), (pointer:coarse){
  .game-shell .hud{--polish-score:clamp(44px,11vw,60px);display:grid!important;grid-template-columns:auto minmax(0,1fr) auto!important;grid-template-areas:"top top top" "lives wave sound"!important;grid-template-rows:auto auto!important;align-content:start!important;align-items:center!important;gap:9px 9px!important}
  .game-shell .hud-top{grid-area:top!important;grid-template-columns:59px minmax(0,1fr) 88px!important;gap:8px!important;align-items:start!important;min-height:72px!important}
  .game-shell .hud .score-stack{position:relative!important;inset:auto!important;transform:none!important;translate:none!important;justify-self:center!important;width:max-content!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;padding:6px 8px!important}
  .game-shell .hud .score-value{font-size:var(--hud-score-fit,var(--polish-score))!important;white-space:nowrap!important;max-width:100%!important}
  .game-shell .hud .score-caption{max-width:100%!important;box-sizing:border-box!important;white-space:normal!important;overflow-wrap:anywhere!important}
  .game-shell .hud .hud-counters{min-width:0!important;max-width:100%!important}
  .game-shell .hud .best-mini{overflow-wrap:anywhere!important}
  .game-shell .hud .hud-sound-button{grid-area:sound!important;position:relative!important;inset:auto!important;justify-self:end!important}
  .game-shell .hud .life-row{grid-area:lives!important;position:relative!important;inset:auto!important;justify-self:start!important}
  .game-shell .hud .wave-meter{grid-area:wave!important;position:relative!important;inset:auto!important;transform:none!important;translate:none!important;display:flex!important;flex-wrap:wrap!important;justify-content:center!important;align-content:center!important;min-width:0!important;width:100%!important;max-width:100%!important;gap:6px!important}
  .game-shell .hud .wave-meter span{flex-shrink:0!important}
}
/* On the smallest embeds the actionable instructions take precedence over a
   decorative lesson heading. Their type size is never reduced to make them fit. */
.game-shell .bank-tutorial-card.tutorial-layout-text-only .tutorial-copy>strong{display:none!important}
.game-shell .bank-tutorial-card.tutorial-layout-text-only .tutorial-copy>small{margin-top:0!important}
@media (hover:none) and (max-width:360px), (pointer:coarse) and (max-width:360px){
  .game-shell .menu-achievement-shortcut{translate:0 8px!important}
}
