/* General Reset & Variables */
:root {
  --color-bg: #080c14;
  --color-bg-card: rgba(18, 28, 48, 0.7);
  --color-bg-input: #111b2d;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-glow: rgba(0, 255, 136, 0.3);
  
  --color-primary: #00ff88;
  --color-secondary: #00d2ff;
  --color-error: #ff3b5c;
  --color-warning: #ffaa00;
  
  --color-text: #f3f4f6;
  --color-text-muted: #9ca3af;
  
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-logo: 'Rajdhani', sans-serif;
  
  --shadow-neon: 0 0 15px rgba(0, 255, 136, 0.2);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Background Gradients decoration */
body::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 50%;
  height: 60%;
  background: radial-gradient(circle, rgba(0, 255, 136, 0.05) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 50%;
  height: 60%;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.05) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 960px;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0 25px 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 30px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px rgba(0, 255, 136, 0.4));
}

.logo h1 {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: 1.8rem;
  letter-spacing: 2px;
}

.accent-text {
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.btn-icon {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  transition: var(--transition-smooth);
}

.btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

/* Game Screens */
.game-screen {
  display: none;
  flex-direction: column;
  flex-grow: 1;
  animation: fadeIn 0.4s ease-out forwards;
}

.game-screen.active {
  display: flex;
}

/* Fade in Keyframes */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* MAIN MENU SCREEN */
.hero-section {
  text-align: center;
  margin-bottom: 40px;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  color: var(--color-text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.mode-card {
  background: var(--color-bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 35px 30px;
  text-align: center;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  position: relative;
  overflow: hidden;
}

.mode-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  transition: var(--transition-smooth);
}

#mode-guess-player::before {
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

#mode-guess-club::before {
  background: linear-gradient(90deg, var(--color-secondary), var(--color-warning));
}

#mode-blitz::before {
  background: linear-gradient(90deg, var(--color-warning), var(--color-error));
}

.mode-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.mode-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.mode-card h3 {
  font-size: 1.4rem;
  font-weight: 600;
}

.mode-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  flex-grow: 1;
}

.leaderboard-preview {
  text-align: center;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 15px;
  max-width: 400px;
  margin: 0 auto;
}

.leaderboard-preview h3 {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

.leaderboard-preview span {
  color: var(--color-warning);
  font-weight: 700;
  font-size: 1.3rem;
}

/* Filtri Fama/Epoca */
.filters-section {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 25px;
  margin-bottom: 30px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.chip {
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.chip:hover {
  border-color: var(--color-secondary);
  color: var(--color-text);
}

.chip.active {
  background-color: rgba(0, 255, 136, 0.12);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Statistiche personali nel menu */
.stats-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 500px;
  margin: 20px auto 0;
}

.stat-mini {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-mini-label {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

.stat-mini-val {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-logo);
}

/* BUTTONS */
.btn {
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #00bb63 100%);
  color: #04080e;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 255, 136, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--color-secondary) 0%, #008ebf 100%);
  color: #04080e;
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 210, 255, 0.4);
}

.btn-success {
  background-color: var(--color-primary);
  color: #04080e;
}

.btn-success:hover {
  background-color: #00dd73;
  box-shadow: 0 5px 12px rgba(0, 255, 136, 0.3);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-large {
  padding: 15px 35px;
  font-size: 1.1rem;
}

.btn:active {
  transform: translateY(0);
}

/* GAMEPLAY SCREEN */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.btn-back-menu {
  font-family: var(--font-main);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background-color: rgba(255,255,255,0.04);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-back-menu:hover {
  background-color: rgba(255,59,92,0.15);
  border-color: var(--color-error);
  color: var(--color-error);
}

.status-item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 10px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 80px;
}

.status-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.status-value {
  font-size: 1.3rem;
  font-weight: 800;
  font-family: var(--font-logo);
}

.glow-yellow {
  color: var(--color-warning);
  text-shadow: 0 0 10px rgba(255, 170, 0, 0.3);
}

.glow-red {
  color: var(--color-error);
  text-shadow: 0 0 10px rgba(255, 59, 92, 0.3);
}

.glow-cyan {
  color: var(--color-secondary);
  text-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

#game-timer.glow-red {
  animation: pulse 1s infinite;
}

.glass-panel {
  background: var(--color-bg-card);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.board-header {
  text-align: center;
  margin-bottom: 30px;
}

.board-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.board-header p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-top: 5px;
}

.target-name {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-secondary);
  text-shadow: 0 0 15px rgba(0, 210, 255, 0.3);
  margin-top: 10px;
  letter-spacing: -0.5px;
}

/* CAREER TIMELINE */
.timeline-container {
  position: relative;
  margin: 30px auto;
  max-width: 500px;
  padding: 10px 0;
}

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 4px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-secondary));
  border-radius: 2px;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.timeline-item {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 50px;
  animation: slideInRight 0.4s ease-out forwards;
  opacity: 0;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-15px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.timeline-dot {
  position: absolute;
  left: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--color-bg);
  border: 4px solid var(--color-primary);
  z-index: 2;
  box-shadow: 0 0 8px var(--color-primary);
  transition: var(--transition-smooth);
}

.timeline-item.active-club .timeline-dot {
  border-color: var(--color-secondary);
  box-shadow: 0 0 8px var(--color-secondary);
}

.timeline-item.hidden-club .timeline-dot {
  border-color: var(--color-warning);
  box-shadow: 0 0 8px var(--color-warning);
}

.timeline-item.manager-role .timeline-dot {
  border-color: #c9a227;
  box-shadow: 0 0 8px #c9a227;
}

.timeline-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  transition: var(--transition-smooth);
}

