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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: #191724;
    color: #e0def4;
    min-height: 100vh;
}

#topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #1f1d2e;
    border-bottom: 1px solid #26233a;
}
#topbar h1 {
    font-size: 18px;
    color: #f6c177;
    letter-spacing: 0.05em;
}
#topbar .user-info { font-size: 13px; color: #908caa; }
#topbar .user-info a {
    color: #c4a7e7;
    margin-left: 12px;
    text-decoration: none;
}
#topbar .user-info a:hover { color: #eb6f92; }

#app { display: flex; padding: 16px; }
#game {
    flex: 1;
    border: 1px solid #26233a;
    border-radius: 4px;
    overflow: hidden;
}

#chat-overlay {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 420px;
    max-height: 70vh;
    background: #1f1d2e;
    border: 2px solid #f6c177;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 100;
}
#chat-overlay.hidden { display: none; }

#chat-header {
    background: #26233a;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 6px 6px 0 0;
}
#chat-team-name { font-weight: bold; color: #f6c177; }
#chat-close {
    background: none;
    border: none;
    color: #e0def4;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
#chat-close:hover { color: #eb6f92; }

#chat-history {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 200px;
}

.bubble {
    padding: 10px 12px;
    border-radius: 8px;
    max-width: 90%;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.45;
}
.bubble-user { background: #3e8fb0; color: #fff; align-self: flex-end; }
.bubble-assistant { background: #26233a; color: #e0def4; align-self: flex-start; border: 1px solid #393552; }
.bubble-system { background: #eb6f92; color: #191724; align-self: center; font-style: italic; font-size: 12px; }

#chat-form {
    padding: 12px;
    display: flex;
    gap: 8px;
    border-top: 1px solid #26233a;
}
#chat-input {
    flex: 1;
    background: #26233a;
    color: #e0def4;
    border: 1px solid #393552;
    border-radius: 4px;
    padding: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
}
#chat-input:focus { outline: none; border-color: #f6c177; }
#chat-send {
    background: #f6c177;
    color: #191724;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
}
#chat-send:hover { background: #eb6f92; color: #fff; }

/* ---- Pages d'authentification (django-two-factor-auth) ---- */
.auth-page {
    max-width: 480px;
    margin: 60px auto;
    padding: 0 24px;
}
.auth-card {
    background: #1f1d2e;
    border: 1px solid #26233a;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}
.auth-card h1,
.auth-card h2 {
    color: #f6c177;
    margin-bottom: 12px;
    font-size: 22px;
    font-weight: 600;
}
.auth-card p {
    margin-bottom: 14px;
    color: #908caa;
    line-height: 1.5;
}
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card form p { margin-bottom: 0; color: #e0def4; }
.auth-card label,
.auth-card .form-label {
    display: block;
    color: #c4a7e7;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.auth-card input[type="text"],
.auth-card input[type="password"],
.auth-card input[type="number"],
.auth-card input[type="email"] {
    width: 100%;
    background: #26233a;
    color: #e0def4;
    border: 1px solid #393552;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
}
.auth-card input:focus { outline: none; border-color: #f6c177; }
.auth-card button,
.auth-card input[type="submit"],
.auth-card .btn {
    background: #f6c177;
    color: #191724;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}
.auth-card button:hover,
.auth-card input[type="submit"]:hover,
.auth-card .btn:hover { background: #eb6f92; color: #fff; }
.auth-card button[disabled],
.auth-card .btn[disabled] {
    background: #393552;
    color: #6e6a86;
    cursor: not-allowed;
}
.auth-card .btn-link {
    background: transparent;
    color: #c4a7e7;
    padding: 10px 8px;
    font-weight: normal;
}
.auth-card .btn-link:hover { background: transparent; color: #eb6f92; }
.auth-card .float-right { float: right; }
.auth-card .button-group,
.auth-card .form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
}
.auth-card a {
    color: #c4a7e7;
    text-decoration: none;
}
.auth-card a:hover { color: #eb6f92; }
.auth-card ul.errorlist {
    list-style: none;
    background: rgba(235, 111, 146, 0.15);
    border: 1px solid #eb6f92;
    border-radius: 4px;
    padding: 8px 12px;
    color: #eb6f92;
    font-size: 13px;
}
.auth-card img { max-width: 100%; height: auto; }
.auth-card table { width: 100%; border-collapse: collapse; }
.auth-card table td { padding: 6px 8px; vertical-align: top; }
.auth-card .mb-3 { margin-bottom: 16px; }
