/* ================================================= */
/* GLAVNI LAYOUT KVIZA (index.html)                  */
/* ================================================= */
html, body {
  /* Ovdje vraćamo zaključavanje, ali samo za igru! */
  width: 100%;
  height: 100%;
  overflow: hidden;        /* Nema skrolanja */
  position: fixed;         /* Zakucano za ekran */
  top: 0;
  left: 0;
  overscroll-behavior: none;
  touch-action: none;
}

/* NOVO PRAVILO za omotač */
#app-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: absolute; /* OBAVEZNO */
  top: 0;             /* OBAVEZNO */
  left: 0;
  width: 100%;
  overflow: hidden; 
}


/* --- QUIZ: visinu kontrolira JS na mobitelu --- */
.quiz-container {
  display: flex;
  flex-direction: column;
  max-width: 600px;
  width: 100%;
  background-color: #1f1f1f;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  overflow: hidden;
  border: 2px solid #333;
  position: relative;
   /* Neka raste i smanjuje se da popuni body */
  min-height: 0;
  flex: 1;
}
/* --- BOJE PITANJA PO TEŽINI (Dodatak u quiz.css) --- */

/* LAKO (Baza: #16a34a - Zelena) */
.question-easy {
    /* Pozadina je 20% tvoje zelene (blaža) */
    background-color: rgba(22, 163, 74, 0.2) !important; 
    border: 2px solid #16a34a !important;
    color: #e0e0e0 !important; /* Svijetli tekst */
}

/* SREDNJE (Baza: #f1c40f - Zlatna) */
.question-medium {
    /* Pozadina je 15% tvoje zlatne (da tekst bude čitljiv) */
    background-color: rgba(241, 196, 15, 0.15) !important; 
    border: 2px solid #f1c40f !important;
    color: #fff !important;
}

/* TEŠKO (Baza: #e74c3c - Crvena) */
.question-hard {
    /* Pozadina je 25% tvoje crvene (blaža, ali opasna) */
    background-color: rgba(231, 76, 60, 0.25) !important;
    border: 2px solid #e74c3c !important;
    color: #ffdddd !important; /* Malo crvenkasti bijeli tekst */
}
/* ================================================= */
/* SCOREBOARD (index.html)                           */
/* ================================================= */
.scoreboard {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 10px 0;
  flex-shrink: 0;
}

/* Osnovni stil za sve bubble-e */
.score-bubble,
.correct-bubble,
.timer-bubble {
    min-width: 150px;
    transition: background-color 0.5s ease, transform 0.3s ease;
}

/* Točni odgovori */
#correctBoard {
  flex: 0 0 200px;
  padding: 6px 10px;
  background: #2d2d2d;
  color: #fff;
  font-weight: bold;
  text-align: start;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  position: relative;
}

#timerBoard {
  display: inline-block;
  width: 160px;
  padding: 0;
  margin: 0 10px;
  background: #222;
  color: #fff;
  font-weight: bold;
  text-align: start;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
#timerBoard .timer-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: #d42718;
  transition: width 0.2s linear;
  z-index: 0;
}
#timerBoard .timer-text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: start;
  height: 100%;
  width: 100%;
  padding: 0 5px;
}

#scoreBoard {
  display: inline-block;
  width: 200px;
  padding: 6px 10px;
  margin: 0 10px;
  background: #222;
  color: #fff;
  font-weight: bold;
  text-align: start;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.score-bubble:hover,
.correct-bubble:hover,
.timer-bubble:hover {
  transform: scale(1.05);
}

.score-bubble {
  background: linear-gradient(135deg, #f7b731, #f1c40f);
  border: 3px solid #d4ac0d;
  position: relative;
  overflow: hidden;
  min-width: 150px;
}
.correct-bubble {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  border: 3px solid #02c955;
  position: relative;
  overflow: hidden;
}
.correct-answers-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, #02c955);
  opacity: 0.9;
  transition: width 0.5s ease-in-out;
  z-index: 1;
}
#correct-answers-text {
    position: absolute;
    z-index: 2;
}
.timer-bubble {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  border: 3px solid #d42718;
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
}
@keyframes pulse-animation {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
.pulse-animation {
    animation: pulse-animation 1s infinite alternate;
}

/* Linija ispod scoreborda */
.scoreboard-line {
  width: 100%;
  height: 2px;
  background-color: #888;
  margin-top: 1px;
  border-radius: 1px;
  position: relative;
}

/* ================================================= */
/* NOTIFICATION BOARD (index.html)                   */
/* ================================================= */
#notificationBoard {
  display: block;
  width: 100%;
  background-color: #333;
  color: #fff;
  font-weight: bold;
  padding: 10px 15px;
  border-radius: 12px;
  text-align: center;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  height: auto !important;
  line-height: 1.4;
  white-space: normal;
  box-sizing: border-box;
}

@keyframes slideInOut {
  0% { transform: translateX(-100%); opacity: 0; }
  10% { transform: translateX(0); opacity: 1; }
  90% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}
#notificationBoard.show {
  animation: slideInOut ease forwards;
}

/* ================================================= */
/* CHAT BOX I PORUKE (index.html)                    */
/* ================================================= */
.chat-box {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column-reverse;
  gap: 15px;
  -webkit-overflow-scrolling: touch;
  white-space: pre-wrap;
  justify-content: flex-start;
  scrollbar-gutter: stable;
}

/* Poruke */
.message-container { display: flex; flex-direction: column; }

.message-bubble {
  padding: 10px 15px;
  border-radius: 20px;
  max-width: 80%;
  word-wrap: break-word;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  border: 2px solid transparent;
  transition: background-color 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
  text-align: start;
  width: -moz-fit-content;
  width: fit-content;
  max-width: 90%;
  margin: 4px 0;
  display: inline-block;
}

