:root {
    --bg-dark: #12100e;
    --parchment-bg: #e6d8b8;
    --parchment-border: #8b6b4a;
    --blood-red: #7a1f1f;
    --blood-red-hover: #5c1414;
    --brass: #b5a642;
    --text-dark: #2c241c;
    --text-light: #d4c4a8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.7)), url('assets/desk.png');
    background-size: cover;
    background-position: center;
    color: var(--text-light);
    font-family: 'Merriweather', serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

h1, h2 {
    font-family: 'Merriweather', serif;
    font-size: 1.2rem;
    font-weight: bold;
    color: #4a2b16;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(74, 43, 22, 0.3);
    padding-bottom: 0.3rem;
}

h3 {
    font-family: 'UnifrakturMaguntia', cursive;
    color: var(--brass);
    text-shadow: 2px 2px 4px #000;
}

.startup-box {
    background-color: rgba(15, 10, 5, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 180, 100, 0.2);
    border-radius: 12px;
    padding: 3rem;
    max-width: 600px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0,0,0,0.9), inset 0 0 20px rgba(255, 180, 100, 0.05);
}

.startup-box h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ffb464;
    text-shadow: 0 0 15px rgba(255, 180, 100, 0.4);
    font-family: 'Merriweather', serif;
}

.startup-box p {
    font-size: 1.2rem;
    margin: 0 auto 2rem;
    color: #ddd;
    line-height: 1.6;
}

.screen {
    display: none;
    width: 100%;
    height: 100vh;
    flex-direction: column;
}

#startup-screen {
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.8)), url('assets/intro.png');
    background-size: cover;
    background-position: center;
    justify-content: center;
    align-items: center;
}

.screen.active {
    display: flex;
}

/* STARTUP & RESULT SCREEN */
#result-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    background-image: linear-gradient(rgba(0,0,0,0.62), rgba(0,0,0,0.82)), url('assets/epilog.png');
    background-size: cover;
    background-position: center;
}

/* Profile rank avatar + inline icons */
.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(181, 166, 66, 0.6);
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.7);
    flex-shrink: 0;
}

.profile-rank-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.profile-inline-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
    flex-shrink: 0;
}

.xp-label .profile-inline-icon {
    margin-right: 0.35rem;
}

#startup-screen h1, #result-screen h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

#startup-screen p, #result-screen p {
    font-size: 1.2rem;
    max-width: 600px;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* BUTTONS */
button {
    font-family: 'Merriweather', serif;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
    letter-spacing: 1px;
}

.btn-primary {
    font-size: 1.1rem;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(145deg, rgba(40, 25, 15, 0.9), rgba(20, 10, 5, 0.9));
    border: 1px solid rgba(255, 180, 100, 0.5);
    color: #ffb464;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6), inset 0 0 10px rgba(255, 180, 100, 0.1);
    font-weight: bold;
}

.btn-primary:hover {
    background: linear-gradient(145deg, rgba(60, 35, 20, 0.9), rgba(30, 15, 5, 0.9));
    border-color: #ffb464;
    box-shadow: 0 0 20px rgba(255, 180, 100, 0.4), inset 0 0 15px rgba(255, 180, 100, 0.2);
    transform: translateY(-2px);
    color: #fff;
}

.btn-danger {
    font-size: 1.5rem;
    padding: 1rem;
    width: 100%;
    margin-top: 1rem;
    background: linear-gradient(145deg, rgba(80, 10, 10, 0.9), rgba(30, 5, 5, 0.9));
    border: 1px solid rgba(255, 50, 50, 0.5);
    color: #ff8888;
    box-shadow: 0 4px 15px rgba(0,0,0,0.6), inset 0 0 10px rgba(255, 50, 50, 0.1);
    font-weight: bold;
}

.btn-danger:hover {
    background: linear-gradient(145deg, rgba(120, 15, 15, 0.9), rgba(50, 5, 5, 0.9));
    border-color: #ff5555;
    box-shadow: 0 0 25px rgba(255, 50, 50, 0.6), inset 0 0 20px rgba(255, 50, 50, 0.3);
    transform: translateY(-2px);
    color: #fff;
}

