/* Play Page Styles */

/* Page Sections */
.section-title {
  margin-bottom: 1rem;
}

.section-description {
  max-width: 600px;
  margin: 0 auto 2rem;
}

.section-subtitle {
  max-width: 600px;
  margin: 1rem auto 2rem;
}

/* Game Container */
.game-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-xl) var(--spacing-lg);
}

.game-section {
  position: relative;
  margin-bottom: 2rem;
}

/* Game Wrapper - 4:3 Aspect Ratio for 1440x1080 canvas */
.game-wrapper {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--color-border);
}

.game-aspect-ratio {
  position: relative;
  width: 100%;
  padding-bottom: 75%; /* 4:3 aspect ratio (1080/1440 = 0.75) for BM2 */
  overflow: hidden;
}

/* 16:9 aspect ratio for BM1 */
.game-aspect-ratio-16-9 {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio (720/1280 = 0.5625) for BM1 */
  overflow: hidden;
}

.game-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Special scaling for games with fixed canvas */
.game-aspect-ratio-16-9 .game-iframe,
.game-aspect-ratio .game-iframe {
  position: absolute;
  transform-origin: top left;
}

/* Loading Animation */
.game-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-card);
  z-index: 10;
  transition: opacity 0.3s ease;
}

.game-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 1.5rem;
  color: var(--color-text-secondary);
  font-size: 1rem;
}

/* Game Controls */
.game-controls {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
  padding: var(--spacing-lg) 0;
  flex-wrap: wrap;
}

.game-control-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--color-bg-secondary);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: 0.95rem;
}

.game-control-btn:hover {
  background: var(--color-bg-card);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

/* Fullscreen Styles */
.game-wrapper.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  z-index: 9999;
  border-radius: 0;
}

.game-wrapper.fullscreen .game-aspect-ratio,
.game-wrapper.fullscreen .game-aspect-ratio-16-9 {
  padding-bottom: 0 !important;
  height: 100% !important;
  position: relative !important;
}

.game-wrapper.fullscreen .game-iframe {
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  left: 0 !important;
  top: 0 !important;
}

.game-wrapper.fullscreen .game-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  background: transparent;
  padding: 0;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.game-wrapper.fullscreen .game-control-btn {
  width: 40px;
  height: 40px;
  padding: 0;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border-color: rgba(255, 255, 255, 0.2);
  font-size: 1.25rem;
  justify-content: center;
}

.game-wrapper.fullscreen .game-control-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: var(--color-primary);
  transform: scale(1.1);
}

.game-wrapper.fullscreen .game-control-btn span:last-child {
  display: none;
}

/* iOS Pseudo-Fullscreen */
.game-wrapper.ios-fullscreen {
  background: #000;
  border: none !important;
}

.game-wrapper.ios-fullscreen .game-aspect-ratio,
.game-wrapper.ios-fullscreen .game-aspect-ratio-16-9 {
  padding-bottom: 0 !important;
  height: 100vh !important;
  width: 100vw !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
}

.game-wrapper.ios-fullscreen .game-iframe {
  width: 100vw !important;
  height: 100vh !important;
  transform: none !important;
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
}

.game-wrapper.ios-fullscreen .game-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.game-wrapper.ios-fullscreen .game-controls {
  position: fixed;
  top: env(safe-area-inset-top, 20px);
  right: env(safe-area-inset-right, 20px);
  z-index: 10001;
  background: transparent;
  padding: 0;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.game-wrapper.ios-fullscreen .game-control-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
  font-size: 1.25rem;
  justify-content: center;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
}

.game-wrapper.ios-fullscreen .game-control-btn span:last-child {
  display: none;
}

/* Prevent iOS bounce */
.ios-fullscreen {
  -webkit-overflow-scrolling: touch;
  overflow: hidden;
  touch-action: none;
}

/* Info Box */
.info-box {
  max-width: 800px;
  margin: 2rem auto;
  padding: var(--spacing-lg);
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.info-box h2 {
  margin-bottom: var(--spacing-md);
}

.info-box p {
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* Vote Section */
.vote-section {
  max-width: 800px;
  margin: 3rem auto;
  padding: var(--spacing-xl);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.vote-buttons {
  display: flex;
  gap: var(--spacing-lg);
  justify-content: center;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.vote-btn {
  flex: 1;
  min-width: 200px;
  max-width: 300px;
  padding: var(--spacing-lg) var(--spacing-xl);
  font-size: 1.25rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  border: 2px solid transparent;
}

.vote-btn-truth {
  background: var(--color-primary);
  color: white;
}

.vote-btn-truth:hover {
  background: var(--color-primary-dark);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.vote-btn-forget {
  background: var(--color-bg-secondary);
  color: var(--color-text);
  border-color: var(--color-border);
}

.vote-btn-forget:hover {
  border-color: var(--color-primary);
  transform: translateY(-4px);
}

.vote-stats {
  margin-top: 2rem;
  padding: var(--spacing-lg);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
}

.stat-bar {
  margin: 1rem 0;
  text-align: left;
}

.stat-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  height: 30px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

.progress-fill.forget {
  background: var(--color-text-secondary);
}

.vote-stats-title {
  margin-bottom: 1.5rem;
}

.vote-total-text {
  margin-top: 1.5rem;
}

.vote-stats-btn {
  margin-top: 1rem;
}

/* Cards */
.card-btn {
  margin-top: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .game-aspect-ratio {
    padding-bottom: 75%; /* Keep 4:3 ratio on mobile for BM2 */
  }

  .game-aspect-ratio-16-9 {
    padding-bottom: 56.25%; /* Keep 16:9 ratio on mobile for BM1 */
  }

  .vote-btn {
    min-width: 100%;
  }

  .game-controls {
    gap: var(--spacing-sm);
  }

  .game-control-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
  }

  .game-wrapper.fullscreen .game-control-btn {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    padding: 0;
  }
}