/* Mjehurić za MOJE poruke (desno) */
.message-bubble.my-chat-bubble {
  /* Glassmorphism Plava */
  background-color: rgba(11, 147, 246, 0.25) !important; 
  border: 2px solid #0b93f6 !important;               
  color: #ffffff !important;
  
  align-self: flex-end;
  
  /* Oblik: Oštar gornji desni kut */
  border-radius: 20px;
  border-top-right-radius: 2px; /* OŠTAR ĆOŠAK */
  
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Mjehurić za TUĐE poruke (lijevo) */
.message-bubble.user-chat-bubble {
  /* Glassmorphism Siva/Neutralna */
  background-color: rgba(255, 255, 255, 0.08) !important; 
  border: 2px solid #666 !important;                   
  color: #e0e0e0 !important;
  
  align-self: flex-start;
  
  /* Oblik: Oštar gornji LIJEVI kut (jer dolaze s lijeve strane) */
  border-radius: 20px;
  border-top-left-radius: 2px; /* OŠTAR ĆOŠAK */
  
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.question-message-bubble {
  /* Oblik */
  border-radius: 20px;
  border-top-left-radius: 2px; /* OŠTAR ĆOŠAK */
  
  /* Postojeći stilovi */
  /* background boja se miče jer je JS postavlja (question-easy, itd.) */
  color: #fff; 
  flex: 1;
  border: 2px solid #333; /* Default border ako JS ne postavi */
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.user-answer-bubble {
  /* Oblik: Oštar gornji desni kut */
  border-radius: 20px;
  border-top-right-radius: 2px; /* OŠTAR ĆOŠAK */
  
  padding: 10px 15px;
  max-width: 70%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  align-self: flex-end;
  word-wrap: break-word;
  min-height: 1.2em;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  
  /* Default boje (Lako/Zeleno) */
  background-color: rgba(22, 163, 74, 0.2);
  border: 2px solid #16a34a;
  color: #e0e0e0;
}

/* 2. BOJE ODGOVORA PO TEŽINI (Iste kao za pitanja) */

/* LAKO - Zelena */
.answer-easy {
    background-color: rgba(22, 163, 74, 0.2) !important; 
    border: 2px solid #16a34a !important;
    color: #e0e0e0 !important;
}

/* SREDNJE - Zlatna */
.answer-medium {
    background-color: rgba(241, 196, 15, 0.15) !important; 
    border: 2px solid #f1c40f !important;
    color: #fff !important;
}

/* TEŠKO - Crvena */
.answer-hard {
    background-color: rgba(231, 76, 60, 0.25) !important;
    border: 2px solid #e74c3c !important;
    color: #ffdddd !important;
}
.user-message-bubble { 
  background:#16a34a; 
  color:#fff; 
  align-self:flex-end; 
}
.user-name { 
  font-weight:600; 
  color:#4a90e2; 
  margin-bottom:5px; 
  margin-left:15px; 
}
.question-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 6px;
  padding: 0 2px; /* Malo uvucimo da se poravna s mjehurićem */
}
.info-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap; /* Ako je ekran preuzak, prebaci u novi red */
}

/* Stil za pojedinačni tag (Glassmorphism) */
.info-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: #ccc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    
    /* Izgled pločice */
    background-color: rgba(0, 0, 0, 0.3); /* Tamna prozirna */
}

/* ---------------------------
     Styles moved from index.html <style> block
     (kept here to avoid inline CSS and fix mobile styling)
     --------------------------- */
/* Block interactions while consent pending */
body.consent-pending * {
    pointer-events: none !important;
    user-select: none !important;
}
/* Allow the banner and its contents to be interactive */
#cookie-banner, #cookie-banner * {
    pointer-events: auto !important;
    user-select: auto !important;
}
#cookie-banner button { margin-top: 8px; }
/* Propose modal styles to match site modals */
#proposeQuestionModal {
    align-items: center;
    justify-content: center;
}
#proposeQuestionModal .modal-content {
    width: 520px;
    max-width: calc(100% - 40px);
    background: #0f0f0f;
    color: #eaeaea;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.03);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#proposeQuestionModal .modal-content h2 { margin: 0 0 4px 0; color: #ffd54a; }
#proposeQuestionModal input, #proposeQuestionModal textarea, #proposeQuestionModal select {
    width: 100%;
    padding: 10px 12px;
    background: #151515;
    border: 1px solid #2a2a2a;
    color: #eaeaea;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
}
#proposeQuestionModal textarea { min-height: 80px; resize: vertical; }
#proposeQuestionModal button { padding: 8px 12px; border-radius:6px; border: none; cursor: pointer; }
#submitProposalBtn { background: #5d5dff; color: white; }
#closeProposalModal { background: #333; color: #fff; }
#proposalStatus { font-size: 13px; }
.info-tag {
    border: 1px solid rgba(255, 255, 255, 0.1); /* Tanki okvir */
    padding: 4px 8px;
    border-radius: 8px; /* Zaobljeno */
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* ------------------
   Choose-room prompt styles
   Matches quiz look and makes the CTA more prominent
   ------------------ */
.choose-room-bubble {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(90deg, rgba(13,90,190,0.14), rgba(10,120,230,0.08));
    border: 2px solid rgba(93,93,255,0.18);
    color: #eaf2ff;
    padding: 12px 14px;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(6,24,80,0.24);
    max-width: 100%;
}

.choose-room-text {
    font-weight: 700;
    color: #e6f0ff;
    font-size: 0.98rem;
    margin-right: 8px;
}

.choose-room-btn {
    background: linear-gradient(180deg, #ffd54a, #ffb300);
    color: #0b0b0b;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0,0,0,0.18);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    white-space: nowrap;
}
.choose-room-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0,0,0,0.22);
}
.choose-room-btn:active {
    transform: translateY(0);
}

/* Slightly larger on small screens for better tap targets */
@media (max-width: 600px) {
    .choose-room-btn {
        padding: 12px 18px;
        font-size: 1.05rem;
        border-radius: 12px;
    }
    .choose-room-bubble { padding: 14px; border-radius: 12px; }
}


/* Specifični stilovi (opcionalno) */
.tag-category {
    color: #b6ccf2; /* Plavičasti tekst za kategoriju */
    border-color: rgba(93, 93, 255, 0.2);
}

.tag-diff-easy {
    color: #4ade80 !important;
    border: 1px solid rgba(74, 222, 128, 0.3) !important;
    background-color: rgba(74, 222, 128, 0.1) !important;
}

/* SREDNJE (Zlatna) */
.tag-diff-medium {
    color: #f1c40f !important;
    border: 1px solid rgba(241, 196, 15, 0.3) !important;
    background-color: rgba(241, 196, 15, 0.1) !important;
}

/* TEŠKO (Crvena) */
.tag-diff-hard {
    color: #ff6b6b !important;
    border: 1px solid rgba(255, 107, 107, 0.3) !important;
    background-color: rgba(255, 107, 107, 0.1) !important;
}
.report-button {
  background: rgba(231, 76, 60, 0.1); /* Blago crvena */
  color: #e57373;
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 8px; /* Isti radius kao tagovi */
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto; /* Gurni ga skroz desno */
}

.report-button:hover {
  background: rgba(231, 76, 60, 0.2);
  border-color: rgba(231, 76, 60, 0.6);
  color: #fff;
}
.report-button:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.1);
  cursor: default;
}

/* Stil za netočne odgovore */
.incorrect-answer-bubble {
  background-color: #f8d7da;
  color: #721c24;
  border: 2px solid #333;
}

@keyframes pop {
  0%   { transform: scale(0.95); opacity: 0.8; }
  50%  { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); }
}

.question-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

