/* Language Switcher - Professional & Clean */

.language-switcher {
  position: relative;
  display: inline-block;
}

.lang-current-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  padding: 4px 6px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: 'Proxima Nova', sans-serif;
}

.lang-current-btn:hover {
  opacity: 0.8;
}

.lang-flag-img {
  width: 18px;
  height: 13px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

.lang-code {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}


.lang-flag-img-dropdown {
  width: 18px;
  height: 13px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

/* Dropdown */
.lang-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-tertiary);
  border: 1px solid var(--white-12);
  border-radius: 8px;
  box-shadow: 0 4px 20px var(--black-50);
  min-width: 130px;
  overflow: hidden;
  z-index: 1000;
  animation: langDropdownFadeIn 0.15s ease-out;
}

@keyframes langDropdownFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  font-family: 'Proxima Nova', sans-serif;
  text-align: left;
}

.lang-option:hover {
  background: var(--white-10);
}

.lang-option:not(:last-child) {
  border-bottom: 1px solid var(--white-8);
}

.lang-name {
  font-size: 13px;
  color: var(--white-90);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .lang-current-btn {
    padding: 3px 4px;
    gap: 3px;
  }

  .lang-flag-img {
    width: 16px;
    height: 12px;
  }

  .lang-code {
    display: none; /* Hide code on mobile, just show flag */
  }

  .lang-dropdown {
    min-width: 120px;
  }

  .lang-flag-img-dropdown {
    width: 16px;
    height: 12px;
  }
}

/* Dark theme compatibility */
@media (prefers-color-scheme: dark) {
  .lang-dropdown {
    background: var(--bg-elevated);
    border-color: var(--white-15);
  }
}

/* Wrapper для Landing Page */
.landing-page-wrapper {
  display: flex;
  flex-direction: column;
  /* min-height убран - не нужен лишний скролл когда мало контента */
  background-color: var(--bg-primary);
}

.landing-page-wrapper .lp-page {
  flex-grow: 1;
}

.lp-bets-page {
  color: #ced4db;
  font-family: 'Proxima Nova', sans-serif;
  padding: 10px;
}

/* .lp-country-flag moved to LivePage.css */

/* League group container for proper sticky behavior */
.lp-league-group {
  /* Container for each league - allows sticky headers to push each other */
}

/* LandingUpcomingPage specific top values */
.landing-page-wrapper .lp-league-header {
  top: 66px;
}

@media (max-width: 768px) {
  .landing-page-wrapper .lp-league-header {
    top: 102px;
  }
}


.lp-header {
  display: flex;
  flex-direction: column;
  padding: 10px 15px;
  position: sticky;
  top: 36px;
  z-index: 999;
  background-color: #000;
  transition: padding 0.2s ease, gap 0.2s ease;
  will-change: transform;
  transform: translateZ(0);
  border-bottom: 1px solid #171717;
}

.morebets-load-more-button {
  border: none;
  border-radius: 4px;
  font-family: Proxima Nova Cond,sans-serif;
  background-color: #1e62d0;
  font-size: 14px;
  color: #fff;
  text-shadow: 0 0 1px #000;  cursor: pointer;
  font-weight: 700;
  padding: 5px 20px;
  transition: background-color .3s ease;
}

.lp-header * {
  transition: font-size 0.2s ease, color 0.2s ease, margin 0.2s ease;
}


.lp-header--compact {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 14px;
}

.lp-header--compact img {
  width: 16px !important;
  height: 16px !important;
}

.lp-header--compact .lp-league-info {
  flex-direction: row;
  align-items: end;
  gap: 6px;
}

.lp-header--compact .lp-sport-name {
  font-size: 14px;
}

.lp-header--compact .lp-league-name {
  font-size: 14px;
  color: #a0a0a5;
}

