/* ==========================================================================
   Variables & base
   ========================================================================== */
:root {
  --bg-dark: #0d0d0d;
  --bg-panel: #1a1a1a;
  --bg-header: #000;
  --text: #fff;
  --text-primary: #fff; /* primary text color, used by selects */
  --text-muted: #b0b0b0;
  --accent-yellow: #f5d020;
  --accent-green: #22c55e;
  --accent-pink: #ec4899;
  --meron-red: #dc2626;
  --wala-blue: #2563eb;
  --cancel-gray: #6b7280;
  --close-gold: #b8860b;
  --chip-outline-20: #22c55e;
  --chip-outline-50: #3b82f6;
  --chip-outline-100: #a855f7;
  --chip-outline-200: #f97316;
  --chip-outline-500: #ef4444;
  --chip-outline-1000: #eab308;
  --chip-outline-2000: #ec4899;
  --chip-outline-5000: #06b6d4;
  --radius: 4px;
  --header-h: 52px;
  --bet-panel-min-w: 320px;
  --bet-panel-max-w: 420px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  min-width: 375px;
  overflow-x: hidden;
  user-select: none;
}

/* ==========================================================================
   App shell
   ========================================================================== */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: var(--header-h);
  background: var(--bg-header);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .header {
    gap: 12px;
    padding: 0 16px;
  }
}

.header__menu {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}

.header__menu span {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 1px;
}

.header__balance-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header__balance {
  font-weight: 700;
  color: var(--accent-yellow);
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .header__balance {
    font-size: 1rem;
  }
}

.header__refresh {
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.header__refresh:hover {
  background: var(--bg-panel);
}

.header__refresh svg {
  width: 18px;
  height: 18px;
  transition: transform 220ms ease, opacity 220ms ease, color 220ms ease;
  display: block;
  transform-origin: 50% 50%;
}

/* Refresh button states: loading (spin), success (green), error (shake) */
.header__refresh.is-loading svg {
  animation: refresh-spin 1s linear infinite;
  opacity: 0.95;
}
.header__refresh.is-success {
  background: rgba(34,197,94,0.08);
  color: var(--accent-green);
}
.header__refresh.is-success svg {
  transform: scale(1.12);
  transition: transform 220ms, color 220ms;
}
.header__refresh.is-error {
  background: rgba(220,38,38,0.04);
  color: var(--meron-red);
}
.header__refresh.is-error svg {
  animation: refresh-shake 420ms ease;
}
.header__refresh[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

@keyframes refresh-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes refresh-shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
  100% { transform: translateX(0); }
}

.header__actions {
  display: flex;
  gap: 8px;
}

/* Sliding menu overlay */
.slide-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100%;
  background: var(--bg-panel);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 1000;
  overflow-y: auto;
  box-shadow: 2px 0 8px rgba(0,0,0,0.5);
}
.slide-menu.open {
  transform: translateX(0);
}
.slide-menu ul {
  list-style: none;
  margin: 0;
  padding: 16px 0;
}
.slide-menu li {
  font-size: 0.9rem;
  color: var(--text);
}
.slide-menu li a {
  color: var(--text);
  text-decoration: none;
  display: block;
  padding: 10px 24px;
}
.slide-menu li a:active {
  color: var(--accent-yellow);
}
.slide-menu li a:hover {
  color: var(--accent-yellow);
}
.slide-menu li#menuUsername {
  font-weight: bold;
  border-bottom: 1px solid #333;
  margin-bottom: 8px;
  padding: 10px 24px;
}

/* Ensure menu does not affect layout when hidden */
body.menu-open {
  overflow: hidden;
}

/* Buttons (shared) */
.btn {
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.98);
}

/* Disabled states for accessibility and visual feedback */
.btn[disabled],
.btn[disabled]:hover {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: grayscale(0.55);
  pointer-events: none;
}

/* Specific styling for large bet buttons when disabled */
.btn--bet-full[disabled] {
  opacity: 0.6;
  filter: grayscale(0.6) contrast(0.9);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.06));
  color: rgba(255,255,255,0.65);
  box-shadow: none;
}

.btn--cash-in {
  background: var(--accent-green);
  color: var(--text);
  font-size: 0.7rem;
  padding: 6px 12px;
}

@media (min-width: 768px) {
  .btn--cash-in {
    font-size: 0.75rem;
    padding: 8px 16px;
  }
}

.btn--cash-out {
  background: var(--accent-pink);
  color: var(--text);
  font-size: 0.7rem;
  padding: 6px 12px;
}

@media (min-width: 768px) {
  .btn--cash-out {
    font-size: 0.75rem;
    padding: 8px 16px;
  }
}

/* ==========================================================================
   Main layout
   ========================================================================== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 4px;
}

@media (min-width: 768px) {
  .main {
    flex-direction: row;
  }
}

/* ==========================================================================
   Video section (left)
   ========================================================================== */
.video-section {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  min-height: 300px;
}

@media (min-width: 768px) {
  .video-section {
    min-height: 400px;
  }
}

@media (min-width: 1024px) {
  .video-section {
    min-height: 500px;
  }
}

.video-section__title {
  background: #2a2a2a;
  padding: 8px 12px;
  flex-shrink: 0;
}

.history-page-label,
.history-pagination__label {
  /* legacy selector kept for backward compatibility */
  margin-left: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
}

@media (min-width: 768px) {
  .video-section__title {
    padding: 16px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}

.event-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text);
}

@media (min-width: 768px) {
  .event-title {
    font-size: 0.85rem;
  }
}

.video-section__player {
  flex: 1;
  min-height: 200px;
  position: relative;
  background: #111;
}

.video-container {
  aspect-ratio: 16 / 9;
  position: relative;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
}

/* -------------------------------------------------------------------------
   Promotions slider (shown when there are no active games)
   ------------------------------------------------------------------------- */
.promo-slider {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}
.promo-slider__track {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease;
}
.promo-slide {
  flex: 0 0 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.promo-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.promo-caption {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  padding: 4px 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
  display: none;
}

/* Video iframe wrapper */
.video-iframe-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.video-iframe-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-placeholder__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}

.video-placeholder__overlay.hidden {
  display: none;
}

