/* Enhanced Welcome Screen Styles */

/* CSS Variables - ARCADE PALETTE */
:root {
  --bg-accent: #000000;
  --btn-radius: 0px;
  /* Pixel style = no radius */
  --btn-padding: 1rem 1.5rem;
  --primary-gold: #FFCC00;
  --tavern-brown: #5c3c1e;
  --light-brown: #d4a574;
  --pixel-border: 4px solid #3a2415;
}

/* Base Welcome Screen - MIT PUMPE EINGANG */
.welcome-screen {
  position: fixed;
  inset: 0;
  /* Hintergrundbild: Pumpe Eingang - DUNKLERES Overlay für bessere Lesbarkeit */
  background:
    linear-gradient(rgba(0, 0, 0, 0.75),
      rgba(0, 0, 0, 0.85)),
    url('../assets/pumpe_eingang.webp') center/cover no-repeat;
  background-attachment: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  /* Leichte Animation für lebendiges Gefühl */
  animation: welcomeBackgroundPulse 20s ease-in-out infinite;
}

@keyframes welcomeBackgroundPulse {

  0%,
  100% {
    background-size: cover;
  }

  50% {
    background-size: 102% 102%;
  }
}

@keyframes tavernBackgroundShift {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

/* Tavern Container - KOMPAKTER um Eingangs-Bild */
/* Tavern Container - PIXEL ART STYLE */
.tavern-container {
  max-width: 700px;
  width: 90%;
  /* Solid dark background for retro feel */
  background: #2d1b0f;

  /* PIXEL BORDER EFFECT */
  border: 4px solid #8b6914;
  outline: 4px solid #000;
  box-shadow:
    10px 10px 0px rgba(0, 0, 0, 0.8),
    inset 4px 4px 0px rgba(255, 255, 255, 0.1);

  border-radius: 0px;
  /* SHARP CORNERS */
  padding: 2rem 2rem;

  transform: translateY(0);
  position: relative;
  overflow: visible;
  image-rendering: pixelated;
  font-family: 'Press Start 2P', monospace;
}

/* Removed pseudo elements for cleaner retro look */
.tavern-container::before,
.tavern-container::after {
  display: none;
}

@keyframes containerFloat {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-8px) scale(1.01);
  }
}

@keyframes rotateBeer {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.tavern-container:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow:
    /* Verstärkter Schatten beim Hover */
    0 20px 60px rgba(0, 0, 0, 0.9),
    0 8px 25px rgba(139, 69, 19, 0.5),
    /* Warmer Schein */
    0 0 40px rgba(255, 140, 0, 0.3),
    /* Innerer Glanz wird stärker */
    inset 0 1px 0 rgba(139, 69, 19, 0.4),
    inset 0 0 80px rgba(255, 140, 0, 0.12);
}

/* Header Section */
.tavern-header {
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

/* Pumpe Logo */
.tavern-logo {
  width: clamp(180px, 40vw, 280px);
  height: auto;
  margin: 0 auto 1rem;
  display: block;
  filter:
    drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 20px rgba(212, 165, 116, 0.3));
  animation: logoGlow 4s ease-in-out infinite;
}

@keyframes logoGlow {

  0%,
  100% {
    filter:
      drop-shadow(0 4px 12px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 20px rgba(212, 165, 116, 0.3));
  }

  50% {
    filter:
      drop-shadow(0 6px 16px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 30px rgba(212, 165, 116, 0.5)) drop-shadow(0 0 40px rgba(139, 105, 20, 0.3));
  }
}

.tavern-title {
  font-size: clamp(1rem, 2.5vw, 1.8rem);
  /* Solid Gold */
  color: #FFCC00;
  margin: 0 0 1rem 0;
  font-family: 'Press Start 2P', monospace;
  text-transform: uppercase;
  text-shadow: 4px 4px 0px #000;
  line-height: 1.5;
}

