/* style.css — PhotoGame, mobile-first */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #4f8dff 100%);
    --accent: #f59e0b;
    --accent-gradient: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --danger: #ef4444;
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    --success: #10b981;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --pink: #ec4899;
    --violet: #8b5cf6;
    --yellow: #eab308;
    --cyan: #06b6d4;
    --bg: #f5f7fb;
    --bg-gradient: linear-gradient(180deg, #eef2ff 0%, #fce7f3 100%);
    --card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 2px 6px rgba(37, 99, 235, 0.08);
    --shadow-md: 0 6px 16px rgba(37, 99, 235, 0.12);
    --shadow-lg: 0 10px 30px rgba(37, 99, 235, 0.18);
    --font-title: 'Fredoka', 'Nunito', -apple-system, sans-serif;
    --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Mascotte sur l'ecran d'accueil */
.welcome-mascot {
    display: block;
    max-width: 180px;
    width: 60%;
    margin: 0 auto 16px;
    filter: drop-shadow(0 6px 18px rgba(139, 92, 246, 0.25));
    animation: welcome-float 3.2s ease-in-out infinite;
}

@keyframes welcome-float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-6px) rotate(2deg); }
}

/* Pattern confettis discret en arriere-plan */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--bg-gradient);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(236, 72, 153, 0.08) 0, transparent 50px),
        radial-gradient(circle at 80% 10%, rgba(139, 92, 246, 0.08) 0, transparent 60px),
        radial-gradient(circle at 30% 70%, rgba(234, 179, 8, 0.08) 0, transparent 50px),
        radial-gradient(circle at 90% 85%, rgba(6, 182, 212, 0.08) 0, transparent 55px),
        radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.05) 0, transparent 80px),
        var(--bg-gradient);
    pointer-events: none;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px 32px;
    min-height: 100vh;
    position: relative;
}

h1, h2, h3 { font-family: var(--font-title); }

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 16px;
}

.logo {
    height: 60px;
    width: auto;
}

#lang-select {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    width: auto;
    min-width: 50px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

#admin-games-list {
    margin-bottom: 16px;
}

.banner-monkey {
    display: block;
    max-width: 260px;
    width: 80%;
    height: auto;
    margin: 16px auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.banner-monkey-pause {
    display: block;
    max-width: 280px;
    width: 90%;
    height: auto;
    margin: 20px auto;
    border-radius: 12px;
}

.balance-badge {
    display: inline-block;
    font-size: 0.9rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
    margin-left: 6px;
    vertical-align: middle;
}
.balance-badge.ok { background: #d1fae5; color: #065f46; }
.balance-badge.warn { background: #fef3c7; color: #92400e; }
#lang-select:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Ecrans */
.screen { animation: fadeIn 0.3s ease; }
.hidden { display: none !important; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
    letter-spacing: -0.3px;
}

/* Bandeau code salle */
.room-banner {
    background: var(--primary-gradient);
    color: white;
    text-align: center;
    padding: 10px 12px;
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 1.05rem;
    letter-spacing: 1px;
    box-shadow: var(--shadow-md);
    font-weight: 600;
}

.identity-banner {
    background: var(--bg);
    color: var(--text);
    text-align: center;
    padding: 6px 10px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 0.9rem;
    border: 1px solid #ddd;
}

/* Toast */
.toast {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--danger);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius);
    z-index: 1000;
    font-size: 0.9rem;
    max-width: 90%;
    text-align: center;
}

.toast-error { background: var(--danger); }
.toast-info { background: var(--success); }
.toast-admin-msg {
    background: var(--accent);
    font-size: 1rem;
    font-weight: 600;
    padding: 16px 28px;
    max-width: 95%;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
    width: 100%;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--primary-gradient); color: white; box-shadow: var(--shadow-md); }
