body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 24px;
  /* background: url('img/background.jpg') no-repeat center center fixed; */
  background-size: cover;
  color: #333;
}

/* Overlay pentru lizibilitate */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
  z-index: -1;
}

/* Fundal video */
#bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

/* Overlay alb pentru lizibilitate */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0);
  z-index: -1;
}

/* Fallback la fundal static (dacă video nu se încarcă) */
#bg-fallback {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('img/background.jpg') no-repeat center center;
  background-size: cover;
  z-index: -2;
}

.session-bar {
  text-align: center;
  margin: 16px auto 24px;
  font-size: 0.88em;
  color: #2c3e50;
  background: #f9fbff;
  padding: 8px;
  border-radius: 8px;
  max-width: 600px;
}

h1 {
  text-align: center;
  margin: 0 0 32px;
  color: #FFFFFF;
  font-size: 1.9em;
  font-weight: 700;
}

.cards-grid {
  display: grid;
  gap: 28px;
  justify-content: center;
  max-width: 1400px;
  margin: 0 auto;
}

@media (min-width: 600px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .cards-grid { grid-template-columns: repeat(4, 1fr); } }

/* DESKTOP: Flip 3D */
@media (min-width: 600px) {
  .card {
    height: 250px;
    perspective: 1000px;
    cursor: pointer;
    border-radius: 18px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
  }

  .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
  }

  .card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
    border-radius: 18px;
  }

  .card.flipped .card-inner {
    transform: rotateY(180deg);
  }

  .card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    padding: 32px 24px;
    box-sizing: border-box;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 18px;
    font-size: 1.15em;
    line-height: 1.4;
  }

  .card-front {
    color: #1a3d6d;
    font-weight: 700;
  }

  .card-back {
    color: #0049B7;
    transform: rotateY(180deg);
  }

  .card:nth-child(5n+1) .card-front { background-color: #eef7ff; }
  .card:nth-child(5n+2) .card-front { background-color: #f0f4ff; }
  .card:nth-child(5n+3) .card-front { background-color: #e8f2ec; }
  .card:nth-child(5n+4) .card-front { background-color: #fdf2f8; }
  .card:nth-child(5n+5) .card-front { background-color: #fff8e1; }

  .card:nth-child(5n+1) .card-back { background-color: #dbeaff; }
  .card:nth-child(5n+2) .card-back { background-color: #e6edff; }
  .card:nth-child(5n+3) .card-back { background-color: #d8f0e0; }
  .card:nth-child(5n+4) .card-back { background-color: #fce6f2; }
  .card:nth-child(5n+5) .card-back { background-color: #fff0c7; }

  .answer-text {
    font-style: italic;
    margin-bottom: 14px;
  }

  .details-btn {
    background: none;
    border: none;
    color: #0049B7;
    font-size: 0.9em;
    text-decoration: underline;
    cursor: pointer;
    padding: 8px 0 0;
  }

  .details-btn:hover {
    color: #002f6c;
  }

  .extra {
    margin-top: 16px;
    font-size: 0.92em;
    line-height: 1.55;
    color: #333;
    display: none;
  }

  .extra.show {
    display: block;
    animation: fadeIn 0.4s ease;
  }

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

/* MOBIL */
@media (max-width: 599px) {
  body { padding: 16px; }

  .card {
    background: white;
    border-radius: 18px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-bottom: 12px;
  }

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

  .card-content {
    padding: 28px 20px;
    text-align: center;
  }

  .question-text {
    font-weight: 700;
    font-size: 1.15em;
    color: #1a3d6d;
    margin-bottom: 12px;
  }

  .answer-text {
    font-style: italic;
    color: #0049B7;
    font-size: 1.1em;
    margin-bottom: 12px;
    display: none;
  }

  .card.flipped .answer-text {
    display: block;
  }

  .details-btn {
    background: none;
    border: none;
    color: #0049B7;
    font-size: 0.9em;
    text-decoration: underline;
    cursor: pointer;
    padding: 8px 0 0;
  }

  .details-btn:hover {
    color: #002f6c;
  }

  .extra {
    margin-top: 16px;
    font-size: 0.92em;
    line-height: 1.55;
    color: #333;
    display: none;
  }

  .extra.show {
    display: block;
    animation: fadeIn 0.4s ease;
  }
}

/* Robotel */
#robot {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 70px;
  height: 70px;
  z-index: 1000;
  cursor: pointer;
  transition: transform 0.3s ease;
  opacity: 0.92;
}

#robot:hover {
  opacity: 1;
  transform: scale(1.1) rotate(2deg);
}

/* Bară de control - sus-dreapta */
#control-bar {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  gap: 6px;
  z-index: 900;
}

.ctrl-btn,
.bg-btn {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
}

/* Buton control – gri mai închis */
.ctrl-btn {
  background: rgba(80, 80, 90, 0.5);
}

.ctrl-btn:hover {
  background: rgba(60, 60, 70, 0.8);
  transform: scale(1.3);
}

/* Buton fundal – gri mai deschis */
.bg-btn {
  background: rgba(100, 100, 120, 0.4);
}

.bg-btn:hover {
  background: rgba(80, 80, 100, 0.7);
  transform: scale(1.3);
}

.bg-btn.active {
  background: rgba(60, 60, 90, 0.9);
  transform: scale(1.2);
}

/* Data și ora - stânga sus */
#datetime-ip-container {
  position: fixed;
  top: 24px;
  left: 24px;
  font-size: 0.82em;
  color: #2c3e50;
  background: rgba(255, 255, 255, 0.85);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 9999;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  pointer-events: none;
  user-select: none;
  text-align: left;
}

.theme-btn {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(70, 130, 180, 0.5); /* albastru deschis */
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
}

.theme-btn:hover {
  background: rgba(70, 130, 180, 0.8);
  transform: scale(1.3);
}

.theme-btn.active {
  background: rgba(70, 130, 180, 0.95);
  transform: scale(1.2);
}

/* Buton temă – albastru mai intens pentru diferențiere */
.theme-btn {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(50, 120, 200, 0.5);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
}

.theme-btn:hover {
  background: rgba(50, 120, 200, 0.8);
  transform: scale(1.3);
}

.theme-btn.active {
  background: rgba(50, 120, 200, 0.95);
  transform: scale(1.2);
}