@import url('https://fonts.googleapis.com/css2?family=Creepster&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Bangers&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;1,400&display=swap');

/* Fiksiranje Manga štapića na apsolutno dno ekrana preko celog viewport-a */
body.theme-manga .manga-sticks-container {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    pointer-events: none !important;
    z-index: 999999 !important;
    box-sizing: border-box !important;
    padding: 0 40px !important;
    margin: 0 !important;
    background: transparent !important;
}

.manga-sticks-container .manga-stick {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    pointer-events: auto !important;
}

/* Dimenzije likova */
.stick-left-1 img { height: 180px !important; width: auto !important; }
.stick-left-2 img { height: 70px !important; width: auto !important; }
.stick-right-1 img { height: 80px !important; width: auto !important; }
.stick-right-2 img { height: 190px !important; width: auto !important; }

/* Pomeranja */
.stick-left-2 { transform: translateX(30px) !important; }
.stick-right-1 { transform: translateX(-30px) !important; }

/* Drveni štapić dole */
.manga-sticks-container .stick-line {
    width: 3px !important;
    height: 40px !important;
    background: #3d281a !important;
    border-radius: 2px !important;
    margin: 0 !important;
}
/* ==========================================
   1. OPŠTI STILOVI & PREKIDAČ (SWITCH)
   ========================================== */

.theme-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
    flex-shrink: 0;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #3d281a;
    transition: 0.3s;
    border-radius: 20px;
    border: 1px solid #5c3d2e;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: #f0e6d2;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #c59d5f;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

body.no-theme .romantic-corner-ribbon {
    display: none !important;
}

/* ==========================================
   1. MANGA MONDAY (Strip & Comic estetika)
   ========================================== */

.manga-sticks-container,
body.no-theme .manga-sticks-container,
body:not(.theme-manga) .manga-sticks-container {
    display: none !important;
}

body.theme-manga:not(.no-theme) .manga-sticks-container {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    pointer-events: none !important;
    z-index: 999 !important;
    justify-content: space-between !important;
    padding: 0 40px !important;
    box-sizing: border-box !important;
}

