@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');

* { box-sizing: border-box; }

:root {
  --correct: #00ff88;
  --partial: #ffd700;
  --wrong: #ff4444;
  --red: #e23636;
  --dark: #0a0e27;
  --darker: #050a1a;
  --light: #ffffff;
  --semi: rgba(255, 255, 255, 0.1);
  --trans: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Visually hidden (keeps content for accessibility/SEO without impacting layout) */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ===== Cookies banner ===== */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1200;
  display: none;
}
.cookie-banner.active {
  display: block;
}
.cookie-banner-inner {
  max-width: 1000px;
  margin: 0 auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 14, 39, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  padding: 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cookie-banner-title {
  font-weight: 950;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.cookie-banner-desc {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 650;
  line-height: 1.4;
}
.cookie-banner-link {
  display: inline-block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  font-weight: 800;
}
.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.cookie-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 900;
  transition: var(--trans);
}
.cookie-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(226, 54, 54, 0.55);
}
.cookie-btn-primary {
  background: rgba(226, 54, 54, 0.18);
  border-color: rgba(226, 54, 54, 0.7);
}
.cookie-btn-secondary {
  background: rgba(255, 255, 255, 0.06);
}

.cookie-manage {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 1199;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 14, 39, 0.65);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-weight: 900;
  letter-spacing: 0.3px;
  backdrop-filter: blur(12px);
  transition: var(--trans);
}
.cookie-manage:hover {
  transform: translateY(-2px);
  border-color: rgba(226, 54, 54, 0.55);
}

.cookie-prefs .modal-content {
  max-width: min(680px, 94vw);
}
.cookie-prefs-body {
  margin-top: 8px;
}
.cookie-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-weight: 850;
  color: rgba(255, 255, 255, 0.9);
}
.cookie-toggle input {
  width: 18px;
  height: 18px;
}
.cookie-prefs-note {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 750;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* ============ GLOBAL ============ */
html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 20px;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--dark) 0%, #1a1f42 50%, var(--darker) 100%);
  color: var(--light);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(226, 54, 54, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(0, 255, 136, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ============ ANIMATIONS ============ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes glow {
  0%, 100% { text-shadow: 0 0 10px rgba(226, 54, 54, 0.6),0 0 20px rgba(226, 54, 54, 0.3); }
  50% { text-shadow: 0 0 20px rgba(226, 54, 54, 0.9),0 0 40px rgba(226, 54, 54, 0.6); }
}

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

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.8) rotateX(90deg); }
  60% { transform: rotateX(-15deg); }
  80% { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1) rotateX(0); }
}