@keyframes slideInQuestion {
  0% { transform: translateX(-100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

.answer-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.round-separator {
  border-top: 2px solid #888;
  margin: 15px 0;
  width: 100%;
}

/* Stil za hint poruku */
.message-bubble.hint-message {
  font-style: italic;
  background-color: rgba(49, 49, 49, 0.5); 
  color: #b0b0b0; 
  text-align: start;
  white-space: pre-wrap;
  word-break: break-word;
}
.message-bubble.hint-message .hint-icons {
  font-size: 1em;
  font-style: normal;
}

/* Sistemske poruke */
.system-message-bubble {
    /* Oblik */
    border-radius: 20px;
    border-top-left-radius: 2px; /* OŠTAR ĆOŠAK */

    /* Postojeći stilovi (Glassmorphism) */
    background-color: rgba(49, 49, 49, 0.5); 
    color: #b0b0b0; 
    text-align: start;
    font-style: italic;
    white-space: pre-wrap;
    word-break: break-word;

    /* Obrub kojeg smo dodali maloprije */
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Stilo i animacija za točne odgovore s multiplajerima */
.multiplier-1x {
    background-color: #166328;
    color: #ffffff;
    border-color: #0e522a;
    animation: bounce 0.35s ease;
}
.multiplier-2x {
    background-color: #f1c40f;
    color: #fff;
    border-color: #d4ac0d;
    animation: bounce 0.6s ease;
}
.multiplier-3x {
    background-color: #e74c3c;
    color: #fff;
    border-color: #922b21;
    animation: pulse-strong 1s infinite alternate;
}

@keyframes bounce {
    0% { transform: scale(0.9); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
@keyframes pulse-strong {
    0% { transform: scale(1); box-shadow: 0 0 10px rgba(231, 76, 60, 0.8); }
    100% { transform: scale(1.1); box-shadow: 0 0 20px rgba(231, 76, 60, 1); }
}

/* Avatari i imena u chatu */
.user-info-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.chat-avatar-name {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #555;
  background-color: #333;
}
.user-info-container + .message-bubble {
  margin-top: 4px;
}


/* ================================================= */
/* BONUS BET (index.html)                            */
/* ================================================= */

.bonus-bet-container {
    display: none; 
    flex-direction: column;
    align-items: center;
    padding: 15px;
    
    /* --- NOVI STIL (Glassmorphism Gold) --- */
    /* Blaga zlatna prozirna pozadina */
    background-color: rgba(255, 215, 0, 0.08); 
    /* Tanki zlatni okvir */
    border: 1px solid rgba(255, 215, 0, 0.4);
    /* Zaobljeni rubovi kao ostale kartice */
    border-radius: 16px;
    
    /* Pozicioniranje i sjena */
    margin: 10px 15px; /* Malo odmaknuto od rubova */
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    backdrop-filter: blur(5px); /* Zamućenje pozadine za bolji efekt */
    
    flex-shrink: 0;
    color: #fff;
    animation: slideInBonus 0.5s ease-out;
}

@keyframes slideInBonus {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Naslov "BONUS PITANJE" */
.bonus-bet-header {
    font-size: 1.2rem;
    font-weight: 800;
    color: #f1c40f; /* Zlatna boja */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    animation: pulseSlow 2s infinite;
}

@keyframes pulseSlow {
    0% { text-shadow: 0 0 5px rgba(241, 196, 15, 0.2); }
    50% { text-shadow: 0 0 15px rgba(241, 196, 15, 0.6); }
    100% { text-shadow: 0 0 5px rgba(241, 196, 15, 0.2); }
}

.bonus-bet-timer, .bonus-bet-pot {
    font-size: 0.95rem;
    margin-top: 4px;
    color: #e0e0e0;
    font-weight: 500;
}

/* Brojke unutar timera i pota */
.bonus-bet-timer span, .bonus-bet-pot span {
    font-weight: bold;
    color: #fff;
    font-family: monospace; /* Da brojevi ne skaču */
    font-size: 1.1em;
}

/* Grupa za unos (Input + Gumb) */
.bonus-bet-input-group {
    display: flex;
    margin-top: 15px;
    width: 100%;
    max-width: 320px;
    gap: 8px; /* Razmak između inputa i gumba */
}

.bonus-bet-input-group input {
    flex-grow: 1;
    background-color: rgba(0, 0, 0, 0.3); /* Tamna prozirna */
    border: 1px solid #555;
    border-radius: 10px; /* Zaobljeno */
    padding: 10px;
    text-align: center;
    color: #fff;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.bonus-bet-input-group input:focus {
    outline: none;
    border-color: #f1c40f; /* Zlatni fokus */
}

/* Gumb "Uloži" */
.bonus-bet-input-group button {
    padding: 10px 20px;
    /* Zlatni gradijent */
    background: linear-gradient(135deg, #f1c40f, #d4ac0d);
    color: #1a1a1a; /* Tamni tekst za kontrast */
    border: none;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.bonus-bet-input-group button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(241, 196, 15, 0.4);
}

.bonus-bet-input-group button:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ================================================= */
/* INPUT AREA (index.html)                           */
/* ================================================= */
.input-area {
  padding: 15px;
  padding-bottom: calc(15px + env(safe-area-inset-bottom));
  border-top: 1px solid #444;
  display: flex;
  gap: 10px;
  align-items: center;
  background: #1f1f1f;
  flex-shrink: 0;
}

#messageInput, #usernameInput {
  flex-grow: 1;
  background-color: #2b2b2b;
  color: #e0e0e0;
  border: 1px solid #555;
  border-radius: 20px;
  padding: 10px 15px;
  transition: border-color .3s;
  font-size: 16px;
}
#messageInput:focus, #usernameInput:focus {
  border-color: #5d5dff;
  outline: none;
}
#sendButton {
  /* Pozadina i boja */
  background-color: #5d5dff;
  color: white;
  border: none;
  
  /* Oblik - KRUG */
  border-radius: 50%; 
  width: 45px;       /* Fiksna širina */
  height: 45px;      /* Fiksna visina */
  
  /* Centriranje ikone */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;        /* Mičemo stari padding */
  
  cursor: pointer;
  flex-shrink: 0;    /* Ne daj da se zgnječi */
  transition: background-color 0.3s, transform 0.2s;
  
  /* Sjena za dubinu */
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

#sendButton:hover:not(:disabled) {
  background-color: #4a4adf;
  transform: scale(1.05);
}

#sendButton:disabled {
  background-color: #444;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Stil za samu ikonu unutar gumba */
#sendButton svg {
  width: 20px;       /* Veličina ikone */
  height: 20px;
  fill: currentColor;
  margin-left: 3px;  /* Optička korekcija (aviončić obično izgleda bolje malo pomaknut) */
}

/* Gumb za prijavu u input area */
.login-button {
    background-color: #5d5dff;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    
    /* Ključne promjene za veličinu */
    padding: 10px 15px;       /* Malo manji padding nego prije */
    font-size: 1em;           /* Standardna veličina */
    width: auto;              /* BITNO: Brišemo 130px, neka bude auto */
    max-width: fit-content;   /* Širi se samo koliko je tekst dugačak */
    flex-shrink: 0;           /* Ne daj da se gumb zgnječi */
    white-space: nowrap;      /* Tekst uvijek u jednom redu */
    margin: 5px 5px 5px 0;    /* Mali razmak desno od gumba */
}
.login-button:hover {
    background-color: #4a4adf;
}
#usernameDisplay {
    padding: 10px;
    background-color: #3a3a3a;
    border-radius: 8px;
    margin-right: 10px;
    color: #e0e0e0;
}


/* ================================================= */
/* LEADERBOARD (index.html)                          */
/* ================================================= */

/* Staro pravilo za .secondary-container je obrisano */

.leaderboard-wrapper {
  width: 100%;
  max-width: 600px;
  margin-top: 20px;
  padding-bottom: env(safe-area-inset-bottom);
  /* max-height: 40vh; */ /* Uklonjeno ograničenje */
}
.drawer-container .leaderboard-wrapper { /* Novo pravilo za ladicu */
  width: 100%;
  margin-top: 0;
  padding-bottom: env(safe-area-inset-bottom);
}


.leaderboard-container {
  /* Prozirna tamna pozadina */
  background-color: rgba(255, 255, 255, 0.03);
  /* Tanki sivi rub */
  border: 1px solid rgba(255, 255, 255, 0.1);
  
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: #e0e0e0;
  width: 100%;
}

.leaderboard-list {
  list-style: none;
  padding: 15px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.leaderboard-item {
  /* Pozadinu postavlja JS (ne diramo background-color) */
  color: #e0e0e0;
  
  /* Moderni padding i oblik */
  padding: 10px 15px;
  border-radius: 12px; /* Zaobljeno */
  
  display: flex;
  justify-content: space-between;
  align-items: center;
  
  /* --- NOVO: Stakleni rub oko boje --- */
  /* Ovo čini da solidna boja izgleda kao "ulivena" u staklo */
  border: 1px solid rgba(255, 255, 255, 0.3); 
  
  /* Sjena za dubinu */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  
  margin-bottom: 6px; /* Razmak između igrača */
  transition: transform 0.1s;
}

.left-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;       
  min-width: 0;
}
.right-group {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-left: auto;
  justify-content: flex-end;
  flex-shrink: 0; 
  white-space: nowrap;
}
.leaderboard-item .username {
  white-space: nowrap;      /* Tekst uvijek u jednom redu */
  overflow: hidden;         /* Sakrij višak */
  text-overflow: ellipsis;  /* Dodaj "..." na kraju */
  font-size: 0.85em; /* Ime je 15% manje od ostatka teksta */
  font-weight: 600;
  /* Opcionalno: Ograniči maksimalnu širinu ako želiš još strože */
  /* max-width: 150px; */ 
}
.leaderboard-item.first { background-color: #FF5722; color: #fff; }
.leaderboard-item.second { background-color: #FFC107; color: #fff; }
.leaderboard-item.third { background-color: #CDDC39; color: #fff; }

/* Gumb za ljestvicu */
.toggle-leaderboard-btn {
  display: block;
  width: 100%;
  margin: 0 0 10px 0;
  padding: 15px;
  background-color: #333;
  color: #fff;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 12px;
}

.leaderboard-divider {
  list-style: none;
  height: 1px;
  background: rgba(255, 255, 255, 0.2); /* Suptilna linija */
  margin: 8px 10px;
}
.leaderboard-item.my-rank {
    border: 2px solid #fff !important; /* Bijeli svijetli rub za mene */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}
.my-rank {
    font-weight: bold;
    border: 3px solid rgb(189, 0, 0);
    padding-left: 5px;
}
.leaderboard-item.first.my-rank,
.leaderboard-item.second.my-rank,
.leaderboard-item.third.my-rank {
    border: 3px solid rgb(189, 0, 0);
}

/* Header ljestvice */
.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    
    /* Transparentno s tankom linijom dolje */
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
#leaderboardTitle {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: #aaa;
  padding: 10px 15px;
  margin: 0;
  
  background-color: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- KONTROLE (Gumbi Runda/Tjedan...) --- */
.leaderboard-controls {
  display: flex;
  justify-content: center; /* Centriraj grupu */
  align-items: center;
  
  /* Ključno: Koristimo gap umjesto margina za savršen razmak */
  gap: 8px; 
  
  padding: 10px 15px;
  background-color: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;            /* Osiguraj da zauzima cijelu širinu */
  box-sizing: border-box; /* Da padding ne širi element van okvira */
}

/* Stil gumba za filtriranje */
.lb-type-btn {
  font-family: 'Inter', sans-serif;
  background-color: transparent;
  color: #aaa;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 8px 0;         /* Vertikalni padding, horizontalni nije bitan zbog flexa */
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  
  /* Ključno za poravnanje: */
  flex: 1;                /* Svaki gumb uzima JEDNAK dio prostora */
  margin: 0;              /* Mičemo margine (gap radi posao) */
  text-align: center;     /* Tekst u sredinu gumba */
  min-width: 0;           /* Sprječava da dugačak tekst razvali gumb */
}

.lb-type-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.lb-type-btn.active {
  background-color: rgba(93, 93, 255, 0.2);
  color: #fff;
  border-color: #5d5dff;
  box-shadow: 0 0 10px rgba(93, 93, 255, 0.2);
}

#leaderboardTitle {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #e0e0e0;
  padding: 8px 15px;
  margin: 0;
  background-color: #2b2b2b;
  border-bottom: 1px solid #444;
  margin-bottom: 5px;
}

/* Level na ljestvici */
.leaderboard-item .level {
  font-size: 0.8em;
  font-weight: 700;
  color: #DDDDDD;
  margin-right: 6px;
  margin-left: 2px;
  opacity: 0.9;
  white-space: nowrap;
  vertical-align: middle;
}
.leaderboard-item.my-rank .level {
  color: #FFFFFF;
  opacity: 1;
}

.level-icon {
  width: 1.2em;
  height: 1.2em;
  margin-right: 4px;
  vertical-align: -0.15em;
  color: #2ecc71;
}

/* Kvačica na ljestvici */
.answered-correctly {
  display: inline-block;
  width: 1.3em;
  height: 1.1em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath fill='%232ecc71' stroke='%23000000' stroke-width='5' d='M10 50 L 40 80 L 90 30 L 80 20 L 40 60 L 20 40 Z' /%3E%3C/svg%3E");
  filter: drop-shadow(1px 1px 1.5px rgba(0, 0, 0, 0.6));
  background-size: 100%;
  background-repeat: no-repeat;
  background-position: center;
  vertical-align: middle;
}

/* Avatar na ljestvici */
.leaderboard-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-left: 2px;
    margin-right: 5px;
    vertical-align: middle;
    border: 1px solid #555;
    background-color: #333;
}

/* Tooltip za igrače */
.player-tooltip {
    display: none;
    position: absolute;
    background-color: #2c3e50;
    color: #ecf0f1;
    border: 2px solid #3498db;
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    z-index: 1001;
    max-width: 250px;
    font-family: 'Inter', sans-serif;
    pointer-events: none;
}
.player-tooltip h3 {
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #34495e;
    color: #f7b731;
    font-size: 1.1rem;
}
.player-tooltip .tooltip-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 5px;
}
.player-tooltip .tooltip-stat strong {
    color: #bdc3c7;
    margin-right: 10px;
}
.player-tooltip .tooltip-stat span {
    font-weight: 600;
    color: #fff;
}




/* ================================================= */
/* PROFILE DROPDOWN (index.html)                     */
/* ================================================= */
.current-room-display {
  padding: 8px 12px;
  background-color: #e0eafc;
  color: #333;
  border-radius: 12px;
  border: 1px solid #b6ccf2;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 2px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.current-room-display span {
  color: #0056b3;
  font-weight: 700;
  text-transform: uppercase;
}
.current-room-display #roundNumberLabel {
  font-weight: 700;
}

/* Gumb za profil/opcije na mobitelu */
.profile-button-mobile {
    display: none;
}

/* Gumb za profil/opcije na desktopu */
.profile-button-desktop {
    display: none;
}

/* Glavni kontejner za pozicioniranje */
.profile-dropdown-container {
    position: relative;
    display: inline-block;
    z-index: 20;
}

/* Sadržaj padajućeg izbornika (Dropdown) */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #383838;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4);
    z-index: 1;
    border-radius: 10px;
    padding: 5px;
    top: 100%;
    right: 0;
    width: 100%;
    border: 2px solid #5e5d5d;
}

/* Stil za link unutar dropdowna */
.dropdown-content a {
    color: #e0e0e0;           /* Svijetli tekst */
    padding: 8px 12px;        /* Malo veći padding za lakši dodir */
    text-decoration: none;
    display: block;
    border-radius: 12px;
    
    /* --- IZMJENA: Tamni stil kao quiz-container --- */
    border: 2px solid #333;   /* Bilo je #5d5dff */
    background-color: #2b2b2b; /* Tamno siva pozadina gumba */
    
    margin-bottom: 5px;       /* Malo veći razmak između gumba */
    text-align: center;
    transition: all 0.2s ease; /* Fina animacija */
}

/* Hover efekt (kad se pritisne) */
.dropdown-content a:hover {
    background-color: #383838; /* Malo svjetlija siva */
    border-color: #555;        /* Svjetliji sivi rub */
    color: #fff;
}

/* Stil za gumb 'Odjavi se' */
.logoff-button {
    background-color: #d9534f;
    color: white;
    width: 100%;
    border: none;
    padding: 8px 12px;
    text-align: center;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
    margin-top: 0;
}
.logoff-button:hover {
    background-color: #c9302c;
}

/* Gumbi unutar dropdowna */
.dropdown-button {
  background-color: #2b2b2b; /* Tamna pozadina (ista kao linkovi) */
  color: #e0e0e0;            /* Svijetli tekst */
  width: 100%;
  border: 2px solid #333;    /* Default tamni rub */
  padding: 10px 12px;        /* Malo veći padding za akcije */
  text-align: center;
  cursor: pointer;
  border-radius: 12px;       /* Isti radius */
  font-size: 14px;
  font-weight: bold;         /* Malo deblji font jer su akcije */
  margin-bottom: 8px;        /* Razmak između gumba */
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.special-btn-room {
    border-color: #5d5dff !important; /* Ističe se bojom ruba */
    color: #fff;
}
.special-btn-room:hover {
    background-color: rgba(93, 93, 255, 0.15); /* Blagi plavi sjaj na dodir */
    transform: translateY(-1px);
}

/* 3. SPECIFIČAN STIL: Promijeni Ikonu (Zeleni rub) */
.special-btn-avatar {
    border-color: #2ecc71 !important; /* Ističe se bojom ruba */
    color: #fff;
}
.special-btn-avatar:hover {
    background-color: rgba(46, 204, 113, 0.15); /* Blagi zeleni sjaj na dodir */
    transform: translateY(-1px);
}
.special-btn-invite {
    border-color: #e67e22 !important; /* Narančasta */
    color: #fff;
}
.special-btn-invite:hover {
    background-color: rgba(230, 126, 34, 0.15); /* Blagi narančasti sjaj */
    transform: translateY(-1px);
}
/* 4. LOG OFF (Zadržavamo crvenu, ali da paše u dizajn) */
.logoff-button {
    background-color: #d9534f; /* Crvena pozadina ostaje za opasnost */
    color: white;
    width: 100%;
    border: none;
    padding: 10px 12px;
    text-align: center;
    cursor: pointer;
    border-radius: 12px; /* Zaobljeno kao ostali */
    font-size: 14px;
    font-weight: bold;
    margin-top: 10px;    /* Odvoji ga malo od ostatka */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.logoff-button:hover {
    background-color: #c9302c;
}


/* ================================================= */
/* MODALI - UNIFICIRANI DIZAJN (SVI MODALI)          */
/* ================================================= */

/* 1. BAZA ZA SVE STANDARDNE MODALE (.modal-content) */
.modal-content {
    background-color: #1f1f1f !important;
    border: 2px solid #5d5dff !important;
    border-radius: 16px !important;
    padding: 30px 25px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7) !important;
    color: #e0e0e0 !important;
    max-width: 450px;
    width: 90%;
    position: relative;
    text-align: center;
    margin: auto; /* Za sigurno centriranje */
}

/* Naslovi u modalima */
.modal-content h2 {
    color: #fff;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

/* Tekst paragrafa */
.modal-content p {
    color: #aaa;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Gumb za zatvaranje (X) */
.close-modal-btn {
    color: #aaa;
    top: 15px;
    right: 20px;
    font-size: 28px;
    transition: color 0.2s, transform 0.2s;
}
.close-modal-btn:hover {
    color: #fff;
    transform: scale(1.1);
}

/* --- 2. MODAL ZA USERNAME --- */

#quizUsernameInput {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    background-color: #0e0e0e;
    border: 1px solid #444;
    border-radius: 12px;
    color: #fff;
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#quizUsernameInput:focus {
    border-color: #5d5dff;
    box-shadow: 0 0 10px rgba(93, 93, 255, 0.3);
}

#submitQuizUsernameBtn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #5d5dff, #4a4adf);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

#submitQuizUsernameBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(93, 93, 255, 0.4);
    filter: brightness(1.1);
}

#submitQuizUsernameBtn:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.google-name-hint {
    margin-top: 15px;
    font-size: 0.85em;
    color: #888;
    font-style: italic;
}

/* --- 3. MODAL ZA LOGIN --- */

.login-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

#googleLoginButtonContainer {
    background-color: #fff;
    padding: 4px;
    border-radius: 6px;
    width: fit-content;
    margin: 0 auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.login-option-button {
    width: 100%;
    max-width: 260px;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
}

#guestLoginBtn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}
#guestLoginBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.4);
}

#closeLoginModal {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}
#closeLoginModal:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(231, 76, 60, 0.4);
}

