html{
    overflow:hidden
}
body {
    font-family: sans-serif;
    background: #121212;
    color: white;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.hidden {
    display: none !important;
}

#chat-box,
#setup-screen {
    width: 100%;
    max-width: 75vw;
    min-width: 50vw;
    height: 75vh;
    border: 1px solid #444;
    overflow-y: auto;
    padding: 15px;
    background: #1e1e1e;
}

#character-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 140px;
    width: 100%;
    max-width: 75vw;
}

.char-card {
    border: 2px solid transparent;
    padding: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    background: #1a1a1a;
    border-radius: 8px;
}

.char-card.selected {
    border-color: #00ffcc;
    background: #333;
}

.char-card p {
    margin: 8px 0 6px;
    font-weight: 200;
    text-align: center;
}

.character-name {
    margin-top: 8px;
}

.character-bio {
    margin: 0 0 8px;
    max-width: 233px;
    font-size: 0.78rem;
    line-height: 1.1;
    color: #d0d0d0;
    text-align: center;
}

.trait-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.72rem;
    line-height: 1.0;
    width: 100%;
    max-width: 185px;
    margin-top: auto;
    align-self: center;
    text-align: left;
    color: #bdbdbd;
}

.trait-list > span {
    display: grid;
    grid-template-columns: 140px auto;
    column-gap: 8px;
    width: 100%;
    align-items: center;
}

.trait-label {
    white-space: nowrap;
}

.trait-value {
    min-width: 12px;
    text-align: left;
}

#progress-counter {
    position: absolute;
    top: 20px;
    right: 20px; /* moved from left to right */
    font-size: 14px;
    color: #888;
    font-weight: bold;
    padding: 8px 12px;
    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 4px;
}

#progress-counter {
    position: fixed;
    top: 20px;
    right: 20px;
    font-size: 1.2rem;
    color: #f0e200;
    font-weight: normal;
    z-index: 100;
}

#language-switcher {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 120;
}

#lang-toggle-btn,
#fullscreen-btn {
    background: #1e1e1e;
    color: #f0e200;
    border: 1px solid #555;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
}

#lang-toggle-btn:hover,
#fullscreen-btn:hover {
    border-color: #f0e200;
}

h1 {
    text-align: center;
    color: #f0e200;
    font-size: large;
    font-weight: normal;
}

#character-selection {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#start-btn {
    background: #f0e200;
    color: #000;
    border: none;
    padding: 30px 40px;
    font-size: large;
    cursor: pointer;
    align-self: center;
}

#start-btn:disabled {
    background: #555;
    color: white;
    cursor: not-allowed;
}

#next-btn {
    position: fixed;
    bottom: 169px;
    left: 50%;
    transform: translateX(-50%);
    background: #f0e200;
    color: white;
    border: none;
    padding: 16px 24px;
    font-size: 1rem;
    cursor: pointer;
    z-index: 10;
}

#character-stage {
    display: grid;
    grid-template-columns: auto 1fr 1fr auto;
    justify-items: center;
    gap: 30px;
    margin: 50px 0;
    min-height: 180px;
    padding: 0 50px;
    width: 120%;
}

.stage-char {
    width: 300px;
    text-align: center;
    position: relative;
}

.stage-char img {
    width: 300px;
    height: 300px;
    object-fit: cover;
}

.speech-bubble {
    background: #22272b;
    color: #fff;
    padding: 10px 12px;
    border-radius: 20px;
    max-width: 350px;
    min-width: 150px;
    font-size: 0.9rem;
    line-height: 1.3;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    word-wrap: break-word;
    margin-top: 0px;
    align-self: start;
    position: relative;
}

#bubble-0::before {
    content: "▶";
    color: #22272b;
    position: absolute;
    transform: rotate(180deg);
    top: 25%;
    left: -10px;
}

#bubble-1::before {
    content: "▶";
    color: #22272b;
    position: absolute;
    top: 25%;
    left: 99%
}

#bubble-0 {
    justify-self: start;
    margin-left: 2vw
}

#bubble-1 {
    justify-self: end;
    margin-right: 2vw
}

#chat-history {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 50px;
    min-width: 70vw;
    border: 1px solid #444;
    padding: 14px;
    height: 220px;
    overflow-y: auto;
    background: #161616;
}


#chat-history h2 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: #f0e200;
}

#history-log {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-line {
    color: #ddd;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* AI messages */
.msg { 
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.msg-content {
    background: #2c3e50;
    padding: 12px 14px;
    border-radius: 20px;
    max-width: 80%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.msg-content strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.msg-content p {
    margin: 0;
    line-height: 1.45;
}

.player-msg {
    justify-content: flex-end;
}

.player-msg .msg-content {
    background: #27ae60;
    color: #111;
}

.moderator .msg-content {
    background: #333;
    color: #f0e200;
}

.ai-msg .msg-content {
    background: #2c3e50;
    color: #fff;
}

#game-screen {
    width: 80vw;
    display: grid;
    justify-items: center;
    position: relative;
}

#language-switcher {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 120;
}

#lang-toggle-btn,
#fullscreen-btn {
    background: #1e1e1e;
    color: #f0e200;
    border: 1px solid #555;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
}

#lang-toggle-btn:hover,
#fullscreen-btn:hover {
    border-color: #f0e200;
}

#user-question {
    width: 95%;
    padding: 0px;
    border: none;
    font-size: 1.5em;
    font-family: sans-serif;
    background: #121212;
    color: #fff;
    outline: none;
    text-wrap-mode: wrap;
    resize: none;
    min-height: 70px
}

#input-fields {
    width: 100%;
    display: grid;
    grid-template-columns: 4fr auto;
    gap: 10px;
    margin-bottom: 90px;
    margin-top: 40px;
    background-color: #121212;
}

#reset-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 10px 20px;
    border: 2px solid #ff3333;
    color: #fff;
    background: #000;
}

#send-btn,
#next-btn,
#download-btn,
#restart-btn {
    background: #f0e200;
    border-radius: 5px;
    border: none;
    padding: 10px 20px;
    cursor: pointer;

}

#toggle-stop-btn {
    background: #000;
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: xx-large;
    cursor: pointer;
}

.invisible {
    visibility: hidden !important;
}

#end-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

#restart-btn {
    min-width: 15vh;
    min-height: 11vh;    
}

#generate-btn {
    background: #ff00b7;
    border-radius: 5px;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
}