.video-placeholder__text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* Loading Spinner */
.video-loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-yellow);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Small inline spinner for buttons */
.btn__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.18);
  border-top-color: var(--accent-yellow);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

/* Loader state for full-width bet buttons */
.btn--bet-full.is-loading {
  position: relative;
  color: transparent !important;
}
.btn--bet-full.is-loading .btn--bet-full__icon,
.btn--bet-full.is-loading .btn--bet-full__text-wrap {
  visibility: hidden;
}
.btn--bet-full.is-loading::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.18);
  border-top-color: var(--accent-yellow);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Balance update pulse (small UX feedback on balance changes) */
.balance-pulse {
  display: inline-block;
  transition: transform .28s cubic-bezier(.2,.9,.3,1), box-shadow .28s ease, background-color .28s ease;
  border-radius: 6px;
  will-change: transform, box-shadow, background-color;
}
.balance-pulse--up {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(6,150,6,0.12);
  background: rgba(6,150,6,0.03);
}
.balance-pulse--down {
  transform: scale(0.99);
  box-shadow: 0 8px 24px rgba(200,20,20,0.08);
  background: rgba(200,20,20,0.02);
}

/* ==========================================================================
   Bet panel (right)
   ========================================================================== */
.bet-panel {
  background: var(--bg-panel);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-h));
}

@media (min-width: 768px) {
  .bet-panel {
    min-width: 340px;
    max-width: 400px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
  }
}

@media (min-width: 1024px) {
  .bet-panel {
    min-width: var(--bet-panel-min-w);
    max-width: var(--bet-panel-max-w);
  }
}

.bet-panel__titles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: -16px -16px 0 -16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bet-panel__title {
  background: #2a2a2a;
  padding: 14px 12px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text);
  letter-spacing: 0.08em;
}

.bet-panel__values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 4px;
}

.bet-panel__status {
  background: var(--accent-green);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: var(--radius);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bet-panel__status--close {
  background: #dc2626;
}

.bet-panel__status--open {
  background: var(--accent-green);
}

.bet-panel__status--draw {
  background: #eab308;
}

.bet-panel__status--cancelled {
  background: #6b7280;
}

.bet-panel__fight {
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: var(--radius);
  letter-spacing: 0.08em;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.totals-single__item {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-yellow);
  padding: 10px 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius);
  letter-spacing: 0.02em;
  word-break: break-word;
  margin-bottom: 16px;
}

@media (min-width: 400px) {
  .totals-single__item {
    font-size: 1.25rem;
    padding: 12px 10px;
  }
}

@media (min-width: 768px) {
  .totals-single__item {
    font-size: 1.4rem;
    padding: 12px;
  }
}

.bet-options-full {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (min-width: 768px) {
  .bet-options-full {
    gap: 12px;
  }
}

.bet-option-full {
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bet-option-full__payout {
  background: rgba(0, 0, 0, 0.4);
  padding: 6px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

@media (min-width: 768px) {
  .bet-option-full__payout {
    padding: 8px;
    font-size: 0.8rem;
  }
}

.bet-option-full__user {
  background: rgba(0, 0, 0, 0.4);
  padding: 6px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-green);
  letter-spacing: 0.02em;
}

@media (min-width: 768px) {
  .bet-option-full__user {
    padding: 8px;
    font-size: 0.75rem;
  }
}

.btn--bet-full {
  background: var(--accent-green);
  color: var(--text);
  padding: 10px 6px;
  border: none;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: opacity 0.15s, transform 0.1s;
  min-height: 80px;
}

@media (min-width: 768px) {
  .btn--bet-full {
    padding: 12px 8px;
    gap: 6px;
  }
}

.btn--bet-full:active {
  transform: scale(0.98);
}

/* Specific bet button colors per side */
.bet-option-full--meron .btn--bet-full {
  background: var(--meron-red);
}

.bet-option-full--wala .btn--bet-full {
  background: var(--wala-blue);
}

/* Hover animation for bet buttons */
.btn--bet-full:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 20px rgba(0,0,0,0.45);
}

/* Horizontal bead-plate grouped column layout (for grouped sequences) */
.bead-plate-horizontal__column {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}

/* Animated bubble overlay indicator - uses absolute positioning to avoid layout reflow */
.animated-change {
  position: relative;
  display: inline-block;
  overflow: visible;
  /* Container maintains fixed dimensions throughout animation */
}

.animated-diff {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 50%);
  /* Bubble styling */
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 12px;
  white-space: nowrap;
  z-index: 9;
  pointer-events: none;  
  will-change: transform, opacity;
  /* Animation: fade in, scale up, and float upward with fade out */
  animation: bubbleFloat 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Bubble animation keyframes */
@keyframes bubbleFloat {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.5);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -90%) scale(1);
  }
}

.animated-diff.up { 
  background: rgba(34,197,94,0.2);
  color: var(--accent-green);
  border: 1px solid rgba(34,197,94,0.4);
}

.animated-diff.down { 
  background: rgba(220,38,38,0.2);
  color: var(--meron-red);
  border: 1px solid rgba(220,38,38,0.4);
}

.btn--bet-full__icon {
  font-size: 1.1rem;
  font-weight: 700;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .btn--bet-full__icon {
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
  }
}

.btn--bet-full__text-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.btn--bet-full__text {
  font-size: 0.7rem;
  line-height: 1.2;
  text-align: center;
  letter-spacing: 0.03em;
}

@media (min-width: 768px) {
  .btn--bet-full__text {
    font-size: 0.75rem;
  }
}

.bet-input-section-new {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 768px) {
  .bet-input-section-new {
    gap: 12px;
  }
}

.bet-input-section-new__balance {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius);
}

@media (min-width: 768px) {
  .bet-input-section-new__balance {
    padding: 10px 12px;
    gap: 8px;
  }
}

.bet-input-section-new__balance-label {
  font-size: 0.85rem;
  color: #aaa;
  font-weight: 600;
  text-transform: uppercase;
}

@media (min-width: 768px) {
  .bet-input-section-new__balance-label {
    font-size: 0.9rem;
  }
}

.bet-input-section-new__balance-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-yellow);
  letter-spacing: 0.02em;
}

@media (min-width: 768px) {
  .bet-input-section-new__balance-value {
    font-size: 1.1rem;
  }
}