.btn-primary:hover { filter: brightness(1.08); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.btn-primary:disabled { background: var(--text-light); cursor: not-allowed; filter: none; box-shadow: none; transform: none; }
.btn-secondary { background: var(--border); color: var(--text); box-shadow: none; }
#btn-join-player {
    background: linear-gradient(135deg, var(--pink) 0%, var(--violet) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}
#btn-join-spectator,
#btn-new-game {
    background: linear-gradient(135deg, var(--cyan) 0%, var(--primary) 100%);
    color: white;
    box-shadow: var(--shadow-md);
    opacity: 1;
}
.btn-accent { background: var(--accent-gradient); color: white; box-shadow: var(--shadow-md); }
.btn-accent:hover { filter: brightness(1.08); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
#btn-auth-master {
    background: linear-gradient(135deg, #fbbf24 0%, #fde68a 100%);
    color: #78350f;
}
.btn-danger { background: var(--danger-gradient); color: white; box-shadow: var(--shadow-md); }
.btn-danger:hover { filter: brightness(1.08); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.btn-success { background: var(--success-gradient); color: white; box-shadow: var(--shadow-md); }
.btn-success:hover { filter: brightness(1.08); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.btn-small { padding: 6px 12px; width: auto; font-size: 0.85rem; box-shadow: var(--shadow-sm); }

/* Boutons "Changer de compte" : centres sous l'action principale */
#btn-admin-logout,
#btn-config-logout {
    display: block;
    margin: 8px auto 0;
}

/* Boutons outline — harmonisation */
.btn-outline-danger {
    background: transparent;
    border: 2px solid var(--danger);
    color: var(--danger);
    font-weight: 700;
    box-shadow: none;
}
.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
}

.btn-outline-accent {
    background: transparent;
    border: 2px solid var(--accent);
    color: #b45309;
    font-weight: 700;
    box-shadow: none;
}
.btn-outline-accent:hover {
    background: rgba(245, 158, 11, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.22);
}

.btn-outline-neutral {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-light);
    font-weight: 600;
    box-shadow: none;
}
.btn-outline-neutral:hover {
    background: var(--bg);
    transform: translateY(-1px);
}

/* Inputs */
input[type="text"],
input[type="password"],
input[type="number"],
select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font-body);
    margin-bottom: 12px;
    background: var(--card);
    transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Accueil */
.role-choice {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

/* Config — themes */
.form-group {
    margin-bottom: 10px;
}
.form-group input,
.form-group select {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    font-style: italic;
    margin-top: 6px;
    padding: 4px 8px;
    background: rgba(37, 99, 235, 0.06);
    border-radius: var(--radius-sm);
}

/* Ecran de configuration — sections cartes */
.config-mascot {
    display: block;
    max-width: 110px;
    margin: 0 auto 4px;
    filter: drop-shadow(0 6px 16px rgba(139, 92, 246, 0.22));
    animation: welcome-float 3.5s ease-in-out infinite;
}

.title-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--violet) 60%, var(--pink) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    text-align: center;
    margin-bottom: 16px;
}

.config-section {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-left: 5px solid var(--section-color, var(--primary));
    padding: 14px 16px 10px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}

.config-section h3 {
    font-size: 1.05rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--section-color, var(--primary));
}

.config-section h3 .section-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.section-actions {
    display: inline-flex;
    gap: 6px;
    margin-left: auto;
}

.btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1.5px solid var(--primary);
    background: #dbeafe;
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, transform 0.1s;
}

.btn-icon:hover {
    background: #bfdbfe;
    transform: translateY(-1px);
}

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

.section-icon {
    font-size: 1.15rem;
}

.section-info    { --section-color: var(--primary); }
.section-options { --section-color: var(--violet); }
.section-themes  { --section-color: var(--pink); }

.config-section .form-group > input,
.config-section .form-group > select {
    border: 1.5px solid var(--section-color, var(--border));
    transition: border-color 0.15s, box-shadow 0.15s;
}

.config-section .form-group > input:focus,
.config-section .form-group > select:focus {
    outline: none;
    border-color: var(--section-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--section-color) 25%, transparent);
}

/* Checkbox custom */
.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text) !important;
    margin-bottom: 0 !important;
    padding-left: 28px;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 48px;
    height: 26px;
    border-radius: 13px;
    background: var(--border);
    cursor: pointer;
    position: relative;
    transition: background 0.25s;
    flex-shrink: 0;
    border: none;
}

.checkbox-label input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s;
}

.checkbox-label input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--violet) 0%, #a78bfa 100%);
}

.checkbox-label input[type="checkbox"]:checked::after {
    transform: translateX(22px);
}