/* --- 4. MODAL ZA ODABIR SOBE --- */

.room-selection-container {
    max-width: 400px;
}

.room-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 20px;
}

.room-button {
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 800;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.room-button:hover:not([disabled]) {
    transform: translateY(-3px);
    filter: brightness(1.1);
    box-shadow: 0 8px 15px rgba(0,0,0,0.4);
}

.room-button[disabled] {
    cursor: not-allowed;
    filter: grayscale(100%);
    opacity: 0.5;
}

.room-button[data-room-id="main-room"] { background: linear-gradient(135deg, #5d5dff, #4a4adf); }
.room-button[data-room-id="Noob"] { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.room-button[data-room-id="Casual"] { background: linear-gradient(135deg, #f1c40f, #d4ac0d); color: #fff; }
.room-button[data-room-id="Pro"] { background: linear-gradient(135deg, #e74c3c, #c0392b); }

/* --- 5. MODAL ZA AVATARE --- */

.avatar-modal {
    max-width: 500px;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 15px;
    background-color: #121212;
    border: 1px solid #333;
    border-radius: 12px;
    max-height: 350px;
    overflow-y: auto;
    margin-top: 10px;
}

.avatar-option {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 2px solid #444;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background-color: #2b2b2b;
}

.avatar-option:hover {
    transform: scale(1.15);
    border-color: #fff;
    z-index: 10;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.avatar-option.selected {
    border-color: #2ecc71;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.6);
    transform: scale(1.1);
    background-color: #1e3a2a;
}

/* --- 6. SHARE MODAL (REDIZAJNIRAN) --- */
/* Ovo zamjenjuje stari stil za .share-modal-content */

.share-modal-content {
    /* Kopiramo stilove iz .modal-content da bude identično */
    background-color: #1f1f1f !important;
    border: 2px solid #5d5dff !important;
    border-radius: 16px !important;
    padding: 30px 25px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7) !important;
    color: #e0e0e0 !important;
    
    /* Specifičnosti za share modal */
    width: 90%;
    max-width: 420px;
    position: relative;
    text-align: center;
    margin: auto;
}

.share-modal-content h3 {
    color: #fff;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

.share-modal-content p {
    color: #aaa;
    margin-bottom: 20px;
}

/* Input za link */
#shareLinkInput {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 20px;
    background-color: #0e0e0e;
    border: 1px solid #444;
    border-radius: 12px;
    color: #4ade80;
    font-family: monospace;
    text-align: center;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}
#shareLinkInput:focus {
    border-color: #5d5dff;
    box-shadow: 0 0 8px rgba(93, 93, 255, 0.3);
}

/* Grid za share gumbe */
.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

/* Stil share gumba */
.share-option {
    padding: 12px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    color: white;
    transition: transform 0.2s, filter 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-option:hover {
    transform: translateY(-3px);
    filter: brightness(1.15);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.share-option[data-platform="whatsapp"] { background: linear-gradient(135deg, #25D366, #128C7E); }
.share-option[data-platform="facebook"] { background: linear-gradient(135deg, #3b5998, #2d4373); }
.share-option[data-platform="messenger"] { background: linear-gradient(135deg, #0084FF, #006bcf); }
.share-option[data-platform="viber"] { background: linear-gradient(135deg, #7360F2, #5949c2); }
.share-option[data-platform="telegram"] { background: linear-gradient(135deg, #0088cc, #006699); }

.share-option[data-platform="copy"] { 
    background: linear-gradient(135deg, #34495e, #2c3e50); 
    grid-column: span 2; 
    color: #fff;
    border: 1px solid #555;
}

/* Close za Share modal */
.close-modal {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    transition: transform 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
.close-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(231, 76, 60, 0.4);
}



/* ================================================= */
/* RESPONZIVNI STILOVI (samo za index.html)          */
/* ================================================= */

/* --- DESKTOP (1024px+) --- */
@media (min-width: 1024px) {
  #app-wrapper {
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    padding: 0;
    margin: 0;
    height: 100vh;
  }

  #drawerTriggers {
        display: none;
    }
    
  /* Sakrij mobilnu ladicu za opcije, NE treba na desktopu */
  #options-drawer {
    display: none;
  }

  /* Ladica za ljestvicu je sada naš desni panel */
  #leaderboard-drawer {
    flex: none;
    width: 300px;
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex; /* Ovo je važno */
    flex-direction: column;
    
    /* Poništavamo mobilne 'fixed' stilove */
    position: static; 
    transform: none;
    box-shadow: none;
    border: none;
    
    /* Poništavamo mobilni overflow */
    overflow-y: hidden;
  }
  
  /* Pokaži ponovno desktop gumb za "Opcije" */
  /* (Ovo poništava pravilo 'display:none' iz mobilnog CSS-a) */
  #leaderboard-drawer .profile-button-desktop {
      display: block !important;
  }
  
  /* Sakrij mobilni gumb za opcije na desktopu */
  #leaderboard-drawer .profile-button-mobile {
      display: none !important;
  }
    
  .quiz-container {
    flex: none;
    width: 600px;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    
  }

  /* .secondary-container je zamijenjen s #leaderboard-drawer */

  #leaderboard-drawer .leaderboard-wrapper {
    flex: 1;
    padding-bottom: 0;
    max-height: unset;
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .leaderboard-content {
    display: block !important;
    flex: 1;
    overflow-y: auto; /* Ljestvica skrola, ne cijeli panel */
    max-height: unset;
  }
  .scoreboard { 
    flex-shrink: 0;
  }

  .chat-box {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
  }

  .input-area {
    flex-shrink: 0;
    margin: 0;
    padding: 5px;
    border-top: 1px solid #444;
    box-sizing: border-box;
  }

  /* .leaderboard-wrapper je već definiran gore */

  .leaderboard-container {
    flex: 1; /* Rastegni se da popuniš .leaderboard-wrapper */
    display: flex;
    flex-direction: column;
    overflow-y: hidden; /* Nema duplog skrola */
    margin: 0;
    padding: 0;
  }

  .toggle-leaderboard-btn {
    display: none !important;
  }
  
  /* Gumb za pozivnice */
  .leaderboard-header .invite-button {
    padding: 6px 20px;
    font-size: 16px;
  }
}

/* --- TABLET (1023px-) --- */
@media (max-width: 1023px) {

    /* --- 1. SAKRIVANJE STARIH/DESKTOP ELEMENATA --- */
    .profile-button-desktop,
    .profile-button-mobile,
    .invite-button-mobile,
    .toggle-leaderboard-btn {
        display: none !important;
    }
    
    /* Sakrij desktop gumbe unutar ladica */
    #leaderboard-drawer .profile-dropdown-container,
    #leaderboard-drawer .leaderboard-header .invite-button,
    #options-drawer .profile-button-mobile,
    #options-drawer .profile-button-desktop {
        display: none !important;
    }

    /* --- 2. POPRAVAK SADRŽAJA U LADICAMA --- */
    
    /* Prisilno prikaži dropdown sadržaj u Options ladici */
    #options-drawer #profileDropdownMobile {
        display: block; 
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0;
    }
    #options-drawer .profile-dropdown-container {
        width: 100%;
    }
    
    /* Okvir s informacijama u Options ladici */
    #options-drawer .current-room-display {
        margin-bottom: 15px;
        flex-shrink: 0;
        width: 100%; 
        box-sizing: border-box;
    }


    /* --- 3. KONTEJNER GUMBA (Fiksira ih desno) --- */
    #drawerTriggers {
        position: fixed;
        right: 0;
        top: 60px;
        z-index: 9999;
        
        display: flex;
        flex-direction: column;
        align-items: flex-end; /* Ključno: Sidri gumbe desno! */
        transform: none;
        pointer-events: none; /* Da kontejner ne blokira klikove, samo gumbi */
    }

    /* --- 4. GUMBI (Osnovno stanje) --- */
    .drawer-trigger {
        pointer-events: auto; /* Vrati klikove na gumbe */
        display: flex;
        align-items: center;
        justify-content: center;
        
        width: 45px;
        height: 45px;
        font-size: 1.4em;
        margin: 8px 0;
        margin-right: 0; /* Mora biti 0 da dira rub */
        
        background-color: #2b2b2b;
        color: #aaa;
        
        /* Debljina 2px da paše ladici */
        border: 2px solid #333; 
        border-right: none; /* Nema desnog ruba jer je na ekranu */
        
        border-radius: 10px 0 0 10px;
        cursor: pointer;
        box-shadow: -2px 2px 5px rgba(0,0,0,0.3);
        
        /* Glatka animacija širine */
        transition: width 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.2s;
        
        position: relative;
        z-index: 1002; /* Iznad ladice */
    }
    
    /* Ukloni stare boje gumba */
    #triggerOptionsBtn, #triggerLeaderboardBtn { 
        background-color: #2b2b2b; 
    }
    
    /* Aktivno stanje na dodir */
    .drawer-trigger:active, 
    .drawer-trigger:hover {
        background-color: #383838;
        color: #fff;
        border-color: #666;
    }

    /* --- 5. GUMB (Aktivno stanje - SPOJEN S LADICOM) --- */
    .drawer-trigger.active-tab {
        /* Širina otvorenog taba */
        width: 56px; 
        
        /* Boja ista kao ladica */
        background-color: #1f1f1f; 
        color: #fff;
        
        /* MAGIJA SPAJANJA */
        border-left: none; /* Ovdje se spaja s ladicom! */
        
        /* Ukloni sjenu da se spoj ne vidi */
        box-shadow: none; 
        
        /* Resetiraj hover efekt za aktivni tab */
        border-color: #333; /* Vrati tamni rub (osim lijevog) */
    }


    /* --- 6. LADICE (Zajedničko) --- */
    .drawer-container {
        position: fixed;
        
        /* IZMJENA: 56px (gumb) - 2px (rub) = 54px */
        right: 54px; 
        
        width: 320px;
        max-width: calc(100% - 60px);
        z-index: 1000; /* Ispod gumba */
        background-color: #1f1f1f;
        box-shadow: -4px 0 20px rgba(0,0,0,0.5);
        
        transform: translateX(120%); 
        transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        
        padding: 0;
        box-sizing: border-box;
        overflow-y: hidden;
    }

    .drawer-container.drawer-open {
        transform: translateX(0);
    }


    /* --- 7. OBLIK LADICA (Svi kutovi zaobljeni) --- */
    
    /* Ljestvica */
    #leaderboard-drawer {
        top: 68px;
        height: calc(100svh - 70px);
        
        border: 2px solid #333; 
        border-radius: 15px; 
        
        display: flex;
        flex-direction: column;
    }

    /* Opcije */
    #options-drawer {
        height: auto;
        top: 68px;
        padding: 20px 15px;
        
        border: 2px solid #333; 
        border-radius: 15px; 
    }


    /* --- 8. FLEXBOX LOGIKA ZA SKROLANJE UNUTAR LJESTVICE --- */
    
    /* Wrapper */
    #leaderboard-drawer .leaderboard-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding: 10px;
    }
    
    #leaderboard-drawer .current-room-display { flex-shrink: 0; }

    /* Kontejner */
    #leaderboard-drawer .leaderboard-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        border: none;
        box-shadow: none;
        overflow-y: hidden;
    }

    /* Sadržaj */
    #leaderboard-drawer .leaderboard-content { 
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    /* Headeri */
    #leaderboard-drawer .leaderboard-header,
    #leaderboard-drawer .leaderboard-controls,
    #leaderboard-drawer #leaderboardTitle {
        flex-shrink: 0;
    }

    /* LISTA (Jedino ovo skrola) */
    #leaderboard-drawer .leaderboard-list {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
        scrollbar-gutter: stable; 
    }
}

/* --- MOBITEL (768px-) --- */
@media (max-width: 768px) {
    /* Header ljestvice */
    .leaderboard-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 12px;
    }
    .leaderboard-title {
        font-size: 1.1rem;
        margin: 0;
    }

    /* Share Modal */
    .share-option {
        display: block !important;
    }
    .share-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .share-option[data-platform="copy"] {
        grid-column: span 1;
        background: #7f8c8d;
    }

    /* Stari gumbi su već sakriveni gornjim pravilom */
    
    /* Profile Dropdown Mobile */
    /* .profile-dropdown-container je sada dio ladice, ne treba posebno pravilo */
}

/* --- DESKTOP (769px+) --- */
@media (min-width: 769px) {
    /* Share Modal - samo Copy */
    .share-option:not([data-platform="copy"]) {
        display: none;
    }
    .share-buttons {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    /* Invite Button Desktop */
    .invite-button-mobile {
        display: none;
    }
    .leaderboard-header .invite-button {
        display: block;
    }
    
    /* Profile Button Desktop */
    .profile-button-desktop {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 10px auto;
    text-align: center;
    text-decoration: none;
    
    /* --- NOVI NEUTRALNI STIL --- */
    background-color: rgba(255, 255, 255, 0.03); /* Prozirno tamno */
    color: #aaa;                                 /* Siva boja teksta */
    border: 1px solid rgba(255, 255, 255, 0.2);  /* Tanki sivi rub */
    
    padding: 10px 15px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    box-sizing: border-box;
    transition: all 0.2s ease;
}

/* Hover efekt - tek kad pređeš mišem postane malo svjetliji i dobije boju */
.profile-button-desktop:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: #5d5dff; /* Plavi rub samo na hover */
    color: #fff;           /* Bijeli tekst na hover */
    transform: translateY(-2px);
}
    .profile-button-mobile {
        display: none !important;
    }
}


/* --- MALI MOBITEL (600px-) --- */
@media (max-width: 600px) {
  #scoreBoard,
  #correctBoard,
  #timerBoard {
    flex: 1;
    min-width: 40px;
    max-width: 120px;
    padding: 4px 6px;
    font-size: 14px;
    text-align: start;
    box-sizing: border-box;
    white-space: nowrap;
  }
  .scoreboard {
    display: flex;
  }
  .login-button {
        padding: 6px 10px;    /* Još manji gumb na mobitelu */
        font-size: 12px;      /* Manja slova */
        height: 36px;         /* Fiksna visina */
    }

    /* Ovo osigurava da input ne bježi van ekrana */
    .input-area #messageInput {
        min-width: 0;         /* Dopušta inputu da se smanji */
        flex-grow: 1;         /* Uzima sav preostali prostor */
        width: 100%; 
    }
    
    /* Malo smanjimo i gumb 'Pošalji' da sve stane */
    #sendButton {
        width: 40px;  /* Malo manji na mobitelu */
        height: 40px;
    }
    #sendButton svg {
        width: 18px;
        height: 18px;
    }
  .leaderboard-item .username {
      font-size: 0.8em; /* (cca 12.8px ako je baza 16px) */
  }
}