.bet-input-section-new__copy {
  width: 28px;
  height: 28px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: background 0.15s;
}

@media (min-width: 768px) {
  .bet-input-section-new__copy {
    width: 32px;
    height: 32px;
  }
}

.bet-input-section-new__copy:hover {
  background: rgba(255, 255, 255, 0.2);
}

.bet-input-section-new__copy svg {
  width: 16px;
  height: 16px;
}

@media (min-width: 768px) {
  .bet-input-section-new__copy svg {
    width: 18px;
    height: 18px;
  }
}

.bet-input-section-new__row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

@media (min-width: 768px) {
  .bet-input-section-new__row {
    gap: 12px;
  }
}

.bet-input-section-new__input-wrap {
  position: relative;
  flex: 1;
  height: 48px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 0 14px;
  display: flex;
  align-items: center;
  min-width: 0;
}

@media (min-width: 768px) {
  .bet-input-section-new__input-wrap {
    height: 52px;
    padding: 0 16px;
  }
}

.bet-input-section-new__input-wrap:focus-within {
  border-color: var(--accent-yellow);
}

.bet-input-section-new__label {
  position: absolute;
  top: -7px;
  left: 12px;
  padding: 0 6px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  background: var(--bg-panel);
  line-height: 1;
}

@media (min-width: 768px) {
  .bet-input-section-new__label {
    font-size: 0.85rem;
  }
}

.bet-input-section-new__input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-yellow);
  line-height: 1;
}

@media (min-width: 768px) {
  .bet-input-section-new__input {
    height: 52px;
    padding: 0 16px;
    font-size: 1.5rem;
  }
}

.bet-input-section-new__input:focus {
  outline: none;
}

.btn--clear-new {
  background: var(--accent-pink);
  color: var(--text);
  height: 48px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.1s;
  letter-spacing: 0.03em;
}

@media (min-width: 768px) {
  .btn--clear-new {
    height: 52px;
    padding: 0 20px;
    font-size: 0.9rem;
    gap: 8px;
  }
}

.btn--clear-new:active {
  transform: scale(0.98);
}

.btn--clear-new svg {
  width: 16px;
  height: 16px;
}

@media (min-width: 768px) {
  .btn--clear-new svg {
    width: 18px;
    height: 18px;
  }
}

/* Chips */
.chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
  justify-items: center;
  gap: 18px;
  max-width: 280px;
  margin: 0 auto;
}

.chip {
  width:70px;
  height:70px;
  border-radius:50%;
  background:white;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:14px;
  cursor:pointer;
  border:6px solid;
  position:relative;
  transition:transform .12s ease, box-shadow .12s ease;
}

.chip::before{
  content:"";
  position:absolute;
  inset:4px;
  border-radius:50%;
  border:2px dashed rgba(0,0,0,.25);
}

@media (min-width: 400px) {
  .chip {
    font-size: 0.8rem;
  }
}

@media (min-width: 768px) {
  .chip {
    font-size: 0.85rem;
  }
}

.chip:hover{
  transform:translateY(-3px) scale(1.08);
  box-shadow:0 10px 25px rgba(0,0,0,.6);
}

.chip:active{
  transform:scale(.96);
}

.chip.active{
  box-shadow:0 0 0 4px rgba(255,255,255,.25), 0 0 18px currentColor;
}