@keyframes spin3D {
  from { transform: rotateY(0) rotateZ(0); }
  to { transform: rotateY(360deg) rotateZ(10deg); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes confettiFall {
  to {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

@keyframes shimmer {
  0%, 100% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

/* ============ LOBBY ============ */
.lobby {
  display: none;
  text-align: center;
  animation: fadeInUp 0.8s ease-out;
}

.lobby.active {
  display: block;
}

.lobby-header {
  margin: 40px 0 60px;
  animation: fadeInDown 0.8s ease-out 0.2s backwards;
}

.logo-title {
  font-family: 'Bebas Neue', 'Arial Black', sans-serif;
  font-size: clamp(2.2rem, 8vw, 4rem);
  margin: 0 auto;
  font-weight: 900;
  letter-spacing: -1px;
  color: white;
  background: linear-gradient(135deg, #ff4444, #e23636, #ff6b6b);
  display: inline-block;
  padding: 15px 40px;
  transform: skew(-12deg) rotate(-2deg);
  border: 4px solid white;
  box-shadow: 12px 12px 0px rgba(0, 0, 0, 0.5), 0 0 40px rgba(226, 54, 54, 0.6);
  transition: var(--trans);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  filter: drop-shadow(0 8px 20px rgba(226, 54, 54, 0.5));
  animation: float 3s ease-in-out infinite;
}

.logo-title:hover {
  transform: skew(-12deg) rotate(0deg) scale(1.05);
  box-shadow: 16px 16px 0px var(--red), 0 0 60px rgba(226, 54, 54, 0.8);
}

.language-selector {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 25px 0;
  flex-wrap: wrap;
}

.lang-btn {
  padding: 8px 18px;
  border: 2px solid var(--semi);
  background: transparent;
  color: var(--light);
  cursor: pointer;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--trans);
  backdrop-filter: blur(10px);
  font-size: 0.9rem;
}

.lang-btn:hover {
  border-color: var(--red);
  background: rgba(226, 54, 54, 0.1);
  transform: translateY(-3px);
}

.lang-btn.active {
  border-color: var(--red);
  background: rgba(226, 54, 54, 0.3);
  box-shadow: 0 0 20px rgba(226, 54, 54, 0.5);
}

.modes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 25px;
  padding: 30px 0;
  max-width: 800px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .modes-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    max-width: 100%;
  }
}

.mode-card {
  background: linear-gradient(135deg, rgba(226, 54, 54, 0.1), rgba(226, 54, 54, 0.02));
  border: 1.5px solid var(--semi);
  padding: 30px 20px;
  border-radius: 16px;
  cursor: pointer;
  transition: var(--trans);
  color: var(--light);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.8s ease-out backwards;
}

.mode-card-locked {
  opacity: 0.75;
  cursor: not-allowed;
  filter: grayscale(15%);
}

.mode-card-locked::after {
  content: '🔒';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 3.2rem;
  line-height: 1;
  opacity: 0.35;
  pointer-events: none;
  transform: rotate(-8deg);
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

/* Center the "in dev" card in the middle column on desktop (3-col lobby grid). */
@media (min-width: 769px) {
  .modes-grid .mode-card-locked {
    grid-column: 2;
    justify-self: center;
    width: 100%;
    max-width: 240px;
  }
}

.mode-card-locked:hover {
  transform: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, rgba(226, 54, 54, 0.12), rgba(226, 54, 54, 0.03));
}

.mode-card:nth-child(1) { animation-delay: 0.1s; }
.mode-card:nth-child(2) { animation-delay: 0.2s; }
.mode-card:nth-child(3) { animation-delay: 0.3s; }
.mode-card:nth-child(4) { animation-delay: 0.4s; }
.mode-card:nth-child(5) { animation-delay: 0.5s; }

.mode-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: rotate(45deg);
  animation: shimmer 3s infinite;
}

.mode-card:hover {
  border-color: var(--red);
  background: linear-gradient(135deg, rgba(226, 54, 54, 0.25), rgba(226, 54, 54, 0.1));
  transform: translateY(-12px);
  box-shadow: 0 20px 50px rgba(226, 54, 54, 0.4);
}

.mode-card h3 {
  margin: 0 0 10px;
  font-size: 1.5rem;
  letter-spacing: 0.5px;
}

.mode-card p {
  margin: 0;
  opacity: 0.8;
  font-size: 0.9rem;
}

.difficulty {
  display: inline-block;
  background: rgba(226, 54, 54, 0.2);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  margin-top: 12px;
  border: 1px solid var(--semi);
}

/* ============ GAME AREA ============ */
.game-area {
  display: none;
  animation: fadeInUp 0.8s ease-out;
}

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

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 25px;
  border-bottom: 2px solid rgba(226, 54, 54, 0.2);
}

.mode-title-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 260px;
}

#mode-title {
  margin: 0;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--red);
  animation: fadeInDown 0.6s ease-out;
  letter-spacing: 1px;
  text-align: center;
}

.mode-switch {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.mode-switch-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 6px 4px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--trans);
}

.mode-switch-btn-locked {
  opacity: 0.7;
  cursor: not-allowed;
}

.mode-switch-btn-locked:hover {
  border-bottom-color: transparent;
  transform: none;
}

.mode-switch-btn:hover {
  color: var(--light);
  border-bottom-color: rgba(226, 54, 54, 0.5);
}

.mode-switch-btn.active {
  color: var(--light);
  border-bottom-color: var(--red);
}

.daily-progress {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(226, 54, 54, 0.18);
  color: rgba(255, 255, 255, 0.75);
  font-weight: 650;
  flex-wrap: wrap;
}

.daily-share {
  appearance: none;
  border: 1px solid rgba(226, 54, 54, 0.35);
  background: rgba(226, 54, 54, 0.12);
  color: var(--light);
  border-radius: 10px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 750;
  transition: var(--trans);
}

.daily-share:hover {
  background: rgba(226, 54, 54, 0.22);
  border-color: rgba(226, 54, 54, 0.6);
  transform: translateY(-2px);
}

.hint-area {
  display: none;
  margin: 14px 0 18px 0;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(226, 54, 54, 0.22);
  background: rgba(226, 54, 54, 0.06);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.hint-area.active { display: block; }

.hint-title {
  font-weight: 800;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 8px;
  text-align: center;
}

.hint-body {
  color: var(--correct);
  font-style: italic;
  line-height: 1.6;
  text-align: center;
}

.timeline-area {
  display: none;
  margin: 14px 0 18px 0;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(226, 54, 54, 0.22);
  background: rgba(226, 54, 54, 0.06);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.timeline-area.active { display: block; }

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  position: sticky;
  top: 10px;
  z-index: 20;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 14, 39, 0.72);
  backdrop-filter: blur(16px);
}