/* --- VRLO MALI MOBITEL (480px-) --- */
@media (max-width: 480px) {
    /* Header ljestvice */
    .leaderboard-header {
        padding: 10px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .leaderboard-title {
        font-size: 1rem;
    }
    .invite-button {
        padding: 5px 10px;
        font-size: 11px;
        width: 100%;
        max-width: 200px;
    }
    
    /* Share Modal */
    .share-buttons {
        grid-template-columns: 1fr;
    }
    .share-modal-content {
        width: 95%;
        padding: 15px;
    }
    
    /* Kontrole ljestvice */
    .leaderboard-controls {
        padding: 8px 10px;
        gap: 5px;
    }
    .lb-type-btn {
        padding: 5px 8px;
        font-size: 13px;
        margin: 0 2px;
    }
    
    /* Naslov ljestvice */
    #leaderboardTitle {
        font-size: 1rem;
        padding: 6px 10px;
    }
}

/* --- Sakrivanje ljestvice kod tipkanja (samo mobitel) --- */
@media (max-width: 1023px) { /* Koristimo 1023px kao mobilni breakpoint */
    .hidden-on-focus {
        display: none !important;
    }
}

/* --- Level na ljestvici (mali ekran) --- */
@media (max-width: 600px) {
  .leaderboard-item .level {
    margin-right: 4px;
    margin-left: 1px;
    font-size: 0.75em;
  }
}