/* GAME SCREEN */
#game-screen header {
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.6);
    border-bottom: 2px solid var(--brass);
    text-align: center;
}

.container {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden;
}

.panel {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    background-color: rgba(15, 10, 5, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 180, 100, 0.15);
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.9), inset 0 0 15px rgba(255, 180, 100, 0.05);
    color: var(--text-light);
}

/* CHAT PANEL */
.chat-panel {
    flex: 2;
}

.chat-header {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem 3rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 180, 100, 0.2);
    padding-bottom: 1rem;
    position: relative;
    text-align: center;
}

.portrait-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.portrait-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 2px solid rgba(255, 100, 50, 0.5);
    object-fit: cover;
    box-shadow: 0 0 20px rgba(255, 100, 50, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
}

.portrait-img:hover {
    box-shadow: 0 0 40px rgba(255, 150, 50, 0.9);
    transform: scale(1.05);
}

.portrait-hint {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(40, 20, 10, 0.9);
    border: 1px solid rgba(255, 180, 100, 0.5);
    color: #ffb464;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(0,0,0,0.8);
    opacity: 0.8;
}

.portrait-wrapper:hover .portrait-hint {
    opacity: 1;
    box-shadow: 0 0 15px rgba(255, 150, 50, 0.6);
}

.suspect-info h2 {
    margin: 0 0 0.2rem 0;
    font-family: 'Merriweather', serif;
    color: #ffb464;
    text-shadow: 0 0 10px rgba(255, 180, 100, 0.5);
}

.suspect-info p {
    margin: 0;
    font-size: 0.9rem;
    font-style: italic;
    color: #ccc;
}

.chat-main-area {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-history::-webkit-scrollbar {
    width: 8px;
}
.chat-history::-webkit-scrollbar-thumb {
    background-color: var(--brass);
    border-radius: 4px;
}

.message {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 6px;
    color: #f4e8d0;
    font-size: 1.05rem;
    line-height: 1.5;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.msg-user {
    flex-direction: row-reverse;
    background: linear-gradient(145deg, rgba(40, 30, 20, 0.9), rgba(20, 15, 10, 0.9));
    text-align: right;
    border-right: 4px solid var(--brass);
}

.msg-npc {
    background: linear-gradient(145deg, rgba(50, 15, 15, 0.9), rgba(25, 5, 5, 0.9));
    border-left: 4px solid var(--blood-red);
}

.msg-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 180, 100, 0.5);
    flex-shrink: 0;
}

.msg-content {
    flex: 1;
}

/* "Postać myśli..." — animowane kropki + licznik czasu na żywo */
.typing-indicator {
    align-items: center;
    gap: 0.55rem;
    opacity: 0.9;
}
.typing-indicator .typing-text {
    font-style: italic;
    color: var(--brass);
}
.typing-indicator .typing-timer {
    margin-left: auto;
    font-size: 0.8rem;
    color: #9c8c5a;
    font-variant-numeric: tabular-nums;
}
.typing-dots {
    display: inline-flex;
    gap: 4px;
    flex-shrink: 0;
}
.typing-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brass);
    animation: typing-bounce 1.2s infinite ease-in-out both;
}
.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0.5); opacity: 0.35; }
    40%           { transform: scale(1);   opacity: 1; }
}

/* Subtelny czas wygenerowania odpowiedzi przy wiadomości NPC */
.msg-gentime {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.72rem;
    color: #8a7c52;
    opacity: 0.75;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.emotion {
    color: #b5a642;
    font-style: italic;
    font-size: 0.95rem;
    opacity: 0.9;
}

.msg-system {
    font-style: italic;
    color: #ffb464;
    text-shadow: 0 0 5px rgba(255, 180, 100, 0.5);
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
}

.chat-input-area {
    display: flex;
    gap: 1rem;
}

textarea {
    flex: 1;
    resize: none;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--brass);
    color: var(--text-light);
    font-family: 'Merriweather', serif;
    background: rgba(0, 0, 0, 0.6);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#player-input {
    flex: 1;
    background: transparent;
    color: #fff;
    border: none;
    font-size: 1rem;
    resize: none;
    outline: none;
    font-family: 'Merriweather', serif;
}