.lp-fixture-time {
  text-align: start;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lp-fixture-star {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease;
  margin-right: 7px;
}

.lp-fixture-star:hover {
  transform: scale(1.15);
}

.lp-page {
  color: #E5E5EA;
  font-family: 'Proxima Nova', sans-serif;
  background-color: var(--bg-primary);
  padding-bottom: 70px; /* Space for bottom nav */
}

.lp-bets-header {
  padding-bottom: 12px;
}

.lp-bets-header h2 {
  font-size: 22px;
  margin: 0;
}

.hdp {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #3478f6;
}

.lp-fixture .value {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #E5E5EA;
}

.lp-fixture {
  background: linear-gradient(90deg, #333338 0%, #3d3d44 100%);
  border-radius: 0;
  margin: 0 0 10px 0;
  overflow: hidden;
}

/* Remove margin from fixture that is followed by a league header */
.lp-fixture:has(+ .lp-league-header) {
  margin-bottom: 0;
}

/* Also remove margin from the very last fixture */
.lp-fixture:last-child {
  margin-bottom: 0;
}

/* ========== ODDS HEADER ========== */
.lp-odds-header {
  display: grid;
  grid-gap: 0;
  gap: 0;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Proxima Nova', sans-serif;
  font-size: 9px;
  line-height: 1;
  text-align: center;
  padding: 8px 0 8px 12px;
  background: linear-gradient(to bottom, #1c1c1e, #2a2a2c);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(100, 100, 100, 0.3);
}

/* Sport-specific gradients */
.lp-odds-header[data-sport="1"] { background: linear-gradient(135deg, #1a3f1f, #28542c); }
.lp-odds-header[data-sport="2"] { background: linear-gradient(135deg, #513517, #634523); }
.lp-odds-header[data-sport="3"] { background: linear-gradient(135deg, #3e1f0d, #5a2d1a); }
.lp-odds-header[data-sport="4"] { background: linear-gradient(135deg, #3F4853, #56595C); }
.lp-odds-header[data-sport="5"] { background: linear-gradient(135deg, #1B222B, #222C37); }
.lp-odds-header[data-sport="6"] { background: linear-gradient(135deg, #0E2A5A, #1E4A82); }
.lp-odds-header[data-sport="7"] { background: linear-gradient(135deg, #512A0D, #81512D); }
.lp-odds-header[data-sport="8"] { background: linear-gradient(135deg, rgb(20, 33, 61), rgb(31, 54, 92)); }
.lp-odds-header[data-sport="9"] { background: linear-gradient(135deg, #4A0E14, #7A1E24); }
.lp-odds-header[data-sport="10"] { background: linear-gradient(135deg, rgb(50, 121, 255), rgb(14, 37, 78)); }
.lp-odds-header[data-sport="11"] { background: linear-gradient(135deg, #7F2F00, #B84E14); }
.lp-odds-header[data-sport="12"] { background: linear-gradient(135deg, #1B222B, #222C37); }
.lp-odds-header[data-sport="18"] { background: linear-gradient(135deg, #1a3f1f, #28542c); }
.lp-odds-header[data-sport="19"] { background: linear-gradient(135deg, #0E2A5A, #1E4A82); }
.lp-odds-header[data-sport="23"] { background: linear-gradient(135deg, #7F2F00, #B84E14); }
.lp-odds-header[data-sport="29"] { background: linear-gradient(135deg, #1a3f1f, #28542c); }

.lp-odds-header.layout-3 {
  grid-template-columns: 3fr 1fr 1fr 1fr;
}

.lp-odds-header.layout-2 {
  grid-template-columns: 3fr 1fr 1fr;
}

.lp-odds-header.layout-1 {
  grid-template-columns: 1fr 1fr;
}

/* ========== ODDS ROWS ========== */
.lp-odds-row {
  display: grid;
  grid-gap: 0;
  gap: 0;
  min-height: 40px;
  align-items: center;
  padding: 0 0 0 10px;
  background: linear-gradient(90deg, #333338 0%, #3d3d44 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
}

.lp-odds-row:last-of-type {
  border-bottom: none;
}

.lp-odds-row.layout-3 {
  grid-template-columns: 3fr 1fr 1fr 1fr;
}

.lp-odds-row.layout-2 {
  grid-template-columns: 3fr 1fr 1fr;
}

.lp-odds-row.layout-1 {
  grid-template-columns: 4fr 1fr;
}

.lp-team-name {
  flex-grow: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  display: inline-block;
  color: #e5e5ea;
  font-family: 'Proxima Nova', sans-serif;
  font-size: 13px;
  font-weight: 600;
  max-width: 100%;
}

/* ========== FIXTURE FOOTER ========== */
.lp-fixture-footer {
  color: var(--text-secondary);
  display: flex;
  font-family: 'Proxima Nova', sans-serif;
  font-size: 11px;
  justify-content: space-between;
  align-items: center;
  padding: 6px 14px;
  background: linear-gradient(90deg, #333338 0%, #3d3d44 100%);
}

.lp-more-bets {
  font-family: Proxima Nova Cond,sans-serif;
  background-color: #3478f62e;
  border: 0 solid #3478f626;
  border-radius: 2px;
  color: #73a4ff;
  font-weight: 500;
  padding: 1px 7px;
  width: fit-content;
  cursor: pointer;
}

.lp-more-bets:hover {
  color: #a5c4fc;
}

.lp-skeleton-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}



@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}



.lp-league-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.lp-sport-name {
  font-weight: bold;
  color: #E5E5EA;
  font-family: 'Proxima Nova', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
}

.lp-league-name {
  font-size: 14px;
  font-family: 'Proxima Nova Cond', sans-serif;
  color: #a0a0a5;
}

.odds-title {
  color: #d7e2f7;
  font-family: Proxima Nova,sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}



.lp-no-odds-grid-inner {
  display: contents; /* Используется для сохранения структуры grid, но без обёртки */
}

.lp-no-odds-teams {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.lp-no-odds-teams .lp-team-name {
  text-align: left;
  font-weight: 600;
  color: #E5E5EA;
  font-size: 15px;
}

.lp-no-odds-button {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lp-no-odds-button .lp-bet-button {
  width: 100%;
  height: 64px;
  font-size: 16px;
  font-weight: 600;
  background-color: transparent;
  border: 2px solid #3478f6;
  border-radius: 8px;
  color: #FFFFFF;
}


.lp-no-odds-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
}

.lp-fixture-footer-line {
  flex-grow: 1;
  height: 1px;
  background-color: #444;
  margin-right: 12px;
}

.lp-footer-line-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-top: 6px;
}

.lp-no-odds-grid {
  grid-gap: 8px;
  align-items: center;
  display: grid;
  gap: 8px;
  margin: 15px 0;
  grid-template-columns: 2fr 1fr;
}

.lp-no-odds-grid .lp-team-names {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 25px;
}

.lp-no-odds-grid .lp-big-button {
  background-color: #2c2c2e;
  border: 1px solid #3a3a3c;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  height: 100%;
  text-align: center;
}

.lp-no-odds-grid .lp-big-button:hover {
  background-color: #444;
}

/* ========== BET BUTTONS - Flat design ========== */
.lp-bet-button {
  align-items: center;
  font-family: 'Proxima Nova', sans-serif;
  background: rgba(56, 56, 61, 1);
  border: none;
  border-radius: 0;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  font-weight: 700;
  height: 38px;
  line-height: 13px;
  justify-content: center;
  min-height: 38px;
  padding: 0;
  text-align: center;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
  transition: background 0.15s ease;
}

/* Hover - desktop only */
@media (min-width: 1024px) {
  .lp-bet-button:hover {
    background: rgba(75, 75, 82, 1);
  }

  .lp-bet-button.active:hover {
    background: rgba(100, 100, 110, 1);
  }
}

.lp-bet-button.active {
  background: rgba(90, 90, 100, 1);
  border: none;
  min-height: 38px;
  height: 38px;
}

.lp-bet-button.active .hdp,
.lp-bet-button.active .value {
  color: var(--text-secondary);
}

/* Handicap label - blue */
.hdp {
  color: #60a5fa;
  font-size: 11px;
  font-weight: 600;
  font-family: 'Proxima Nova', sans-serif;
}

/* Odds value - white */
.lp-fixture .value {
  font-family: 'Proxima Nova', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
}

.lp-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(50% + 6px);   /* на 3px в каждую сторону */
  height: calc(50% + 6px);  /* по вертикали тоже чуть больше */
  background: rgba(255, 255, 255, 0.198);
  opacity: 0.9;
  border-radius: 4px;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  animation: ripple 300ms ease-out;
  z-index: 1000;
}

@keyframes ripple {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.4;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0;
  }
}

.currently-suspended {
  display: flex;
  align-items: end;
  font-weight: 500;
  color: #7c7c7c; /* можешь поменять */
  font-size: 14px; /* подгони под стиль */
  margin-top: 4px; /* если надо чуть отступить от кнопок */
}

.lock-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
}

.lock-icon svg {
  width: 16px;
  height: 16px;
  fill: #aaa; /* цвет замка */
}

.lock-text {
  display: flex;
  align-items: center;
}

/* ============================================
   FLASH АНИМАЦИИ - Подсветка коэффициента
   ============================================ */

/* Анимация роста (зеленый) */
.lp-bet-button.flash-up,
.lp-bet-button.active.flash-up {
  animation: glowGreen 1.5s ease-out forwards;
}

/* Анимация падения (красный) */
.lp-bet-button.flash-down,
.lp-bet-button.active.flash-down {
  animation: glowRed 1.5s ease-out forwards;
}

/* Подсветка зеленым (рост) */
@keyframes glowGreen {
  0%, 50% {
    color: #22c55e;
    font-weight: 700;
  }
  100% {
    color: #E5E5EA;
    font-weight: 600;
  }
}

/* Подсветка красным (падение) */
@keyframes glowRed {
  0%, 50% {
    color: #ef4444;
    font-weight: 700;
  }
  100% {
    color: #E5E5EA;
    font-weight: 600;
  }
}


.lp-team {
  display: flex;
  align-items: center;
  min-width: 0;
  margin-right: 5px;
  overflow: hidden;
}

.lp-team-icon-and-name {
  display: flex;
  width: 100%;
  align-items: center;
  position: relative;
  gap: 10px;
  min-width: 0;
}

/* Two-line layout for Tennis/MMA with participant info */
.lp-team-icon-and-name.has-participant-info {
  align-items: center;
}

.lp-team-icon-and-name.has-participant-info .lp-team-name-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
  flex: 1 1;
}

.lp-team-icon-and-name.has-participant-info .lp-team-name {
  line-height: 1.3;
}

.lp-team-icon-and-name.has-participant-info .participant-info {
  margin-top: 0;
}

/* Default: name column takes remaining space */
.lp-team-name-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1;
  overflow: hidden;
}

.lp-icon-reversed-home::after {
  bottom: -19px;
  color: #f09b51;
  font-family: sans-serif;
  content: "@";
  font-size: 12px;
  font-weight: bold;
  left: 3px;
  pointer-events: none;
  position: absolute;
}

.lp-team-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 1px;
}

.lp-team-icon img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  background-size: contain;
  display: block;
}

.lp-placeholder-team {
  align-items: center;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  grid-gap: 5px;
  justify-content: space-between;
  min-width: 160px;
}

.lp-placeholder-main {
  font-weight: bold;
  color: rgb(196, 205, 210);
}

.lp-placeholder-sub {
  background-color: #3478f621;
  border: 1px solid #3478f67d;
  border-radius: 10px;
  color: #3478f6;
  font-size: 10px;
  font-weight: 700;
  padding: 0 7px;
  width: fit-content;
}

.lp-team-icon-and-name {
  width: 100%;
}

/* .lp-league-header moved to LivePage.css */
/* Удалено: старый код который блокировал изменение цвета */


.lp-fixture-tag {
  background-color: #1e3a8a;
  border: 1px solid #3478f67d;
  border-radius: 2px;
  color: #fff;
  font-size: 11px;
  margin-left: 6px;
  padding: 0 4px;
  text-transform: uppercase;
}

.lp-fixture-tag--gameorder {
  background-color: #8a1e1e;
  border: 1px solid #a82b2bba;
  border-radius: 2px;
  color: #fff;
  font-size: 11px;
  margin-left: 6px;
  padding: 0 4px;
  text-transform: uppercase;
}

.lp-fixture-clock {
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 0 5px;
  text-transform: uppercase;
}

.lp-fixture-clock, .lp-fixture-clock-date {
  color: rgb(255, 255, 255);
  font-size: 11px;
  padding: 0 5px;
  text-transform: uppercase;
}

.lp-fixture-clock-date {
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 0 5px;
  text-transform: uppercase;
}
/* ========== DESKTOP STYLES ========== */
@media (min-width: 1024px) {
  .lp-fixture {
    border-radius: 8px;
  }
}
/* Keno Game Styles */

.keno-game {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
  color: #fff;
  padding: 10px;
  height: 100%;
  max-height: 100%;
  width: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

/* Desktop - limit width */
@media (min-width: 768px) {
  .keno-game {
    max-width: 500px;
    margin: 0 auto;
  }
}

.keno-game.fullscreen-mode {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  z-index: 9999;
  padding: 16px;
  height: 100vh;
  height: 100dvh;
}

/* Header */
.keno-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.keno-header-left,
.keno-header-right {
  display: flex;
  gap: 4px;
}

.keno-icon-btn {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  padding: 0;
  color: #fff;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.keno-icon-btn svg {
  width: 18px;
  height: 18px;
}

.keno-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.keno-icon-btn.close-btn {
  color: #ff6b6b;
}

.keno-icon-btn.close-btn:hover {
  background: rgba(255, 100, 100, 0.2);
}

/* Hide fullscreen toggle on mobile */
.keno-icon-btn.fullscreen-toggle {
  display: none;
}

@media (min-width: 768px) {
  .keno-icon-btn.fullscreen-toggle {
    display: flex;
  }
}

.keno-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 0px 10px;
  border-radius: 6px;
  font-weight: 600;
  min-width: 80px;
  height: 30px;
  transition: all 0.4s ease, width 0.4s ease, min-width 0.4s ease, background 0.4s ease;
}

.keno-timer.drawing {
  background: rgba(0, 50, 100, 0.6);
  min-width: 150px;
  width: 150px;
}

.keno-timer.winner {
  background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
  min-width: 80px;
  animation: winnerPulse 0.5s ease-out;
}

@keyframes winnerPulse {
  0% { transform: scale(0.95); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.timer-icon {
  display: flex;
  align-items: center;
  margin-right: 4px;
}

.timer-icon svg {
  width: 14px;
  height: 14px;
}

.timer-value {
  font-size: 13px;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

.timer-value.urgent {
  color: #ff4444;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Timer balls during draw */
.timer-balls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 6px;
}

.timer-balls-list {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1;
}

.timer-ball {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* White 3D ball effect */
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #e8e8e8 40%, #c0c0c0 70%, #a0a0a0 100%);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  color: #333;
  animation: ballAppear 0.5s ease-out;
  flex-shrink: 0;
}

/* Newest ball - gold (first because list is reversed) */
.timer-ball:first-child {
  background: radial-gradient(circle at 30% 30%, #fff9c4 0%, #ffd700 40%, #ff8c00 80%, #e65100 100%);
  color: #000;
}

@keyframes ballAppear {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.timer-ball-count {
  font-size: 11px;
  color: #fff;
  opacity: 0.9;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 32px;
  text-align: right;
}

/* Timer win display */
.timer-win-label {
  font-size: 11px;
  font-weight: 700;
  color: #000;
  text-transform: uppercase;
}

.timer-win-amount {
  font-size: 16px;
  font-weight: 700;
  color: #000;
}

.keno-header-right {
  display: flex;
  gap: 8px;
}

/* Old win display - removed, now using timer area */

/* Number Grid */
.keno-grid-container {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 6px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.keno-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-gap: 3px;
  gap: 3px;
}

.keno-number {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a2a3e;
  border: 1px solid #3a3a4e;
  border-radius: 6px;
  color: #888;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-user-select: none;
          user-select: none;
  max-width: 38px;
  max-height: 38px;
}

@media (min-width: 400px) {
  .keno-number {
    font-size: 12px;
  }
}

.keno-number:hover:not(:disabled) {
  background: #3a3a4e;
  border-color: #4a4a5e;
}

.keno-number.selected {
  background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%) !important;
  border-color: #ffd700 !important;
  color: #000 !important;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.keno-number.in-card:not(.selected) {
  background: #4a4a6e;
  border-color: #6a6a8e;
  color: #fff;
}

.keno-number.drawn {
  background: #8b0000;
  border-color: #aa0000;
  color: #fff;
}

.keno-number.match {
  background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%) !important;
  border-color: #ffd700 !important;
  color: #000 !important;
  font-weight: 700 !important;
  animation: matchPop 0.3s ease-out;
}

@keyframes matchPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.keno-number.just-drawn {
  animation: ballDrop 0.25s ease-out;
}

@keyframes ballDrop {
  0% { transform: scale(0) translateY(-20px); opacity: 0; }
  60% { transform: scale(1.1) translateY(0); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.keno-number:disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

/* Quick Pick Row - scrollable numbers + fixed buttons */
.keno-quickpick-row {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  flex-shrink: 0;
  align-items: center;
}

.quickpick-numbers {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  flex: 1 1;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.quickpick-numbers::-webkit-scrollbar {
  display: none;
}

.quickpick-btn {
  min-width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a2a3e;
  border: 1px solid #3a3a4e;
  border-radius: 5px;
  color: #888;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.quickpick-fixed-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.shuffle-btn,
.clear-btn {
  width: 32px;
  height: 26px;
  min-width: 32px;
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
  box-sizing: border-box;
}

.shuffle-btn {
  background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
  color: #000;
}

.clear-btn {
  background: rgba(255, 100, 100, 0.2);
  color: #ff6b6b;
}

.shuffle-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.clear-btn:hover:not(:disabled) {
  background: rgba(255, 100, 100, 0.3);
}

.shuffle-btn:disabled,
.clear-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.quickpick-btn:hover:not(:disabled) {
  background: #3a3a4e;
  border-color: #4a4a5e;
  color: #fff;
}

.quickpick-btn.active {
  background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
  border-color: #ffd700;
  color: #000;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

/* Highlight when manually selected count matches this number */
.quickpick-btn.selected-count:not(.active) {
  background: rgba(0, 200, 83, 0.25);
  border-color: #00c853;
  color: #00c853;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(0, 200, 83, 0.5);
}

.quickpick-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Bet Row */
.keno-bet-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-shrink: 0;
  padding-top: 4px;
}

.bet-selector {
  flex: 1 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.bet-selector:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.bet-selector:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bet-selector .bet-label {
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
}

.bet-selector .bet-value {
  font-size: 14px;
  font-weight: 700;
  color: #ffd700;
}

.add-card-btn {
  flex: 2 1;
  background: linear-gradient(135deg, #00aa00 0%, #008800 100%);
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.add-card-btn:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: scale(1.02);
}

.add-card-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Cards Section */
.keno-cards-section {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 6px;
  flex: 1 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cards-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.cards-total {
  color: #ffd700;
}

.cards-list {
  flex: 1 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.no-cards {
  text-align: center;
  color: #666;
  padding: 20px;
  font-size: 13px;
}

.keno-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 5px 8px;
  margin-bottom: 4px;
  min-height: 28px;
  gap: 8px;
}

.keno-card.won {
  border-color: #00aa00;
  background: rgba(0, 170, 0, 0.1);
}

.keno-card.lost {
  border-color: #aa0000;
  background: rgba(170, 0, 0, 0.1);
  opacity: 0.7;
}

.card-info {
  display: flex;
  align-items: center;
  flex: 1 1;
  min-width: 0;
  line-height: 1;
}

.card-numbers {
  font-size: 11px;
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
}

.card-numbers .number-match {
  color: #ffd700;
  font-weight: 700;
}

.card-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.card-matches {
  font-size: 11px;
  color: #888;
  min-width: 28px;
  text-align: center;
}

.card-win {
  font-size: 12px;
  font-weight: 700;
  color: #00ff00;
}

.card-bet {
  font-size: 11px;
  font-weight: 600;
  color: #ffd700;
  min-width: 36px;
  text-align: right;
}

.remove-card-btn {
  background: none;
  border: none;
  padding: 0;
  color: #ff6666;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.remove-card-btn:hover {
  color: #ff4444;
}

/* History Popup */
.history-popup {
  max-width: 400px;
}

.history-popup-content {
  padding-top: 8px;
}

.history-popup .repeat-all-btn {
  width: 100%;
  margin-bottom: 12px;
  justify-content: center;
}

.repeat-all-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.repeat-all-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.repeat-all-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.history-list {
  max-height: 300px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.no-history {
  text-align: center;
  color: #666;
  padding: 16px;
  font-size: 13px;
}

/* History round item */
.history-round-item {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.history-round-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.history-round-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.history-round {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  flex: 1 1;
}

.history-total {
  font-size: 12px;
  color: #888;
}

.history-total.positive {
  color: #00ff00;
  font-weight: 600;
}

.repeat-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.repeat-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.repeat-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* History cards list */
.history-cards-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-card.won {
  border-color: rgba(0, 255, 0, 0.3);
  background: rgba(0, 255, 0, 0.05);
}

.history-card.lost {
  opacity: 0.7;
}

.history-card-numbers {
  font-size: 10px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1;
  min-width: 0;
}

.history-card-numbers .match {
  color: #ffd700;
  font-weight: 600;
}

.history-card-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.history-card-matches {
  font-size: 10px;
  color: #666;
  min-width: 24px;
  text-align: center;
}

.history-card-win {
  font-size: 11px;
  font-weight: 600;
  color: #00ff00;
}

.history-card-bet {
  font-size: 10px;
  color: #ffd700;
  min-width: 32px;
  text-align: right;
}

.repeat-card-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 4px;
  padding: 4px 6px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.repeat-card-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.repeat-card-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Popup Overlay */
.keno-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.keno-popup {
  background: #1a1a2e;
  border-radius: 16px;
  padding: 20px;
  max-width: 350px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.popup-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.popup-close {
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.popup-close:hover {
  color: #fff;
}

/* Bet Popup */
.bet-popup {
  max-width: 380px;
}

.bet-popup .popup-title {
  margin-bottom: 16px;
}

.bet-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-gap: 6px;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.bet-option {
  background: #2a2a3e;
  border: 2px solid #3a3a4e;
  border-radius: 6px;
  padding: 8px 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.bet-option:hover {
  background: #3a3a4e;
  border-color: #4a4a5e;
}

.bet-option.active {
  background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
  border-color: #ffd700;
  color: #000;
}

/* Paytable Popup */
.paytable-popup .popup-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
}

.paytable-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.paytable-tab {
  flex: 1 1;
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a2a3e;
  border: 1px solid #3a3a4e;
  border-radius: 6px;
  color: #888;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.paytable-tab:hover {
  background: #3a3a4e;
  color: #fff;
}

.paytable-tab.active {
  background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
  border-color: #4a90d9;
  color: #fff;
}

.paytable-content h3 {
  text-align: center;
  font-size: 16px;
  margin-bottom: 12px;
  color: #ffd700;
}

.paytable-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.paytable-table th,
.paytable-table td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.paytable-table th {
  color: #888;
  font-size: 12px;
  text-transform: uppercase;
}

.paytable-table td {
  font-size: 14px;
}

.paytable-table tr.jackpot td {
  color: #ffd700;
  font-weight: 700;
  font-size: 16px;
}

.paytable-info {
  text-align: center;
  color: #666;
  font-size: 12px;
}

.paytable-info p {
  margin: 4px 0;
}


/* Scrollbar styling */
.keno-game ::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

.keno-game ::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.keno-game ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.keno-game ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Mobile optimizations */
@media (max-width: 360px) {
  .keno-game {
    padding: 6px;
  }

  .keno-number {
    font-size: 10px;
    border-radius: 4px;
  }

  .quickpick-btn {
    min-width: 22px;
    height: 26px;
    font-size: 10px;
  }

  .shuffle-btn {
    min-width: 28px;
  }

  .bet-selector .bet-value {
    font-size: 14px;
  }

  .add-card-btn {
    font-size: 13px;
    padding: 8px 12px;
  }
}

/* Fullscreen mode - limit button sizes on large screens */
.keno-game.fullscreen-mode .keno-grid-container {
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

.keno-game.fullscreen-mode .keno-number {
  max-width: 42px;
  max-height: 42px;
  font-size: 14px;
}

.keno-game.fullscreen-mode .keno-quickpick-row {
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

.keno-game.fullscreen-mode .keno-bet-row {
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

.keno-game.fullscreen-mode .keno-cards-section {
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

/* Touch devices - disable sticky hover */
@media (hover: none) {
  .keno-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .keno-icon-btn.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .keno-number:hover:not(:disabled):not(.selected):not(.in-card) {
    background: #2a2a3e;
    border-color: #3a3a4e;
  }

  .keno-number.selected:hover {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
  }

  .quickpick-btn:hover:not(:disabled):not(.active) {
    background: #2a2a3e;
    border-color: #3a3a4e;
  }

  .quickpick-btn.active:hover {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
    border-color: #ffd700;
  }

  .shuffle-btn:hover:not(:disabled),
  .add-card-btn:hover:not(:disabled),
  .repeat-all-btn:hover:not(:disabled) {
    filter: none;
    transform: none;
  }

  .bet-selector:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
  }

  .clear-btn:hover:not(:disabled) {
    background: transparent;
  }

  .repeat-btn:hover:not(:disabled),
  .repeat-card-btn:hover:not(:disabled) {
    background: transparent;
  }

  .bet-option:hover {
    background: #2a2a3e;
    border-color: #3a3a4e;
  }

  .paytable-tab:hover {
    background: transparent;
  }
}

