/* ======= OGÓLNE ======= */
body {
    font-family: Arial, Helvetica, sans-serif;
    color: #ffffff;
    text-shadow: none;
    background-color: #111111;
    padding: 15px;
    font-size: 15px;
}

input,
textarea {
    background-color: #222222;
    color: #ffffff;
    border: 1px solid #3a3a3a;
}

input::placeholder {
    color: #cfcfcf;
}

.container {
    width: 80%;
    padding: 0;
}

.hidden {
    display: none;
}

/* ======= NAGŁÓWKI ======= */
h1 {
    text-align: center;
}

h2,
h3 {
    display: inline;
}

h2,
label {
    margin: 0;
    padding: 0;
}

h3 {
    font-size: 18px;
}

h4,
h4-c {
    font-size: 10px;
    text-shadow: none;
    display: inline;
}

h4 {
    color: #cfcfcf;
}

h4-c {
    color: #ff7b7b;
}

.page-title {
    display: block;
    margin-top: 0;
    margin-bottom: .5rem;
    font-size: 2.15rem;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.subtitle {
    display: block;
    margin: 0;
    font-size: 1rem;
    color: #a0a0a0;
}

h-da {
    font-size: 16px;
    color: #ffd700;
}

/* ======= MENU I SEKCJE ======= */
.menu,
.dif,
.dif2,
.epoki,
.sortowanie {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 10px;
    background-color: #1f1f1f;
    border-radius: 8px;
    box-shadow: none;
    align-items: center;
    text-align: center;
    display: block;
}

.epoki {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.epoki h2 + label {
    margin-top: 0;
}

#innekraje {
    text-align: left;
}

#epoki {
    text-align: left;
}

.ni,
.opcjonalne {
    text-align: center;
    align-items: center;
    margin: 0 auto;
    display: block;
}

.opcjonalne {
    margin-bottom: 6px;
    margin-top: 5px;
}

.advanced-options {
    width: 50%;
    padding: 10px;
    background-color: #1f1f1f;
    border: 1px solid #333;
    border-radius: 8px;
    margin: 0 auto;
    align-items: left;
}

.advanced-options.visible {
    align-items: left;
}

/* ======= FLASHCARDS & SUMMARY ======= */
.flashcards,
.summary {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background-color: #1f1f1f;
    box-shadow: none;
    display: none;

}

.progress-container {
    width: 100%;
    background-color: #2a2a2a;
    border: 1px solid #333;
    margin-top: 0;
    position: relative;
    height: 25px;
}

#progress-bar {
    height: 100%;
    background-color: #4caf50;
    width: 0%;
    border-radius: 5px;
    transition: width 0.3s ease;
}

#progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    font-size: 14px;
    color: #fff;
    font-weight: bold;
}

.nadpaskowcy {
    display: flex;
    margin-bottom: 0;
    align-items: center;
}

.time-display {
    display: inline-block;
    font-size: 17px;
    font-weight: bold;
    color: #ffffff;
    padding: 5px 10px;
    margin-left: 73%;
    margin-bottom: -2px;
}

.chart {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 120px;
    width: 25%;
    margin-bottom: 0;
}

#resultsChart {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center !important;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 10px;
    margin-left: 150%;
}

/* ======= PRZYCISKI ======= */
.button,
#firebase-login button {
    background-color: #222222;
    color: #ffffff;
    padding: 10px 20px;
    border: 1px solid #3a3a3a;
    cursor: pointer;
    margin-right: 10px;
    display: inline-block;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    border-radius: 6px;
}

.button:hover,
#firebase-login button:hover {
    background-color: #2e2e2e;
}

#start {
    background-color: #2b2b2b;
    color: #ffffff;
    padding: 10px 20px;
    border: 1px solid #333;
    cursor: pointer;
    font-size: 20px;
    margin-bottom: 10px;
    width: 75%;
    margin: 0 auto;
    font-weight: bold;
    border-radius: 6px;
}

#start:hover {
    background-color: #333333;
}

.guziki {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 10px;
}

.guziki .next-button {
    background-color: #222222;
    color: #ffffff;
    padding: 10px 20px;
    border: 1px solid #3a3a3a;
    cursor: pointer;
    margin-left: 5%;
    margin-right: 0;
    text-align: center;
}