#player-input::placeholder {
    color: #888;
}

.chat-hint {
    font-size: 0.8rem;
    color: #b5a642;
    margin-top: 0.5rem;
    text-align: center;
    opacity: 0.8;
}

/* TOOLS PANEL */
.tools-panel {
    flex: 1;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    margin-right: 12px;
    vertical-align: middle;
    flex-shrink: 0;
}

.btn-action, .clue-item {
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
    background: rgba(20, 15, 10, 0.9);
    color: #ddd;
    border: 1px solid rgba(255, 180, 100, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Merriweather', serif;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    text-align: left;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5);
}

.btn-action:hover, .clue-item:hover {
    background: rgba(40, 25, 15, 0.9);
    border-color: rgba(255, 180, 100, 0.8);
    box-shadow: 0 0 15px rgba(255, 180, 100, 0.3);
    transform: translateY(-2px);
    color: #fff;
}

.notepad {
    flex: 1;
    background-color: var(--parchment-bg);
    background-image: linear-gradient(rgba(245, 235, 210, 0.85), rgba(245, 235, 210, 0.85)), url('assets/parchment.png');
    background-size: cover;
    background-blend-mode: normal;
    border: 1px solid var(--parchment-border);
    padding: 1rem;
    color: #111;
    font-family: 'Merriweather', serif;
    font-size: 1rem;
    resize: none;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.1);
}

.notepad:focus {
    box-shadow: inset 0 0 30px rgba(139, 107, 74, 0.8), 0 0 8px var(--parchment-border);
}
/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: rgba(15, 10, 5, 0.95);
    border: 1px solid rgba(255, 180, 100, 0.3);
    border-radius: 8px;
    padding: 2rem;
    width: 80%;
    max-width: 700px;
    box-shadow: 0 0 40px rgba(0,0,0,1), inset 0 0 20px rgba(255, 180, 100, 0.1);
    color: #ddd;
    position: relative;
    font-family: 'Merriweather', serif;
    line-height: 1.6;
}

.modal-scroll-area {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 1rem;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 20px;
}

.close:hover {
    color: #ffb464;
    text-decoration: none;
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
        overflow-y: auto;
    }
    .panel {
        max-height: none;
        overflow: visible;
        margin-bottom: 1rem;
    }
    .chat-history {
        min-height: 400px;
    }
}
/* METERS */
.meters-container {
    width: 80%;
    margin: 0.5rem auto 1rem auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.meter {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.meter-label {
    width: 60px;
    font-size: 0.8rem;
    color: var(--brass);
    text-align: right;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.meter-bar-bg {
    flex: 1;
    height: 12px;
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(181, 166, 66, 0.3);
    border-radius: 6px;
    overflow: hidden;
}

.meter-bar-fill {
    height: 100%;
    width: 0%;
    transition: width 0.5s ease-out;
}

.meter-fear {
    background: linear-gradient(90deg, #501515, #cc1111);
    box-shadow: 0 0 5px #cc1111;
}

.meter-resist {
    background: linear-gradient(90deg, #2a3a4a, #8090a0);
    box-shadow: 0 0 5px #8090a0;
}

/* GRAPHIC METERS */
.graphic-meter-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
    padding-top: 1rem;
}

.graphic-meter-label {
    font-size: 0.9rem;
    color: var(--brass);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    text-shadow: 0 0 5px rgba(255,180,100,0.5);
    font-family: 'UnifrakturMaguntia', cursive;
}

.graphic-meter-box {
    position: relative;
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
}

.graphic-meter-bg {
    position: absolute;
    bottom: 0;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    filter: grayscale(100%) brightness(0.2);
}

.graphic-meter-fill {
    position: absolute;
    bottom: 0;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: clip-path 0.5s ease-out;
}

/* NEW METER STYLES */
.meter-medallion {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--brass);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(255, 180, 100, 0.2);
    flex-shrink: 0;
}

.meter-medallion-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) brightness(0.2);
}

.meter-medallion-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: clip-path 0.5s ease-out;
}

