.stat-value.is-big-brick-award {
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.autoplay-choices {
  margin-top: 16px; padding: 16px; border: 2px solid #b68b42;
  border-radius: 14px; background: #fff4d8; color: #55301e;
  line-height: 1.5; overflow-wrap: anywhere;
}
.autoplay-choices[hidden] { display: none; }
.autoplay-choices p { margin: 8px 0; }
.autoplay-choices select { font: inherit; min-height: 44px; max-width: 100%; margin: 6px; }
.autoplay-choices button { margin: 6px; }
.autoplay-choices :focus-visible { outline: 3px solid #07585f !important; outline-offset: 3px; }
/* style.css */
:root {
  --pink-main: #ff4785;
  --pink-dark: #d6245f;
  --pink-light: #ff7aa8;
  
  --purple-main: #9b51e0;
  --purple-dark: #6f2eb3;
  --purple-light: #c28ef5;
  
  --blue-main: #2d9cdb;
  --blue-dark: #1b73a8;
  --blue-light: #6bc0f2;
  
  --yellow-main: #f2c94c;
  --yellow-dark: #c99b17;
  --yellow-light: #fbe089;
  
  --green-main: #78c51a;
  --green-dark: #4c8a06;
  --green-light: #a4e650;
  
  --white: #ffffff;
  --text-dark: #4a2842;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--pink-main);
  background-image: 
    radial-gradient(circle at center 10%, var(--pink-light) 0%, transparent 50%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.08) 0px, rgba(255,255,255,0.08) 20px, transparent 20px, transparent 40px);
  background-attachment: fixed;
  font-family: system-ui, -apple-system, 'Arial Rounded MT Bold', 'Baloo', 'Comic Sans MS', sans-serif;
  color: var(--text-dark);
  user-select: none;
  min-height: 100dvh;
}

#confettiLayer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

#coinFlightLayer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10000;
}

.flying-coin {
  position: absolute;
  pointer-events: none;
  left: var(--coin-start-x);
  top: var(--coin-start-y);
  width: 25px;
  height: 25px;
  filter: drop-shadow(0 2px 3px rgba(75, 35, 0, .45));
  animation: fly-to-wallet 850ms cubic-bezier(.25, .65, .35, 1) both;
  animation-delay: var(--coin-delay);
}

.flying-coin svg {
  display: block;
  width: 100%;
  height: 100%;
  position: static;
  transform: none;
  filter: none;
}

@keyframes fly-to-wallet {
  0% { transform: translate(-50%, -50%) scale(.65); opacity: 0; }
  12% { opacity: 1; }
  42% { transform: translate(calc(-50% + var(--coin-mid-x)), calc(-50% + var(--coin-mid-y))) scale(1.25); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--coin-end-x)), calc(-50% + var(--coin-end-y))) scale(.45); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .flying-coin { animation: none; display: none; }
}

.app-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand {
  text-align: center;
  color: #fff;
  text-shadow: 0 4px 0 #a72374, 0 8px 18px rgba(81, 11, 70, .35);
  padding: 14px 0 4px;
}
.brand-kicker, .brand-subtitle {
  display: block;
  font-weight: 900;
  letter-spacing: .16em;
  font-size: .72rem;
}
.brand h1 {
  font-weight: 1000;
  line-height: 1;
  letter-spacing: -.065em;
  font-size: clamp(3.2rem, 11vw, 5.5rem);
  transform: rotate(-2deg);
  margin: 5px 0 7px;
}
.brand h1 span { color: var(--yellow-main); }
.brand h1 > [data-candy-copy] { color: inherit; }

