/**
 * Topbar Styles
 * Reusable component for application header with branding, HUD info, and actions
 **/

/* ********************************************************************** */
 /* Global Styles */
.topbar {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(100px, 0.75fr) auto;
  gap: 1rem;
}

.brand,
.hud,
.actions {
  background: rgba(16, 39, 58, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  padding: 0.2rem;
}

.hud,
.actions,
#game-controls,
.level-selector,
#game-controls {
  gap: 0.75rem;
}

.hud,
.hud-card,
.actions,
.level-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hud-card,
.level-tile {
  align-items: center;
}

.hud-card .label,
.level-tile .level-number {
  margin-bottom: 0.2rem;
  font-weight: bold;
  font-size: 1.2rem;
}

.hud-card, 
.actions button,
.level-tile {
  border-radius: 12px;
}

.brand p, 
.hud-card .label,
.level-tile .level-score {
  color: #b6d5e8;
}

.actions button,
.level-tile {
  color: #eaf6ff;
}

.hud-card,
.actions button {
  background: linear-gradient(180deg, #1b5374, #143d57);
}

/* ********************************************************************** */
/* Brand Section */
.brand h1 {
  margin: 0.5rem 0 0.25rem 0.5rem;
  font-size: 1.8rem;
}

.brand p {
  margin: 0 0 0 0.5rem;
}

/* ********************************************************************** */
/* HUD Section */
.hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

/* ********************************************************************** */
/* Actions Section */
#game-controls {
  display: flex;
  justify-content: center;
}

.actions button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  font: inherit;
  cursor: pointer;
}

.actions button:hover {
  background: linear-gradient(180deg, #1f5f8a, #164268);
}

/* Level Selector */
.level-selector {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
}

.level-tile {
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  cursor: pointer;
}

.level-tile.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.level-tile.available {
  background: rgba(255, 255, 255, 0.10);
}

.level-tile.solved {
  background: rgba(80, 180, 120, 0.30);
  border-color: rgba(120, 220, 150, 0.55);
}

.level-tile.active {
  outline: 2px solid rgba(255, 255, 255, 0.65);
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
  }
}
