/* EP16 Grand Galaxy Ensemble Styles */
.screen-container.ep16-group-screen .cinema-cut.active {
  animation: none;
  transform: none;
}
.ep16-ensemble-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  max-width: none;
  width: 100%;
  pointer-events: auto;
  animation: ep16FadeIn 0.3s ease;
}

/* The ensemble has characters across the full frame, so the controls get
   their own column instead of floating over a face. */
.cinema-stage.ep16-side-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 400px);
  column-gap: 12px;
  align-items: center;
}

.cinema-stage.ep16-side-layout > :not(#screenContainer):not(#ep16EnsembleWrap) {
  grid-column: 1 / -1;
}

.cinema-stage.ep16-side-layout > #screenContainer {
  grid-column: 1;
}

.cinema-stage.ep16-side-layout > #ep16EnsembleWrap {
  grid-column: 2;
}

@keyframes ep16FadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ep16-panel {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(250, 204, 21, 0.4);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 24px rgba(250, 204, 21, 0.2);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ep16-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ep16-badge {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(250, 204, 21, 0.4);
}

.ep16-hint {
  font-size: 11px;
  color: #fde047;
  font-weight: 600;
}

.ep16-magic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.ep16-magic-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 0.6;
}

.ep16-magic-card.active {
  opacity: 1;
  transform: translateY(-2px) scale(1.05);
  background: rgba(250, 204, 21, 0.2);
  border-color: rgba(250, 204, 21, 0.8);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.5);
}

.ep16-magic-icon {
  font-size: 20px;
}

.ep16-magic-name {
  font-size: 11px;
  color: #f8fafc;
  font-weight: 700;
  margin-top: 2px;
}

.ep16-btn-start {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 800;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(250, 204, 21, 0.4);
  transition: all 0.25s ease;
  min-height: 48px;
}

.ep16-btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(250, 204, 21, 0.6);
}

.ep16-btn-start.playing {
  background: #10b981;
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

/* Season 2 Master Certificate Card Under Canvas */
.ep16-complete-wrap {
  width: 100%;
  max-width: 900px;
  margin: 16px auto 0;
  animation: ep16FadeIn 0.4s ease;
}

.ep16-cert-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 27, 75, 0.95));
  border: 2px solid #facc15;
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(250, 204, 21, 0.25);
  text-align: center;
}

.ep16-cert-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 14px;
}

.ep16-cert-seal {
  font-size: 48px;
}

.ep16-cert-header h2 {
  font-size: 20px;
  color: #facc15;
  margin-bottom: 4px;
}

.ep16-cert-header p {
  font-size: 13px;
  color: #94a3b8;
}

.ep16-cert-desc {
  font-size: 14px;
  color: #e2e8f0;
  line-height: 1.6;
  margin-bottom: 16px;
}

.ep16-cert-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}

.ep16-cert-badges span {
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.4);
  color: #fef08a;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 16px;
}

.ep16-cert-footer {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.ep16-btn-print {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #0f172a;
  font-weight: 800;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  min-height: 48px;
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.4);
}

.ep16-btn-replay {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 12px;
  cursor: pointer;
  min-height: 48px;
}

@media (max-width: 900px) {
  .cinema-stage.ep16-side-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .cinema-stage.ep16-side-layout > #screenContainer,
  .cinema-stage.ep16-side-layout > #ep16EnsembleWrap {
    grid-column: 1;
  }
  .ep16-ensemble-wrap { margin: 12px auto 0; }
}

@media print {
  body * {
    visibility: hidden;
  }
  .ep16-cert-card, .ep16-cert-card * {
    visibility: visible;
  }
  .ep16-cert-card {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: 4px solid #facc15;
    background: white !important;
    color: black !important;
  }
}