/* Theme row avec badge */
.theme-row {
    display: grid;
    grid-template-columns: 32px 1fr 140px 36px;
    grid-template-areas: "badge label timers remove";
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
    padding: 6px 4px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.5);
    border-left: 4px solid hsl(var(--theme-hue, 0), 70%, 60%);
}

.theme-row .theme-badge { grid-area: badge; }
.theme-row .theme-label { grid-area: label; }
.theme-row .theme-timers { grid-area: timers; display: flex; gap: 6px; }
.theme-row .theme-remove { grid-area: remove; }

.theme-row .theme-timers input {
    width: 60px;
    min-width: 0;
}

@media (max-width: 500px) {
    .theme-row {
        grid-template-columns: 32px 1fr 36px;
        grid-template-areas:
            "badge label  remove"
            ".     timers timers";
        row-gap: 6px;
    }
    .theme-row .theme-timers { justify-content: flex-start; }
}

.theme-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: hsl(var(--theme-hue, 0), 70%, 55%);
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    justify-self: center;
}

.theme-row input {
    margin-bottom: 0;
    padding: 8px 6px;
    text-align: center;
    border: 1.5px solid hsl(var(--theme-hue, 280), 65%, 70%);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.theme-row input:focus {
    outline: none;
    border-color: hsl(var(--theme-hue, 280), 65%, 50%);
    box-shadow: 0 0 0 3px hsla(var(--theme-hue, 280), 65%, 55%, 0.2);
}
.theme-row input.theme-label {
    text-align: left;
    padding: 8px 10px;
}

.theme-remove {
    padding: 4px 8px !important;
    font-size: 1.1rem !important;
    line-height: 1;
    background: hsl(var(--theme-hue, 320), 65%, 60%) !important;
    border: none;
    color: white;
    box-shadow: none !important;
}

.theme-remove:hover {
    background: hsl(var(--theme-hue, 320), 65%, 52%) !important;
}

.admin-toolbar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

#btn-add-theme {
    margin-top: 4px;
    width: 100%;
    background: transparent;
    border: 2px solid var(--pink);
    color: var(--pink);
    font-weight: 700;
    box-shadow: none;
    transition: background 0.15s, transform 0.1s, box-shadow 0.2s;
}

#btn-add-theme:hover {
    background: rgba(236, 72, 153, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(236, 72, 153, 0.2);
}

/* Form actions — bouton Creer proeminent */
.form-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-large {
    padding: 18px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: var(--shadow-lg);
}

.version-footer {
    text-align: center;
    color: var(--text-light);
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 16px;
}

.form-actions-secondary {
    display: flex;
    gap: 8px;
}

.form-actions-secondary .btn {
    flex: 1;
    width: auto;
    margin-bottom: 0;
}

.form-actions .btn {
    width: auto;
    flex: 1;
}

/* Lobby */
.lobby-team {
    padding: 14px 16px;
    margin-bottom: 12px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    border-left: 6px solid var(--team-color, var(--primary));
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.lobby-team::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 70px;
    height: 70px;
    background: var(--team-color, var(--primary));
    opacity: 0.08;
    border-radius: 50%;
    transform: translate(35%, -35%);
    pointer-events: none;
}

.lobby-team.empty {
    border-style: dashed;
    border-left-style: solid;
    background: rgba(255, 255, 255, 0.6);
}

.team-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lobby-team .team-header > span:first-child {
    font-weight: 600;
    min-width: 80px;
}

.lobby-team input {
    margin-bottom: 0;
    flex: 1;
    min-width: 120px;
}

.btn-team-name-save:disabled {
    opacity: 0.4;
    cursor: default;
}

.player-item {
    padding: 6px 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

input[readonly] {
    background: var(--bg);
    color: var(--text-light);
    cursor: default;
}

.input-saved {
    border-color: var(--success) !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.team-members {
    margin-top: 4px;
}

.player-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-gradient);
    color: white;
    padding: 3px 12px 3px 3px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 3px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.player-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.3);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Format compact : rond + nom libre + × */
.player-item-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 12px 4px 0;
    font-size: 0.9rem;
    color: var(--text);
}

.player-item-inline.disconnected {
    opacity: 0.5;
}
.player-item-inline.disconnected .player-name {
    text-decoration: line-through;
}

