/* ============================================================
 *  Player page add-on styles
 *  - loaded in addition to /style.css on the player view
 *  - layout (header/sidebar/main/footer) lives in style.css
 * ============================================================ */

.player-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.player-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.player-card__title strong {
  display: block;
  font-size: 1.05rem;
  color: var(--text-strong);
}

.player-card__title span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.menu-button {
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 6px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, opacity 0.15s;
}

.menu-button:hover:not(:disabled) {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.menu-button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.build-description {
  margin-bottom: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.build-description__summary {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.build-description__meta {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.unity-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #121213;
}

#unity-canvas,
.launch-overlay,
.unity-warning {
  position: absolute;
  inset: 0;
}

#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #121213;
}

.launch-overlay {
  display: grid;
  place-items: center;
  padding: 1rem;
  background: linear-gradient(
    180deg,
    rgba(20, 20, 22, 0.88),
    rgba(37, 37, 38, 0.92)
  );
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.launch-overlay.is-ready {
  background: linear-gradient(
    180deg,
    rgba(20, 20, 22, 0.48),
    rgba(37, 37, 38, 0.56)
  );
}

.launch-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.launch-panel {
  width: min(420px, 100%);
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}

.launch-panel h2 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.launch-subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.launch-progress {
  margin-top: 1rem;
}

.launch-progress__track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.launch-progress__value {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ff7a8f);
  transition: width 0.18s linear;
}

.launch-progress__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.launch-status {
  margin: 0.9rem 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
}

.unity-warning {
  inset: auto 12px 12px 12px;
  display: grid;
  gap: 8px;
}

.unity-warning__item {
  padding: 0.75rem 0.9rem;
  border-radius: 6px;
  background: rgba(30, 30, 30, 0.95);
  border: 1px solid var(--border);
  color: var(--text);
}

.unity-warning__item--error {
  border-color: var(--accent);
}

.unity-mobile #unity-canvas,
#unity-canvas.unity-mobile {
  width: 100%;
  height: 100%;
}

@media (max-width: 640px) {
  .view__toolbar,
  .player-card__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .menu-button {
    width: 100%;
    justify-content: center;
  }
}
