* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: Arial, sans-serif; color: #e0e0e0; background: #121212; }

/* NAV */
header { width: 100%; padding: 24px 60px; position: fixed; top: 0; left: 0; background: rgba(18,18,18,0.95); backdrop-filter: blur(10px); border-bottom: 1px solid #333; z-index: 100; }
nav { display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.6rem; font-weight: bold; color: #bb86fc; }
.nav-links { list-style: none; display: flex; gap: 32px; }
.nav-links a { text-decoration: none; color: #e0e0e0; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: #bb86fc; }
.btn-primary { background: #bb86fc; border: none; padding: 12px 26px; color: #121212; border-radius: 8px; cursor: pointer; font-size: 1rem; text-decoration: none; font-weight: 500; transition: background 0.2s; }
.btn-primary:hover { background: #a66efc; }

/* LOGO PLACEHOLDER */
.logo-placeholder {
    width: 40px;
    height: 40px;
    background-color: #86fce2;
    background-image: url('../res/hofr.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
    display: inline-block;
    margin-left: 20px;
    margin-right: 20px;
}

/* HERO SECTION */
.hero-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 160px 60px 100px;
    background: linear-gradient(135deg, #1f1f1f, #2c2c2c);
    color: #e0e0e0;
}
.hero-content { max-width: 60%; }
.hero-content h1 { font-size: 3rem; margin-bottom: 20px; line-height: 1.2; color: #bb86fc; }
.hero-content p { font-size: 1.2rem; opacity: 0.85; margin-bottom: 30px; line-height: 1.6; }
.hero-image img { width: 250px; height: 250px; border-radius: 50%; border: 4px solid #bb86fc; box-shadow: 0 0 30px rgba(187, 134, 252, 0.4); }

/* Page spacer (replaces hero section) */
.page-spacer {
    height: 100px;
}

/* GENERATOR */
.generator-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.generator-options {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #333;
    margin-bottom: 24px;
}

/* Number inputs row */
.options-numbers {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 24px;
}

.option-number {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.option-number label {
    color: #e0e0e0;
    font-weight: 500;
    font-size: 0.95rem;
}

.option-number input[type="number"] {
    width: 70px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 2px solid #444;
    background: #1a1a1a;
    color: #e0e0e0;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    transition: border-color 0.2s;
}

.option-number input[type="number"]:focus {
    outline: none;
    border-color: #bb86fc;
}

/* Toggle switches */
.options-toggles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #252525;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-label:hover {
    background: #2a2a2a;
}

.toggle-label span:first-child {
    color: #ccc;
    font-size: 0.9rem;
}

.toggle {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #444;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #888;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
    background-color: #bb86fc;
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(22px);
    background-color: #fff;
}

.toggle input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.3);
}

.btn-generate {
    width: 100%;
    padding: 14px;
    background: #bb86fc;
    color: #121212;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-generate:hover {
    background: #a66efc;
}

.btn-generate:active {
    transform: scale(0.98);
}

/* Lineup Results */
.lineup-results {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.lineup-card {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #333;
    min-width: 200px;
    text-align: center;
}

.lineup-card h3 {
    color: #bb86fc;
    margin-bottom: 16px;
    font-size: 1.1rem;
}

.lineup-chars {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.lineup-char {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lineup-char img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid #888;
    margin-bottom: 8px;
}

.lineup-char .char-name {
    font-size: 0.85rem;
    color: #e0e0e0;
}

.lineup-char .faction-name {
    font-size: 0.75rem;
    color: #888;
}

.generator-error {
    text-align: center;
    color: #ff6b6b;
    padding: 20px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 8px;
    border: 1px solid #ff6b6b;
}

/* Animations Generator */
@keyframes cardFlipIn {
    0% {
        transform: rotateY(180deg) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: rotateY(90deg) scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: rotateY(0deg) scale(1);
        opacity: 1;
    }
}

@keyframes charPopIn {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.2) rotate(10deg);
        opacity: 1;
    }
    80% {
        transform: scale(0.9) rotate(-5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(187, 134, 252, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(187, 134, 252, 0.8), 0 0 40px rgba(187, 134, 252, 0.4);
    }
}

@keyframes slideUp {
    0% {
        transform: translateY(30px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.lineup-card {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #333;
    min-width: 200px;
    text-align: center;
    opacity: 0;
    animation: cardFlipIn 0.6s ease-out forwards;
}

.lineup-card.revealed {
    opacity: 1;
    animation: glowPulse 2s ease-in-out infinite;
}

.lineup-char.pop {
    opacity: 1;
}

.lineup-char {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
}

.lineup-char.pop {
    animation: charPopIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.lineup-char img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid #888;
    margin-bottom: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.lineup-char img:hover {
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 0 20px rgba(187, 134, 252, 0.6);
}

/* Shuffle animation on button */
.btn-generate.shuffling {
    animation: shake 0.5s ease-in-out;
    pointer-events: none;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px) rotate(-2deg); }
    40% { transform: translateX(8px) rotate(2deg); }
    60% { transform: translateX(-6px) rotate(-1deg); }
    80% { transform: translateX(6px) rotate(1deg); }
}

/* SECTION TITLES */
.section-title {
    padding: 40px 60px 20px;
    text-align: center;
}
.section-title h2 {
    font-size: 2.2rem;
    color: #bb86fc;
    margin-bottom: 10px;
}
.section-title p {
    font-size: 1.1rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto;
}

/* CHARACTERS GRID */
.characters-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    padding: 20px 60px 60px;
}

.faction-column {
    text-align: center;
    padding: 0 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.faction-column:last-child {
    border-right: none;
}

.faction-characters {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 6px 4px;
    justify-content: center;
}

.faction-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 18px;
}

.faction-header img {
    margin-bottom: 8px;
}

/* CHARACTER CARDS */
.character {
    position: relative;
    display: inline-block;
    margin-bottom: 12px;
    width: 64px;
}

.character img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid #888;
    box-shadow: 0 0 10px rgba(255,255,255,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.character img:hover {
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(255,255,255,0.4);
}

/* TOOLTIP */
.character .tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(30,30,30,0.95);
    color: #eee;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
    max-width: 180px;
    white-space: normal;
    word-wrap: break-word;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
    box-shadow: 0 0 8px rgba(0,0,0,0.6);
}

.character .tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: rgba(30,30,30,0.95) transparent transparent transparent;
}

.character:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* Personnages déjà joués (grisés) */
.character.played img {
    filter: grayscale(100%);
    opacity: 0.5;
    border-color: #555;
}

.character.played:hover img {
    filter: grayscale(50%);
    opacity: 0.7;
}

/* Personnages bannis (bordure rouge animée) */
@keyframes banned-pulse {
    0% { box-shadow: 0 0 6px red; }
    50% { box-shadow: 0 0 14px red, 0 0 20px rgba(255, 0, 0, 0.4); }
    100% { box-shadow: 0 0 6px red; }
}

.character.banned img {
    border-color: red;
    animation: banned-pulse 1.5s infinite ease-in-out;
}

/* Banni + joué : garde le grisé mais avec bordure rouge */
.character.banned.played img {
    filter: grayscale(100%);
    opacity: 0.5;
    border-color: red;
    animation: banned-pulse 1.5s infinite ease-in-out;
}

/* FORM CONTAINER */
.form-container {
    padding: 20px 60px 60px;
}

.week-form {
    background: #1e1e1e;
    border-radius: 16px;
    padding: 30px;
    border: 1px solid #333;
    max-width: 900px;
    margin: 0 auto;
}

.form-header {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.form-header .form-group {
    text-align: center;
}

.form-header input {
    width: 100px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.players-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.player-card {
    background: #252525;
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #444;
}

.player-card h3 {
    color: #bb86fc;
    margin-bottom: 20px;
    font-size: 1.3rem;
    text-align: center;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #e0e0e0;
    font-weight: 500;
}

.form-group .required {
    color: #ff6b6b;
}

.form-group .optional {
    color: #888;
    font-size: 0.85rem;
    font-weight: normal;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #444;
    background: #1a1a1a;
    color: #e0e0e0;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #bb86fc;
    box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.2);
}

.form-group input::placeholder {
    color: #666;
}

.char-select {
    cursor: pointer;
}

.char-select option {
    background: #1a1a1a;
    color: #e0e0e0;
}

.char-select optgroup {
    background: #252525;
    color: #bb86fc;
    font-weight: bold;
}

.form-actions {
    margin-top: 30px;
    text-align: center;
}

.btn-submit {
    background: #bb86fc;
    color: #121212;
    border: none;
    padding: 14px 40px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.btn-submit:hover {
    background: #a66efc;
    transform: translateY(-2px);
}

.btn-submit:active {
    transform: translateY(0);
}

.form-message {
    margin-top: 20px;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    display: none;
}

.form-message.success {
    display: block;
    background: rgba(34, 165, 51, 0.2);
    color: #22a533;
    border: 1px solid #22a533;
}

.form-message.error {
    display: block;
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
}

/* GAME HISTORY */
.game-history {
    padding: 20px 60px 60px;
}

.game-session {
    margin-bottom: 24px;
    border-radius: 12px;
    background: #1e1e1e;
    border: 1px solid #333;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.session-header {
    width: 100%;
    padding: 16px 24px;
    text-align: left;
    font-weight: bold;
    font-size: 1.1rem;
    background: #2a2a2a;
    color: #e0e0e0;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-header:hover {
    background: #3a3a3a;
}

.session-header .date {
    color: #bb86fc;
}

.session-header .toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.session-header.open .toggle-icon {
    transform: rotate(180deg);
}

.session-content {
    display: none;
    padding: 20px 24px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    animation: fadeIn 0.3s ease-in-out;
}

.session-notes {
    margin-bottom: 20px;
    font-size: 1rem;
    opacity: 0.85;
    line-height: 1.5;
}

/* PLAYERS GRID - Séparation des joueurs */
.players-grid {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.player-section {
    text-align: center;
    min-width: 200px;
}

.player-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #bb86fc;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #bb86fc;
}

.player-chars {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.player-separator {
    width: 2px;
    background: linear-gradient(to bottom, transparent, #555, transparent);
    min-height: 120px;
    align-self: stretch;
}

/* SQUAD DISPLAY */
.squad-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.squad-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: #222;
    border-radius: 12px;
    border: 1px solid #444;
    min-width: 100px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.squad-member:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 15px rgba(187, 134, 252, 0.3);
}

.squad-member img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid #888;
    margin-bottom: 8px;
    box-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.squad-member .char-name {
    font-size: 0.9rem;
    font-weight: bold;
    color: #e0e0e0;
    text-align: center;
    margin-bottom: 4px;
}

.squad-member .player-name {
    font-size: 0.8rem;
    color: #bb86fc;
    text-align: center;
}

.squad-member .slot-number {
    font-size: 0.75rem;
    color: #888;
    margin-top: 4px;
}

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 1.1rem;
}

/* FOOTER */
footer {
    text-align: center;
    padding: 40px 0;
    background: #111;
    color: #e0e0e0;
    margin-top: 60px;
}

.footer-logo {
    margin-top: 15px;
    height: 30px;
    opacity: 0.7;
}

/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* RESPONSIVE */
@media (max-width: 1200px) {
    .characters-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .characters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .characters-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 15px;
        gap: 15px;
    }
    .faction-column {
        padding: 0 5px;
    }
}

@media (max-width: 768px) {
    header { padding: 16px 20px; }
    .game-history { padding: 20px; }
    .section-title { padding: 30px 20px 15px; }
    .form-container { padding: 20px; }
    .week-form { padding: 20px; }
    .players-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .players-grid {
        flex-direction: column;
        align-items: center;
    }
    .player-separator {
        width: 80%;
        height: 2px;
        min-height: 2px;
        background: linear-gradient(to right, transparent, #555, transparent);
    }
    .page-spacer {
        height: 80px;
    }
    .options-toggles {
        grid-template-columns: 1fr;
    }
    .options-numbers {
        gap: 20px;
    }
}
