@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&display=swap");

:root {
    --bg-dark: #1a1a1a;
    --text-light: #f0f0f0;
    --accent: #6200ea;
    --danger: #f1eced;
    --success: #03dac6;
}

body {
    font-family: "Lexend", sans-serif;
    font-optical-sizing: auto;
    font-weight: 300;
    font-style: normal;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- OUTPUT OBS STYLES --- */
body.obs-output {
    background-color: transparent;
    /* Crucial pour OBS */
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.overlay-item {
    position: absolute;
    padding: 10px 20px;
    border-radius: 8px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    pointer-events: none;
    /* Clics traversent dans OBS */
}

.overlay-item.active {
    opacity: 1;
    transform: translateY(0);
}

.overlay-item img {
    max-width: 100%;
    display: block;
}

/* --- ADMIN STYLES --- */
body.admin-interface {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.status-indicator {
    font-size: 0.8em;
    padding: 4px 8px;
    border-radius: 4px;
    background: #555;
}

.status-indicator.connected {
    background: var(--success);
    color: #000;
}

.status-indicator.disconnected {
    background: var(--danger);
}

.group-card {
    border: 1px solid #888;
    margin-bottom: 10px;
    background: #222;
    padding: 10px;
}

.overlay-card {
    background: #2c2c2c;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.overlay-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
}

.overlay-info p {
    margin: 0;
    font-size: 0.9em;
    color: #aaa;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

/* Responsive Mobile */
@media (max-width: 480px) {
    .overlay-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .switch-container {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }
}

/* --- ADMIN --- */
.creator-panel {
    background: #333;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--accent);
}

.input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.input-group input,
.input-group select {
    padding: 8px;
    border-radius: 4px;
    border: none;
}

.input-group button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.value-display {
    font-size: 1.5em;
    font-weight: bold;
    width: 40px;
    text-align: center;
}

.range-control {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
    font-size: 0.8em;
}

.range-control input {
    flex: 1;
}

/* --- OUTPUT ELEMENTS --- */
.score-board {
    font-family: 'Impact', sans-serif;
    font-size: 100px;
    color: #fff;
    text-shadow: 4px 4px 0 #000;
    -webkit-text-stroke: 2px black;
    background-color: #bc96c5;
    border-radius: 20px;
    box-shadow: 0px 10px 10px #00000062;
    padding: 20px;
}

.timer-display {
    font-family: monospace;
    font-size: 80px;
    background-color: #bc96c5;
    border-radius: 20px;
    box-shadow: 0px 10px 10px #000000;
    color: var(--danger);
    padding: 10px 20px;
    border-radius: 10px;
}

/* ROUE DE LA FORTUNE */
.type-wheel {
    width: 300px;
    height: 300px;
    position: absolute;
}

.wheel-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 40px;
    color: yellow;
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* --- MODAL (POPUP) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    /* Caché par défaut */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.open {
    display: flex;
}

.modal-content {
    background: #2c2c2c;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    border: 1px solid var(--accent);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

.close-btn {
    background: transparent;
    color: var(--text-light);
    font-size: 1.5em;
    padding: 0;
}

/* --- ROUE AVANCÉE --- */
.wheel-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.wheel-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid white;
    position: relative;
    overflow: hidden;
    /* La transition sera définie dynamiquement en JS pour la vitesse */
}

.wheel-segment-text {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 20px;
    /* Hauteur ligne texte */
    transform-origin: 0% 50%;
    text-align: right;
    padding-right: 15px;
    color: white;
    font-weight: bold;
    pointer-events: none;
    font-size: 16px;
    /* Centrage vertical du texte */
    display: flex;
    align-items: center;
    justify-content: flex-end;
}