/* NEW BAR METERS */
.meter-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}
.meter-label {
    font-family: 'UnifrakturMaguntia', cursive;
    color: var(--brass);
    font-size: 1.2rem;
    text-shadow: 0 0 5px rgba(255,180,100,0.5);
    letter-spacing: 2px;
}
.meter-frame-container {
    position: relative;
    width: 80px;
    height: 250px;
    display: flex;
    justify-content: center;
    overflow: hidden; /* crops the square image sides */
    border-radius: 10px;
}
.meter-frame-img {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    z-index: 2;
    pointer-events: none;
}
.meter-fill-container {
    position: absolute;
    top: 15%;
    bottom: 15%;
    left: 30%;
    right: 30%;
    z-index: 3;
    display: flex;
    align-items: flex-end;
    mix-blend-mode: screen;
}
.meter-fill {
    width: 100%;
    transition: height 0.5s ease-out;
}
.fear-fill {
    background: linear-gradient(to top, #600000, #ff1111);
    box-shadow: 0 0 15px #ff1111;
}
.resist-fill {
    background: linear-gradient(to top, #002244, #1188ff);
    box-shadow: 0 0 15px #1188ff;
}

/* HORIZONTAL METER STYLES */
.meter-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}
.meter-label-horiz {
    font-family: 'Merriweather', serif;
    color: var(--brass);
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
}
.meter-frame-horiz-container {
    position: relative;
    width: 180px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.meter-frame-horiz-img {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    z-index: 2;
    pointer-events: none;
}
.meter-fill-horiz-container {
    position: absolute;
    top: 25%;
    bottom: 25%;
    left: 15%;
    right: 15%;
    z-index: 3;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    mix-blend-mode: screen;
}
.meter-fill-horiz {
    height: 100%;
    transition: width 0.5s ease-out;
}
.fear-fill-horiz {
    background: linear-gradient(to right, #600000, #ff1111);
    box-shadow: 0 0 10px #ff1111;
}
.resist-fill-horiz {
    background: linear-gradient(to right, #002244, #1188ff);
    box-shadow: 0 0 10px #1188ff;
}

/* ---- TELEFON (≤600px): zmieść nagłówek czatu i mierniki Strach/Opór ---- */
@media (max-width: 600px) {
    .panel { padding: 1rem; }
    .chat-header {
        gap: 0.6rem 0.8rem;
    }
    /* portret + imię na własnej, pierwszej linii */
    .chat-header-center {
        order: -1;
        flex-basis: 100%;
    }
    /* dwa mierniki dzielą drugą linię */
    .meter-row {
        flex: 1 1 0;
        min-width: 0;
        max-width: 49%;
    }
    .meter-frame-horiz-container {
        width: 100%;
        max-width: 160px;
        height: 30px;
    }
    .meter-label-horiz {
        font-size: 0.72rem;
        letter-spacing: 0.5px;
    }
}

/* ========================================
   NEW STYLES — MULTI-SUSPECT GAME FLOW
   ======================================== */

/* BRIEFING SCREEN */
.briefing-screen {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.75)), url('assets/desk_2.png');
    background-size: cover;
    background-position: center;
    overflow-y: auto;
}

.briefing-scroll {
    max-width: 900px;
    width: 90%;
    max-height: 92vh;
    overflow-y: auto;
    padding: 2.5rem 3rem;
    background: linear-gradient(160deg, rgba(30, 22, 14, 0.92), rgba(12, 8, 4, 0.96));
    border: 2px solid rgba(255, 180, 100, 0.25);
    border-radius: 10px;
    box-shadow:
        0 0 60px rgba(0,0,0,0.9),
        inset 0 0 30px rgba(255, 180, 100, 0.04),
        0 0 120px rgba(122, 31, 31, 0.15);
}

.briefing-scroll::-webkit-scrollbar {
    width: 8px;
}
.briefing-scroll::-webkit-scrollbar-thumb {
    background-color: var(--brass);
    border-radius: 4px;
}

.briefing-title {
    font-family: 'UnifrakturMaguntia', cursive;
    font-size: 2.8rem;
    color: #ffb464;
    text-shadow: 0 0 20px rgba(255, 180, 100, 0.5), 0 2px 8px #000;
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255, 180, 100, 0.25);
    padding-bottom: 1rem;
}

.briefing-body {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #d4c4a8;
    text-align: justify;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 180, 100, 0.12);
}