.player-round {
    display: inline-block !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border-radius: 50% !important;
    text-align: center;
    line-height: 32px;
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    vertical-align: middle;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    flex: 0 0 auto;
}

.player-name {
    font-weight: 500;
}

.player-item-inline .player-remove {
    background: rgba(0, 0, 0, 0.12);
    color: var(--text-light);
    width: 22px;
    height: 22px;
    min-width: 22px;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}
.player-item-inline .player-remove:hover {
    background: var(--danger);
    color: white;
}

.spectator-status {
    color: var(--accent);
    font-size: 0.85rem;
    font-style: italic;
}

.spectators-section {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.player-tag.disconnected {
    background: var(--text-light);
    opacity: 0.6;
}

.player-remove {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.8rem;
    line-height: 14px;
    padding: 0;
    margin-left: 4px;
    cursor: pointer;
}
.player-remove:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--primary);
}
.player-item .player-remove,
.spectator-chip .player-remove {
    background: #e74c3c;
    color: white;
}
.player-item .player-remove:hover,
.spectator-chip .player-remove:hover {
    background: #c0392b;
    color: white;
}

.waiting-message {
    text-align: center;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 600;
    padding: 16px;
    margin: 12px 0;
    background: #eff6ff;
    border-radius: var(--radius);
    animation: pulse 2s ease-in-out infinite;
}

#theme-expired-msg {
    font-size: 0.95rem;
    line-height: 1.3;
}

/* Ecrans d'attente (results waiting, spectator wait) */
.waiting-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px 16px;
    margin: 20px 0;
}

.waiting-mascot {
    max-width: 180px;
    width: 55%;
    filter: drop-shadow(0 8px 20px rgba(139, 92, 246, 0.25));
    animation: mascot-bob 2.8s ease-in-out infinite;
}

@keyframes mascot-bob {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50% { transform: translateY(-8px) rotate(3deg); }
}

.waiting-dots {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.waiting-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.5;
    animation: dot-pulse 1.2s ease-in-out infinite;
}

.waiting-dots span:nth-child(2) { animation-delay: 0.2s; background: var(--violet); }
.waiting-dots span:nth-child(3) { animation-delay: 0.4s; background: var(--pink); }