.chip--20{border-color:#22c55e;color:#16a34a;}
.chip--50{border-color:#3b82f6;color:#2563eb;}
.chip--100{border-color:#a855f7;color:#9333ea;}
.chip--200{border-color:#f97316;color:#ea580c;}
.chip--500{border-color:#ef4444;color:#dc2626;}
.chip--1000{border-color:#eab308;color:#ca8a04;}
.chip--2000{border-color:#ec4899;color:#db2777;}
.chip--5000{border-color:#06b6d4;color:#0891b2;}

/* ==========================================================================
   Bead Plate Section
   ========================================================================== */
.bead-plate-section {
  margin-top: 16px;
  background: var(--bg-panel);
  border-radius: var(--radius);
  display: none;
}

.bead-plate-section__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-yellow);
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

/* Horizontal Bead Plate */
.bead-plate-horizontal {
  display: flex;
  flex-direction: row;
  gap: 4px;
  padding: 4px;
  background: 
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    rgba(0, 0, 0, 0.3);
  background-size: 20px 20px;
  background-position: 2px 2px;
  background-attachment: local;
  border-radius: var(--radius);
  min-height: 100px;
  max-height: 200px;
  overflow-x: auto;
  margin-bottom: 12px;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  scrollbar-width: thin;
}

/* Custom scrollbar styling for webkit browsers */
.bead-plate-horizontal::-webkit-scrollbar {
  height: 6px;
}

.bead-plate-horizontal::-webkit-scrollbar-track {
  background: transparent;
}

.bead-plate-horizontal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.bead-plate-horizontal::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.bead-plate-horizontal__bead {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.bead-plate-horizontal__bead--meron {
  background: var(--meron-red);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.bead-plate-horizontal__bead--wala {
  background: var(--wala-blue);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.bead-plate-horizontal__bead--draw {
  background: var(--accent-green);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.bead-plate-horizontal__bead--cancelled {
  background: var(--cancel-gray);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Statistics Display */
.bead-plate-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius);
}

@media (min-width: 400px) {
  .bead-plate-stats {
    gap: 10px;
  }
}

.bead-plate-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.bead-plate-stat__circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

/* Wave delays for seamless flow */
.bead-plate-stat__circle.wave {
  animation: statWave 1.4s ease-in-out infinite;
}
.bead-plate-stat__circle.wave span {
  opacity: 0.4;
}

.bead-plate-stat:nth-child(1) .bead-plate-stat__circle.wave { animation-delay: 0s; }
.bead-plate-stat:nth-child(2) .bead-plate-stat__circle.wave { animation-delay: 0.2s; }
.bead-plate-stat:nth-child(3) .bead-plate-stat__circle.wave { animation-delay: 0.4s; }
.bead-plate-stat:nth-child(4) .bead-plate-stat__circle.wave { animation-delay: 0.6s; }

@keyframes statWave {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-2px);
    opacity: 1;
    box-shadow: 0 0 20px currentColor;
  }
}

@media (min-width: 400px) {
  .bead-plate-stat__circle {
    width: 56px;
    height: 56px;
    font-size: 1.1rem;
  }
}

.bead-plate-stat--meron .bead-plate-stat__circle {
  background: var(--meron-red);
}

.bead-plate-stat--wala .bead-plate-stat__circle {
  background: var(--wala-blue);
}

.bead-plate-stat--draw .bead-plate-stat__circle {
  background: var(--accent-green);
}

.bead-plate-stat--cancelled .bead-plate-stat__circle {
  background: var(--cancel-gray);
}

.bead-plate-stat__label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}

@media (min-width: 400px) {
  .bead-plate-stat__label {
    font-size: 0.75rem;
  }
}

/* Derived Road Pattern Tracker */
.bead-plate-road {
  display: flex;
  gap: 10px;
  padding: 3px;
  background: 
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    rgba(0, 0, 0, 0.3);
  background-attachment: local;
  border-radius: var(--radius);
  min-height: 100px;
  max-height: 250px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  scrollbar-width: thin;
}

.bead-plate-road::-webkit-scrollbar {
  height: 6px;
}

.bead-plate-road::-webkit-scrollbar-track {
  background: transparent;
}

.bead-plate-road::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.bead-plate-road::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.bead-plate-road__column {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 24px;
}

.bead-plate-road__cell {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Notification System
   ========================================================================== */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  min-width: 300px;
  max-width: 500px;
  background: #1a1a1a;
  border-radius: 8px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s ease;
  z-index: 10010; /* above modal(10005) so notifications remain visible */
  pointer-events: none;
}

.notification--show {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.notification__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.notification__icon svg {
  width: 100%;
  height: 100%;
}

.notification__message {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}

.notification--success {
  border-left: 4px solid var(--accent-green);
}

.notification--success .notification__icon {
  color: var(--accent-green);
}

.notification--error {
  border-left: 4px solid #ef4444;
}

.notification--error .notification__icon {
  color: #ef4444;
}

.notification--warning {
  border-left: 4px solid var(--accent-yellow);
}

.notification--warning .notification__icon {
  color: var(--accent-yellow);
}

.notification--info {
  border-left: 4px solid #3b82f6;
}

.notification--info .notification__icon {
  color: #3b82f6;
}

/* ==========================================================================
   Modals (Stripe-inspired premium design)
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1200px 600px at 10% 10%, rgba(0,0,0,0.3), rgba(0,0,0,0.65));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 10005;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal--show {
  display: flex;
}

.modal__dialog {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient( 316deg, rgb(173 14 14 / 95%), rgb(16 100 154 / 98%));
  border-radius: 20px;
  padding: 32px;
  position: relative;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
  transform-origin: center top;
  transition: transform .24s cubic-bezier(.34,.1,.68,.1), opacity .24s ease;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  
  /* refined shadow system */
  box-shadow: 
    0 0 0 1px rgba(255,255,255,0.02),
    0 8px 24px -4px rgba(0,0,0,0.25),
    0 16px 48px -8px rgba(0,0,0,0.35),
    0 24px 80px -12px rgba(0,0,0,0.45);
}

.modal--show .modal__dialog {
  animation: stripeModalEnter .36s cubic-bezier(.34,.1,.68,.1);
}

@keyframes stripeModalEnter {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* premium accent bar */
.modal__dialog::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, transparent, var(--accent) 20%, #7c3aed 50%, #06b6d4 80%, transparent);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  pointer-events: none;
}

.modal__header {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* modal brand — premium presentation */
.modal__brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.modal__brand svg { 
  border-radius: 12px;
  box-shadow: 
    0 4px 12px rgba(0,0,0,0.15),
    inset 0 1px 0 rgba(255,255,255,0.1);
}
.modal__brand__text { 
  display: flex;
  flex-direction: column;
  line-height: 1;
  color: var(--text);
  font-weight: 700;
}
.modal__brand__text strong { 
  font-size: 1rem;
  letter-spacing: 0.8px;
  font-weight: 800;
}
.modal__brand__text span { 
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  font-weight: 600;
  margin-top: 2px;
}

.modal__header h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  line-height: 1.2;
}

.modal__sub {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.4;
}

.modal__close { 
  position: absolute;
  right: 16px;
  top: 16px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.65);
  font-size: 20px;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: all .16s cubic-bezier(.34,.1,.68,.1);
}

.modal__close:hover { 
  transform: translateY(-1px);
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.12);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.modal__close:active { transform: translateY(0); }

.modal__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 20px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* referral code badge style */
.ref-code {
  font-weight: 600;
  padding: 6px 10px;
  background: #f5f5f5;
  border-radius: 4px;
  display: inline-block;
}

.modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.modal__field label {
  display: block;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.modal__field input[type="number"],
.modal__field input[type="text"],
.modal__field input[type="password"] {
  width: 100%;
  padding: 12px 38px;
  border-radius: 10px;
  border: 1.5px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

/* inputs with icon wrapper */
.input-with-icon {
  position: relative;
}
.input-with-icon input {
  padding-right: 40px; /* allow space for icon */
}
.input-with-icon .icon-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text);
}

/* password show/hide toggle */
.pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  line-height: 1;
  transition: color .15s ease;
}
.pw-toggle:hover {
  color: rgba(255,255,255,0.8);
}
.input-with-icon:has(.pw-toggle) input {
  padding-right: 44px;
}

/* center QR and adjust surrounding wrapper */
#referQrWrapper {
  text-align: center;
}
#referQrCode {
  background: #fff;
  border-radius: 10px;
  display: inline-block;
  margin: 0 auto;
  padding: 12px;
}

/* modal-themed buttons/links */
.modal .btn {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.modal .btn:hover {
  opacity: 0.9;
}
.modal a.btn {
  text-decoration: none;
}

/* referral link input allows text selection */
#referLinkInput {
  cursor: text;
}

/* modal input focus state */
.modal__field input:focus {
  box-shadow: 
    inset 0 1px 2px rgba(0,0,0,0.1),
    inset 0 0 0 1px rgba(255,255,255,0.02);
  transition: all .16s cubic-bezier(.34,.1,.68,.1);
  outline: none;
}

.modal__field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: var(--text); /* white text on dark modal, avoids invisibility on iOS */
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

/* ensure options also readable when opened in native picker */
.modal__field select option {
  color: var(--text);
  background: var(--bg-panel);
}

.modal__field input::placeholder { 
  color: rgba(255,255,255,0.3);
  font-weight: 500;
}

.modal__field input:hover {
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
}

.modal__field input:focus { 
  border-color: rgba(99,102,241,0.6);
  background: rgba(99,102,241,0.02);
  box-shadow: 
    inset 0 1px 2px rgba(0,0,0,0.1),
    0 0 0 3px rgba(99,102,241,0.08),
    0 4px 16px rgba(99,102,241,0.1);
  transform: translateY(-1px);
}

.modal__footer { 
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* controls container combining toolbar and pagination for history modals */
.history-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 8px;
}
.history-controls__left,
.history-controls__center,
.history-controls__right {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.history-controls__left {
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}
.history-controls__center {
  justify-content: center;
  padding: 4px 0;
}
.history-controls__right {
  justify-content: center;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

/* compact label/select styling */
.history-toolbar__label {
  font-size: 0.7rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.history-toolbar__select {
  font-size: 0.7rem;
  padding: 0 10px;
  height: 30px;
  border-radius: 4px;
  background: rgba(255,255,255,0.02);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.35);
  appearance: none;
}

.history-page-label {
  font-size: 0.7rem;
  white-space: nowrap;
  height: 30px;
  line-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* buttons match input height and share width */
.history-pagination__btn {
  height: 30px;
  padding: 0 10px;
  font-size: 0.68rem;
  flex: 1 1 auto;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.03);
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.history-pagination__btn:hover:not(:disabled) {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: rgba(34,197,94,0.1);
}
.history-pagination__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* remove legacy toolbar margin auto */
.history-toolbar {
  display: none;
}

/* small screens: everything stacks with tight spacing */
@media (max-width: 480px) {
  .history-controls {
    gap: 6px;
  }
  .history-controls__left,
  .history-controls__right {
    gap: 4px;
  }
  .history-toolbar__select,
  .history-pagination__btn {
    padding: 0 8px;
    height: 28px;
    font-size: 0.66rem;
  }
  .history-page-label {
    font-size: 0.66rem;
    height: 28px;
    line-height: 28px;
  }
}

/* narrow phones: keep full-width groups to avoid overflow */
@media (max-width: 400px) {
  .history-controls__left,
  .history-controls__right {
    flex: 1 1 100%;
    justify-content: center;
  }
  .history-controls__left label,
  .history-controls__right button {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* larger screens: maintain column flow but allow tighter grouping */
@media (min-width: 640px) {
  .history-controls {
    gap: 10px;
  }
  .history-controls__left {
    flex-wrap: nowrap;
  }
}


.history-table-wrapper {
  background: rgba(255,255,255,0.01);
}

.history-table-scroll {
  overflow-y: auto;
}

.history-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.history-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #654457;
}

.history-table thead tr {
  background: rgba(255,255,255,0.02);
}

.history-table th,
.history-table td {
  padding: 6px 8px;
}

#historyModal .history-table th,
#historyModal .history-table td {
  font-size: 0.7rem;
}

@media ( max-width: 410px ) {
  #historyModal .history-table td[data-label="Date"] {
    max-width: 80px;
  }
}

#historyModal .history-table th:nth-child(2),
#historyModal .history-table td:nth-child(2) {
  display:none;
}

/* compact variant for bet history modal */
#betHistoryModal .history-table th,
#betHistoryModal .history-table td {
  padding: 6px 8px;
  font-size: 0.7rem;
}
#betHistoryModal .history-table th {
  letter-spacing: 0.12em;
}

/* truncate game column to avoid breaking layout */
#betHistoryModal .history-table td[data-label="Game"] {
  max-width: 80px; /* roughly 10 chars in compact font */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-table th {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  font-weight: 600;
}

.history-table tbody tr {
  border-top: 1px solid rgba(255,255,255,0.06);
}

.history-table tbody tr:last-child {
  border-bottom: 0;
}

.history-table td {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.87);
}

.history-table td[data-label="Amount"] {
  text-align: right;
}

.history-cell__amount {
  display: inline-block;
  color: var(--accent-yellow);
  font-weight: 700;
}

.history-cell__amount--failed {
  color: var(--accent-pink);
  text-decoration: line-through;
}

/* add coloring for transaction type */
.history-cell__amount--debit {
  color: var(--accent-yellow);
}

.history-cell__amount--credit {
  color: var(--accent-green);
}

.history-table td[data-label="Reference"] {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.65);
  word-break: break-all;
}