.guziki .next-button:hover {
    background-color: #2e2e2e;
}

.zs,
.for,
.ch {
    color: #ffffff;
    padding: 10px 20px;
    border: 1px solid #3a3a3a;
    cursor: pointer;
    background-color: #222222;
}

.zs {
    background-color: #c90202;
    margin-right: 1px;
    border-color: #8b0000;
}

.for,
.ch {
    background-color: #2b2b2b;
}

.for {
    margin-left: 5%;
    margin-right: 0;
    text-align: center;
}

.ch {
    margin-right: 10px;
}

.summary .button-container {
    display: flex;
    margin-top: 20px;
}

.button-container {
    display: block;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-top: 20px;
}

.hidden-button-container {
    display: none;
}

.hidden-input {
    display: none;
}

/* ======= INPUTY ======= */
.input-group input,
#firebase-login input[type="email"],
#firebase-login input[type="password"],
#firebase-login input[type="text"] {
    width: 100%;
    margin: 8px 0;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #222222;
    color: #fff;
    font-size: 15px;
    box-sizing: border-box;
    display: block;
}

.input-group {
    margin-bottom: 15px;
    margin-top: 10px;
}

#register-form input {
    display: block;
    margin: 8px auto;
}

/* ======= LIGHTBOX ======= */
.image-lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.image-lightbox-backdrop.visible { display: flex; }
.image-lightbox-content { max-width: 95%; max-height: 95%; position: relative; }
.image-lightbox-content img { max-width: 100%; max-height: 100%; border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,0.6); }
.image-lightbox-close {
    position: absolute; top: -10px; right: -10px; background: #222; color: #fff; border-radius: 50%; width: 36px; height: 36px; display:flex; align-items:center; justify-content:center; cursor:pointer; border:1px solid #444; font-weight:bold;
}
.image-lightbox-caption { margin-top:8px; color:#ddd; text-align:center; font-size:0.95rem; }

#firebase-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 40px auto 30px auto;
    padding: 30px 30px 20px 30px;
    background-color: #1f1f1f;
    border-radius: 12px;
    max-width: 350px;
    min-width: 260px;
    min-height: 320px;
    font-size: 16px;
}

#login-form,
#register-form {
    text-align: center;
}

#login-error {
    color: #ff4d4d;
    margin: 5px 0 0 0;
    min-height: 18px;
    text-align: center;
}

/* ======= EPOKI ======= */
.epoki label {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 16px;
    vertical-align: middle;
    width: 100%;
}

.epoka-daty,
.epoki .daty,
.epoki .przedzial {
    font-size: 12px !important;
    color: #bdbdbd;
    margin-left: 8px;
    display: inline;
    vertical-align: middle;
    font-weight: normal;
}

/* ======= LEADERBOARD & USER INFO ======= */
#leaderboard-container,
.user-info {
    background: #161616;
    color: #fff;
    padding: 14px 18px 10px 18px;
    border-radius: 10px;
    z-index: 1500;
    min-width: 220px;
    box-shadow: none;
    font-size: 15px;
    max-width: 320px;
    position: fixed;
}

#leaderboard-container {
    top: 60px;
    left: 10px;
}

.user-info {
    top: 10px;
    right: 20px;
    font-family: Arial, Helvetica, sans-serif;
    pointer-events: none;
}

#leaderboard-container h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #FFD700;
    text-align: left;
}

#leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

#leaderboard-table th,
#leaderboard-table td {
    padding: 2px 6px;
    text-align: left;
}

#leaderboard-table th {
    color: #FFD700;
    font-weight: bold;
    border-bottom: 1px solid #FFD700;
}

#leaderboard-table tr:nth-child(even) {
    background: #222222;
}

.gold-username {
    color: #FFD700;
    font-weight: bold;
}

/* Admin panel button placeholder left in layout - color updated only */
#admin-panel {
    position: fixed;
    bottom: 10px;
    left: 20px;
    background-color: #1f1f1f;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    border: 1px solid #333;
}

/* ======= INNE ======= */
c-c {
    position: fixed;
    bottom: 0;
    right: 0;
    font-size: 12px;
    color: #cfcfcf;
}

c-b {
    position: fixed;
    bottom: 0;
    left: 0;
    font-size: 12px;
}