.timeline-title {
  font-weight: 900;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.92);
}

.timeline-meta {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 700;
}

.timeline-current {
  display: flex;
  justify-content: center;
  margin: 12px 0 16px;
  position: sticky;
  top: 74px;
  z-index: 19;
}

.timeline-card {
  user-select: none;
  cursor: grab;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(20, 25, 50, 0.55);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 900;
  letter-spacing: 0.3px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.25);
  transition: var(--trans);
}

.timeline-card:active { cursor: grabbing; transform: scale(0.98); }

.timeline-line {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-slot {
  border: 2px dashed rgba(226, 54, 54, 0.28);
  border-radius: 12px;
  padding: 10px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 800;
  transition: var(--trans);
}

.timeline-slot.over {
  border-color: rgba(226, 54, 54, 0.7);
  background: rgba(226, 54, 54, 0.12);
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 14, 39, 0.55);
  font-weight: 850;
}

.timeline-year {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.timeline-presets {
  margin-left: 10px;
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.timeline-preset {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-weight: 950;
  transition: var(--trans);
}

.timeline-preset:hover {
  transform: translateY(-1px);
  border-color: rgba(226, 54, 54, 0.55);
}

.timeline-preset.active {
  background: rgba(226, 54, 54, 0.18);
  border-color: rgba(226, 54, 54, 0.7);
}

.stats-card {
  margin-top: 18px;
  padding: 16px 14px;
  border-radius: 14px;
  border: 1px solid rgba(226, 54, 54, 0.22);
  background: rgba(226, 54, 54, 0.06);
}

.stats-card-tight {
  margin-top: 12px;
}

.stats-card-title {
  font-weight: 950;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.92);
}

.stats-card-foot {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 800;
  font-size: 0.9rem;
}

.stats-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.stats-title {
  font-weight: 1000;
  letter-spacing: 0.8px;
  font-size: 1.15rem;
}

.stats-sub {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 800;
  font-size: 0.9rem;
}

.stats-kpis {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.stats-kpi {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 14, 39, 0.45);
  padding: 12px 12px;
}

.stats-kpi-label {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 850;
  font-size: 0.82rem;
}

.stats-kpi-value {
  margin-top: 6px;
  font-weight: 1000;
  font-size: 1.1rem;
}

.stats-tabs {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stats-tab {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-weight: 950;
  letter-spacing: 0.5px;
  transition: var(--trans);
}

.stats-tab:hover {
  transform: translateY(-2px);
  border-color: rgba(226, 54, 54, 0.55);
}

.stats-tab.active {
  background: rgba(226, 54, 54, 0.18);
  border-color: rgba(226, 54, 54, 0.7);
}

.stats-panels {
  margin-top: 12px;
}

.stats-panel {
  display: none;
}
.stats-panel.active {
  display: block;
}

.stats-bars {
  display: grid;
  gap: 8px;
}

.stats-bar-row {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  gap: 10px;
  align-items: center;
}

.stats-bar-label,
.stats-bar-val {
  font-weight: 950;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
}

.stats-bar-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.stats-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(0, 255, 136, 0.9), rgba(226, 54, 54, 0.85));
  border-radius: 999px;
}

.stats-empty {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 850;
  padding: 6px 2px;
}

.stats-meta {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 850;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.stats-meta-label {
  color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 900px) {
  .stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.stats-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px solid rgba(226, 54, 54, 0.12);
  flex-wrap: wrap;
}

.stats-row:last-child { border-bottom: none; }

.stats-mode {
  font-weight: 900;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.92);
}

.back-btn {
  padding: 10px 20px;
  background: transparent;
  border: 1.5px solid var(--semi);
  color: var(--light);
  cursor: pointer;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--trans);
  backdrop-filter: blur(10px);
}

.back-btn:hover {
  border-color: var(--red);
  background: rgba(226, 54, 54, 0.15);
  transform: translateX(-4px);
}

/* ============ SEARCH ============ */
.search-area {
  margin-bottom: 30px;
  position: relative;
}