.history-table tr:hover {
  background: rgba(255,255,255,0.03);
}

.history-empty {
  padding: 24px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.25);
  text-align: center;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.02);
}

.history-table-scroll::-webkit-scrollbar {
  width: 6px;
}

.history-table-scroll::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
}

.history-table-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
}

/* Stripe-style button hierarchy still needed for the auth modal */
#authModal .btn {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  padding: 11px 24px;
  border-radius: 10px;
  box-shadow: 
    0 4px 12px rgba(0,0,0,0.15),
    0 0 0 1px rgba(255,255,255,0.05);
  border: none;
  font-weight: 700;
}

#authModal .btn:hover { 
  transform: translateY(-2px);
  box-shadow: 
    0 8px 20px rgba(0,0,0,0.25),
    0 0 0 1px rgba(255,255,255,0.05);
}

#authModal .btn:active { 
  transform: translateY(0);
  box-shadow: 
    0 2px 6px rgba(0,0,0,0.12),
    0 0 0 1px rgba(255,255,255,0.05);
}

#authModal .btn.modal-cancel,
#authModal .btn.modal-cancel:hover {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: none;
  transition: all .16s cubic-bezier(.34,.1,.68,.1);
}

#authModal .btn.modal-cancel:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.2);
}

#authModal .btn.btn--ghost { 
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: none;
}

#authModal .btn.btn--ghost:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
}

/* loading spinner */
#authModal .btn.is-loading {
  color: transparent;
  pointer-events: none;
}

#authModal .btn.is-loading::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-right-color: #fff;
  animation: stripe-spin .7s linear infinite;
}

#cashInModal .modal__body .btn {
  background-color: #ff8c00;
  color: #fff;
  text-decoration: none;
}