.game-help-nav { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px 12px; max-width: 100%; min-width: 0; }
.game-help-nav > * { max-width: 100%; min-width: 0; }
.theme-selector {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  row-gap: 10px;
  max-width: 100%;
  color: #fff;
  font-weight: 900;
}
.theme-label { margin-right: 5px; text-shadow: 0 2px 3px #6e1b50; }
/* Appearance option buttons are fully styled in appearance-picker.css. */
.game-help-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 22px;
  background: #fff9ee;
  border: 3px solid #ffe38c;
  border-radius: 16px;
  color: #6f2eb3;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 4px 0 #b63578;
}
.game-help-link:hover { background: #fff1d1; }
.game-help-link:focus-visible { outline: 4px solid #21385b; outline-offset: 4px; }

/* Header */
.header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 3px solid #fff2cd;
  border-radius: 22px;
  background: #fff9ee;
  box-shadow: 0 6px 0 #b63578, 0 10px 20px rgba(81, 11, 70, .18);
  z-index: 10;
}
.level-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  padding: 7px 9px;
  border: 2px solid #fff1aa;
  border-radius: 18px;
  background: linear-gradient(160deg, #ffe38c, #f49a28);
  color: #713411;
  box-shadow: inset 0 -2px 0 #b86717;
}
.level-icon { width: 25px; height: 25px; flex: none; }
.level-details { display: grid; grid-template-columns: minmax(0, 1fr); flex: 1; gap: 2px; min-width: 0; font-size: .66rem; font-weight: 800; }
.level-details strong { font-size: .92rem; overflow-wrap: anywhere; }
.level-details progress { width: 100%; height: 5px; accent-color: #a34b0d; }
#levelProgress {
  /* Passive readout: Chromium's native hover paint changes fill AND track.
     Hit-test the surrounding pill instead, retaining native idle/forced colors,
     value/max semantics and geometry. Other controls still receive pointers. */
  pointer-events: none;
}
.level-details span { overflow-wrap: anywhere; }

/* Level-up celebration · themes override these tokens */
.level-pill {
  position: relative;
  --level-glow: rgba(255, 74, 168, .55);
  --level-ring: #ff4aa8;
  --level-badge-bg: linear-gradient(160deg, #ff5fb4, #7b4de8);
  --level-badge-border: #fff1aa;
  --level-badge-text: #fff;
  --level-badge-shadow: #9c2366;
}
.level-pill.is-leveling-up { animation: levelPulse 900ms cubic-bezier(.3, .7, .4, 1) both; }
.level-pill.is-level-highlight {
  outline: 3px solid var(--level-ring);
  outline-offset: 2px;
  filter: drop-shadow(0 0 7px var(--level-glow));
}
.level-details strong.is-level-pop {
  transform-origin: 0 50%;
  animation: levelNumberPop 520ms cubic-bezier(.3, 1.6, .5, 1) both;
}
.level-up-badge {
  position: absolute;
  left: 50%;
  top: calc(100% - 6px);
  z-index: 2;
  padding: 5px 12px;
  border: 2px solid var(--level-badge-border);
  border-radius: 999px;
  background: var(--level-badge-bg);
  color: var(--level-badge-text);
  box-shadow: 0 3px 0 var(--level-badge-shadow), 0 6px 14px rgba(0, 0, 0, .2);
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .02em;
  width: max-content;
  max-width: min(290px, calc(100vw - 40px));
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
  user-select: none;
  transform: translateX(-50%);
}
.level-up-badge.is-animated { animation: levelBadge 1800ms ease-out both; }
@media (max-width: 600px) {
  .level-pill:has(.level-up-badge:not([hidden])) { align-self: start; margin-bottom: 80px; }
  .level-up-badge { left: auto; right: 0; max-width: 100%; transform: none; }
  .level-up-badge.is-animated { animation-name: levelBadgeMobile; }
}
@keyframes levelBadgeMobile {
  0% { opacity: 0; transform: translateY(-6px) scale(.7); }
  14% { opacity: 1; transform: scale(1.03); }
  24%, 78% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(4px) scale(.96); }
}
@keyframes levelPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); }
  35% { transform: scale(1.07); filter: drop-shadow(0 0 10px var(--level-glow)); }
  100% { transform: scale(1); filter: drop-shadow(0 0 0 transparent); }
}
@keyframes levelNumberPop {
  0% { transform: scale(.6); opacity: .3; }
  60% { transform: scale(1.22); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes levelBadge {
  0% { opacity: 0; transform: translate(-50%, -6px) scale(.7); }
  14% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  24% { transform: translate(-50%, 0) scale(1); }
  78% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, 4px) scale(.96); }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.wallet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.balance-pill {
  flex-shrink: 0;
  background: #8e3974;
  border: 2px solid #edc5df;
  border-radius: 30px;
  padding: 5px 10px 5px 29px;
  position: relative;
  display: flex;
  align-items: center;
  box-shadow: inset 0 2px 3px rgba(0,0,0,0.15);
  color: var(--white);
  font-weight: 900;
  font-size: 1.05rem;
  text-shadow: 0 2px 2px rgba(0,0,0,0.5);
}

.icon-coin {
  width: 30px;
  height: 30px;
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  filter: drop-shadow(0 4px 2px rgba(0,0,0,0.3));
}

.bonus-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 6px;
  min-width: 0;
}