#hero-input {
  width: 100%;
  padding: 16px 22px;
  border: 1.5px solid var(--semi);
  background: rgba(20, 25, 50, 0.6);
  color: var(--light);
  border-radius: 12px;
  font-size: 1.1rem;
  transition: var(--trans);
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#hero-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#hero-input:focus {
  outline: none;
  border-color: var(--red);
  background: rgba(20, 25, 50, 0.95);
  box-shadow: 0 0 30px rgba(226, 54, 54, 0.5), inset 0 0 20px rgba(226, 54, 54, 0.1);
  transform: scale(1.02);
}

.suggestions {
  list-style: none;
  margin: 8px 0 0;
  padding: 8px 0;
  background: rgba(15, 20, 45, 0.95);
  border: 1.5px solid rgba(226, 54, 54, 0.3);
  border-radius: 12px;
  max-height: 280px;
  overflow-y: auto;
  position: absolute;
  width: 100%;
  z-index: 1000;
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.validate-guess {
  margin-top: 12px;
  width: 100%;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  border: 1.5px solid rgba(226, 54, 54, 0.35);
  /* Override anti "barre noire" Windows/Edge */
  background-color: rgba(226, 54, 54, 0.22);
  background-image: none;
  color: var(--light);
  transition: var(--trans);
  backdrop-filter: none;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  box-shadow: none;
  filter: none;
  overflow: hidden;
}

.validate-guess:hover {
  background: rgba(226, 54, 54, 0.24);
  transform: translateY(-2px);
}

.suggestions li.active {
  background: rgba(226, 54, 54, 0.22);
  color: var(--light);
  font-weight: 700;
}

.lobby-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 10px 0 30px;
  flex-wrap: wrap;
}

.lobby-action-btn {
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
  border: 1.5px solid rgba(226, 54, 54, 0.35);
  background: rgba(226, 54, 54, 0.12);
  color: var(--light);
  transition: var(--trans);
}

.lobby-action-btn:hover {
  background: rgba(226, 54, 54, 0.22);
  transform: translateY(-2px);
}