#cashInModal .modal__body .btn:hover {
  background-color: #ff7a00;
}

/* Cash-in / Cash-out — chips & footer buttons that harmonize with modal background */
#p2pModal .modal-chip,
#cashInModal .modal-chip,
#cashOutModal .modal-chip,
#topUpModal .modal-chip {
  padding: 8px 12px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  color: #fff;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: none;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease, background-color .18s ease;
  cursor: pointer;
  min-width: 72px;
  text-align: center;
}

#p2pModal .modal-chip {
  border-radius: 99px;
  min-width: 32px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

#p2pModal .modal-chip:hover,
#cashInModal .modal-chip:hover,
#cashOutModal .modal-chip:hover,
#topUpModal .modal-chip:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.035);
  box-shadow: none;
}

#p2pModal .modal-chip:active,
#cashInModal .modal-chip:active,
#cashOutModal .modal-chip:active,
#topUpModal .modal-chip:active {
  transform: translateY(0) scale(.997);
  background: rgba(255,255,255,0.05);
  box-shadow: none;
}

#p2pModal .modal-chip:focus-visible,
#cashInModal .modal-chip:focus-visible,
#cashOutModal .modal-chip:focus-visible,
#topUpModal .modal-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
  border-color: rgba(255,255,255,0.12);
}

#p2pModal .modal-chip[aria-pressed="true"],
#cashInModal .modal-chip[aria-pressed="true"],
#cashOutModal .modal-chip[aria-pressed="true"],
#topUpModal .modal-chip[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(99,102,241,0.12), rgba(6,182,212,0.06));
  border-color: rgba(99,102,241,0.18);
  color: #fff;
  transform: translateY(0);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.02);
}

#p2pModal .modal__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}
/* Footer buttons inside cashIn/cashOut — premium, low‑gloss, accessible */
#p2pModal .modal__footer .btn,
#cashInModal .modal__footer .btn,
#cashOutModal .modal__footer .btn,
#topUpModal .modal__footer .btn,
#commissionModal .modal__footer .btn {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 6px 18px rgba(2,6,23,0.36), inset 0 1px 0 rgba(255,255,255,0.02);
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease, filter .18s ease;
  font-weight: 700;
}

#cashInModal .modal__footer .btn:hover,
#cashOutModal .modal__footer .btn:hover,
#topUpModal .modal__footer .btn:hover,
#commissionModal .modal__footer .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(2,6,23,0.42);
  filter: brightness(1.03);
}

#cashInModal .modal__footer .btn:active,
#cashOutModal .modal__footer .btn:active,
#topUpModal .modal__footer .btn:active,
#commissionModal .modal__footer .btn:active {
  transform: translateY(0) scale(.997);
  box-shadow: 0 2px 6px rgba(2,6,23,0.12);
  filter: brightness(0.98);
}

#cashInModal .modal__footer .btn.modal-cancel,
#cashOutModal .modal__footer .btn.modal-cancel,
#topUpModal .modal__footer .btn.modal-cancel,
#commissionModal .modal__footer .btn.modal-cancel {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: none;
}

#cashInModal .modal__footer .btn:focus-visible,
#cashOutModal .modal__footer .btn:focus-visible,
#topUpModal .modal__footer .btn:focus-visible,
#commissionModal .modal__footer .btn:focus-visible {
  outline: none;
  box-shadow: 0 8px 18px rgba(2,6,23,0.36), 0 0 0 4px rgba(99,102,241,0.10);
  border-color: rgba(255,255,255,0.12);
}

#cashInModal .modal__footer .btn[disabled],
#cashOutModal .modal__footer .btn[disabled],
#topUpModal .modal__footer .btn[disabled],
#commissionModal .modal__footer .btn[disabled] {
  opacity: 0.55;
  pointer-events: none;
  filter: grayscale(0.35) contrast(0.85);
  box-shadow: none;
}

#changePasswordModal .modal__footer .btn,
#topUpModal .modal__footer .btn,
#commissionModal .modal__footer .btn {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 6px 18px rgba(2,6,23,0.36), inset 0 1px 0 rgba(255,255,255,0.02);
  transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s ease, filter .18s ease;
  font-weight: 700;
}

#changePasswordModal .modal__footer .btn:hover,
#topUpModal .modal__footer .btn:hover,
#commissionModal .modal__footer .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(2,6,23,0.42);
  filter: brightness(1.03);
}

#changePasswordModal .modal__footer .btn:active,
#topUpModal .modal__footer .btn:active,
#commissionModal .modal__footer .btn:active {
  transform: translateY(0) scale(.997);
  box-shadow: 0 2px 6px rgba(2,6,23,0.12);
  filter: brightness(0.98);
}

#changePasswordModal .modal__footer .btn.modal-cancel,
#topUpModal .modal__footer .btn.modal-cancel,
#commissionModal .modal__footer .btn.modal-cancel {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: none;
}

#changePasswordModal .modal__footer .btn:focus-visible,
#topUpModal .modal__footer .btn:focus-visible,
#commissionModal .modal__footer .btn:focus-visible {
  outline: none;
  box-shadow: 0 8px 18px rgba(2,6,23,0.36), 0 0 0 4px rgba(99,102,241,0.10);
  border-color: rgba(255,255,255,0.12);
}

/* Ghost button used in P2P modal */
.btn.btn--ghost {
  background: transparent;
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: none;
}

.btn.btn--ghost:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-color: rgba(255,255,255,0.26);
}

.btn.btn--ghost:active {
  transform: translateY(0) scale(.995);
}

#changePasswordModal .modal__footer .btn[disabled],
#topUpModal .modal__footer .btn[disabled],
#commissionModal .modal__footer .btn[disabled] {
  opacity: 0.55;
  pointer-events: none;
  filter: grayscale(0.35) contrast(0.85);
  box-shadow: none;
}

#commissionModal .modal__field .icon-btn {
  cursor: pointer;
}

/* -------------------------------------------------------------------------
   P2P modal
   ------------------------------------------------------------------------- */
.p2p-tabs {
  justify-content: center;
}

.p2p-panel {
  display: block;
}

.p2p-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.p2p-card--center {
  align-items: center;
  text-align: center;
}