/* --- Tooltip na mobitelu --- */
@media (pointer: coarse) {
    .player-tooltip {
        pointer-events: auto;
    }
}

/* ================================================= */
/* NEON ZNAK U LADICAMA (DRAWER HEADER)              */
/* ================================================= */

.neon-sign-drawer {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    letter-spacing: 1px;
    text-align: center;
    margin: 15px 0;
        
    /* Vrlo suptilan sjaj, bez onog "blurry" efekta */
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
        
    cursor: default;
}

.neon-sign-drawer .neon-kviz {
    color: #FFD700; 
}

/* Suptilnija animacija za ladicu */
@keyframes neon-pulse {
    from { opacity: 0.9; transform: scale(1); }
    to { opacity: 1; transform: scale(1.02); }
}

/* Na malim mobitelima još malo smanji */
@media (max-width: 480px) {
    .neon-sign-drawer {
        font-size: 1.2rem;
        margin: 5px 0 10px 0;
    }
}
/* --- GORNJA LADICA ZA REKLAME --- */
.drawer-top {
    position: fixed;
    top: -100%; /* Skriveno iznad ekrana */
    left: 0;
    width: 100%;
    height: 100%; /* Prekriva cijeli ekran */
    background-color: rgba(10, 10, 15, 0.98);
    z-index: 9999; /* Iznad svega */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    visibility: hidden; /* Dok nije aktivna, nevidljiva je sustavu */
    opacity: 0;         /* Za svaki slučaj */
    /* Dodajemo visibility u tranziciju da se ne pojavi prerano/prekasno */
    transition: top 0.5s cubic-bezier(0.25, 1, 0.5, 1), visibility 0s linear 0.5s, opacity 0.3s ease;
}