.briefing-suspects-heading {
    font-family: 'UnifrakturMaguntia', cursive;
    font-size: 1.8rem;
    color: var(--brass);
    text-shadow: 0 0 10px rgba(255, 180, 100, 0.4);
    text-align: center;
    margin-bottom: 1.5rem;
    border-bottom: none;
}

.briefing-hint {
    text-align: center;
    color: #888;
    font-size: 0.85rem;
    margin-top: 1.5rem;
    font-style: italic;
}

/* SUSPECT CARDS */
.suspect-cards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.suspect-card {
    width: 240px;
    background: linear-gradient(160deg, rgba(25, 18, 10, 0.95), rgba(10, 6, 3, 0.98));
    border: 2px solid rgba(255, 180, 100, 0.2);
    border-radius: 10px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.35s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.7);
    position: relative;
    overflow: hidden;
}

.suspect-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 10px;
    border: 2px solid transparent;
    transition: border-color 0.35s ease, box-shadow 0.35s ease;
    pointer-events: none;
}

.suspect-card:hover {
    transform: translateY(-6px) scale(1.03);
    border-color: var(--brass);
    box-shadow:
        0 12px 35px rgba(0,0,0,0.8),
        0 0 30px rgba(255, 180, 100, 0.25),
        inset 0 0 15px rgba(255, 180, 100, 0.06);
}

.suspect-card:hover::before {
    border-color: var(--brass);
    box-shadow: 0 0 20px rgba(181, 166, 66, 0.4);
}

.suspect-card-portrait {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid rgba(255, 100, 50, 0.4);
    object-fit: cover;
    box-shadow: 0 0 20px rgba(255, 100, 50, 0.3);
    margin-bottom: 0.8rem;
    transition: box-shadow 0.35s ease;
}

.suspect-card:hover .suspect-card-portrait {
    box-shadow: 0 0 35px rgba(255, 150, 50, 0.6);
}

.suspect-card-name {
    font-family: 'Merriweather', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffb464;
    margin-bottom: 0.3rem;
}

.suspect-card-role {
    font-size: 0.85rem;
    color: #b5a642;
    margin-bottom: 0.4rem;
    font-style: italic;
}

.suspect-card-accusation {
    font-size: 0.8rem;
    color: #cc8888;
    line-height: 1.4;
}

/* SUSPECT TABS */
.suspect-tabs {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: rgba(0, 0, 0, 0.7);
    border-bottom: 2px solid rgba(255, 180, 100, 0.15);
    padding: 0;
    gap: 0;
}

.suspect-tab {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.6rem 1rem;
    background: rgba(15, 10, 5, 0.6);
    border: none;
    border-bottom: 3px solid transparent;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Merriweather', serif;
    font-size: 0.85rem;
}

.suspect-tab:hover {
    background: rgba(30, 20, 10, 0.8);
    color: #ddd;
}

.suspect-tab.active {
    background: rgba(40, 25, 15, 0.9);
    border-bottom: 3px solid var(--brass);
    color: #ffb464;
    box-shadow: inset 0 -5px 15px rgba(255, 180, 100, 0.08);
}

.suspect-tab-portrait {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 100, 50, 0.3);
    object-fit: cover;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.suspect-tab.active .suspect-tab-portrait {
    border-color: var(--brass);
    box-shadow: 0 0 12px rgba(255, 180, 100, 0.4);
}

