/* ==========================================================
   BLITZ TRACKER — Events & Game Log
   BEM naming with bt- prefix
   ========================================================== */

/* ── EVENT TYPE GRID ── */

.bt-evt-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.bt-evt-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2);
  min-height: 56px;
  background: var(--bg-elevated);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.bt-evt-type:hover {
  border-color: var(--gold-600);
  background: var(--gold-alpha-10);
}

.bt-evt-type--selected {
  border-color: var(--gold-500);
  background: var(--gold-alpha-20);
  box-shadow: 0 0 0 2px var(--gold-alpha-20);
}

.bt-evt-type__icon {
  font-size: var(--text-lg);
  line-height: 1;
}

.bt-evt-type__label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: center;
  line-height: 1.2;
}

.bt-evt-type--selected .bt-evt-type__label {
  color: var(--gold-500);
}

/* ── EVENT MODAL ── */

.bt-evt-modal__context {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
  text-align: center;
}

.bt-evt-modal__field {
  margin-bottom: var(--space-3);
}

.bt-evt-modal__row {
  display: flex;
  gap: var(--space-3);
}

.bt-evt-modal__row .bt-evt-modal__field {
  flex: 1;
  min-width: 0;
}

.bt-evt-modal__row .bt-evt-modal__field--num {
  flex: 0 0 72px;
}

/* ── GAME LOG PANEL ── */

.bt-log {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-backdrop);
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
}

.bt-log__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 48px;
}

.bt-log__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--gold-500);
  text-transform: uppercase;
}

.bt-log__close {
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-xl);
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.bt-log__close:hover {
  color: var(--text-primary);
}

/* ── LOG FILTERS ── */

.bt-log__filters {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
}

.bt-log__filter {
  height: 36px;
  padding: 0 var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23C79652'%3E%3Cpath d='M5 7L0 2h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-2) center;
  padding-right: var(--space-6);
}

/* ── LOG LIST ── */

.bt-log__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.bt-log__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bt-log__group-header {
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--gold-500);
  background: var(--bg-elevated);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: sticky;
  top: 0;
  z-index: 1;
}

.bt-log__entry {
  padding: var(--space-2) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  line-height: 1.5;
}

.bt-log__entry:last-child {
  border-bottom: none;
}

.bt-log__icon {
  margin-right: var(--space-1);
}

.bt-log__side {
  font-weight: 600;
  color: var(--text-primary);
}

.bt-log__side--home {
  color: var(--gold-500);
}

.bt-log__side--away {
  color: var(--text-bright);
}

.bt-log__type {
  font-weight: 600;
  color: var(--text-primary);
}

.bt-log__player,
.bt-log__target {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.bt-log__arrow {
  color: var(--text-muted);
  margin: 0 var(--space-1);
}

.bt-log__notes {
  color: var(--text-muted);
  font-style: italic;
}

.bt-log__empty {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: var(--text-base);
}

/* ── LOG FOOTER ── */

.bt-log__footer {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border-subtle);
}

.bt-log__footer .bt-btn {
  flex: 1;
}

/* ── EVENT COUNT BADGE ── */

.bt-evt-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-1);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-on-gold);
  background: var(--gradient-gold);
  border-radius: var(--radius-full);
  margin-left: var(--space-1);
}

.bt-evt-count--empty {
  display: none;
}

/* ── GAME NOTES ── */

.bt-game-notes {
  margin-top: var(--space-6);
}

.bt-game-notes__textarea {
  display: block;
  width: 100%;
  min-height: 80px;
  padding: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  resize: vertical;
  box-sizing: border-box;
}

.bt-game-notes__textarea:focus {
  border-color: var(--gold-600);
  box-shadow: 0 0 0 3px var(--gold-alpha-20);
  outline: none;
}

/* ── RESPONSIVE ── */

@media (min-width: 480px) {
  .bt-evt-type-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (min-width: 768px) {
  .bt-log {
    position: fixed;
    right: 0;
    left: auto;
    width: 400px;
    border-left: 1px solid var(--border-default);
  }
}

/* ── REDUCED MOTION ── */

@media (prefers-reduced-motion: reduce) {
  .bt-evt-type {
    transition-duration: 0.01ms !important;
  }
}