.home-button {
    position: fixed;
    top: 10px;
    left: 10px;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
}

.correct {
    color: #4caf50;
}

.incorrect {
    color: #c90202;
}

#logout-btn {
    position: fixed;
    bottom: 30px;
    right: 20px;
    z-index: 1001;
    background-color: #222222;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    border: 1px solid #333;
}

#logout-btn:hover {
    background: #2e2e2e;
}

/* Bug report button (smaller than #logout-btn) */
.bug-btn {
        position: fixed;
        bottom: 10px;
        left: 20px;
        z-index: 1002;
        background-color: #222222;
        color: #ffffff;
        padding: 6px 12px; /* ~50% of logout (12px 24px) */
        border: 1px solid #3a3a3a;
        cursor: pointer;
        font-weight: bold;
        border-radius: 6px;
        font-size: 12px; /* smaller */
}
.bug-btn:hover { background-color: #2e2e2e; }

/* Simple modal for bug report */
.bug-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index:1003; display:flex;align-items:center;justify-content:center;
}
.bug-modal {
    background:#1f1f1f; color:#fff; padding:16px; border-radius:8px; width:90%; max-width:540px; box-sizing:border-box; border:1px solid #333;
}
.bug-modal h3 { margin-top:0; }
.bug-modal label { display:block; margin:8px 0 4px; font-weight:bold; }
.bug-modal textarea, .bug-modal select, .bug-modal input { width:100%; box-sizing:border-box; padding:8px; border-radius:6px; background:#222; border:1px solid #333; color:#fff; }
.bug-modal .row { display:flex; gap:8px; margin-top:12px; }
.bug-modal .row button { flex:1; }

@media (max-width: 768px) {
    /* extra safety: hide if small screen */
    .bug-btn, .bug-modal-backdrop { display:none !important; }
}

.year-range,
.error-margin {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 18px auto;
    padding: 18px 24px 14px 24px;
    background-color: #1f1f1f;
    border-radius: 8px;
    text-align: center;
    display: block;
    box-sizing: border-box;
}

.year-range h3,
.error-margin label {
    margin-bottom: 8px;
    margin-top: 1px;
    font-size: 17px;
    color: #fff;
    font-weight: bold;
    text-align: center;
    display: block;
}

.year-range input[type="number"],
.error-margin input[type="number"] {
    width: 260px;
    max-width: 90%;
    margin: 8px auto;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #222222;
    color: #fff;
    font-size: 16px;
    text-align: center;
    display: block;
    box-sizing: border-box;
}

.blok {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 18px auto;
    padding: 10px;
    background-color: #1f1f1f;
    border-radius: 8px;
    text-align: center;
    box-sizing: border-box;
}

.chronology-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 10px;
}

.chronology-event {
    flex: 1 1 auto;
    text-align: left;
    margin-right: 20px;
}

.chronology-input {
    width: 60px;
    text-align: right;
    margin-left: 0;
}

#mode-select {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: stretch;
    width: 100%;
    padding: 0;
}

#mode-select .button.trybowe {
    flex: 1 1 0;
    min-width: 0;
    min-height: 80px;
    height: 80px;
    box-sizing: border-box;
    font-size: 19px;
    margin: 0;
    border-radius: 0px;
    text-align: center;
    padding: 0;
}

.diva {
    display: block;
    font-size: 30px;
    margin-top: 10px;
    margin-bottom: 10px;
    color: #fff;
    text-align: center;
}

#mode-flashcards-btn {
    margin-right: 2px;
}

#mode-tryb2-btn {
    margin-left: 2px;
}

.button.sybau {
    font-size: 25px;
    width: 30%;
}

#mode-select {
    display: flex !important;
}

#guess-person-section {
    max-width: 600px;
    margin: 30px auto;
    padding: 30px;
    background: #1f1f1f;
    border-radius: 10px;
    color: #fff;
    text-align: center;
}

#person-description {
    font-size: 1.2em;
    margin-bottom: 20px;
}

#person-guess-input {
    width: 80%;
    padding: 10px;
    font-size: 1em;
    margin-bottom: 10px;
}

#person-guess-btn {
    margin-bottom: 20px;
}

#person-guess-result {
    margin-top: 15px;
    font-weight: bold;
}

.timeline-tooltip {
    pointer-events: none;
    opacity: 0.97;
}