.suspect-tab-name {
    font-weight: 700;
    white-space: nowrap;
}

/* TURN COUNTER */
.turn-counter {
    text-align: center;
    font-family: 'Merriweather', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--brass);
    padding: 0.6rem 1rem;
    margin-bottom: 0.8rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 180, 100, 0.2);
    border-radius: 6px;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.turn-counter.urgent {
    color: #ff4444;
    border-color: rgba(255, 50, 50, 0.5);
    box-shadow: 0 0 20px rgba(255, 50, 50, 0.3);
    animation: urgentPulse 1.2s ease-in-out infinite;
}

@keyframes urgentPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 50, 50, 0.3); }
    50% { box-shadow: 0 0 30px rgba(255, 50, 50, 0.6); }
}

/* CLUE BOARD (Investigation Board) */
.clue-board {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.8rem;
    background: linear-gradient(170deg, rgba(20, 15, 8, 0.95), rgba(8, 5, 2, 0.98));
    border: 1px solid rgba(255, 180, 100, 0.12);
    border-radius: 6px;
    min-height: 120px;
    max-height: 300px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.clue-board::-webkit-scrollbar {
    width: 6px;
}
.clue-board::-webkit-scrollbar-thumb {
    background-color: rgba(181, 166, 66, 0.5);
    border-radius: 3px;
}

.clue-pin {
    font-size: 0.82rem;
    padding: 0.5rem 0.7rem;
    background: linear-gradient(145deg, rgba(50, 40, 25, 0.9), rgba(30, 22, 12, 0.95));
    color: #d4c4a8;
    border: 1px solid rgba(255, 180, 100, 0.18);
    border-left: 3px solid var(--brass);
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Merriweather', serif;
    transition: all 0.2s ease;
    line-height: 1.4;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    position: relative;
}

.clue-pin::before {
    content: '📌';
    margin-right: 0.4rem;
    font-size: 0.75rem;
}

.clue-pin:hover {
    background: linear-gradient(145deg, rgba(65, 50, 30, 0.95), rgba(40, 28, 15, 0.95));
    border-color: rgba(255, 180, 100, 0.5);
    transform: translateX(3px);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5), 0 0 8px rgba(255, 180, 100, 0.15);
}

.clue-pin.clue-new {
    animation: clueAppear 0.5s ease-out;
    border-left-color: #ff8844;
}

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

/* VERDICT MODAL */
.verdict-modal .verdict-modal-content {
    max-width: 500px;
}

.verdict-modal-title {
    font-family: 'UnifrakturMaguntia', cursive;
    font-size: 2rem;
    color: #ffb464 !important;
    text-shadow: 0 0 15px rgba(255, 180, 100, 0.4);
    text-align: center;
    border-bottom: 2px solid rgba(255, 180, 100, 0.25) !important;
    padding-bottom: 0.8rem !important;
    margin-bottom: 1.5rem;
}