/* Entfernt - keine Sternchen mehr */

@keyframes titleShine {
  to {
    background-position: 0% 200%;
  }
}

.tavern-subtitle {
  font-size: clamp(0.55rem, 1.4vw, 0.75rem);
  /* Warmes, gedämpftes Gold - wie altes Messing */
  color: #c9a55c;
  margin: 0;
  opacity: 0.9;
  font-family: 'Press Start 2P', monospace;
  line-height: 1.4;
  text-shadow:
    1px 1px 2px rgba(20, 10, 5, 0.9),
    0 0 8px rgba(201, 165, 92, 0.3);
}

/* Entfernt - keine Bounce Animation mehr */

/* User Profile Section */
.user-profile-section {
  margin: 1.5rem 0;
  padding: 1rem;
  background: rgba(139, 69, 19, 0.2);
  border: 2px solid #D2691E;
  border-radius: 15px;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid #FFD700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.user-details {
  flex: 1;
}

.user-name {
  font-size: 1rem;
  color: #FFD700;
  margin: 0 0 0.3rem 0;
  font-family: 'Press Start 2P', monospace;
}

.user-email {
  font-size: 0.6rem;
  color: #DEB887;
  margin: 0 0 0.5rem 0;
  font-family: 'Press Start 2P', monospace;
}

.sign-out-btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.6rem;
  background: rgba(220, 20, 60, 0.8);
  border: 2px solid #DC143C;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-family: 'Press Start 2P', monospace;
  transition: all 0.2s ease;
}

.sign-out-btn:hover {
  background: rgba(220, 20, 60, 1);
  transform: scale(1.05);
}

/* Google Sign-In Section */
.google-signin-container {
  margin: 1.5rem 0;
}

.google-signin-btn {
  width: 100%;
  padding: 1rem;
  background: white;
  border: 2px solid #dadce0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  cursor: pointer;
  font-family: 'Roboto', 'Press Start 2P', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #3c4043;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.google-signin-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.google-signin-btn:active {
  background: #e8e8e9;
  transform: translateY(0);
}

.google-signin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.google-icon {
  width: 20px;
  height: 20px;
}

.divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: rgba(255, 215, 0, 0.3);
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

.divider span {
  color: #DEB887;
  font-size: 0.7rem;
  padding: 0 1rem;
  background: rgba(101, 67, 33, 0.95);
  position: relative;
  font-family: 'Press Start 2P', monospace;
}