.drawer-top.active {
    top: 0;
    
    /* --- NOVO: KAD JE AKTIVNA, POSTAJE VIDLJIVA --- */
    visibility: visible;
    opacity: 1;
    /* Odmah postavi visibility na visible, bez odgode */
    transition: top 0.5s cubic-bezier(0.25, 1, 0.5, 1), visibility 0s, opacity 0.3s ease;
}

.ad-content {
    width: 100%;
    max-width: 500px;
    text-align: center;
    padding: 20px;
}

.ad-slot-container {
    margin: 20px auto;
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-timer-wrapper {
    width: 80%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    margin: 0 auto;
    overflow: hidden;
}

.ad-progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    transform-origin: left;
}

.banner-ad-container {
    width: 100%;
    height: 60px;
    background-color: #0a0a0a;
    border-bottom: 1px solid #333;
    border-top: 1px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    overflow: hidden;
    transition: height 0.3s ease, opacity 0.3s ease;
    
    /* --- NOVO: Razmak i pozicioniranje --- */
    margin-top: 15px;       /* Odmakni ga 10px od gornjeg scoreboarda */
    position: relative;     /* Da z-index radi */
    z-index: 1;             /* Da ne ode "ispod" sjene scoreboarda */
}

/* Placeholder stil (samo dok ne staviš pravu reklamu) */
.ad-placeholder-content {
    width: 320px;
    height: 50px;
    background: #1a1a1a;
    border: 1px dashed #444;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #666;
}