.btn-get-coins {
  background: var(--purple-main);
  border: 2px solid var(--white);
  border-radius: 10px;
  color: var(--white);
  font-size: .76rem;
  font-weight: 900;
  padding: 4px 9px;
  box-shadow: 0 2px 0 var(--purple-dark);
}

.coin-shop {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(420px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  border: 4px solid var(--purple-light);
  border-radius: 22px;
  padding: 18px;
  background: #fff9fc;
  color: var(--text-dark);
  box-shadow: 0 18px 50px rgba(39, 6, 43, .4);
}
.coin-shop::backdrop { background: rgba(30, 10, 39, .7); }
.shop-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.shop-heading h2 { color: var(--purple-dark); font-size: 1.5rem; }
.shop-close { background: transparent; color: var(--purple-dark); font-size: 2rem; line-height: 1; padding: 2px 8px; }
.shop-disclosure { margin: 12px 0; line-height: 1.4; }
.shop-disclosure strong { color: #9b1d54; }
.shop-packs { border: 0; display: grid; gap: 8px; }
.shop-packs legend { font-weight: 900; margin-bottom: 8px; }
.shop-pack {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 2px solid var(--purple-light);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
}
.shop-pack:has(input:checked) { border-color: var(--purple-dark); background: #f3e8ff; }
.shop-pack:focus-within { outline: 3px solid var(--purple-main); outline-offset: 2px; }
.shop-pack input { width: 18px; height: 18px; accent-color: var(--purple-dark); flex: none; }
.shop-pack span { display: grid; gap: 2px; }
.shop-pack small { font-size: .85rem; }
.shop-message { margin-top: 10px; color: #a51939; font-weight: 800; }
.shop-actions { display: flex; gap: 8px; margin-top: 16px; }
.shop-actions button { flex: 1; border-radius: 12px; padding: 10px 6px; font-size: .9rem; font-weight: 900; }
.shop-cancel { background: #eee4ef; color: var(--purple-dark); }
.shop-confirm { background: var(--green-main); color: #153900; }
.bonus-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

/* 3D Button Base */
button {
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}
button:active {
  transform: translateY(4px) !important;
}
button:focus-visible {
  outline: 4px solid var(--white);
  outline-offset: 2px;
}
button:disabled {
  opacity: 1;
  filter: none;
  cursor: not-allowed;
  transform: none;
}

.btn-bonus {
  background: linear-gradient(180deg, var(--yellow-light) 0%, var(--yellow-main) 100%);
  border: 2px solid var(--white);
  border-radius: 11px;
  color: #4a2b16;
  font-weight: 900;
  font-size: .79rem;
  padding: 7px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  justify-content: center;
  white-space: nowrap;
  box-shadow: 0 3px 0 var(--yellow-dark);
  text-shadow: none;
}
.btn-bonus:active {
  box-shadow: 0 1px 0 var(--yellow-dark);
}

.btn-bonus-mini {
  font-size: .79rem;
  padding: 7px 6px;
  border-radius: 11px;
  background: linear-gradient(180deg, #fff0ac, #f8b94c);
  box-shadow: 0 3px 0 #b87612;
}
.btn-bonus-mini:active {
  box-shadow: 0 1px 0 #b87612;
}
.btn-bonus-mini .icon-chest {
  width: 19px;
  height: 19px;
}

.icon-chest {
  width: 19px;
  height: 19px;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,0.2));
}
.btn-bonus.is-cooling {
  background: linear-gradient(180deg, #dfe1e6, #b4b9c3);
  border-color: #e7e9ed;
  color: #414956;
  box-shadow: 0 3px 0 #737b8a;
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}
.btn-bonus.is-cooling .icon-chest {
  filter: grayscale(1) brightness(.85) drop-shadow(0 2px 1px rgba(0,0,0,.15));
}

.bonus-countdown {
  color: #71425a;
  font-weight: 800;
  font-size: .68rem;
  text-shadow: none;
  background: #f8e8ec;
  padding: 2px 4px;
  border-radius: 12px;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .header {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 9px;
  }
  .level-pill { justify-self: stretch; min-width: 0; width: 100%; }
  .bonus-group {
    grid-column: 1 / -1;
  }
}

@media (max-width: 350px) {
  .bonus-group { gap: 8px; }
  .level-pill { padding-inline: 5px; gap: 4px; }
  .level-icon { width: 20px; height: 20px; }
  .level-details { font-size: .59rem; }
  .btn-bonus { font-size: .75rem; padding: 6px 3px; gap: 3px; }
  .btn-bonus-mini { font-size: .75rem; padding: 6px 3px; }
  .bonus-countdown { font-size: .61rem; }
}

/* Main Content Panels */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

section {
  background: var(--white);
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 8px 0 rgba(0,0,0,0.1), 0 12px 24px rgba(0,0,0,0.15);
  border: 4px solid rgba(255,255,255,0.5);
}

/* Top Status */
.top-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  padding: 8px 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, #237ab0 0%, var(--blue-dark) 100%);
  color: var(--white);
  border-color: var(--blue-light);
  box-shadow: 0 4px 0 var(--blue-dark), 0 7px 14px rgba(0,0,0,0.16);
}

.status-msg {
  flex: 1 1 200px;
  min-width: min(100%, 200px);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.selection-tracker {
  flex: none;
  margin-left: auto;
  background: rgba(0,0,0,0.24);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: .82rem;
  font-weight: 700;
  display: flex;
  gap: 4px;
  white-space: nowrap;
}

.sound-toggle {
  flex: none;
  border: 1px solid #d8e9ff;
  border-radius: 12px;
  background: #fff;
  color: #174f79;
  padding: 6px 10px;
  font-size: .78rem;
  font-weight: 800;
  min-height: 34px;
  white-space: nowrap;
}
.sound-toggle:focus-visible { outline: 3px solid #ffe27a; outline-offset: 2px; }
.sound-toggle:disabled { opacity: .55; cursor: not-allowed; }

/* Board */
.board-section {
  padding: 12px;
  background: #fdf2f7;
  border-color: var(--white);
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
@media (min-width: 320px) {
  .number-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (min-width: 360px) {
  .number-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 480px) {
  .number-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}
@media (min-width: 600px) {
  .number-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 8px;
  }
}

/* Grid Buttons */
#numberGrid button {
  aspect-ratio: 1;
  min-width: 0;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid #f0e6f5;
  color: var(--purple-main);
  font-size: 1.1rem;
  font-weight: 900;
  box-shadow: 0 4px 0 #d9c2e9, 0 4px 6px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}
#numberGrid button:focus-visible {
  outline: 3px solid var(--blue-dark);
  outline-offset: 1px;
}
#numberGrid button:active {
  box-shadow: 0 0px 0 #d9c2e9, 0 1px 2px rgba(0,0,0,0.1);
  transform: translateY(4px);
}
/* A locked board is still the draw display: keep its picks and hits vivid. */
#numberGrid button:disabled {
  opacity: 1;
  cursor: default;
}
/* Selected */
#numberGrid button.is-selected {
  background: linear-gradient(145deg, var(--pink-light), var(--pink-main));
  border-color: var(--pink-light);
  color: var(--white);
  box-shadow: 0 4px 0 var(--pink-dark), 0 4px 6px rgba(0,0,0,0.2);
  transform: scale(1.05);
  animation: pop 0.38s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#numberGrid button.is-selected:active {
  box-shadow: 0 0px 0 var(--pink-dark);
  transform: scale(1.05) translateY(4px);
}
/* Drawn (Miss) */
#numberGrid button.is-drawn {
  background: #cbd5e1;
  border-color: #94a3b8;
  color: #475569;
  box-shadow: 0 4px 0 #94a3b8;
}
/* Drawn (Hit) */
#numberGrid button.is-match {
  background: var(--yellow-main);
  border-color: var(--yellow-light);
  color: #69400a;
  box-shadow: 0 4px 0 var(--yellow-dark), 0 0 15px var(--yellow-main);
  animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes pop {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Controls */
.controls-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f3e8ff;
  border-color: var(--white);
}

.bet-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
}
.bet-label {
  font-weight: 800;
  color: var(--purple-dark);
  font-size: 1.1rem;
  padding-top: 8px;
}
.bet-options {
  display: flex;
  flex: 1 1 360px;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.bet-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.btn-bet {
  background: var(--white);
  border: 2px solid var(--purple-light);
  border-radius: 12px;
  color: var(--purple-main);
  font-weight: 800;
  font-size: 1rem;
  padding: 8px 16px;
  box-shadow: 0 4px 0 var(--purple-light), 0 4px 8px rgba(0,0,0,0.1);
}
.btn-bet:active {
  box-shadow: 0 0px 0 var(--purple-light);
}
.btn-bet.is-active, .btn-bet[aria-pressed="true"] {
  background: var(--purple-main);
  border-color: var(--purple-light);
  color: var(--white);
  box-shadow: 0 4px 0 var(--purple-dark), 0 4px 8px rgba(0,0,0,0.2);
  transform: scale(1.05);
}
.btn-bet.is-active:active, .btn-bet[aria-pressed="true"]:active {
  box-shadow: 0 0px 0 var(--purple-dark);
  transform: scale(1.05) translateY(4px);
}
.custom-bet-option {
  display: inline-grid;
  grid-template-columns: max-content 78px;
  align-items: center;
  column-gap: 6px;
  width: max-content;
  max-width: 100%;
  padding: 5px 8px;
  white-space: nowrap;
  cursor: text;
}
.custom-bet-option.is-active {
  background: var(--purple-main);
  border-color: var(--purple-light);
  color: var(--white);
  box-shadow: 0 4px 0 var(--purple-dark), 0 4px 8px rgba(0,0,0,0.2);
}
.custom-bet-option:focus-within {
  outline: 3px solid var(--purple-dark);
  outline-offset: 2px;
}
.custom-bet-option.has-error {
  border-color: #a51939;
}
.custom-bet-option.is-disabled {
  cursor: not-allowed;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
#customBetInput {
  width: 78px;
  max-width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 3px 5px;
  border: 1px solid var(--purple-light);
  border-radius: 6px;
  background: var(--white);
  color: var(--text-dark);
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  user-select: text;
}
#customBetInput[aria-invalid="true"] { border-color: #a51939; }
#customBetInput:focus-visible { outline: none; }
#customBetInput:disabled { opacity: 1; cursor: not-allowed; }
.bet-feedback {
  flex: 1 0 100%;
  color: #a51939;
  font-size: .9rem;
  font-weight: 800;
  text-align: center;
}
.bet-feedback:empty { display: none; }
@media (max-width: 430px) {
  .bet-panel { justify-content: flex-start; }
  .bet-options { flex-basis: 100%; }
}

.action-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr);
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}
.btn-action {
  min-width: 0;
  border: 3px solid var(--white);
  border-radius: 16px;
  font-weight: 800;
  font-size: 1.1rem;
  padding: 10px 6px;
  color: var(--white);
}
.btn-clear {
  background: var(--pink-main);
  box-shadow: 0 6px 0 var(--pink-dark), 0 8px 12px rgba(0,0,0,0.2);
}
.btn-clear:active { box-shadow: 0 2px 0 var(--pink-dark); }
.btn-quick {
  background: var(--blue-main);
  box-shadow: 0 6px 0 var(--blue-dark), 0 8px 12px rgba(0,0,0,0.2);
}
.btn-quick:active { box-shadow: 0 2px 0 var(--blue-dark); }

/* Play Button */
.btn-play {
  min-width: 0;
  width: 100%;
  background: linear-gradient(180deg, var(--green-light) 0%, var(--green-main) 100%);
  border: 6px solid var(--white);
  border-radius: 40px;
  color: var(--white);
  font-size: 1.6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 8px;
  text-shadow: 0 3px 0 var(--green-dark);
  box-shadow: 0 10px 0 var(--green-dark), 0 15px 25px rgba(0,0,0,0.3);
  animation: pulse 2s infinite;
}
.btn-play:active {
  box-shadow: 0 3px 0 var(--green-dark), 0 5px 10px rgba(0,0,0,0.3);
  transform: translateY(7px) !important;
  animation: none;
}
.btn-play:disabled { animation: none; }
@media (max-width: 500px) {
  .action-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-panel .btn-play { grid-column: 1 / -1; }
}
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* Results */
.results-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: #fffbe6;
}
.section-title {
  color: var(--purple-dark);
  font-size: 1.5rem;
  font-weight: 900;
  text-align: center;
}
.drawn-balls-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 100px;
  width: 100%;
  background: rgba(0,0,0,0.05);
  border-radius: 20px;
  padding: 16px;
  border: inset 4px rgba(255,255,255,0.5);
}
.drawn-balls-container .draw-ball {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--white);
  color: var(--purple-main);
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 0 #d9c2e9, 0 4px 6px rgba(0,0,0,0.1);
  animation: ballDrop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  opacity: 0;
  transform: scale(0.5) translateY(-20px);
}
.drawn-balls-container .draw-ball.is-match {
  background: var(--yellow-main);
  color: #69400a;
  box-shadow: 0 4px 0 var(--yellow-dark);
}
@keyframes ballDrop {
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.results-stats {
  display: flex;
  gap: 16px;
  width: 100%;
}
.stat-box {
  flex: 1;
  background: var(--white);
  border: 3px solid #f0e6f5;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 0 #f0e6f5;
}
.stat-highlight {
  background: var(--yellow-light);
  border-color: var(--yellow-main);
  box-shadow: 0 4px 0 var(--yellow-main);
}
.stat-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--purple-main);
  text-transform: uppercase;
}
.stat-highlight .stat-title {
  color: var(--yellow-dark);
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--purple-dark);
}
.stat-highlight .stat-value {
  color: #b37d00;
}
.results-message {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--pink-main);
  text-align: center;
}