.timeline-content:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Manager badge at the bottom of the timeline */
.manager-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 10px 16px;
  background: rgba(255, 170, 0, 0.08);
  border: 1px solid rgba(255, 170, 0, 0.3);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--color-warning);
  font-weight: 600;
  animation: scaleIn 0.4s ease-out;
}

.team-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-text-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.team-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.04);
}

.team-logo-placeholder {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  opacity: 0.5;
}

.team-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.timeline-item.hidden-club .team-name {
  color: var(--color-warning);
  font-style: italic;
}

.team-years {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.capacity-tag {
  display: inline-block;
  background: rgba(201, 162, 39, 0.15);
  border: 1px solid rgba(201, 162, 39, 0.4);
  color: #c9a227;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 4px;
}

/* HINTS PANEL */
.hints-panel {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.btn-hint {
  font-size: 0.85rem;
  padding: 8px 14px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  border-radius: 8px;
}

.btn-hint:hover:not(:disabled) {
  background-color: rgba(0, 210, 255, 0.1);
  border-color: var(--color-secondary);
}

.btn-hint:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint-cost {
  color: var(--color-text-muted);
  font-size: 0.75rem;
}

.revealed-hints {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
}

.hint-pill {
  background: rgba(0, 210, 255, 0.15);
  border: 1px solid rgba(0, 210, 255, 0.3);
  color: #fff;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.hint-photo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: scaleIn 0.3s ease-out;
}

.blurred-image {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-secondary);
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.2);
  filter: blur(10px);
  transition: filter 0.5s ease-out;
}

.blurred-image.clear {
  filter: blur(0);
  border-color: var(--color-primary);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.btn-text {
  background: none;
  border: none;
  color: var(--color-secondary);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-text:hover {
  color: #6ee3ff;
}

/* GUESS SECTION */
.guess-section {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.autocomplete-container {
  position: relative;
  width: 100%;
}

input[type="text"] {
  width: 100%;
  background-color: var(--color-bg-input);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 15px 20px;
  border-radius: 12px;
  font-family: var(--font-main);
  font-size: 1.1rem;
  transition: var(--transition-smooth);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.2), inset 0 2px 4px rgba(0,0,0,0.2);
}

input[type="text"].guess-correct {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 18px rgba(0, 255, 136, 0.5) !important;
  background-color: rgba(0, 255, 136, 0.08);
  transition: all 0.15s ease;
}

input[type="text"].guess-incorrect {
  border-color: var(--color-error) !important;
  box-shadow: 0 0 18px rgba(255, 59, 92, 0.4) !important;
  background-color: rgba(255, 59, 92, 0.08);
  transition: all 0.15s ease;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-7px); }
  40%  { transform: translateX(7px); }
  60%  { transform: translateX(-5px); }
  80%  { transform: translateX(5px); }
  100% { transform: translateX(0); }
}

.autocomplete-list {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background-color: #111b2d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: none;
}

.autocomplete-list.active {
  display: block;
}

.autocomplete-item {
  padding: 12px 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover, .autocomplete-item.active {
  background-color: rgba(0, 255, 136, 0.1);
  color: var(--color-primary);
}

.guess-actions {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

/* GAME OVER SCREEN */
.gameover-card {
  max-width: 600px;
  margin: 40px auto;
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: center;
}

.gameover-icon {
  font-size: 4rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.gameover-title {
  font-family: var(--font-logo);
  font-size: 3rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-error);
  text-shadow: 0 0 15px rgba(255, 59, 92, 0.3);
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  width: 100%;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 15px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-val {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-logo);
}

.guessed-players-log {
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
  text-align: left;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 15px;
  border: 1px solid var(--color-border);
}

.guessed-players-log h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--color-text-muted);
}

.guessed-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.guessed-list li {
  background-color: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.2);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.gameover-actions {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 12px;
}

/* Helpers */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

/* Responsiveness */
@media (max-width: 600px) {
  .app-header {
    margin-bottom: 15px;
  }
  .hero-title {
    font-size: 1.8rem;
  }
  .status-bar {
    gap: 8px;
  }
  .status-item {
    padding: 8px;
  }
  .status-value {
    font-size: 1.1rem;
  }
  .glass-panel {
    padding: 15px;
  }
  .guess-actions {
    grid-template-columns: 1fr;
  }
  .stats-summary {
    grid-template-columns: 1fr;
  }
  .stats-preview {
    grid-template-columns: 1fr;
  }
  .filters-section {
    gap: 15px;
  }
}
