/* NoBall Components */

/* =========================================
   Buttons
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-family: inherit;
  font-size: var(--font-size-body);
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

.btn-primary {
  background-color: var(--color-accent-primary);
  color: var(--color-bg-base);
}

.btn-primary:hover {
  background-color: var(--color-accent-primary-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text-high);
  border: 1px solid var(--color-bg-elevated);
}

.btn-secondary:hover {
  background-color: var(--color-bg-elevated);
}

/* Odds Button (Crucial for Betting) */
.btn-odds {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background-color: var(--color-bg-elevated);
  border-radius: var(--radius-sm);
  min-width: 60px;
  border: 1px solid transparent;
}

.btn-odds .price {
  font-size: var(--font-size-body);
  font-weight: 700;
  color: var(--color-text-high);
  font-variant-numeric: tabular-nums;
}

.btn-odds .size {
  font-size: 10px;
  color: var(--color-text-muted);
}

.btn-odds:hover {
  background-color: var(--color-bg-card);
  border-color: var(--color-accent-primary);
}

/* Exchange Odds */
.btn-odds.back {
  background-color: var(--color-odds-back-bg);
}

.btn-odds.back .price,
.btn-odds.back .size {
  color: var(--color-odds-back-text);
}

.btn-odds.lay {
  background-color: var(--color-odds-lay-bg);
}

.btn-odds.lay .price,
.btn-odds.lay .size {
  color: var(--color-odds-lay-text);
}

/* Flashing states */
.flash-up {
  animation: flashGreen 0.6s ease-out;
}

.flash-down {
  animation: flashRed 0.6s ease-out;
}

@keyframes flashGreen {
  0% {
    background-color: var(--color-success);
  }

  100% {
    background-color: inherit;
  }
}

@keyframes flashRed {
  0% {
    background-color: var(--color-danger);
  }

  100% {
    background-color: inherit;
  }
}

/* =========================================
   Cards
   ========================================= */
.card {
  background-color: var(--color-bg-card);
  border-radius: var(--radius-md);
  padding: var(--space-2);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Match Card Specifics */
.match-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-bg-elevated);
  padding-bottom: var(--space-1);
}

.match-status {
  color: var(--color-accent-secondary);
  font-size: var(--font-size-caption);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.match-status::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  background-color: var(--color-accent-secondary);
  border-radius: 50%;
}

.teams-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-name {
  font-weight: 500;
}

.odds-container {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

/* =========================================
   Inputs & Forms
   ========================================= */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: var(--space-2);
}

.input-label {
  font-size: var(--font-size-caption);
  color: var(--color-text-muted);
}

.input-field {
  background-color: var(--color-bg-base);
  border: 1px solid var(--color-bg-elevated);
  color: var(--color-text-high);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: var(--font-size-body);
  transition: border-color 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: var(--color-accent-primary);
  box-shadow: 0 0 0 1px var(--color-accent-primary);
}

/* =========================================
   Casino Tile
   ========================================= */
.casino-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background-color: var(--color-bg-card);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.casino-tile img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  flex: 0 0 auto;
  display: block;
  transition: transform 0.3s ease;
}

.casino-tile:hover img {
  transform: scale(1.04);
}

.casino-tile-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-2);
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0) 100%);
}

.casino-tile-title {
  font-weight: 600;
  font-size: var(--font-size-body);
}

/* =========================================
   Layout Utilities
   ========================================= */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-2);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-2);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-2);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.gap-2 {
  gap: var(--space-2);
}

.mt-4 {
  margin-top: var(--space-4);
}

.mb-2 {
  margin-bottom: var(--space-2);
}

/* =========================================
   Category Filter Pills (Casino)
   ========================================= */
.category-pills-wrapper {
  overflow-x: auto;
  padding: var(--space-2);
  scrollbar-width: thin;
  scrollbar-color: var(--color-accent-primary) var(--color-bg-card);
  -ms-overflow-style: none;
  background-color: var(--color-bg-base);
  border-bottom: 1px solid var(--color-bg-elevated);
}

.category-pills-wrapper::-webkit-scrollbar {
  height: 4px;
}

.category-pills-wrapper::-webkit-scrollbar-track {
  background: var(--color-bg-card);
}

.category-pills-wrapper::-webkit-scrollbar-thumb {
  background: var(--color-accent-primary);
  border-radius: 4px;
}

.category-pills {
  display: flex;
  gap: var(--space-1);
}

