/* ============================================================
   Blood Bowl Companion — css/game-bar.css
   Persistent game bar: scores, turns, re-rolls, team selects.
   Glass navy aesthetic — sticky header.
   ============================================================ */

/* ── Loading veil: hide app content until JS init completes ── */
.bb-app {
  transition: opacity 0.2s ease;
}
body.app-loading .bb-app {
  opacity: 0;
}

/* ── Bar container ── */
.game-bar {
  display:               grid;
  grid-template-columns: 1fr auto 1fr;
  align-items:           stretch;
  background:            rgba(4, 10, 28, 0.92);
  backdrop-filter:       blur(12px) saturate(1.3);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  border-bottom:         1px solid rgba(70, 110, 220, 0.3);
  min-height:            74px;
  position:              sticky;
  top:                   0;
  z-index:               var(--z-gamebar, 200);
  box-shadow:            0 4px 24px rgba(0, 0, 0, 0.65);
}

/* ── Team sides ── */
.gb-team {
  display:     flex;
  align-items: stretch;
  padding:     0;
}

.gb-home { border-right: 1px solid rgba(70, 110, 220, 0.2); }
.gb-away { border-left:  1px solid rgba(70, 110, 220, 0.2); }

.gb-team-inner {
  display:         flex;
  flex-direction:  column;
  justify-content: space-between;
  width:           100%;
  padding:         0.45rem 0.8rem;
  gap:             0.25rem;
}