body:not(.no-theme).theme-manga h1, 
body:not(.no-theme).theme-manga h2 {
    font-family: 'Bangers', 'Comic Sans MS', cursive, sans-serif !important;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

body:not(.no-theme).theme-manga::before {
    content: "";
    position: fixed; 
    top: 0; left: 0; 
    width: 100vw; height: 100vh;
    pointer-events: none; 
    z-index: 9999;
    background: radial-gradient(circle, #000000 10%, transparent 11%);
    background-size: 12px 12px;
    opacity: 0.03;
}

.manga-notice-box {
    text-align: center;
    background: #fff0f5;
    border: 2px dashed #ff69b4;
    color: #c71585;
    padding: 8px 15px;
    border-radius: 8px;
    margin: 10px auto 20px auto;
    max-width: 420px;
    font-weight: 600;
    box-shadow: 2px 2px 0px #000;
}

.pageflip-wrapper {
    width: 100% !important;
    max-width: 800px !important;
    margin: 30px auto !important;
    display: flex !important;
    justify-content: center !important;
}

#flip-book {
    margin: 0 auto;
    box-sizing: border-box;
}

.page {
    background-color: #fdfbf7 !important;
    border: 1px solid #c9b097 !important;
    overflow: hidden !important;
    box-sizing: border-box;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important;
}

body:not(.no-theme).theme-manga .page {
    border: 3px solid #000 !important;
    background-color: #ffffff !important;
    box-shadow: 4px 4px 0px #000 !important;
}
/* ==========================================
   MANGA MONDAY - STICK PUPPETS (Fiksirano i srazmerno)
   ========================================== */

body.theme-manga .manga-sticks-container {
    display: flex !important;
    position: absolute !important; /* Promenjeno iz fixed u absolute da prate stranicu do samog dna */
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    pointer-events: none !important;
    z-index: 999999 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    background: transparent !important;
}

.manga-sticks-container .manga-stick {
    position: absolute !important;
    bottom: 0 !important; 
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    pointer-events: auto !important;
    background: transparent !important;
}

.manga-sticks-container img {
    background-color: transparent !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* 1. Dark Magician (Skroz levo) */
.stick-left-1 {
    left: 0% !important;
}
.stick-left-1 img { height: 240px !important; width: auto !important; }
.stick-left-1 .stick-line { height: 160px !important; width: 3px !important; background: #3d281a !important; }

/* 2. Kuriboh (Unutra levo) - Smanjen štapić */
.stick-left-2 {
    left: 13% !important;
}
.stick-left-2 img { height: 150px !important; width: auto !important; }
.stick-left-2 .stick-line { height: 80px !important; width: 2px !important; background: #3d281a !important; }

/* 3. Red-Eyes Black Dragon (Unutra desno) - Smanjen štapić */
.stick-right-1 {
    right: 15% !important;
}
.stick-right-1 img { height: 140px !important; width: auto !important; }
.stick-right-1 .stick-line { height: 100px !important; width: 2px !important; background: #3d281a !important; }

/* 4. Blue-Eyes White Dragon (Skroz desno) */
.stick-right-2 {
    right: 0% !important;
}
.stick-right-2 img { height: 200px !important; width: auto !important; }
.stick-right-2 .stick-line { height: 180px !important; width: 3px !important; background: #3d281a !important; }
/* ==========================================
   3. ROMANTIC FRIDAY
   ========================================== */

body:not(.no-theme).theme-romantic a:not(.romantic-corner-ribbon):hover, 
body:not(.no-theme).theme-romantic button:hover {
    position: relative;
}

body:not(.no-theme).theme-romantic a:not(.romantic-corner-ribbon):hover::before, 
body:not(.no-theme).theme-romantic button:hover::before {
    content: "💖";
    position: absolute;
    top: -5px;
    left: 20%;
    font-size: 1.2rem;
    pointer-events: none;
    animation: multiHeart1 0.8s ease-out forwards;
}

body:not(.no-theme).theme-romantic a:not(.romantic-corner-ribbon):hover::after, 
body:not(.no-theme).theme-romantic button:hover::after {
    content: "💕";
    position: absolute;
    top: -5px;
    right: 20%;
    font-size: 1.2rem;
    pointer-events: none;
    animation: multiHeart2 0.8s ease-out forwards;
}

@keyframes multiHeart1 {
    0% { transform: translate(0, 0) scale(0.4); opacity: 1; }
    100% { transform: translate(-25px, -30px) scale(1.3); opacity: 0; }
}

@keyframes multiHeart2 {
    0% { transform: translate(0, 0) scale(0.4); opacity: 1; }
    100% { transform: translate(25px, -30px) scale(1.3); opacity: 0; }
}

body:not(.no-theme) .romantic-corner-ribbon {
    position: fixed;
    top: 0;
    left: 0;
    background: url('ribbon.png') no-repeat center center;
    background-size: 100% 100%;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 380px;
    height: 110px;
    padding: 0 40px;
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    text-decoration: none;
    z-index: 99999;
    transform: translate(-55px, 25px) rotate(-42deg);
    transform-origin: center center;
    pointer-events: none;
    transition: none !important;
    animation: none !important;
    will-change: auto;
}


/* ==========================================
   4. UKLANJANJE BELE KUTIJE SAMO ZA MANGA SEKCIJU KARTICA
   ========================================== */

section.popular-books.daily-theme-section {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}


/* ==========================================
   5. DARK MODE SPECIJALNA PRAVILA
   ========================================== */

body.dark.theme-manga h2,
body.dark.theme-manga .daily-theme-title {
    color: #ffffff !important;
    text-shadow: none !important;
}

body.dark.theme-manga .stick-line {
    background: #ffffff !important;
    opacity: 0.6;
}


/* ==========================================
   6. YUGIOH ARENA & DUEL INTERFEJS
   ========================================== */

.yugioh-arena-container {
    background: #121216;
    border: 2px solid #3b3b4f;
    border-radius: 12px;
    padding: 20px;
    max-width: 600px;
    margin: 20px auto;
    font-family: 'Courier New', monospace;
    color: #f0f0f5;
    box-shadow: 0 8px 25px rgba(0,0,0,0.7);
}

.duel-header {
    text-align: center;
    margin-bottom: 20px;
}

.duel-header h2 {
    color: #ffd700;
    margin-bottom: 5px;
    font-size: 22px;
}

.duel-header p {
    font-size: 13px;
    color: #a0a0b0;
}

.battlefield {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.fighter-card {
    background: #1c1c24;
    border: 1px solid #2e2e3d;
    border-radius: 8px;
    padding: 15px;
    width: 42%;
    text-align: center;
}

.avatar-container {
    font-size: 45px;
    margin-bottom: 8px;
}

.fighter-card h3 {
    font-size: 15px;
    margin-bottom: 10px;
    color: #e0e0ff;
}

.hp-bar-container {
    background: #2a2a38;
    border-radius: 4px;
    height: 12px;
    overflow: hidden;
    margin-bottom: 5px;
    border: 1px solid #44445c;
}

.hp-bar {
    background: #4caf50;
    height: 100%;
    transition: width 0.3s ease;
}

.enemy-side .hp-bar {
    background: #f44336;
}

.fighter-card span {
    font-size: 12px;
    color: #a0a0b0;
}

.vs-badge {
    font-weight: bold;
    font-size: 18px;
    color: #ffd700;
}

.duel-log {
    background: #0a0a0e;
    border: 1px solid #2e2e3d;
    border-radius: 6px;
    padding: 12px;
    min-height: 50px;
    font-size: 13px;
    margin-bottom: 15px;
    color: #d0d0e0;
    line-height: 1.4;
}

.duel-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.duel-status-controls {
    display: flex;
    justify-content: center;
}

.duel-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: opacity 0.2s, transform 0.1s;
}

.duel-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.attack-btn { background: #ff9800; color: #fff; }
.spell-btn { background: #2196f3; color: #fff; }
.trap-btn { background: #9c27b0; color: #fff; }
.restart-btn { background: #4caf50; color: #fff; width: 100%; }

.character-select-screen {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.fighter-choice {
    background: #1c1c24;
    border: 2px solid #3b3b4f;
    border-radius: 10px;
    padding: 20px;
    width: 45%;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fighter-choice:hover {
    border-color: #ffd700;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.2);
}

.choice-emoji {
    font-size: 50px;
    display: block;
    margin-bottom: 10px;
}

.fighter-choice h3 {
    color: #ffd700;
    margin-bottom: 5px;
    font-size: 16px;
}

.fighter-choice p {
    font-size: 11px;
    color: #a0a0b0;
}
/* ==========================================
   THRILLER THURSDAY - VEĆA DETEKTIVSKA TABLA (DONJI LEVI UGAO)
   ========================================== */

body.theme-thriller:not(.no-theme) .detective-corner-widget {
    display: block !important;
}

.detective-corner-widget {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 380px;
    height: 280px;
    background-color: #b0855b; /* Čista boja plute / drveta, bez slika */
    border: 8px solid #3d2314;
    box-shadow: 5px 8px 20px rgba(0,0,0,0.6);
    padding: 12px;
    z-index: 9998;
    transform: rotate(-2deg);
    transition: transform 0.3s ease;
    pointer-events: auto;
    font-family: 'Courier New', monospace;
}

.detective-corner-widget:hover {
    transform: rotate(0deg) scale(1.02);
}

/* Crveni konac koji dijagonalno prelazi preko table */
.detective-corner-widget::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 50px;
    width: 3px;
    height: 280px;
    background: #cc241d;
    transform: rotate(25deg);
    pointer-events: none;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    z-index: 2;
}

.corner-header {
    font-size: 0.75rem;
    background: #111;
    color: #ff3333;
    padding: 6px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    border: 2px dashed #ff3333;
    letter-spacing: 1px;
    position: relative;
    z-index: 3;
}

.corner-content-grid {
    display: flex;
    gap: 15px;
    align-items: center;
    position: relative;
    z-index: 3;
}

.corner-polaroid {
    background: #fff;
    padding: 6px 6px 20px 6px;
    width: 130px;
    box-shadow: 3px 4px 8px rgba(0,0,0,0.4);
    transform: rotate(-4deg);
}

.corner-polaroid img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.corner-note-box {
    background: #fdfbf7;
    padding: 10px;
    border: 1px solid #d4c5b9;
    font-size: 0.75rem;
    color: #222;
    line-height: 1.3;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    transform: rotate(2deg);
    flex-grow: 1;
}
/* Stil za tekst beleške na tabli da izgleda kao da je klikabilan */
.corner-note-box {
    background: #fdfbf7;
    padding: 10px;
    border: 1px solid #d4c5b9;
    font-size: 0.75rem;
    color: #222;
    line-height: 1.3;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    transform: rotate(2deg);
    flex-grow: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.corner-note-box:hover {
    background: #fffdf9;
    outline: 1px dashed #cc241d;
}

/* Pozadina modalnog prozora (zatamnjenje ekrana) */
.evidence-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

/* Iskačući zgužvani papir */
.crumpled-paper-popup {
    background: #f4eee1 url('https://images.unsplash.com/photo-1586075010923-2dd4570fb338?auto=format&fit=crop&w=600&q=80') center/cover;
    background-blend-mode: multiply;
    width: 450px;
    padding: 40px;
    border: 1px solid #d1c2a5;
    box-shadow: 0 15px 35px rgba(0,0,0,0.8), inset 0 0 30px rgba(0,0,0,0.1);
    transform: rotate(-1deg);
    position: relative;
    font-family: 'Courier New', monospace;
    color: #1a1a1a;
}

/* Efekat iskrzanih ivica ili starog papira */
.crumpled-paper-popup h3 {
    text-align: center;
    color: #cc241d;
    margin-bottom: 15px;
    border-bottom: 2px dashed #cc241d;
    padding-bottom: 8px;
    letter-spacing: 1px;
}

.crumpled-paper-popup p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Dugme za zatvaranje (X) */
.close-paper-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: #111;
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 50%;
}
/* ==========================================
   THRILLER THURSDAY - FIKSNI ČIVILUK I ŠEŠIR
   ========================================== */

body.theme-thriller:not(.no-theme) .detective-hat-widget {
    display: block !important;
}
#detective-game-modal-overlay {
    display: none; /* Ovo je ključno da ne bi iskakalo samo od sebe */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}
#detective-game-modal-overlay.active {
    display: flex; /* Prikazuje se samo kada se dodao 'active' class preko JavaScript-a */
}
#detective-game-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}