.suggestions li {
  padding: 12px 18px;
  cursor: pointer;
  transition: 0.2s;
  border-bottom: 1px solid rgba(226, 54, 54, 0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.suggestions li:last-child { border-bottom: none; }

.suggestions li:hover {
  background: rgba(226, 54, 54, 0.2);
  padding-left: 24px;
  color: var(--red);
  font-weight: 600;
}

.hero-mini {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-mini.broken { display: none; }

/* ============ DISPLAY CENTER ============ */
.display-center {
  margin: 0 0 30px 0;
  min-height: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
  background: linear-gradient(135deg, rgba(226, 54, 54, 0.12), rgba(226, 54, 54, 0.02));
  border: 1.5px solid rgba(226, 54, 54, 0.2);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
  position: relative;
}

.display-center.active {
  display: flex;
  min-height: 140px;
  margin: 20px 0 16px 0;
  padding: 18px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.emoji-display {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.emoji-item {
  font-size: clamp(2.5rem, 8vw, 5rem);
  display: inline-block;
  animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 0 15px rgba(226, 54, 54, 0.4));
}

.emoji-item.hidden {
  opacity: 0.2;
  filter: grayscale(100%);
  animation: pulse 2s ease-in-out infinite;
}

.citation-display {
  font-size: 1.4rem;
  font-style: italic;
  color: var(--correct);
  text-align: center;
  padding: 35px;
  line-height: 1.8;
  animation: fadeInUp 0.8s ease-out;
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
  letter-spacing: 0.5px;
}

/* ============ YESTERDAY ============ */
.yesterday {
  text-align: center;
  padding: 20px;
  margin: 30px 0;
  background: rgba(226, 54, 54, 0.08);
  border-left: 4px solid var(--red);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

#yesterday-text {
  font-weight: 600;
  opacity: 0.85;
  margin: 0;
}

#yesterday-hero {
  color: var(--correct);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 8px 0 0;
}

/* ============ RESULT BOXES ============ */
.guess-result-box {
  padding: 20px 25px;
  border-radius: 12px;
  margin-top: 20px;
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
  animation: slideIn 0.5s ease-out;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
}

.guess-result-box.correct {
  background: linear-gradient(135deg, var(--correct), #00dd77);
  color: #000;
  box-shadow: 0 0 25px rgba(0, 255, 136, 0.6), 0 10px 35px rgba(0, 0, 0, 0.3);
}

.guess-result-box.wrong {
  background: linear-gradient(135deg, var(--wrong), #ff2020);
  color: var(--light);
  box-shadow: 0 0 25px rgba(255, 68, 68, 0.6), 0 10px 35px rgba(0, 0, 0, 0.3);
}

.guesses-history {
  margin: 40px 0;
  animation: fadeInUp 0.8s ease-out 0.1s backwards;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.result-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
  animation: slideIn 0.5s ease-out;
  min-width: 0;
}

.property-box {
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: var(--trans);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.property-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.property-box.correct {
  background: linear-gradient(135deg, var(--correct), #00dd77);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.5), 0 6px 20px rgba(0, 0, 0, 0.25);
}

.property-box.partial {
  background: linear-gradient(135deg, var(--partial), #ffb700);
  color: #000;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 6px 20px rgba(0, 0, 0, 0.25);
}

.property-box.wrong {
  background: linear-gradient(135deg, var(--wrong), #ff2020);
  color: var(--light);
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.5), 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* ============ LEGEND ============ */
.legend {
  display: flex;
  justify-content: center;
  gap: 35px;
  margin: 40px 0;
  flex-wrap: wrap;
  padding: 30px;
  background: rgba(226, 54, 54, 0.08);
  border-radius: 12px;
  border: 1px solid rgba(226, 54, 54, 0.15);
  animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.correct-box, .partial-box, .wrong-box, .legend-arrows {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.correct-box {
  background: linear-gradient(135deg, var(--correct), #00dd77);
}

.partial-box {
  background: linear-gradient(135deg, var(--partial), #ffb700);
}

.wrong-box {
  background: linear-gradient(135deg, var(--wrong), #ff2020);
}

.legend-arrows {
  background: transparent;
  color: var(--red);
  font-size: 1.2rem;
  gap: 8px;
}

/* ============ MODAL ============ */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInUp 0.4s ease-out;
}

.modal-content {
  background: linear-gradient(135deg, rgba(226, 54, 54, 0.18), rgba(226, 54, 54, 0.05));
  padding: 50px;
  border-radius: 20px;
  max-width: 450px;
  width: 90%;
  border: 1.5px solid rgba(226, 54, 54, 0.3);
  backdrop-filter: blur(25px);
  text-align: center;
  animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(226, 54, 54, 0.4);
}

#modal-title {
  font-size: 2rem;
  margin: 0 0 15px;
  color: var(--correct);
  animation: glow 2s ease-in-out infinite;
}

#modal-hero {
  font-size: 1.6rem;
  color: var(--light);
  margin: 15px 0 20px;
  font-weight: 800;
  animation: slideIn 0.6s ease-out 0.2s backwards;
}

.modal-hero-img {
  width: min(140px, 46vw);
  aspect-ratio: 1;
  border-radius: 14px;
  object-fit: cover;
  display: none;
  margin: 12px auto 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}

#modal-tries {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 20px 0 30px;
  animation: slideIn 0.6s ease-out 0.3s backwards;
}

.modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.mode-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.help-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--light);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  cursor: pointer;
  padding: 8px 10px;
  font-weight: 800;
  transition: var(--trans);
  backdrop-filter: blur(10px);
}
.help-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--light);
  transform: translateY(-2px);
}

.patch-btn {
  /* Même style que .help-btn */
  background: rgba(255, 255, 255, 0.08);
  color: var(--light);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  cursor: pointer;
  padding: 8px 10px;
  font-weight: 800;
  transition: var(--trans);
  backdrop-filter: blur(10px);
}
.patch-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--light);
  transform: translateY(-2px);
}

.patch-meta {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 800;
  font-size: 0.95rem;
  margin: 6px 0 14px;
  text-align: center;
}

.patch-section-title {
  margin: 18px 0 10px;
  font-weight: 950;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.92);
}

.patch-list {
  margin: 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.55;
}

.patch-pool {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.patch-pill {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 14, 39, 0.45);
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 850;
  color: rgba(255, 255, 255, 0.88);
  text-align: center;
}

@media (max-width: 768px) {
  .patch-pool { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.howto-content {
  max-width: 720px;
  text-align: left;
}

/* Modale patch notes : fenêtre plus petite + scroll dans le corps */
#patch-modal .modal-content {
  max-width: min(680px, 94vw);
  width: 94%;
  max-height: min(72vh, 560px);
  padding: 22px 22px 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  overflow: hidden;
}

#patch-modal #patch-title {
  flex-shrink: 0;
  margin: 0 0 10px;
  text-align: center;
}

#patch-modal #patch-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 6px;
}

#patch-modal .modal-buttons {
  flex-shrink: 0;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(226, 54, 54, 0.18);
}
#howto-title {
  margin: 0 0 12px;
  text-align: center;
}
#howto-body h3 {
  margin: 14px 0 8px;
  font-size: 1.05rem;
}
#howto-body p {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
}
#howto-body ul {
  margin: 0 0 10px;
  padding-left: 18px;
}
#howto-body li {
  margin: 6px 0;
  color: rgba(255, 255, 255, 0.88);
}