.verdict-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.verdict-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.verdict-field label {
    font-size: 0.9rem;
    color: var(--brass);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.verdict-field select {
    font-family: 'Merriweather', serif;
    font-size: 0.95rem;
    padding: 0.7rem;
    background: rgba(0, 0, 0, 0.7);
    color: #d4c4a8;
    border: 1px solid rgba(255, 180, 100, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23b5a642' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.5rem;
}

.verdict-field select:hover,
.verdict-field select:focus {
    border-color: var(--brass);
    box-shadow: 0 0 10px rgba(255, 180, 100, 0.2);
    outline: none;
}

.verdict-field select option {
    background: #1a1208;
    color: #d4c4a8;
}

/* SCORE STARS */
.result-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 700px;
    padding: 2rem;
    text-align: center;
}

.result-heading {
    font-family: 'UnifrakturMaguntia', cursive;
    font-size: 3.5rem;
    color: #ffb464;
    text-shadow: 0 0 25px rgba(255, 180, 100, 0.5), 0 4px 12px #000;
    margin-bottom: 2rem;
}

.score-stars-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.score-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.score-label {
    font-family: 'Merriweather', serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--brass);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.score-stars {
    display: flex;
    gap: 0.3rem;
    font-size: 1.8rem;
}

.star-filled {
    color: #ffb464;
    text-shadow: 0 0 10px rgba(255, 180, 100, 0.6);
}

.star-empty {
    color: rgba(255, 180, 100, 0.15);
}

/* EPILOGUE TEXT */
.epilogue-text {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #d4c4a8;
    text-align: justify;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(160deg, rgba(30, 22, 14, 0.8), rgba(12, 8, 4, 0.9));
    border: 1px solid rgba(255, 180, 100, 0.15);
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
    max-height: 30vh;
    overflow-y: auto;
}

.epilogue-text::-webkit-scrollbar {
    width: 6px;
}
.epilogue-text::-webkit-scrollbar-thumb {
    background-color: rgba(181, 166, 66, 0.4);
    border-radius: 3px;
}

/* TRUTH REVEAL */
.truth-reveal {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #cc8888;
    text-align: center;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    background: rgba(80, 10, 10, 0.2);
    border: 1px solid rgba(255, 50, 50, 0.2);
    border-radius: 8px;
    font-style: italic;
}

.truth-reveal-label {
    display: block;
    font-family: 'UnifrakturMaguntia', cursive;
    font-size: 1.4rem;
    color: var(--blood-red);
    text-shadow: 0 0 8px rgba(122, 31, 31, 0.5);
    margin-bottom: 0.5rem;
    font-style: normal;
}

/* Responsive adjustments for new elements */
@media (max-width: 900px) {
    .suspect-tabs {
        flex-wrap: wrap;
    }
    .suspect-tab {
        flex: 1 1 auto;
        min-width: 100px;
    }
    .suspect-cards-row {
        flex-direction: column;
        align-items: center;
    }
    .suspect-card {
        width: 80%;
        max-width: 300px;
    }
    .briefing-scroll {
        padding: 1.5rem;
    }
    .briefing-title {
        font-size: 2rem;
    }
    .score-stars-row {
        gap: 1.5rem;
    }
}

/* ===================== AUTH & HUB (accounts update) ===================== */

.auth-box { max-width: 460px; }

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.auth-form input {
    font-family: 'Merriweather', serif;
    font-size: 1rem;
    padding: 0.8rem;
    background: rgba(0, 0, 0, 0.6);
    color: #d4c4a8;
    border: 1px solid rgba(255, 180, 100, 0.3);
    border-radius: 6px;
}

.auth-form input:focus {
    border-color: #ffb464;
    box-shadow: 0 0 10px rgba(255, 180, 100, 0.2);
    outline: none;
}

.auth-error {
    color: #ff6b5e;
    font-size: 0.9rem;
    padding: 0.4rem 0;
}

.btn-link {
    background: none;
    border: none;
    color: #b5a642;
    font-family: 'Merriweather', serif;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0.4rem;
}

.btn-link:hover { color: #ffb464; }

/* ---- hub ---- */

.hub-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    width: 100%;
    overflow-y: auto;
    max-height: 100vh;
}

.profile-bar {
    display: flex;
    align-items: center;
    gap: 2rem;
    background: rgba(15, 10, 5, 0.8);
    border: 1px solid rgba(255, 180, 100, 0.25);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
}

.profile-identity { flex: 1; }

.profile-identity h2 {
    margin: 0;
    color: #ffb464;
    font-family: 'Merriweather', serif;
    font-size: 1.4rem;
}

.profile-rank {
    color: #b5a642;
    font-size: 0.9rem;
    margin-top: 0.2rem;
}

.profile-reputation {
    color: #ff8c5e;
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 0.2rem;
}

.profile-xp { width: 260px; }

.xp-label {
    font-size: 0.8rem;
    color: #d4c4a8;
    text-align: right;
    margin-bottom: 0.3rem;
}

.xp-bar {
    height: 10px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255, 180, 100, 0.3);
    border-radius: 5px;
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #8a5a2b, #ffb464);
    transition: width 0.6s ease;
}

