/* 
 * Layout Styles
 * Page layouts and positioning
 */

/* ===== Main Layout ===== */
.main-menu {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-fixed);
  background: var(--background);
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(14, 165, 233, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(80, 250, 123, 0.05) 0%, transparent 50%);
}

.main-menu.active {
  display: flex;
}

/* ===== Logo Section ===== */
.logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--space-12);
  animation: slideDown 0.8s ease-out;
}

.logo {
  max-width: 60%;
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
  transition: transform var(--transition-normal);
}

.logo:hover {
  transform: scale(1.02);
}

.logo-hints {
  margin-top: var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-align: center;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
}

/* ===== Watermark ===== */
.watermark {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4);
  z-index: var(--z-fixed);
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
}

.version,
.watermark-message {
  font-size: var(--font-size-xs);
  color: var(--text-primary);
  opacity: 0.8;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
}

/* ===== Matchmaking Screen ===== */
.matchmaking-screen {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-fixed);
  background: var(--background);
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.1) 0%, transparent 70%);
}

.matchmaking-screen[data-visible="true"] {
  display: flex;
}

.matchmaking-status {
  font-size: var(--font-size-2xl);
  color: var(--text-primary);
  margin-bottom: var(--space-12);
  text-align: center;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.8);
  animation: pulse 2s ease-in-out infinite;
}

/* ===== Game Container ===== */
#app {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#game-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

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

.game-container.active {
  display: block;
}

/* ===== Popup Overlay ===== */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: var(--z-modal-backdrop);
  transition: opacity var(--transition-normal);
}

.popup-overlay.active {
  display: flex;
}

.popup-content {
  background: var(--surface-elevated);
  backdrop-filter: var(--glass-blur);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  width: 400px;
  max-width: 90%;
  max-height: 90%;
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  animation: popupAppear 0.3s ease-out;
  z-index: var(--z-modal);
}

.popup-header {
  background: var(--surface-elevated);
  padding: var(--space-4) var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.popup-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--font-size-lg);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
}

.popup-body {
  padding: var(--space-5);
  background: var(--surface);
}

/* ===== Chat Interface ===== */
.chat-container {
  display: none;
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  width: 320px;
  height: 400px;
  background: var(--surface-elevated);
  backdrop-filter: var(--glass-blur);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  display: none;
  flex-direction: column;
  z-index: var(--z-dropdown);
  overflow: hidden;
  box-shadow: var(--glass-shadow);
  opacity: 0.95;
  transition: all var(--transition-normal);
}

.chat-container.visible {
  display: flex;
}

.chat-container:hover {
  opacity: 1;
}

.chat-container.minimized {
  height: 50px;
}

.chat-header {
  background: var(--surface-elevated);
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  border-bottom: 1px solid var(--border);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--surface);
}

/* ===== HUD Layout ===== */
#HUD {
  position: absolute;
  width: 100%;
  height: 100%;
  display: block;
  z-index: var(--z-fixed);
  pointer-events: none;
}

#cards-frame {
  position: absolute;
  width: 100%;
  height: 300px;
  bottom: 0;
  pointer-events: none;

  --mobile-scale-factor: 1;
  --cards-fan-radius: 800px;
}

/* ===== Animations ===== */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popupAppear {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}