.modal-btn {
  padding: 12px 30px;
  border: 1.5px solid var(--semi);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  transition: var(--trans);
  backdrop-filter: blur(10px);
  animation: fadeInUp 0.6s ease-out backwards;
}

#share-btn {
  background: rgba(226, 54, 54, 0.2);
  color: var(--light);
  border-color: var(--red);
  animation-delay: 0.4s;
}

#share-btn:hover {
  background: rgba(226, 54, 54, 0.4);
  box-shadow: 0 0 20px rgba(226, 54, 54, 0.5);
  transform: translateY(-3px);
}

#close-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--light);
  border-color: rgba(255, 255, 255, 0.3);
  animation-delay: 0.5s;
}

#close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--light);
  transform: translateY(-3px);
}

/* ============ CONFETTI ============ */
.confetti-container {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
}

.confetti {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: confettiFall 3s ease-in forwards;
  top: -20px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .logo-title { font-size: 2.5rem; }
  #mode-title { font-size: 1.8rem; }
  .modes-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 15px; }
  .result-row { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; min-width: 640px; }
  .property-box { font-size: 0.62rem; padding: 8px 4px; }
  .legend { gap: 20px; }
  .display-center.active { min-height: 110px; padding: 14px; margin: 16px 0 12px 0; }
  .emoji-item { font-size: 3rem; }
  .citation-display { font-size: 1.1rem; padding: 25px; }
  .game-header { flex-direction: column; align-items: stretch; }
  .back-btn { width: 100%; }
  .language-selector { margin-top: 15px; }
  .mode-title-wrap { width: 100%; }
}

/* ===== ANIMATIONS ÉPIQUES ===== */
@keyframes slideInResult {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes boxAppear {
  0% {
    opacity: 0;
    transform: scale(0.5) rotateX(90deg);
  }
  50% {
    transform: rotateX(-10deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateX(0);
  }
}

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

@keyframes glow {
  0%, 100% { text-shadow: 0 0 10px rgba(226, 54, 54, 0.5), 0 0 20px rgba(226, 54, 54, 0.3); }
  50% { text-shadow: 0 0 20px rgba(226, 54, 54, 0.8), 0 0 30px rgba(226, 54, 54, 0.5); }
}

@keyframes modalBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes revealEmoji {
  from {
    opacity: 0;
    transform: scale(0) rotateZ(-180deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotateZ(0);
  }
}

/* ===== LOBBY ===== */
.lobby {
  display: none;
  text-align: center;
  animation: slideUp 0.6s ease-out;
}

.lobby.active {
  display: block;
}

.lobby-header {
  margin-bottom: 50px;
  margin-top: 20px;
}

.logo-title {
  font-size: 4rem;
  margin: 0 0 5px 0;
  font-weight: bold;
  background: linear-gradient(135deg, #e23636, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(226, 54, 54, 0.4);
  animation: glow 2s ease-in-out infinite;
  letter-spacing: 2px;
}

.logo-title::before {
  content: '';
  margin-right: 10px;
}

.logo-subtitle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 10px 0 30px 0;
}

.language-selector {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 30px;
}

.lang-btn {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  color: #fff;
  cursor: pointer;
  border-radius: 8px;
  font-weight: bold;
  transition: 0.3s;
  backdrop-filter: blur(10px);
}

.lang-btn.active {
  border-color: #e23636;
  background: rgba(226, 54, 54, 0.3);
  box-shadow: 0 0 20px rgba(226, 54, 54, 0.3);
}

.lang-btn:hover {
  transform: translateY(-2px);
}

.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.mode-card {
  background: linear-gradient(135deg, rgba(226, 54, 54, 0.15), rgba(226, 54, 54, 0.05));
  border: 2px solid rgba(226, 54, 54, 0.3);
  padding: 25px 20px;
  border-radius: 12px;
  cursor: pointer;
  transition: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #fff;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.mode-card:hover {
  background: linear-gradient(135deg, rgba(226, 54, 54, 0.3), rgba(226, 54, 54, 0.15));
  border-color: #e23636;
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(226, 54, 54, 0.4);
}

.mode-card h3 {
  margin: 0 0 8px 0;
  font-size: 1.6rem;
  letter-spacing: 1px;
}

.mode-card p {
  margin: 0;
  opacity: 0.85;
  font-size: 0.9rem;
}

.difficulty {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.8rem;
  margin-top: 10px;
}

/* ===== GAME AREA ===== */
.game-area {
  display: none;
  animation: slideUp 0.6s ease-out;
}

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

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(226, 54, 54, 0.2);
}

#mode-title {
  flex: 1;
  margin: 0;
  font-size: 2rem;
  font-weight: bold;
  color: #e23636;
}

.back-btn {
  padding: 10px 20px;
  background: rgba(226, 54, 54, 0.15);
  border: 2px solid rgba(226, 54, 54, 0.3);
  color: #fff;
  cursor: pointer;
  border-radius: 8px;
  font-weight: bold;
  transition: 0.3s;
  backdrop-filter: blur(10px);
}

.back-btn:hover {
  background: rgba(226, 54, 54, 0.3);
  border-color: #e23636;
  transform: translateX(-3px);
}

/* ===== SEARCH AREA ===== */
.search-area {
  margin-bottom: 30px;
  position: relative;
}

#hero-input {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid rgba(226, 54, 54, 0.3);
  background: rgba(20, 25, 50, 0.8);
  color: #fff;
  border-radius: 10px;
  font-size: 1.1rem;
  transition: 0.3s;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

#hero-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

#hero-input:focus {
  outline: none;
  border-color: #e23636;
  background: rgba(20, 25, 50, 0.95);
  box-shadow: 0 0 20px rgba(226, 54, 54, 0.3), 0 8px 32px rgba(0, 0, 0, 0.3);
}