/* ── Choose-team button (opens the Choose Team window) ── */
.gb-choose-btn {
  font-family:    'Nuffle Italic', serif;
  font-size:      0.95rem;
  width:          100%;
  color:          rgba(210, 230, 255, 0.9);
  background:     rgba(255, 255, 255, 0.06);
  border:         1px solid rgba(100, 140, 220, 0.32);
  border-top:     3px solid var(--gb-team-accent, rgba(100, 140, 220, 0.32));
  border-radius:  4px;
  padding:        0.4rem 0.7rem;
  letter-spacing: 0.02em;
  cursor:         pointer;
  transition:     background-color 0.15s, border-color 0.15s;
}
.gb-choose-btn:hover {
  background:   rgba(80, 130, 255, 0.16);
  border-color: rgba(120, 170, 255, 0.55);
}
.gb-choose-btn.has-team { color: #fff; }

/* ── Team select dropdown ── */
.gb-select {
  font-family:    'JetBrains Mono', monospace;
  font-weight:    700;
  font-size:      0.7rem;
  color:          rgba(200, 220, 255, 0.8);
  background:     rgba(255, 255, 255, 0.06);
  border:         1px solid rgba(100, 140, 220, 0.3);
  border-radius:  3px;
  padding:        0.28rem 1.6rem 0.28rem 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  appearance:     none;
  -webkit-appearance: none;
  background-image:    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='rgba(150,180,255,0.5)' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat:   no-repeat;
  background-position: right 0.5rem center;
  cursor:         pointer;
  transition:     background-color 0.15s, border-color 0.15s;
}

.gb-select:focus {
  outline:         2px solid rgba(120, 170, 255, 0.5);
  outline-offset:  1px;
}

/* ── Score block ── */
.gb-score-block {
  display:     flex;
  align-items: center;
  gap:         0.3rem;
}

.gb-score-label {
  font-family:    'JetBrains Mono', monospace;
  font-weight:    500;
  font-size:      0.54rem;
  color:          rgba(140, 175, 240, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-right:   0.1rem;
}

.gb-score-btn {
  background:   rgba(255, 255, 255, 0.07);
  border:       1px solid rgba(100, 140, 220, 0.25);
  color:        rgba(180, 210, 255, 0.7);
  width:        20px;
  height:       20px;
  border-radius: 3px;
  font-size:    0.9rem;
  line-height:  1;
  cursor:       pointer;
  display:      flex;
  align-items:  center;
  justify-content: center;
  transition:   background 0.12s;
  flex-shrink:  0;
}

.gb-score-btn:hover { background: rgba(100, 140, 220, 0.22); }

.gb-score {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  font-size:   1.55rem;
  color:       var(--bb-gold, #D4AF37);
  line-height: 1;
  min-width:   1.8rem;
  text-align:  center;
  text-shadow: 0 0 14px rgba(212, 175, 55, 0.35);
}

/* ── Re-roll block ── */
.gb-rr-block {
  display:    flex;
  align-items: center;
  gap:        0.3rem;
  flex-wrap:  wrap;
}

.gb-rr-label {
  font-family:    'JetBrains Mono', monospace;
  font-weight:    500;
  font-size:      0.5rem;
  color:          rgba(120, 160, 230, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  flex-shrink:    0;
}

.gb-rr-pips {
  display:  flex;
  gap:      4px;
  flex-wrap: wrap;
}

.rr-pip {
  width:        12px;
  height:       12px;
  border-radius: 50%;
  background:   rgba(180, 210, 255, 0.75);
  border:       1px solid rgba(100, 155, 255, 0.4);
  cursor:       pointer;
  transition:   background 0.14s, transform 0.1s;
  flex-shrink:  0;
}

.rr-pip:hover  { transform: scale(1.25); }

.rr-pip.used {
  background:   rgba(40, 60, 120, 0.45);
  border-color: rgba(80, 110, 200, 0.3);
}

/* ── Center: half + turn tracker ── */
.gb-center {
  display:         flex;
  flex-direction:  column;
  align-items:     center;
  justify-content: center;
  padding:         0.5rem 0.75rem;
  gap:             0.22rem;
  min-width:       130px;
}

/* ── Start Game launcher (replaces the turn tracker) ──
   Scoped under .gb-center so these win over the later-loaded .roll-btn base. */
.gb-center .gb-start-btn {
  font-family:     'Nuffle Italic', serif;
  font-size:       1.15rem;
  letter-spacing:  0.06em;
  justify-content: center;
  margin:          0;
  padding:         0.35em 1.4em;
  background:      rgba(212, 175, 55, 0.88);
  border-color:    rgba(212, 175, 55, 0.95);
  color:           #fff;
  text-shadow:     0 0 4px rgba(0,0,0,0.7), 0 1px 2px rgba(0,0,0,0.9);
  transition:      background 0.15s, box-shadow 0.7s ease, transform 0.12s, border-color 0.15s;
}
.gb-center .gb-start-btn:hover {
  transition:   background 0.15s, box-shadow 0.15s, transform 0.12s, border-color 0.15s;
  background:   rgba(212, 175, 55, 1);
  border-color: rgba(212, 175, 55, 1);
  box-shadow:   0 0 20px rgba(212, 175, 55, 0.5), 0 4px 16px rgba(0,0,0,0.35);
  transform:    translateY(-1px);
}
/* Pulses only once both teams are set (animation defined in css/wizards.css) */
.gb-center .gb-start-btn.glow-gold { animation: bwiz-pulse-gold-strong 1.6s ease-in-out infinite; }

.gb-start-sub {
  display:     flex;
  gap:         0.4rem;
  margin-top:  0.4rem;
}

.gb-start-sub-btn {
  font-family:    'JetBrains Mono', monospace;
  font-weight:    700;
  font-size:      0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color:          rgba(160, 195, 255, 0.7);
  background:     rgba(255, 255, 255, 0.05);
  border:         1px solid rgba(100, 140, 220, 0.25);
  border-radius:  5px;
  padding:        0.4rem 0.7rem;
  cursor:         pointer;
  transition:     color 0.15s, border-color 0.15s, box-shadow 0.15s, background 0.15s, transform 0.15s;
}
/* Glow on hover only */
.gb-start-sub-btn:hover {
  color:        #fff;
  background:   rgba(10, 22, 65, 0.9);
  border-color: rgba(120, 170, 255, 0.7);
  box-shadow:   0 0 0 1px rgba(120, 170, 255, 0.35),
                0 4px 14px rgba(60, 100, 255, 0.25),
                0 0 14px rgba(80, 130, 255, 0.18);
  transform:    translateY(-1px);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .game-bar {
    grid-template-columns: 1fr 1fr;
    grid-template-rows:    auto auto;
  }

  .gb-center {
    grid-column:    1 / -1;
    grid-row:       2;
    flex-direction: row;
    justify-content: space-between;
    border-top:     1px solid rgba(70, 110, 220, 0.15);
    padding:        0.35rem 0.75rem;
    min-width:      0;
  }

  .gb-home { border-right: 1px solid rgba(70, 110, 220, 0.18); }
  .gb-away { border-left: none; }
  .gb-score { font-size: 1.3rem; }
}

@media (max-width: 479px) {
  .gb-center {
    padding:         0.4rem 0.75rem;
    flex-wrap:       wrap;
    gap:             0.3rem;
    justify-content: space-between;
  }
  .gb-score        { font-size: 1.2rem; }
  .gb-rr-label     { display: none; }
  .gb-select       { font-size: 0.62rem; padding: 0.22rem 1.4rem 0.22rem 0.4rem; }
  .gb-score-btn    { min-height: 28px; min-width: 28px; }
}