.p2p-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.p2p-id {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.p2p-qr-canvas {
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  border-radius: 12px;
  border: 1px dashed rgba(255,255,255,0.18);
}

.p2p-hint {
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
}

.p2p-field input {
  text-align: center;
}

.p2p-field label[for="p2pScanAmount"] {
  display: none;
}

#p2pModal .modal__header {
  margin-bottom: 0;
}

#p2pScanAmount {
  border: 0 !important;
  background: transparent !important;
  font-size: 3rem;
  font-weight: 800;
  color: #34d399;
  letter-spacing: 0.02em;
  padding: 0;
  width: 100%;
}

.p2p-scan-video-wrap {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.06), rgba(0,0,0,0.65));
  border: 1px solid rgba(255,255,255,0.1);
  aspect-ratio: 4 / 3;
}

.p2p-scan-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.p2p-scan-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.8);
  background: linear-gradient(135deg, rgba(0,0,0,0.65), rgba(0,0,0,0.35));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  font-size: 0.8rem;
  pointer-events: none;
}

.p2p-manual {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.p2p-manual-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}

.p2p-manual textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: #fff;
  padding: 10px 12px;
  font-family: inherit;
  font-weight: 600;
}

.p2p-scan-summary {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  font-weight: 600;
  color: rgba(255,255,255,0.78);
  text-align: center;
  display: none;
}

.p2p-scan-summary--ok { display: none;}
.p2p-scan-summary--error { border-color: rgba(239,68,68,0.5); color: #f87171; }

.p2p-scan-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.p2p-username {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  color: #34d399;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  padding: 14px 28px;
  display: none;
}

.p2p-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.p2p-actions .btn {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 14px;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  padding: 14px 28px;
}

.p2p-qr-canvas canvas, .p2p-qr-canvas img {
  max-width: 100%;
  height: auto;
}

@keyframes stripe-spin { to { transform: rotate(360deg); } }

/* input with icon */
.input-with-icon { 
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .input-icon { 
  position: absolute;
  left: 14px;
  color: rgba(255,255,255,0.45);
  pointer-events: none;
  transition: color .16s ease;
}

.input-with-icon input { 
  padding-left: 44px;
}

.input-with-icon input:focus ~ .input-icon,
.input-with-icon .input-icon {
  color: rgba(255,255,255,0.6);
}

.input-with-icon .input-icon svg, 
.input-with-icon .input-icon { 
  width: 18px;
  height: 18px;
}

/* per-field inline error */
.field-error { 
  color: #ff6b6b;
  font-size: 0.8rem;
  margin-top: 4px;
  min-height: 18px;
  line-height: 1.3;
  font-weight: 500;
}

.input-error { 
  border-color: rgba(255,107,107,0.5) !important;
  background: rgba(255,107,107,0.03) !important;
  box-shadow: 
    inset 0 1px 2px rgba(255,107,107,0.05),
    0 0 0 3px rgba(255,107,107,0.06) !important;
}

/* Tabs & toggles — Stripe style */
.modal__tabs { 
  display: flex;
  margin-top: 8px;
}

.modal__tabs button {
  text-transform: uppercase;
}

.auth-tab { 
  padding: 10px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  font-size: 0.9rem;
  transition: all .16s cubic-bezier(.34,.1,.68,.1);
  text-transform: capitalize;
}

.auth-tab:nth-child(1) { 
  border-radius: 8px 0 0 8px;
}

.auth-tab:nth-child(2) { 
  border-radius: 0 8px 8px 0;
}

.auth-tab:hover:not(.auth-tab--active) {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color: rgba(255,255,255,0.7);
}

.auth-tab--active { 
  background: rgba(99,102,241,0.15);
  color: var(--text);
  border-color: rgba(99,102,241,0.3);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.2);
}

.auth-tab-panel { margin-top: 16px; }

/* toggle group container */
.auth-toggle-group {
  display: flex;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 4px;
  gap: 0;
}

/* toggle option buttons */
.auth-toggle-option {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .16s cubic-bezier(.34,.1,.68,.1);
  color: rgba(255,255,255,0.6);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: capitalize;
}

.auth-toggle-option:hover:not(.auth-toggle-option--active) {
  color: rgba(255,255,255,0.75);
}

.auth-toggle-option--active {
  background: rgba(99,102,241,0.12);
  border-color: rgba(99,102,241,0.25);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.15);
}

/* status messages */
#authModal #authLoginMessage, 
#authModal #authRegisterMessage { 
  min-height: 18px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  margin-top: 8px;
  line-height: 1.4;
}

.auth-note { 
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  margin-top: 8px;
}

@media (max-width: 520px) {
  .modal__dialog { 
    padding: 24px;
    border-radius: 16px;
    max-width: 440px;
  }
  .modal__header { margin-bottom: 20px; }
  #authModal .btn { 
    width: 100%;
    padding: 12px 20px;
  }
}

.withdraw-methods {
  display: flex;
}

.withdraw-method-option {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.03);
  text-transform:uppercase;
}

.withdraw-method-option:nth-child(1) {
  border-radius: 8px 0 0 8px;
}

.withdraw-method-option:nth-child(2) {
  border-radius: 0 8px 8px 0;
}

.withdraw-method-option.selected {
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color: #fff;
  cursor: default; /* show selected/locked appearance */
}

/* Dim non-selected siblings to give a "disabled" contrast */
.withdraw-methods .withdraw-method-option:not(.selected) {
  opacity: 0.55;
  filter: grayscale(0.12);
}


.method-icon { font-size: 20px; }
.method-label { font-weight: 700; font-size: 0.95rem; }

/* E‑wallet provider options (GCASH / ShopeePay) */
.ewallet-options {
  display: flex;
  gap: 4px;
}

.ewallet-option {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.04);
  font-weight: 800;
  color: #fff; /* text should be white */
}

.ewallet-option .ewallet-icon { font-size: 18px; }
.ewallet-option .ewallet-label { font-size: 0.95rem; }

/* Bank options (populated dynamically) */
.bank-options {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.bank-option {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.04);
  min-width: 150px;
}

.bank-option__logo,
.ewallet-option__logo {
  width: 28px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(255,255,255,0.02);
}

.bank-option__name { font-weight: 700; font-size: 0.9rem; color: var(--text); }

.bank-option.selected {
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color: #fff;
  cursor: default;
}