@keyframes dot-pulse {
    0%, 80%, 100% { transform: scale(0.8); opacity: 0.4; }
    40% { transform: scale(1.2); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Photo */
.timer {
    font-size: 3.8rem;
    font-weight: 700;
    font-family: var(--font-title);
    text-align: center;
    color: var(--primary);
    margin: 18px 0;
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
    text-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

/* Wrapper timer + mascotte */
.timer-wrap {
    position: relative;
    width: 200px;
    margin: 18px auto 8px;
}

/* Timer circulaire SVG */
.timer-ring {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 6px 16px rgba(139, 92, 246, 0.22));
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-track {
    fill: #fef6ff;
    stroke: var(--border);
    stroke-width: 8;
}

.timer-progress {
    fill: transparent;
    stroke: url(#timerGrad);
    stroke-width: 9;
    stroke-linecap: round;
    stroke-dasharray: 339.3;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.9s linear;
}

.timer-ring.warn  { filter: drop-shadow(0 6px 18px rgba(245, 158, 11, 0.55)); }
.timer-ring.danger {
    filter: drop-shadow(0 6px 20px rgba(239, 68, 68, 0.7));
    animation: timer-pulse 0.9s ease-in-out infinite;
}
@keyframes timer-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.timer-text {
    position: absolute;
    font-family: var(--font-title);
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    letter-spacing: -1.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.timer-text.closed {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* Mascotte a cote du chrono */
.timer-mascot {
    position: absolute;
    right: -20px;
    bottom: -8px;
    width: 70px;
    height: auto;
    filter: drop-shadow(0 4px 10px rgba(139, 92, 246, 0.3));
    animation: mascot-tilt 2.4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes mascot-tilt {
    0%, 100% { transform: rotate(-8deg); }
    50% { transform: rotate(8deg); }
}

/* Tagline photo */
.photo-tagline {
    text-align: center;
    font-family: var(--font-title);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--violet);
    margin: 4px 0 4px;
}

.photo-tagline-note {
    text-align: center;
    font-size: 0.8rem;
    font-style: italic;
    color: var(--text-light);
    margin: 0 0 12px;
}

.photo-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 6px 0 4px;
}

/* Polaroid preview */
.polaroid-frame {
    background: white;
    padding: 10px 10px 40px;
    margin: 16px auto;
    max-width: 280px;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    transform: rotate(-2deg);
    animation: polaroid-develop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.polaroid-frame img {
    width: 100%;
    display: block;
    aspect-ratio: 1;
    object-fit: cover;
}

@keyframes polaroid-develop {
    0% { opacity: 0; transform: rotate(-10deg) scale(0.7); }
    100% { opacity: 1; transform: rotate(-2deg) scale(1); }
}

/* Confettis discrets en bas de page photo */
#screen-photo::after {
    content: "";
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background-image:
        radial-gradient(circle, var(--pink) 2px, transparent 3px),
        radial-gradient(circle, var(--cyan) 2px, transparent 3px),
        radial-gradient(circle, var(--yellow) 2px, transparent 3px);
    background-size: 40px 40px, 60px 60px, 80px 80px;
    background-position: 0 0, 20px 30px, 40px 15px;
    opacity: 0.15;
    pointer-events: none;
    z-index: -1;
}

.progress-indicator {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 16px;
}
.progress-indicator.success {
    color: var(--success);
    font-weight: bold;
}

/* Tableau de bord maitre — phase photo */
#photo-teams-status {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.master-team-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    text-align: center;
}

.master-team-card.photo-done {
    border-color: var(--success);
    background: #f0fdf4;
}

.team-card-name {
    font-weight: 700;
    margin-bottom: 4px;
}

.team-photo-status {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.master-team-card.photo-done .team-photo-status {
    color: var(--success);
}

.team-photo-thumb {
    width: 100%;
    max-height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

#photo-preview {
    text-align: center;
    margin-top: 16px;
}

#photo-preview-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius);
    border: 2px solid var(--success);
}

/* Vote — grille photos */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.photo-card {
    background: var(--card);
    border-radius: 6px;
    padding: 8px 8px 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.photo-card:nth-child(odd) { transform: rotate(-1.2deg); }
.photo-card:nth-child(even) { transform: rotate(1.2deg); }
.photo-card:hover {
    transform: rotate(0) scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    z-index: 2;
}

.photo-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    cursor: pointer;
    display: block;
}

.btn-vote {
    display: block;
    width: 100%;
    padding: 10px;
    border: none;
    background: linear-gradient(135deg, var(--border) 0%, #f1f5f9 100%);
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn-vote:hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #ddd6fe 100%);
    transform: translateY(-1px);
}

.btn-vote.voted {
    background: var(--accent-gradient);
    color: white;
    font-weight: 700;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.15);
}
.btn-vote.voted::before {
    content: "★ ";
}

/* Modal zoom */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal img {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
}

.modal-box {
    background: var(--card);
    color: var(--text);
    padding: 20px;
    border-radius: var(--radius);
    max-width: 90%;
    width: 420px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.modal-box h3 {
    margin: 0 0 12px;
    font-family: 'Fredoka', sans-serif;
}

.qr-modal-box {
    text-align: center;
}

.qr-code-container {
    display: flex;
    justify-content: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin: 8px auto;
}

.qr-code-container canvas,
.qr-code-container img {
    display: block;
}

.qr-code-caption {
    margin: 10px 0 4px;
    font-size: 1rem;
}

.qr-code-caption strong {
    color: var(--primary);
    font-size: 1.15rem;
    letter-spacing: 0.5px;
}

.qr-code-url {
    font-size: 0.75rem;
    color: var(--text-light);
    word-break: break-all;
    margin: 0 0 12px;
}

.modal-box textarea {
    width: 100%;
    padding: 10px;
    font-family: inherit;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    resize: vertical;
}

.admin-msg-sound-select {
    width: 100%;
    margin-top: 6px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    font-size: 0.9rem;
}

.admin-msg-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.preset-chip {
    background: rgba(139, 92, 246, 0.1);
    border: 1.5px solid var(--violet);
    color: var(--violet);
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.preset-chip:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
}

.tip-mascot {
    display: block;
    max-width: 110px;
    margin: 10px auto;
    animation: welcome-float 3s ease-in-out infinite;
}

.admin-msg-counter {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 4px 0 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 501;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 16px;
    cursor: pointer;
}

.modal-prev { left: 8px; }
.modal-next { right: 8px; }

/* Podium */
.podium {
    margin: 16px 0;
}

.podium-entry {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.podium-entry.rank-1 {
    border-color: gold;
    background: #fffbeb;
}

.podium-entry.rank-2 {
    border-color: silver;
    background: #f8fafc;
}

.podium-entry.rank-3 {
    border-color: #cd7f32;
    background: #fef3c7;
}

.podium-entry.rank-4 {
    border-color: var(--violet);
    background: #f5f3ff;
}

.podium-entry.rank-5 {
    border-color: var(--pink);
    background: #fdf2f8;
}

.podium-entry.rank-6 {
    border-color: var(--cyan);
    background: #ecfeff;
}

.podium-entry.rank-7 {
    opacity: 0.75;
}

/* Table classement complet (recap final) */
#final-full-ranking {
    margin: 20px 0;
    padding: 14px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

#final-full-ranking h3 {
    font-family: var(--font-title);
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 10px;
    text-align: center;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ranking-table th {
    text-align: left;
    padding: 6px 8px;
    font-size: 0.8rem;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
}

.ranking-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border);
}

.ranking-table tr:last-child td {
    border-bottom: none;
}

.ranking-table tr.rank-1 td { background: #fffbeb; font-weight: 700; }
.ranking-table tr.rank-2 td { background: #f8fafc; font-weight: 600; }
.ranking-table tr.rank-3 td { background: #fef3c7; font-weight: 600; }
.ranking-table tr.rank-4 td { background: #f5f3ff; }
.ranking-table tr.rank-5 td { background: #fdf2f8; }
.ranking-table tr.rank-6 td { background: #ecfeff; }
.ranking-table tr.rank-7 td { opacity: 0.75; }

.ranking-table tr.my-team td {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.ranking-table .rank-cell {
    width: 36px;
    text-align: center;
    font-weight: 700;
}

.ranking-table .points-cell {
    text-align: right;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.ranking-table .players-cell {
    font-size: 0.8rem;
    color: var(--text-light);
}

.podium-rank {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 32px;
    text-align: center;
}

.podium-photo {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--border);
}

.podium-entry.rank-1 .podium-photo { border-color: gold; }
.podium-entry.rank-2 .podium-photo { border-color: silver; }
.podium-entry.rank-3 .podium-photo { border-color: #cd7f32; }

/* Ligne "Vote de Dieu" sous les joueurs (couleur doree, petite taille). */
.podium-master-vote-note {
    font-size: 0.75rem;
    font-weight: 700;
    color: #b45309;
    margin-top: 2px;
}

/* Fond dore sur la carte entiere de l'equipe elue par le maitre. */
.podium-entry.master-voted-entry {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
    border-color: #f59e0b !important;
    border-width: 2px;
}

.podium-details {
    flex: 1;
}

.podium-team {
    font-weight: 600;
}

.podium-players {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 2px;
}

.reveal-anim {
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.final-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 8px;
    margin: 24px 0 16px;
}
.final-podium .podium-step {
    flex: 1;
    max-width: 120px;
    border-radius: 8px 8px 0 0;
    padding: 12px 6px;
    text-align: center;
    border: 2px solid;
    border-bottom: none;
    transition: background 0.4s ease;
}
.final-podium .medal { font-size: 2rem; line-height: 1; }
.final-podium .rank { font-size: 1.3rem; font-weight: 800; margin: 2px 0; }
.final-podium .team { font-weight: 700; font-size: 0.95rem; margin: 4px 0; word-break: break-word; }
.final-podium .team.placeholder { opacity: 0.3; font-size: 1.5rem; }
.final-podium .pts { font-size: 0.85rem; min-height: 1em; }
.final-podium .p1 { background: #f5c43b; border-color: #b8860b; height: 180px; }
.final-podium .p2 { background: #ffd873; border-color: #d4a017; height: 150px; }
.final-podium .p3 { background: #ffe9a3; border-color: #e6b800; height: 120px; }
.final-podium .podium-step.revealed { animation: podiumReveal 0.6s ease-out; }
@keyframes podiumReveal {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.final-podium .p1.revealed {
    box-shadow: 0 0 0 3px #f5c43b, 0 10px 24px rgba(245, 196, 59, 0.55);
    animation: podiumReveal 0.6s ease-out, goldGlow 2s ease-in-out infinite 0.6s;
}
@keyframes goldGlow {
    0%, 100% { box-shadow: 0 0 0 3px #f5c43b, 0 10px 24px rgba(245, 196, 59, 0.45); }
    50% { box-shadow: 0 0 0 5px #fbbf24, 0 14px 30px rgba(245, 196, 59, 0.75); }
}

/* Celebration finale */
#final-celebration {
    text-align: center;
    margin: 24px 0 16px;
    position: relative;
}

.champion-mascot {
    max-width: 140px;
    width: 45%;
    filter: drop-shadow(0 8px 20px rgba(245, 196, 59, 0.45));
    animation: champion-bounce 2s ease-in-out infinite;
}

@keyframes champion-bounce {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50% { transform: translateY(-10px) rotate(4deg); }
}

.champion-tagline {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: 8px;
    text-shadow: 0 2px 6px rgba(245, 196, 59, 0.35);
}

/* Confettis CSS animés (10 spans) */
.confetti-burst {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 180px;
    pointer-events: none;
    overflow: hidden;
}

.confetti-burst span {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 14px;
    opacity: 0;
    animation: confetti-fall 3s ease-in infinite;
}

.confetti-burst span:nth-child(1)  { left: 10%; background: var(--pink);    animation-delay: 0s;   transform: rotate(15deg); }
.confetti-burst span:nth-child(2)  { left: 20%; background: var(--violet);  animation-delay: 0.3s; transform: rotate(-20deg); }
.confetti-burst span:nth-child(3)  { left: 30%; background: var(--yellow);  animation-delay: 0.6s; transform: rotate(25deg); }
.confetti-burst span:nth-child(4)  { left: 40%; background: var(--cyan);    animation-delay: 0.9s; transform: rotate(-10deg); }
.confetti-burst span:nth-child(5)  { left: 50%; background: var(--accent);  animation-delay: 0.2s; transform: rotate(30deg); }
.confetti-burst span:nth-child(6)  { left: 60%; background: var(--pink);    animation-delay: 0.5s; transform: rotate(-25deg); }
.confetti-burst span:nth-child(7)  { left: 70%; background: var(--violet);  animation-delay: 0.8s; transform: rotate(10deg); }
.confetti-burst span:nth-child(8)  { left: 80%; background: var(--yellow);  animation-delay: 0.1s; transform: rotate(-30deg); }
.confetti-burst span:nth-child(9)  { left: 90%; background: var(--cyan);    animation-delay: 0.4s; transform: rotate(20deg); }
.confetti-burst span:nth-child(10) { left: 95%; background: var(--accent);  animation-delay: 0.7s; transform: rotate(-15deg); }

@keyframes confetti-fall {
    0%   { transform: translateY(-20px) rotate(0deg);   opacity: 1; }
    100% { transform: translateY(220px) rotate(720deg); opacity: 0; }
}

#results-end-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* Screen-end : version festive fallback */
.end-celebration {
    text-align: center;
    position: relative;
    margin: 24px 0 20px;
    padding-top: 60px;
}

.end-celebration .champion-mascot {
    max-width: 140px;
    width: 45%;
}

#end-master-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.podium-points {
    color: var(--primary);
    font-weight: 600;
}

/* Fin */
.winner {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin: 24px 0;
}

/* Suivi des votes (maitre) */
.vote-counter {
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    margin: 8px 0;
    color: var(--primary);
}
.vote-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}
.vote-chip {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 0.85rem;
    background: var(--card);
    border: 1px solid var(--border);
}
.vote-chip.voted {
    background: #d1fae5;
    border-color: var(--success);
    color: #065f46;
}
.vote-chip.pending {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #78350f;
}
.vote-chip.disconnected {
    opacity: 0.5;
    background: var(--card);
    border-style: dashed;
}
.vote-done-details summary {
    cursor: pointer;
    padding: 6px 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Suivi votes — sections joueurs/spectateurs */
.vote-section {
    margin: 10px 0 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
}

.vote-section:nth-of-type(2) {
    border-left-color: var(--violet);
}

.vote-section-title {
    font-family: var(--font-title);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.vote-subsection {
    margin: 4px 0;
}

.vote-subsection summary {
    cursor: pointer;
    padding: 4px 0;
    color: var(--text-light);
    font-size: 0.88rem;
    font-weight: 600;
    list-style: none;
}

.vote-subsection summary::-webkit-details-marker {
    display: none;
}

.vote-subsection summary::before {
    content: "▸";
    display: inline-block;
    margin-right: 6px;
    transition: transform 0.15s;
}

.vote-subsection[open] summary::before {
    transform: rotate(90deg);
}

.assign-select {
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.spectator-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.spectator-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    font-size: 0.85rem;
}
.spectator-chip.disconnected {
    opacity: 0.5;
}
.spectators-section summary {
    cursor: pointer;
}

#lobby-master-controls {
    margin-top: 24px;
}

.vote-status-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 4px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.vote-status-item.voted {
    border-color: var(--success);
    background: #f0fdf4;
}

.vote-status-item.disconnected {
    opacity: 0.5;
}

.vote-status-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.vote-status-item.voted .vote-status-label {
    color: var(--success);
    font-weight: 600;
}

/* Overlay pause */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-content {
    background: var(--card);
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    max-width: 90%;
    width: 360px;
}

.overlay-content h2 {
    color: var(--accent);
    border: none;
}

/* Countdown overlay (lancement partie) */
#countdown-overlay {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1500;
}

.countdown-number {
    font-family: var(--font-title);
    font-size: 8rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    text-align: center;
    line-height: 1;
    padding: 0 16px;
    max-width: 100%;
    word-break: break-word;
}

.countdown-pulse {
    animation: countdown-anim 0.9s ease-out both;
}

@keyframes countdown-anim {
    0%   { transform: scale(0.3); opacity: 0; }
    40%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.countdown-number.countdown-final {
    font-size: 2.4rem;
}

/* Admin parties — ecran */
.admin-mascot {
    display: block;
    max-width: 110px;
    margin: 0 auto 4px;
    filter: drop-shadow(0 6px 16px rgba(139, 92, 246, 0.22));
    animation: welcome-float 3.5s ease-in-out infinite;
}

.admin-tagline {
    text-align: center;
    color: var(--text-light);
    font-size: 0.95rem;
    margin: 4px 0 18px;
}

.admin-empty {
    text-align: center;
    padding: 24px 16px;
    background: var(--card);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
    margin-bottom: 16px;
}

.admin-empty-mascot {
    max-width: 100px;
    margin-bottom: 10px;
    animation: mascot-bob 2.8s ease-in-out infinite;
}

.admin-empty p {
    font-family: var(--font-title);
    color: var(--text-light);
    font-size: 1rem;
}

/* Admin parties — cartes */
.admin-game-item {
    padding: 14px 16px;
    margin-bottom: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 5px solid var(--status-color, var(--primary));
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, box-shadow 0.2s;
}

.admin-game-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.admin-game-item.status-finished { --status-color: #f5c43b; }
.admin-game-item.status-lobby    { --status-color: var(--success); }
.admin-game-item.status-photo    { --status-color: var(--primary); }
.admin-game-item.status-vote     { --status-color: var(--violet); }
.admin-game-item.status-results  { --status-color: var(--pink); }

.game-info {
    margin-bottom: 10px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.game-code {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.3px;
}

.game-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    background: var(--status-color, var(--primary));
}

.game-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.game-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--bg);
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.game-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Barre arret jeu maitre */
.master-stop-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--border);
    z-index: 500;
    transform: translateZ(0);
}

.btn-resume-hint {
    animation: resumePulse 1.5s ease-in-out infinite;
}
@keyframes resumePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    50% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
}

/* Reserver de l'espace pour la master-stop-bar fixe (via classe sur body) */
body.has-stop-bar {
    padding-bottom: 64px;
}

/* Bloc inline equivalent a master-stop-bar, utilise sur screen-results (bug Firefox Android) */
#screen-results {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 150px);
    min-height: calc(100dvh - 150px);
}

.results-master-stop {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 14px 8px;
    margin-top: auto;
    border-top: 1px solid var(--border);
}

/* Responsive tablette */
@media (min-width: 600px) {
    body { max-width: 600px; }
    .photo-grid { grid-template-columns: repeat(3, 1fr); }
}