.pill {
  white-space: nowrap;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: var(--font-size-body);
  font-weight: 500;
  color: var(--color-text-muted);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.pill:hover,
.pill.active {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--color-accent-primary);
  border-color: var(--color-accent-primary);
}

/* =========================================
   Recent Winners Ticker
   ========================================= */
.winners-ticker {
  background-color: rgba(245, 158, 11, 0.1);
  /* Amber tint */
  color: var(--color-accent-secondary);
  padding: 8px var(--space-2);
  font-size: var(--font-size-caption);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.winners-ticker-content {
  display: inline-block;
  animation: ticker 20s linear infinite;
}

@keyframes ticker {
  0% {
    transform: translateX(100%);
  }

  100% {
    transform: translateX(-100%);
  }
}

/* =========================================
   Exchange specific components
   ========================================= */
.scoreboard {
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg-base) 100%);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.scoreboard .score {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-accent-secondary);
  line-height: 1.2;
}

.market-group {
  background-color: var(--color-bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.market-header {
  background-color: var(--color-bg-elevated);
  padding: 12px 16px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.market-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.market-selection {
  font-weight: 500;
}

/* =========================================
   Wallet / Deposit specific components
   ========================================= */
.wallet-card {
  background: linear-gradient(135deg, var(--color-bg-elevated) 0%, var(--color-bg-card) 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border: 1px solid var(--color-accent-primary);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.wallet-balance {
  font-size: 42px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.payment-method {
  background: var(--color-bg-card);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.payment-method:hover,
.payment-method.active {
  border-color: var(--color-accent-primary);
  background: rgba(16, 185, 129, 0.05);
}

.payment-method img {
  width: 64px;
  height: 36px;
  margin-bottom: var(--space-2);
  object-fit: contain;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.amount-btn {
  background: var(--color-bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  color: var(--color-text-primary);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.amount-btn:hover {
  background: var(--color-accent-primary);
  color: var(--color-bg-base);
  border-color: var(--color-accent-primary);
}

/* Accessible interaction floor. These controls already use flex/grid layouts,
   so the four-pixel increase does not change NoBall's information architecture. */
button:not(.nb-rea-activity-day),
[role='button'],
a[href],
select,
input:not([type='hidden']):not([type='checkbox']):not([type='radio']) {
  min-width: 44px !important;
  min-height: 44px !important;
}

.nb-rea-activity-day {
  min-width: 0 !important;
  min-height: 40px !important;
}

/* Loading, error and default-media states (dynamic-responsive pass). */
.nb-loading {
  position: relative;
  min-height: 44px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: nb-shimmer 1.6s ease-in-out infinite;
}

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

  100% {
    background-position: 200% 0;
  }
}

.nb-loading[data-state="error"] {
  animation: none;
  background: none;
}

.nb-load-error {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 16px;
  border: 1px solid var(--color-border, rgba(255, 255, 255, 0.16));
  border-radius: 8px;
}

.nb-load-error p {
  margin: 0;
  color: var(--color-text-muted);
}

.nb-load-error__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nb-load-error__actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  text-decoration: none;
}

.core-game-visual,
.nb-default-tile {
  background-position: center;
  background-size: cover;
}

.nb-empty-art {
  display: block;
  width: min(160px, 50vw);
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 8px auto;
  object-fit: contain;
}

.nb-promo-icon svg {
  width: 28px;
  height: 28px;
  display: block;
}

.nb-event-crest {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 auto;
}

.nb-promo-art {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .nb-loading {
    animation: none;
  }

  .casino-tile,
  .casino-tile img,
  .btn {
    transition: none !important;
  }
}

.feed-row[data-state="loading"]:empty::before {
  content: '';
  min-width: min(300px, 85vw);
  height: 96px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: nb-shimmer 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .feed-row[data-state="loading"]:empty::before {
    animation: none;
  }
}

.feed-row:has(> .nb-empty-art),
.feed-row:has(> .nb-load-error) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px;
  margin-inline: var(--space-2);
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-md);
  background: rgba(18, 26, 41, 0.55);
  overflow-x: visible;
  text-align: center;
}

.feed-row:has(> .nb-empty-art)>.core-status {
  margin: 0;
  background: transparent;
  border: 0;
  color: var(--color-text-muted);
}

.casino-grid>.nb-empty-art,
.casino-grid>.core-status {
  grid-column: 1 / -1;
  justify-self: center;
  text-align: center;
}

.casino-grid[data-state="loading"]:empty::before {
  content: '';
  grid-column: 1 / -1;
  min-height: 160px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: nb-shimmer 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .casino-grid[data-state="loading"]:empty::before {
    animation: none;
  }
}