/* Name Input Section */
.name-input-section {
  margin: 2rem 0;
  /* Dark Pixel Box */
  background: #1a0f0a;
  border: 4px solid #5a3a1a;
  border-radius: 0px;
  padding: 1.5rem;
  position: relative;
  box-shadow: inset 4px 4px 0px rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.name-label {
  display: block;
  /* Warmes, gedämpftes Orange - wie Kerzenlicht */
  color: #d4a574;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  font-family: 'Press Start 2P', monospace;
  text-shadow:
    1px 1px 2px rgba(0, 0, 0, 0.8),
    0 0 10px rgba(212, 165, 116, 0.2);
}

.input-container {
  display: flex;
  gap: 0.5rem;
  position: relative;
}

.tavern-input {
  flex: 1;
  padding: 1rem;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.8rem;
  background: #000;
  color: #FFCC00;
  border: 4px solid #8b6914;
  box-shadow: none;
  border-radius: 0;
  transition: none;
}

.tavern-input:focus {
  outline: none;
  border-color: #8b6914;
  box-shadow:
    inset 0 2px 4px rgba(90, 58, 26, 0.3),
    0 0 12px rgba(212, 165, 116, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.2);
  transform: scale(1.02);
  background:
    linear-gradient(145deg,
      #fff8e7 0%,
      #f5e6d3 50%,
      #fff8e7 100%);
}

.tavern-input.name-generated {
  animation: namePopIn 0.5s ease;
}

@keyframes namePopIn {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.random-name-btn {
  padding: 0.8rem;
  background: linear-gradient(145deg, #FFD700, #FFA500);
  border: 3px solid #FF8C00;
  border-radius: 10px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 50px;
}

.random-name-btn:hover {
  transform: rotate(360deg) scale(1.1);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
}

.random-name-btn:active {
  transform: scale(0.95);
}

.name-hint {
  font-size: 0.6rem;
  color: #DEB887;
  margin: 0.8rem 0 0 0;
  font-family: 'Press Start 2P', monospace;
}

/* Start Button - RUSTIKALES WIRTSHAUS-DESIGN */
.tavern-start-button {
  width: 100%;
  padding: 1.2rem;
  background: #008000;
  /* Retro Green */
  border: 4px solid #004d00;
  border-radius: 0;
  box-shadow:
    0 6px 0 #004d00,
    0 12px 10px rgba(0, 0, 0, 0.5);
  font-family: 'Press Start 2P', monospace;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0 1rem 0;
  position: relative;
  overflow: visible;
  text-shadow: 2px 2px 0px #000;
  transition: transform 0.1s;
}

.tavern-start-button:active {
  transform: translateY(6px);
  /* Button press effect */
  box-shadow:
    0 0 0 #004d00,
    inset 0 4px 0 rgba(0, 0, 0, 0.2);
}

.tavern-start-button:hover {
  background: #00a000;
  animation: none;
}

.tavern-start-button:hover::before {
  animation: shimmer 0.8s ease;
}

.tavern-start-button:hover .button-text {
  animation: textShake 0.5s ease;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    opacity: 0;
  }

  50% {
    opacity: 1;
  }

  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
    opacity: 0;
  }
}

@keyframes textShake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-2px) rotate(-1deg);
  }

  75% {
    transform: translateX(2px) rotate(1deg);
  }
}

.tavern-start-button:active {
  transform: translateY(2px) scale(0.98);
  box-shadow:
    0 5px 15px rgba(0, 0, 0, 0.6),
    inset 0 4px 12px rgba(0, 0, 0, 0.8),
    inset 0 1px 0 rgba(139, 105, 20, 0.3);
  filter: brightness(0.85);
}

.button-icon {
  font-size: 2.5rem;
  animation: iconBounce 1s ease-in-out infinite;
}

@keyframes iconBounce {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-5px) rotate(-10deg);
  }

  75% {
    transform: translateY(-5px) rotate(10deg);
  }
}

.button-text {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  position: relative;
  z-index: 1;
}

.button-subtitle {
  font-size: 0.7rem;
  opacity: 0.95;
  animation: subtitleFade 2s ease-in-out infinite;
}

@keyframes subtitleFade {

  0%,
  100% {
    opacity: 0.95;
  }

  50% {
    opacity: 1;
  }
}

