/**
 * GAME PLAYER COMPONENT STYLES
 */

.player-wrapper {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border-medium);
  margin-bottom: var(--space-8);
}

.player-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050507;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* When fullscreen is active */
.player-wrapper:fullscreen,
.player-wrapper:-webkit-full-screen {
  border-radius: 0;
  width: 100vw;
  height: 100vh;
}

.player-wrapper:fullscreen .player-container,
.player-wrapper:-webkit-full-screen .player-container {
  height: calc(100vh - 60px);
  aspect-ratio: auto;
}

/* Game Canvas & Frame Elements */
.game-viewport-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.game-viewport-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

/* Launch Overlay */
.player-launch-overlay {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  cursor: pointer;
  transition: opacity var(--transition-normal);
}

.player-launch-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(7, 7, 9, 0.7) 0%, rgba(7, 7, 9, 0.95) 100%);
}

.player-launch-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-6);
  max-width: 500px;
}

.player-launch-btn {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: var(--space-4);
  box-shadow: 0 0 35px var(--accent-glow);
  transition: transform var(--transition-spring), box-shadow var(--transition-normal);
}

.player-launch-overlay:hover .player-launch-btn {
  transform: scale(1.12);
  box-shadow: 0 0 50px var(--accent-primary);
}

.player-launch-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-black);
  margin-bottom: var(--space-2);
}

.player-launch-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Player HUD / Toolbar */
.player-toolbar {
  height: 56px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  z-index: 5;
}

.player-title-info {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.player-title-text {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.player-controls-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.player-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.player-tool-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

.player-tool-btn.active {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* Mobile On-Screen Touch Controls */
.mobile-controls-panel {
  display: none;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-4);
  touch-action: manipulation;
  user-select: none;
}

@media (pointer: coarse) {
  .mobile-controls-panel.active {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

.dpad-container {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  gap: 4px;
}

.touch-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  active: background: var(--accent-primary);
}

.touch-btn:active {
  background: var(--accent-primary);
  color: #fff;
}

.touch-action-btn {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: var(--accent-primary);
  color: #fff;
  font-weight: var(--font-weight-bold);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--accent-glow-subtle);
}

.touch-action-btn:active {
  transform: scale(0.92);
}

/* Error / Compatibility Overlay */
.player-error-overlay {
  position: absolute;
  inset: 0;
  background: rgba(14, 16, 23, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6);
  z-index: 15;
}

.player-error-icon {
  font-size: 36px;
  color: var(--accent-primary);
  margin-bottom: var(--space-3);
}

.player-error-msg {
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 420px;
  margin-bottom: var(--space-4);
}
