/* MODERN RESET & VARIABLES */
:root {
  --primary: #6366f1;
  /* Indigo */
  --primary-dark: #4338ca;
  --accent: #f472b6;
  /* Pink */
  --bg-dark: #0f172a;
  /* Slate 900 */
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --text-light: #f8fafc;
  --text-dim: #94a3b8;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.5);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Outfit:wght@500;700;900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  outline: none;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-light);
  overflow-x: hidden;
  min-height: 100vh;
}

/* ANIMATED BACKGROUND */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.3) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(244, 114, 182, 0.2) 0%, transparent 40%);
  z-index: -1;
  animation: bgPulse 10s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(1.1);
  }
}

/* LOGIN LAYOUT */
.modern-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.glass-container {
  background: rgba(30, 41, 59, 0.7);
  /* Darker glass for better contrast */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 3rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  text-align: center;
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.glass-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), var(--shadow-glow);
}

/* BRANDING */
.brand-section {
  margin-bottom: 2.5rem;
}

.brand-logo {
  max-width: 180px;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

/* FORM ELEMENTS */
.modern-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.modern-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 2px solid var(--glass-border);
  padding: 1rem 1rem 1rem 3.5rem;
  border-radius: 12px;
  color: white;
  font-size: 1rem;
  font-family: var(--font-body);
  transition: all 0.3s ease;
}

.modern-input:focus {
  border-color: var(--primary);
  background: rgba(15, 23, 42, 0.9);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.modern-input:focus+.input-icon,
.input-group:focus-within .input-icon {
  color: var(--primary);
}

/* BUTTONS */
.modern-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 1rem;
}

.modern-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.5);
  background: linear-gradient(135deg, #818cf8, #6366f1);
}

.modern-btn:active {
  transform: translateY(0);
}

/* SUPPORT & LINKS */
.support-links {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.highlight-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

.highlight-link:hover {
  color: #f9a8d4;
  text-decoration: underline;
}

.error-message {
  background: rgba(220, 38, 38, 0.2);
  border: 1px solid rgba(220, 38, 38, 0.5);
  color: #fca5a5;
  padding: 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.extra-link {
  margin-top: 2rem;
}

.secondary-link {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.3s;
}

.secondary-link:hover {
  opacity: 1;
}

/* GAME SCREEN SPECIFIC */
.game-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding-top: 2rem;
  background: url(assets/images/bg-pattern.png) repeat, var(--bg-dark);
  /* Fallback */
}

#logo img {
  max-width: 250px;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
}

#container {
  padding-top: 368px;
  /* Original padding */
  width: 420px;
  margin: 0 auto;
}

#container div {
  display: inline-block;
  vertical-align: top;
  transition: transform 0.1s;
}

#result {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  margin-top: 1rem;
  text-shadow: 0 0 10px rgba(244, 114, 182, 0.5);
}

/* RESPONSIVE */
.game-container-wrapper {
  /* Ensure the game fits on smaller screens if possible, though scratch canvas is usually fixed */
  transform-origin: top center;
}

@media (max-width: 600px) {
  .glass-container {
    padding: 2rem;
  }

  .game-container-wrapper {
    transform: scale(0.65);
    /* Scale down ONLY on mobile */
    margin-top: -50px;
  }
}