.start-hint {
  text-align: center;
  font-size: 0.6rem;
  color: #FFD700;
  margin: 1rem 0 0 0;
  opacity: 0.9;
  font-family: 'Press Start 2P', monospace;
  animation: hintPulse 3s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

@keyframes hintPulse {

  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* Atmosphere Section */
.tavern-atmosphere {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #000;
  border: 4px solid #5a3a1a;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  z-index: 1;
}

.atmosphere-text {
  text-align: center;
  font-size: 0.6rem;
  /* Warmes, gedämpftes Gold */
  color: #c9a55c;
  line-height: 1.8;
  font-family: 'Press Start 2P', monospace;
  text-shadow:
    1px 1px 2px rgba(0, 0, 0, 0.8),
    0 0 8px rgba(201, 165, 92, 0.2);
}

/* Footer */
.tavern-footer {
  margin-top: 2rem;
  text-align: center;
}

.alpine-decoration {
  font-size: 0.6rem;
  color: #a88850;
  opacity: 0.85;
  font-family: 'Press Start 2P', monospace;
  text-shadow:
    1px 1px 2px rgba(0, 0, 0, 0.9),
    0 0 8px rgba(168, 136, 80, 0.2);
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  z-index: 9999;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.notification.show {
  transform: translateX(0);
}

.notification-success {
  background: linear-gradient(145deg, #228B22, #32CD32);
  border: 2px solid #00FF00;
  color: white;
}

.notification-error {
  background: linear-gradient(145deg, #8B0000, #DC143C);
  border: 2px solid #FF0000;
  color: white;
}

.notification-info {
  background: linear-gradient(145deg, #4169E1, #1E90FF);
  border: 2px solid #00BFFF;
  color: white;
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #4285F4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Mobile Optimizations */
@media (max-width: 768px) {
  .tavern-container {
    width: 95%;
    padding: 1.5rem;
    max-height: 90vh;
    overflow-y: auto;
  }

  .tavern-title {
    font-size: 1.2rem;
  }

  .tavern-subtitle {
    font-size: 0.6rem;
  }

  .name-input-section {
    padding: 1rem;
  }

  .tavern-input {
    font-size: 0.7rem;
    padding: 0.8rem;
  }

  .random-name-btn {
    min-width: 45px;
    padding: 0.7rem;
  }

  .tavern-start-button {
    padding: 1.2rem;
  }

  .button-text {
    font-size: 0.9rem;
  }

  .button-icon {
    font-size: 1.5rem;
  }

  .google-signin-btn {
    padding: 0.8rem;
    font-size: 0.8rem;
  }

  .user-avatar {
    width: 50px;
    height: 50px;
  }

  .user-name {
    font-size: 0.8rem;
  }

  .user-email {
    font-size: 0.5rem;
  }

  /* Touch-friendly enhancements */
  .mobile-device button {
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-device input {
    min-height: 44px;
    font-size: 16px !important;
    /* CRITICAL: Prevents zoom on iOS */
    /* Additional mobile input optimizations */
    -webkit-appearance: none;
    -webkit-border-radius: 0;
    border-radius: 10px;
    /* Enhanced touch responsiveness */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* CRITICAL: Spieler name input mobile optimization */
  .mobile-device .tavern-input {
    font-size: 16px !important;
    /* CRITICAL: Prevents iOS zoom */
    min-height: 48px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    /* Better mobile input handling */
    -webkit-appearance: none;
    border-radius: 10px;
  }

  /* Smaller notifications on mobile */
  .notification {
    right: 10px;
    left: 10px;
    width: auto;
    font-size: 0.6rem;
    padding: 0.8rem 1rem;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .tavern-container {
    border-radius: 12px;
    padding: 1rem;
  }

  .tavern-logo {
    width: clamp(120px, 60vw, 180px);
  }

  .tavern-title {
    font-size: 0.85rem;
  }

  .tavern-subtitle {
    font-size: 0.5rem;
  }

  .profile-info {
    flex-direction: column;
    text-align: center;
  }

  .atmosphere-text {
    font-size: 0.5rem;
  }

  .alpine-decoration {
    font-size: 0.5rem;
  }
}

/* Landscape mobile */
@media (max-height: 600px) and (orientation: landscape) {
  .tavern-container {
    max-height: 85vh;
    overflow-y: auto;
    padding: 1rem;
  }

  .tavern-header {
    margin-bottom: 1rem;
  }

  .name-input-section {
    margin: 1rem 0;
    padding: 0.8rem;
  }

  .tavern-start-button {
    padding: 1rem;
    margin: 1rem 0 0.5rem 0;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
  .tavern-container {
    border-width: 3px;
  }

  .tavern-input,
  .random-name-btn,
  .tavern-start-button {
    border-width: 2px;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .google-signin-btn {
    background: #202124;
    color: #e8eaed;
    border-color: #5f6368;
  }

  .google-signin-btn:hover {
    background: #303134;
  }
}