/* =============================================================
   RETRO CHAT – styl terminala / BBS
   ============================================================= */

/* Czcionka monospace z Google Fonts (jeśli dostępne) */
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

/* ---- Kontener główny ---- */
.retro-chat-wrap {
    position: relative;
    background: #000;
    border: 2px solid #00cc00;
    border-radius: 4px;
    max-width: 820px;
    margin: 24px auto;
    font-family: 'Share Tech Mono', 'Courier New', Courier, monospace;
    color: #00ff00;
    box-shadow:
        0 0 8px  rgba(0, 255, 0, 0.4),
        0 0 30px rgba(0, 255, 0, 0.15),
        inset 0 0 60px rgba(0, 0, 0, 0.8);
    overflow: hidden;
}

/* Efekt scanlines */
.retro-chat-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        rgba(0, 0, 0, 0.08) 3px,
        rgba(0, 0, 0, 0.08) 4px
    );
    pointer-events: none;
    z-index: 20;
}

/* Lekka winietka ekranu CRT */
.retro-chat-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center,
        transparent 65%,
        rgba(0, 0, 0, 0.5) 100%);
    pointer-events: none;
    z-index: 21;
}

/* ---- Pasek tytułu (imitacja okna DOS) ---- */
.retro-chat-header {
    background: #00cc00;
    color: #000;
    padding: 4px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    user-select: none;
}

.retro-chat-winctrl span {
    display: inline-block;
    border: 1px solid #000;
    padding: 0 5px;
    margin-left: 6px;
    cursor: default;
    font-size: 10px;
}

/* ---- Dropdown selektor drużyny ---- */
.retro-team-dropdown-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: #001a00;
    border-bottom: 1px solid #004400;
}

.retro-sel-label {
    font-size: 12px;
    color: #00cc00;
    letter-spacing: 1px;
    white-space: nowrap;
    margin: 0;
}

.retro-team-select {
    background: #000;
    border: 1px solid #00cc00;
    color: #00ff00;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 1px;
    padding: 3px 8px;
    cursor: pointer;
    outline: none;
    flex: 1;
    max-width: 220px;
}

.retro-team-select:focus {
    border-color: #00ff00;
    box-shadow: 0 0 6px rgba(0, 255, 0, 0.4);
}

.retro-team-select option {
    background: #000;
    color: #00ff00;
}

/* ---- Ekran czatu ---- */
.retro-chat-screen {
    display: flex;
    flex-direction: column;
}

/* ---- Obszar wyjścia (output) ---- */
.retro-chat-output {
    min-height: 280px;
    max-height: 520px;
    overflow-y: auto;
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.7;
    scroll-behavior: smooth;
}

/* Scrollbar retro */
.retro-chat-output::-webkit-scrollbar        { width: 8px; }
.retro-chat-output::-webkit-scrollbar-track  { background: #001100; }
.retro-chat-output::-webkit-scrollbar-thumb  { background: #00aa00; border-radius: 0; }
.retro-chat-output::-webkit-scrollbar-thumb:hover { background: #00ff00; }

/* ---- Typy linii ---- */
.retro-line { margin: 3px 0; word-break: break-word; }

.retro-sys {
    color: #007700;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.retro-input-line {
    color: #aaffaa;
}
.retro-input-line::before {
    content: '> ';
    color: #00ff00;
    font-weight: bold;
}

.retro-response {
    color: #ccffcc;
    margin: 8px 0 10px;
    padding-left: 4px;
    border-left: 2px solid #004400;
}

.retro-error {
    color: #ff4444;
    text-shadow: 0 0 6px rgba(255, 68, 68, 0.5);
}

.retro-think {
    color: #005500;
    font-size: 12px;
}

/* ---- Animacja kursora (pisanie) ---- */
.retro-typing-cursor::after {
    content: '▋';
    animation: rc-blink 0.65s step-end infinite;
    color: #00ff00;
    margin-left: 2px;
}

@keyframes rc-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ---- Wiersz inputu ---- */
.retro-chat-input-row {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    border-top: 1px solid #004400;
    background: #000800;
}

.retro-prompt {
    color: #00ff00;
    font-weight: bold;
    margin-right: 8px;
    white-space: nowrap;
    text-shadow: 0 0 6px rgba(0, 255, 0, 0.6);
}

.retro-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #00ff00;
    font-family: inherit;
    font-size: 14px;
    letter-spacing: 0.5px;
    caret-color: #00ff00;
}

.retro-input::placeholder {
    color: #005500;
}

/* ---- Linki w odpowiedziach ---- */
.retro-response a,
.retro-chat-output a {
    color: #ffff44;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.retro-response a:hover,
.retro-chat-output a:hover {
    color: #ffffff;
    text-shadow: 0 0 6px #ffff44;
}

/* ---- Obrazki w odpowiedziach ---- */
.retro-response img,
.retro-chat-output img {
    max-width: 100%;
    display: block;
    border: 1px solid #00aa00;
    margin: 8px 0;
    box-shadow: 0 0 10px rgba(0, 200, 0, 0.3);
}

/* ---- YouTube embed ---- */
.retro-yt {
    margin: 10px 0;
    border: 1px solid #00aa00;
    box-shadow: 0 0 12px rgba(0, 200, 0, 0.3);
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}
.retro-yt iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---- Efekt pojawiania się nowej linii ---- */
@keyframes rc-fadeIn {
    from { opacity: 0; transform: translateY(2px); }
    to   { opacity: 1; transform: translateY(0); }
}
.retro-line {
    animation: rc-fadeIn 0.2s ease;
}

/* ---- Responsywność ---- */
@media (max-width: 600px) {
    .retro-chat-output {
        font-size: 12px;
        min-height: 220px;
    }
    .retro-input {
        font-size: 12px;
    }
    .retro-team-btn {
        font-size: 12px;
        padding: 8px 16px;
    }
}
