* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #0d0d0d;
  color: #ffffff;
  width: 380px;
  min-height: 400px;
  max-height: 600px;
  overflow-y: auto;
}

.container {
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.header {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #2a2a2a;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.logo h1 {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  flex: 1;
}

.refresh-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.refresh-btn:hover {
  color: #ffffff;
  background: #2a2a2a;
}

.refresh-btn.spinning svg {
  animation: spin 1s linear infinite;
}

.tagline {
  font-size: 13px;
  color: #9ca3af;
  margin-left: 34px;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #9ca3af;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #2a2a2a;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

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

.hidden {
  display: none !important;
}

.error, .no-markets {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: #9ca3af;
}

.error p, .no-markets p {
  margin-top: 12px;
  font-size: 14px;
}

.markets-container {
  flex: 1;
}

.markets-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.event-group {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  overflow: hidden;
}

.event-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #1f1f2e;
  border-bottom: 1px solid #2a2a2a;
  cursor: pointer;
  transition: background 0.2s;
}

.event-header:hover {
  background: #252538;
}

.event-icon {
  font-size: 14px;
}

.event-title {
  font-size: 13px;
  font-weight: 600;
  color: #a5b4fc;
  flex: 1;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-count {
  font-size: 11px;
  color: #6b7280;
  background: #2a2a4a;
  padding: 2px 8px;
  border-radius: 10px;
}

.event-markets {
  display: flex;
  flex-direction: column;
}

.event-markets .market-card {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid #2a2a2a;
}

.event-markets .market-card:last-child {
  border-bottom: none;
}

.market-row {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #2a2a2a;
  cursor: pointer;
  transition: background 0.2s;
  gap: 12px;
}

.market-row:last-child {
  border-bottom: none;
}

.market-row:hover {
  background: #252538;
}

.market-row-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-row-name.yes-option {
  color: #22c55e;
}

.market-row-name.no-option {
  color: #ef4444;
}

.market-row-odds {
  font-size: 14px;
  font-weight: 600;
  color: #9ca3af;
  min-width: 40px;
  text-align: right;
}

.market-row-bar {
  width: 60px;
  height: 6px;
  background: #ef4444;
  border-radius: 3px;
  overflow: hidden;
}

.market-row-bar-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 3px;
}

.market-row-bar.bar-inverted {
  background: #22c55e;
}

.market-row-bar.bar-inverted .market-row-bar-fill {
  background: #ef4444;
}

.market-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.market-card:hover {
  border-color: #6366f1;
  background: #1f1f1f;
}

.market-card.compact {
  padding: 12px 14px;
}

.market-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.market-card.compact .market-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  flex: 1;
  line-height: 1.3;
}

.market-volume {
  font-size: 11px;
  color: #6b7280;
  background: #2a2a2a;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.market-odds-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.market-title {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.market-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 15px;
  font-weight: 600;
}

.stat-value.yes {
  color: #22c55e;
}

.stat-value.no {
  color: #ef4444;
}

.stat-value.volume {
  color: #9ca3af;
}

.odds-bar {
  flex: 1;
  height: 6px;
  background: #ef4444;
  border-radius: 3px;
  overflow: hidden;
  margin-left: auto;
  max-width: 100px;
}

.odds-bar-fill {
  height: 100%;
  background: #22c55e;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.market-link {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #2a2a2a;
  font-size: 12px;
  color: #6366f1;
}

.market-link svg {
  width: 12px;
  height: 12px;
}

.footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #2a2a2a;
  text-align: center;
}

.footer a {
  font-size: 13px;
  color: #6366f1;
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  color: #818cf8;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4a4a4a;
}