/* --- PAMETNO SKRIVANJE NA MOBITELU --- */
/* Kada je visina ekrana mala (znači tipkovnica je otvorena), sakrij reklamu */
@media (max-height: 500px) {
    .banner-ad-container {
        height: 0;
        opacity: 0;
        margin: 0;
        border: none;
    }
}
/* --- DESKTOP SIDE ADS (SKYSCRAPERS) --- */

.desktop-ad-side {
    position: fixed;
    top: 50%;
    transform: translateY(-50%); /* Centriraj vertikalno */
    width: 160px; /* Ili 300px, ovisno koju veličinu odabereš u Googleu */
    height: 600px;
    z-index: 90; /* Ispod ladica i modala, ali vidljivo */
    display: flex;
    justify-content: center;
    align-items: center;
}

.left-ad {
    left: 20px; /* Odmak od lijevog ruba ekrana */
}

.right-ad {
    right: 20px; /* Odmak od desnog ruba ekrana */
}

/* Placeholder stil (obriši kad staviš Google kod) */
.ad-placeholder-vertical {
    width: 100%;
    height: 100%;
    background: #0a0a0a;
    border: 1px dashed #444;
    color: #555;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* --- SAKRIJ NA MOBITELIMA I TABLETIMA --- */
/* Prikazuj samo ako je ekran širi od 1000px */
@media (max-width: 1000px) {
    .desktop-ad-side {
        display: none !important;
    }
}
@media (min-width: 1001px) {
    .banner-ad-container {
        display: none !important;
    }
}
.round-end-bubble {
    /* 1. GLASS EFEKT (Tamna prozirna ljubičasta) */
    background: rgba(120, 40, 200, 0.3); 
    
    /* 2. ZAMUĆENJE POZADINE (Frosted Glass) */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    /* 3. NEON RUB (Tanak i svijetao) */
    border: 1px solid rgba(216, 180, 254, 0.5);
    border-radius: 16px; /* Isti radius kao tvoji ostali elementi */

    /* 4. VANJSKI SJAJ (Glow) */
    box-shadow: 
        0 0 15px rgba(147, 51, 234, 0.4),  /* Vanjski ljubičasti sjaj */
        inset 0 0 20px rgba(147, 51, 234, 0.1); /* Unutarnji suptilni sjaj */

    /* 5. TEKST STIL */
    color: #f3e8ff; /* Skoro bijela ljubičasta */
    text-align: center;
    font-weight: 800; /* Bold */
    font-size: 1.1rem;
    font-family:'Inter', sans-serif; /* Tvoji fontovi */
    letter-spacing: 1px;
    text-transform: uppercase;

    /* 6. POZICIONIRANJE */
    width: 96%; /* Skoro cijela širina */
    margin: 20px auto; /* Odmak gore/dolje */
    padding: 16px;
    
    /* 7. ANIMACIJA */
    animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Obavezna animacija ako je već nemaš */
@keyframes pop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- NOVI BONUS STIL --- */
.bonus-flash {
    /* Osvijetli postojeću boju za 30% i pojačaj zasićenost */
    filter: brightness(1.3) saturate(1.2); 
    
    /* Dodaj bijeli okvir i vanjski sjaj */
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    
    /* Malo agresivnija animacija iskakanja */
    animation: bonusPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    z-index: 5;
}

@keyframes bonusPop {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.15); } /* Malo veće od normalnog */
    100% { transform: scale(1); opacity: 1; }
}
.no-copy {
    -webkit-user-select: none; /* Safari / Chrome */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE / Edge */
    user-select: none;         /* Standard */
    cursor: default;           /* Prikazuje strelicu umjesto 'I' kursora za tekst */
}