.suggestions {
  list-style: none;
  margin: 10px 0 0 0;
  padding: 0;
  background: rgba(20, 25, 50, 0.95);
  border: 2px solid rgba(226, 54, 54, 0.3);
  border-radius: 10px;
  max-height: 250px;
  overflow-y: auto;
  position: absolute;
  width: 100%;
  z-index: 10;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.suggestions li {
  padding: 12px 20px;
  cursor: pointer;
  transition: 0.2s;
  border-bottom: 1px solid rgba(226, 54, 54, 0.1);
}

.suggestions li:last-child {
  border-bottom: none;
}

.suggestions li:hover {
  background: rgba(226, 54, 54, 0.2);
  padding-left: 25px;
}

/* ===== YESTERDAY HERO ===== */
.yesterday-info {
  text-align: center;
  margin: 20px 0 30px 0;
  padding: 15px;
  background: rgba(226, 54, 54, 0.1);
  border-radius: 8px;
  border-left: 4px solid #e23636;
}

#yesterday-text {
  font-weight: bold;
  color: rgba(255, 255, 255, 0.8);
}

#yesterday-hero {
  color: #00ff88;
  font-weight: bold;
  margin-left: 5px;
}

/* ===== DISPLAY CENTER (LOLDLE) ===== */
.display-center {
  margin: 50px 0;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 40px;
  background: linear-gradient(135deg, rgba(226, 54, 54, 0.15), rgba(226, 54, 54, 0.05));
  border: 2px solid rgba(226, 54, 54, 0.2);
  border-radius: 15px;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.emoji-display {
  display: flex;
  gap: 15px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.emoji-item {
  font-size: 4rem;
  display: inline-block;
  animation: revealEmoji 0.6s ease-out;
  filter: drop-shadow(0 0 10px rgba(226, 54, 54, 0.4));
}

.emoji-item.hidden {
  font-size: 4rem;
  opacity: 0.15;
  filter: none;
}

.citation-display {
  font-size: 1.4rem;
  font-style: italic;
  color: #00ff88;
  text-align: center;
  padding: 30px;
  line-height: 1.8;
  animation: slideUp 0.6s ease-out;
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

/* ===== GUESS RESULT BOX ===== */
.guess-result-box {
  padding: 18px;
  border-radius: 12px;
  margin-top: 25px;
  font-weight: bold;
  font-size: 1.1rem;
  text-align: center;
  animation: slideInResult 0.5s ease-out;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.guess-result-box.correct {
  background: linear-gradient(135deg, #00ff88, #00cc66);
  color: #000;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.5), 0 8px 32px rgba(0, 0, 0, 0.3);
}

.guess-result-box.wrong {
  background: linear-gradient(135deg, #ff4444, #cc0000);
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 68, 68, 0.5), 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ===== GUESSES HISTORY ===== */
.guesses-history {
  margin: 40px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.result-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  margin: 15px 0;
  animation: slideInResult 0.5s ease-out;
  min-width: 0;
}

.property-box {
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: bold;
  text-align: center;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  animation: boxAppear 0.5s ease-out;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: 0.2s;
}

.property-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.property-box.correct {
  background: linear-gradient(135deg, #00ff88, #00cc66);
  color: #000;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.4), 0 4px 15px rgba(0, 0, 0, 0.2);
}

.property-box.partial {
  background: linear-gradient(135deg, #ffd700, #ffb700);
  color: #000;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4), 0 4px 15px rgba(0, 0, 0, 0.2);
}

.property-box.wrong {
  background: linear-gradient(135deg, #ff4444, #cc0000);
  color: #fff;
  box-shadow: 0 0 15px rgba(255, 68, 68, 0.4), 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ===== LEGEND ===== */
.legend {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 40px 0;
  flex-wrap: wrap;
  padding: 25px;
  background: rgba(226, 54, 54, 0.08);
  border-radius: 12px;
  border: 1px solid rgba(226, 54, 54, 0.15);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
}

.legend-box {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.legend-box.correct {
  background: linear-gradient(135deg, #00ff88, #00cc66);
}

.legend-box.partial {
  background: linear-gradient(135deg, #ffd700, #ffb700);
}

.legend-box.wrong {
  background: linear-gradient(135deg, #ff4444, #cc0000);
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 100;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: linear-gradient(135deg, rgba(226, 54, 54, 0.2), rgba(226, 54, 54, 0.05));
  padding: 40px;
  border-radius: 20px;
  max-width: 500px;
  border: 2px solid rgba(226, 54, 54, 0.3);
  backdrop-filter: blur(20px);
  text-align: center;
  animation: modalBounce 0.6s ease-out;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(226, 54, 54, 0.3);
}

#modal-title {
  font-size: 2.5rem;
  margin: 0 0 15px 0;
  color: #00ff88;
  animation: glow 2s ease-in-out infinite;
}

#modal-hero {
  font-size: 1.5rem;
  color: #fff;
  margin: 15px 0 20px 0;
}

#modal-tries {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 15px 0 25px 0;
}

.modal-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-btn {
  padding: 12px 25px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: 0.3s;
  backdrop-filter: blur(10px);
}

#share-btn {
  background: rgba(226, 54, 54, 0.3);
  color: #fff;
  border: 2px solid #e23636;
}

#share-btn:hover {
  background: rgba(226, 54, 54, 0.5);
  transform: translateY(-2px);
}

#close-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

#close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #fff;
  transform: translateY(-2px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .logo-title {
    font-size: 2.5rem;
  }

  .modes-grid {
    grid-template-columns: 1fr;
  }

  .result-row { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; min-width: 640px; }

  .property-box {
    font-size: 0.62rem;
    padding: 8px 4px;
  }

  .legend {
    gap: 20px;
    flex-direction: column;
  }

  .game-header {
    flex-direction: column;
    align-items: flex-start;
  }

  #mode-title {
    font-size: 1.5rem;
  }

  .display-center {
    min-height: 120px;
    margin: 30px 0;
    padding: 25px;
  }

  .emoji-item {
    font-size: 3rem;
  }

  .citation-display {
    font-size: 1rem;
    padding: 20px;
  }
}

/* ===== Splash (zoomed crop) ===== */
.splash-viewport {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  background: #0d0d12;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  position: relative;
}
.splash-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform;
}

.splash-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform, filter;
}

.splash-img-fallback {
  transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1), filter 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
  will-change: transform, filter;
}

.splash-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.splash-toggle {
  background: rgba(0, 0, 0, 0.45);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.8rem;
  backdrop-filter: blur(10px);
  transition: var(--trans);
}
.splash-toggle:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.38);
}
.splash-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: #888;
  font-size: 0.95rem;
}

/* ===== Final overrides: grille des modes en 3 colonnes ===== */
.modes-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  max-width: 800px;
}

@media (max-width: 768px) {
  .modes-grid {
    grid-template-columns: repeat(2, minmax(140px, 1fr)) !important;
  }
}

/* ===== FINAL OVERRIDES (display-center: emoji, citation, splash) ===== */
.display-center { display: none !important; }
.display-center.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  margin: 20px 0 16px 0;
  padding: 18px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.display-center.active:has(.splash-viewport) {
  min-height: min(72vw, 440px);
}
@media (max-width: 768px) {
  .display-center.active { min-height: 110px; padding: 14px; margin: 16px 0 12px 0; }
  .display-center.active:has(.splash-viewport) {
    min-height: min(88vw, 380px);
  }
}

/* ===== En-têtes colonnes (classic / expert) ===== */
.guess-header-row {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 8px;
  min-width: 0;
}

.guess-header-cell {
  padding: 8px 6px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 14, 39, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