#timeline-container {
    margin-bottom: 10px;
}

#timeline-container {
    margin-bottom: 30px !important;
}

.guziki {
    margin-top: 30px !important;
}

#timeline-summary-container {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
    position: relative;
}

#timeline-summary {
    position: relative;
    height: 40px;
    width: 100%;
    min-width: 200px;
    max-width: none;
    margin: 0 auto;
}

.multimedia-item img {
    border-radius: 8px;
    box-shadow: 0 2px 8px #0002;
    transition: transform 0.2s;
}

.multimedia-item img:hover {
    transform: scale(1.05);
}

.multimedia-item {
    display: inline-block;
    margin: 12px;
    text-align: center;
    vertical-align: top;
    width: 240px;
}

.multimedia-item .img-wrapper {
    width: 220px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px auto;
    background: #161616;
    border-radius: 8px;
    overflow: hidden;
}

.multimedia-item img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

#settings-gear {
    transition: color 0.2s;
}

#settings-gear:hover {
    color: #FFD700;
}

#settings-panel label {
    display: block;
    margin-bottom: 6px;
    cursor: pointer;
}

#flashcardContent {
    position: relative;
    color: #fff;
}

.grzyb {
    display: block;
}

.input-group-input {
    width: 100%;
    margin: 8px 0 0px;
    padding: 0px;
    border-radius: 6px;
    border: none;
    background: #222222;
    color: #fff;
    font-size: 15px;
    box-sizing: border-box;
    display: block;
}

#back-to-menu-tryb1 {
    display: block;
}

.input-group-label {
    font-weight: bold;
    display: block;
    margin-bottom: 0px;
    color: #fff;
    font-size: 16px;
}

#flashcard-count,
#guess-person-count {
    width: 50%;
    display: block;
    align-items: center;
    margin: 0 auto;
    justify-content: center;
    text-align: center;
    margin-left: 25%;
    margin-bottom: 0px;
    font-weight: bold;
    color: #fff;
    font-size: 15px;
    padding: 5px;
    border-radius: 6px;
    margin-bottom: 10px;
}

#institutions-count {
    width: 50% !important;
    margin: 0 auto;
    text-align: center;
    font-weight: bold !important;
    display: block;
    padding: 5px !important;
    border-radius: 6px !important;
    margin-bottom: 5px !important;
}

#start-guess-person-btn {
    width: 50%;
    font-size: 20px;
    margin-top: 10px;
}
#flashcardContent {
    position: relative; /* potrzebne dla absolutnego pozycjonowania indikatora */
    padding-top: 36px;  /* zarezerwowane miejsce u góry */
    box-sizing: border-box;
    margin-top: -50px;
}

/* Wspólny styl dla indikatorów trudności (fiszki, postacie, pojęcia) */
.dif-indicator {
    position: absolute;
    top: 8px;
    right: 12px;
    display: inline-block;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9em;
    z-index: 50;
    box-shadow: 0 2px 6px rgba(0,0,0,0.6);
    background: #444;
    color: #fff;
    width: auto;            /* nie zajmuje całego kontenera */
    min-width: 48px;       /* lekko dłuższy niż tekst */
    max-width: 60%;        /* nie za szeroki względem kontenera */
    box-sizing: border-box;
    text-align: center;
    pointer-events: none;
}

/* warianty kolorystyczne */
.dif-1 { background:#4caf50; }   /* podstawowy */
.dif-2 { background:#ff9800; }   /* rozszerzony */
.dif-3 { background:#f44336; }   /* ponadrozszerzony */

/* zapewnij, że definicja/tekst ma normalny z-index (aby nie zasłaniał) */
#flashcardContent > * { position: relative; z-index: 1; }

/* Dla sekcji zgadywania postaci i pojęć - rezerwuj miejsce */
#guess-person-section, #pojecia-section {
    position: relative;
    padding-top: 36px;
    box-sizing: border-box;
}
.institutions-btn-wrap { position: relative; display: inline-block; }
.beta-badge {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 100%;
  margin-top: 0px;
  font-size: 0.75rem;
  color: #ffd700;
  background: transparent;
  pointer-events: none;
  white-space: nowrap;
  line-height: 1;
  font-weight: 700;
  user-select: none;
}