#resultsTitle:not(:empty) { text-wrap: balance; }
#resultsTitle.is-win {
  color: var(--pink-main);
  animation: winFlash .75s ease-in-out 4 alternate;
}
@keyframes winFlash {
  50% { transform: scale(1.18) rotate(-3deg); color: var(--yellow-dark); text-shadow: 0 0 20px var(--yellow-main); }
}
.btn-bonus.is-ready:not(:disabled) {
  animation: chestPulse 6s ease-in-out infinite;
}
/* One second of motion, then five seconds upright and unlit on EVERY loop.
   Caveman changes only the animation name so both chests share this cadence. */
@keyframes chestPulse {
  0%, 16.6667%, 100% { transform: rotate(0deg) scale(1); filter: none; }
  4.1667% { transform: rotate(-3deg) scale(1.04); }
  8.3333% { transform: rotate(3deg) scale(1.13); filter: drop-shadow(0 0 16px #ffe474); }
  12.5% { transform: rotate(-1deg) scale(1.04); }
}
#confettiLayer .particle {
  position: absolute;
  top: -30px;
  width: 11px;
  height: 20px;
  animation: confettiFall 3s ease-in forwards;
}
@keyframes confettiFall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* Paytable */
.paytable-rounding-note {
  margin: 10px 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.paytable-section {
  background: var(--blue-main);
  color: var(--white);
  border-color: var(--blue-light);
  box-shadow: 0 8px 0 var(--blue-dark), 0 12px 24px rgba(0,0,0,0.2);
}
.paytable-section .section-title {
  color: var(--white);
  text-shadow: 0 2px 2px rgba(0,0,0,0.3);
  margin-bottom: 12px;
}
.table-container {
  background: rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 8px;
  border: inset 3px rgba(255,255,255,0.2);
}
.paytable {
  width: 100%;
  border-collapse: collapse;
  font-weight: 700;
}
.paytable th, .paytable td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 2px solid rgba(255,255,255,0.1);
}
.paytable th {
  text-transform: uppercase;
  font-size: 0.9rem;
  color: var(--yellow-light);
}
.paytable tbody tr:last-child td {
  border-bottom: none;
}
.paytable tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.05);
}