/* ---- TELEFON (≤600px): pasek profilu (avatar + imię + XP + Wyloguj) ---- */
@media (max-width: 600px) {
    .hub-container { padding: 1rem 1rem 3rem; }
    .profile-bar {
        flex-wrap: wrap;
        gap: 0.5rem 0.8rem;
        padding: 0.85rem 1rem;
    }
    .profile-avatar { width: 52px; height: 52px; }
    .profile-identity { flex: 1 1 0; min-width: 0; }
    .profile-identity h2 { font-size: 1.15rem; }
    /* Wyloguj zostaje w pierwszej linii, dosunięty do prawej */
    #btn-logout { order: 2; margin-left: auto; }
    /* pasek XP schodzi na własną, pełną linię */
    .profile-xp { order: 3; width: 100%; }
    .xp-label { text-align: left; }
}

.hub-title {
    color: #ffb464;
    font-family: 'UnifrakturMaguntia', 'Merriweather', serif;
    font-size: 2.4rem;
    text-align: center;
    margin: 0 0 0.3rem;
    text-shadow: 0 0 15px rgba(255, 180, 100, 0.4);
}

.hub-hint {
    text-align: center;
    color: #b5a642;
    margin: 0 0 1.5rem;
    font-size: 0.95rem;
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.case-card {
    background: rgba(20, 12, 6, 0.85);
    border: 1px solid rgba(255, 180, 100, 0.25);
    border-radius: 10px;
    padding: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.case-card:hover {
    border-color: #ffb464;
    box-shadow: 0 0 20px rgba(255, 180, 100, 0.25);
    transform: translateY(-3px);
}

.case-card.case-locked {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.7);
}

.case-card.case-locked:hover {
    transform: none;
    box-shadow: none;
    border-color: rgba(255, 180, 100, 0.25);
}

.case-card-title {
    color: #ffb464;
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 1.15rem;
}

.case-card-difficulty {
    color: #c0392b;
    letter-spacing: 3px;
    font-size: 0.9rem;
}

.case-card-teaser {
    color: #d4c4a8;
    font-size: 0.85rem;
    line-height: 1.5;
    flex: 1;
}

.case-card-footer {
    color: #b5a642;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-top: 1px solid rgba(255, 180, 100, 0.15);
    padding-top: 0.6rem;
}

/* ---- leaderboard ---- */

.hub-leaderboard-title {
    color: #ffb464;
    font-family: 'Merriweather', serif;
    text-align: center;
    margin-bottom: 1rem;
}

.leaderboard {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(15, 10, 5, 0.8);
    border: 1px solid rgba(255, 180, 100, 0.2);
    border-radius: 10px;
    padding: 0.8rem 1.2rem;
}

.leaderboard-row {
    display: flex;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255, 180, 100, 0.08);
    font-size: 0.95rem;
    color: #d4c4a8;
}

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

.lb-pos { width: 2rem; color: #b5a642; }
.lb-name { flex: 1; color: #ffb464; }
.lb-rank { color: #b5a642; }
.lb-xp { width: 5.5rem; text-align: right; }

.leaderboard-empty {
    text-align: center;
    color: #b5a642;
    font-style: italic;
    padding: 0.5rem;
}

/* ---- result XP summary ---- */

.xp-summary {
    text-align: center;
    margin: 1.5rem 0;
}

.xp-gain {
    font-size: 1.4rem;
    color: #ffb464;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 180, 100, 0.4);
}

.xp-total {
    font-size: 0.9rem;
    color: #b5a642;
    font-weight: normal;
}

.rank-up {
    margin-top: 0.8rem;
    font-size: 1.2rem;
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    animation: rankup-glow 1.2s ease-in-out infinite alternate;
}

@keyframes rankup-glow {
    from { text-shadow: 0 0 8px rgba(255, 215, 0, 0.4); }
    to   { text-shadow: 0 0 22px rgba(255, 215, 0, 0.9); }
}