.bank-options .bank-option:not(.selected) { opacity: 0.6; filter: grayscale(0.08); }
/* Provider brand colors */
.ewallet-option[data-ewallet="gcash"] {
  background: #0984ff;
  border-color: rgba(9,132,255,0.18);
  color: #fff;
}
.ewallet-option[data-ewallet="gcash"]:hover { filter: brightness(0.95); }

.ewallet-option[data-ewallet="shopee"] {
  background: #e37411;
  border-color: rgba(227,116,17,0.18);
  color: #fff;
}
.ewallet-option[data-ewallet="shopee"]:hover { filter: brightness(0.95); }

.ewallet-option.selected {
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color: #fff;
  cursor: default;
}

/* Dim non-selected providers to emphasize the selected one */
.ewallet-options .ewallet-option:not(.selected) {
  opacity: 0.6;
  filter: grayscale(0.12);
}

@media (max-width: 640px) {
  .modal__dialog { padding: 14px; }
  /* basic fallback if somewhere else uses modal-chip */
/* nothing extra, cashIn/cashOut/topUp override above */
.modal-chip { padding: 6px 10px; }

  .p2p-manual-row {
    grid-template-columns: 1fr;
  }
}

/* Flashy Winner Notification */
.winner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  animation: overlayFadeIn 0.3s ease forwards;
}

@keyframes overlayFadeIn {
  to { opacity: 1; }
}

@keyframes overlayFadeOut {
  to { opacity: 0; }
}

.winner-card {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  border: 3px solid var(--accent-yellow);
  border-radius: 16px;
  padding: 48px 64px;
  text-align: center;
  box-shadow: 0 0 60px rgba(245, 208, 32, 0.4), 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  max-width: 600px;
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: scale(0.3) rotateZ(-10deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateZ(0);
  }
}

.winner-card__title {
  font-size: 2.5rem;
  font-weight: 900;
  text-transform: uppercase;
  margin: 0 0 16px 0;
  color: var(--accent-yellow);
  text-shadow: 0 0 20px rgba(245, 208, 32, 0.6);
  letter-spacing: 0.1em;
  animation: pulse-glow 1.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    text-shadow: 0 0 20px rgba(245, 208, 32, 0.6);
  }
  50% {
    text-shadow: 0 0 40px rgba(245, 208, 32, 1);
  }
}

.winner-card__subtitle {
  font-size: 1.3rem;
  color: #a0a0a0;
  margin-bottom: 24px;
  font-weight: 500;
}

.winner-card__winner {
  font-size: 4rem;
  font-weight: 900;
  margin: 16px 0 24px 0;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 16px 32px;
  border-radius: 12px;
  animation: scale-pulse 1s ease-in-out infinite;
}

@keyframes scale-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.winner-card__winner--meron {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  box-shadow: 0 0 30px rgba(220, 38, 38, 0.6);
}

.winner-card__winner--wala {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  box-shadow: 0 0 30px rgba(37, 99, 235, 0.6);
}

.winner-card__winner--draw {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.6);
}

.winner-card__starfield {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  overflow: hidden;
}

.winner-card__star {
  position: absolute;
  background: var(--accent-yellow);
  border-radius: 50%;
  animation: twinkle 0.8s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.winner-card__confetti {
  position: absolute;
  pointer-events: none;
}

.winner-card__confetti-piece {
  position: fixed;
  pointer-events: none;
  animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translateY(100vh) rotateZ(720deg);
    opacity: 0;
  }
}

@media (max-width: 640px) {
  .notification {
    right: 12px;
    left: 12px;
    min-width: auto;
  }

  .winner-card {
    padding: 32px 24px;
    margin: 16px;
    border-width: 2px;
  }

  .winner-card__title {
    font-size: 1.8rem;
  }

  .winner-card__winner {
    font-size: 2.5rem;
  }
}

.bead-plate-road__cell--meron {
  background: var(--meron-red);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.bead-plate-road__cell--wala {
  background: var(--wala-blue);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.bead-plate-road__cell--draw {
  background: var(--accent-green);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.bead-plate-road__cell--cancelled {
  background: var(--cancel-gray);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   Responsive Design - Tablet (max-width: 960px)
   ========================================================================== */
@media (max-width: 960px) {
  /* Main layout - stack vertically on tablets */
  .main {
    flex-direction: column;
  }

  /* Video section adjustments */
  .video-section {
    min-height: 250px;
    max-height: 50vh;
  }

  .video-section__title {
    padding: 8px 12px;
  }

  .event-title {
    font-size: 0.75rem;
  }

  /* Bet panel - full width on tablets */
  .bet-panel {
    min-width: 100%;
    max-width: 100%;
    max-height: none;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  /* Header adjustments */
  .header {
    padding: 0 12px;
    gap: 8px;
  }

  .header__balance {
    font-size: 0.85rem;
  }

  .header__actions {
    gap: 6px;
  }

  .btn--cash-in,
  .btn--cash-out {
    font-size: 0.7rem;
    padding: 6px 10px;
  }

  /* Bet panel titles */
  .bet-panel__title {
    font-size: 1rem;
    padding: 12px 10px;
  }

  /* Bet options grid */
  .bet-options-full {
    gap: 10px;
  }

  .btn--bet-full {
    padding: 10px 8px;
    min-height: 75px;
  }

  .btn--bet-full__icon {
    width: 30px;
    height: 30px;
    font-size: 1.15rem;
  }

  .btn--bet-full__text {
    font-size: 0.72rem;
  }

  /* Totals */
  .totals-single__item {
    font-size: 1.4rem;
  }

  /* Bet input section */
  .bet-input-section-new__input {
    font-size: 1rem;
  }

  /* Bead plate section */
  .bead-plate-section {
    gap: 10px;
  }

  .bead-plate-section__title {
    font-size: 0.85rem;
    padding: 8px 10px;
  }

  .bead-plate-stats {
    gap: 8px;
  }

  .bead-plate-stat__circle {
    width: 40px;
    height: 40px;
    font-size: 0.85rem;
  }

  .bead-plate-stat__label {
    font-size: 0.65rem;
  }

  /* Notification adjustments */
  .notification {
    right: 16px;
    left: 16px;
    min-width: auto;
  }
}