/* Footer / Pinning guidance */
.footer-section {
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: none;
}
.btn-pin {
  width: 100%;
  background: var(--purple-main);
  border: 3px solid var(--white);
  border-radius: 20px;
  color: var(--white);
  font-weight: 800;
  font-size: 1.1rem;
  padding: 16px;
  box-shadow: 0 6px 0 var(--purple-dark), 0 8px 12px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-pin:active {
  box-shadow: 0 2px 0 var(--purple-dark);
}
.source-credit {
  display: block;
  margin: 16px auto 5px;
  color: #fff;
  font-size: .75rem;
  text-align: center;
}
.source-credit:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .btn-bonus { animation: none !important; transition: none !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Community layer · candy-arcade cards with compact editorial labels */
[hidden] { display: none !important; }
.community-strip, .community-panel {
  background: #fff8ed;
  border: 3px solid #ffe3ab;
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 7px 0 #c83270, 0 12px 22px rgba(69, 18, 65, .18);
}
.community-strip { display: grid; gap: 10px; }
.community-strip-top, .community-panel-head, .community-row, .community-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.community-strip-top > div { min-width: 0; }
.community-flag {
  display: inline-block;
  width: 1.375rem;
  height: 1.03rem;
  object-fit: cover;
  vertical-align: -0.11em;
  margin-right: .4rem;
  border: 1px solid rgba(74, 40, 66, .18);
  border-radius: 2px;
  flex: none;
}
.community-eyebrow { display: block; font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 900; color: #a72a65; margin-bottom: 3px; }
.community-strip h2, .community-panel h2 { font-size: 1.25rem; color: #68245f; line-height: 1.2; }
.community-copy { font-size: .83rem; line-height: 1.45; color: #74546b; }
.community-badge { flex: none; background: #f5d8e8; border-radius: 99px; padding: 5px 9px; font-size: .72rem; font-weight: 900; color: #87234f; }
.community-badge.is-online { background: #ddf3b7; color: #385c16; }
.community-badge.is-offline { background: #ffdfca; color: #8d3d22; }
.community-button {
  background: #8b45bf; color: #fff8ed; padding: 9px 13px; border-radius: 11px;
  font-weight: 900; font-size: .84rem; box-shadow: 0 3px 0 #59217c;
}
.community-button.secondary { background: #f7d8e8; color: #752352; box-shadow: 0 3px 0 #cb9fb4; }
.community-button.warn { background: #fff0df; color: #a83f52; box-shadow: 0 3px 0 #e5bbc2; }
.community-button:focus-visible, .community-field:focus-visible { outline: 3px solid #299fcb; outline-offset: 2px; }
.community-actions { justify-content: flex-start; flex-wrap: wrap; }
.community-section { display: grid; gap: 16px; min-width: 0; }
.community-feed { display: grid; gap: 10px; min-width: 0; }
.community-feed + .community-feed { border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent); padding-top: 16px; }
.community-feed-title { font-size: 1rem; line-height: 1.25; font-weight: 900; }
.community-list { display: grid; gap: 8px; min-width: 0; }
.community-item { background: #fff; border: 1px solid #f1d8df; border-radius: 13px; padding: 10px 12px; min-width: 0; }
.community-item strong { font-size: .92rem; color: #5b2759; overflow-wrap: anywhere; }
.community-strip h2 { overflow-wrap: anywhere; }
.community-item small { color: #805c70; font-size: .73rem; }
.community-item .community-row + p { margin-top: 7px; overflow-wrap: anywhere; line-height: 1.35; user-select: text; }
.community-value { font-weight: 900; color: #a32b68; white-space: nowrap; }
.sample-tag { display: inline-block; margin-left: 5px; padding: 2px 5px; border-radius: 5px; background: #fbe5ad; color: #76500a; font-size: .62rem; font-weight: 900; text-transform: uppercase; vertical-align: middle; }
.sample-tag.is-test { background: #e6d7fa; color: #572b80; }
.community-empty { padding: 25px 15px; text-align: center; border: 2px dashed #e9b9ca; border-radius: 13px; color: #775268; font-size: .85rem; line-height: 1.5; }
.community-error { color: #9c2849; font-weight: 800; font-size: .83rem; }
.community-form { display: grid; gap: 11px; }
.community-form label { display: grid; gap: 5px; font-weight: 800; font-size: .82rem; color: #672b60; }
.community-field { width: 100%; background: #fff; border: 2px solid #e4bcd2; border-radius: 11px; min-height: 41px; padding: 8px 10px; color: #4a2842; font: inherit; user-select: text; }
.community-field:focus { border-color: #9b51e0; }
.country-picker { display: grid; gap: 5px; min-width: 0; }
.country-picker > label { font-weight: 800; font-size: .82rem; color: #672b60; }
.country-trigger { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; min-height: 44px; cursor: pointer; }
.country-value, .country-option { display: flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.country-picker .community-flag { flex: 0 0 24px; width: 24px; height: 18px; object-fit: contain; border-radius: 2px; }
.country-list { position: relative; max-height: min(220px, 30dvh); overflow-y: auto; overscroll-behavior: contain; scroll-padding: 3px; scroll-margin-block: 18px; border: 2px solid #9b51e0; border-radius: 11px; background: #fff; color: #4a2842; }
.country-option { position: relative; min-height: 44px; padding: 8px 10px; border: 2px solid transparent; cursor: pointer; font-size: .9rem; }
.country-option[aria-selected="true"] { font-weight: 800; }
.country-option[aria-selected="true"]::after { content: "✓"; margin-left: auto; }
.country-option[data-active="true"] { background: #ede0fa; border-color: #6f2eb3; }
.country-option:hover { text-decoration: underline; }
.country-trigger:focus-visible { outline: 3px solid #0b6c6a; outline-offset: 2px; }
@media (forced-colors: active) {
  .country-trigger, .country-list { background: Canvas; color: CanvasText; border: 2px solid ButtonText; }
  .country-option[data-active="true"] { background: Highlight; color: HighlightText; border-color: Highlight; }
  .country-trigger:focus-visible { outline-color: Highlight; }
}
.community-form .community-button { justify-self: start; }
.community-form .community-button { min-height: 44px; width: 100%; }
.community-legacy-login { border-top: 1px solid #eab5d1; padding-top: 10px; }
.community-legacy-login summary { cursor: pointer; font-weight: 800; font-size: .82rem; color: #672b60; }
.community-legacy-login > form { margin-top: 12px; }
.community-dialog { position: fixed; inset: 0; margin: auto; width: min(420px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; background: #fff8ed; border: 4px solid #eab5d1; border-radius: 22px; padding: 18px; color: #4a2842; box-shadow: 0 18px 50px rgba(39,6,43,.4); }
.community-dialog::backdrop { background: rgba(30,10,39,.7); }
.community-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.community-dialog-head h2 { color: #68245f; font-size: 1.45rem; }
.community-close { background: transparent; color: #68245f; font-size: 1.8rem; line-height: 1; padding: 0 6px; }
.community-dialog .community-copy { margin-bottom: 14px; }
.community-notice { min-height: 1.25em; color: #a32b68; font-size: .82rem; font-weight: 800; margin-top: 8px; }
.community-notice:empty { display: none; }
.community-message { min-width: 0; flex: 1; }
.community-chat-form { display: flex; gap: 7px; align-items: end; }
.community-chat-form label { flex: 1; min-width: 0; }
.community-chat-form .community-button { min-height: 41px; }
.community-report { border: 0; background: transparent; box-shadow: none; color: #8e4266; font-size: .72rem; text-decoration: underline; padding: 3px 0; }
.community-skeleton { height: 52px; border-radius: 12px; background: linear-gradient(90deg, #f5dce6 20%, #fff0f4 50%, #f5dce6 80%); background-size: 200% 100%; animation: communityShimmer 1.3s linear infinite; }
@keyframes communityShimmer { to { background-position: -200% 0; } }
.community-disclosure { font-size: .875rem; color: #775268; line-height: 1.4; overflow-wrap: anywhere; }
/* Explicit text utilities for the standalone extension (no Tailwind runtime).
   Keep requested sizes above theme-specific and compact-layout font rules. */
#gameApp .text-\[14px\] { font-size: 14px !important; }
#gameApp .text-\[16px\] { font-size: 16px !important; }
#gameApp .text-\[18px\] { font-size: 18px !important; }
#gameApp .text-\[22px\] { font-size: 22px !important; }
@media (max-width: 420px) { .community-strip-top { align-items: flex-start; } .community-panel { padding: 12px; } }
