/* =================== COMPONENTS =================== */

/* Variables CSS */
:root {
    --pill-h: 60px;
    --pill-gap: 5px;
}

/* Icons (SVG) */
svg{
    max-width: 30px;
    max-height: 30px;
}

.colored-by-theme{
    color: var(--accent) !important;
}

/* Glass effect */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Cards */
.mode-card {
    transition: all 0.3s ease;
    border-radius: 15px;
    border: none;
}

.mode-card:hover:not(.disabled) {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.game-card {
    background: var(--bg-card);
    border-radius: 50px;
    padding: 40px 30px;
    padding-top: 10px;
    width: 100%;
    text-align: center;
    border: none;
    transition: transform .25s ease, opacity .25s ease;
    will-change: transform, opacity;
    position: relative;
    overflow: hidden;
}

.game-card:hover {
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* Buttons */
.btn-custom {
    border-radius: 15px;
    font-weight: bold;
    transition: all 0.3s ease;
    padding: 14px 18px;
}

.btn-custom:hover {
    transform: translateY(-2px);
}

.btn-primary {
    padding: 14px 20px;
    background: #1a1a1a;
    border: none;
    border-bottom: 4px solid var(--accent);
    color: white;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.btn-primary:hover {
    background: #1a1a1a;
    border-bottom: 4px solid var(--accent);
}

.btn-primary:active,
.btn-primary:focus {
    background: #1a1a1a;
    border-bottom: 4px solid var(--accent);
}

.btn-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--accent);
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    /*box-shadow: 0 0 6px var(--accent-weak);*/
}

.btn-cards{
    min-width: 115px;
}

:not(.btn-check)+.btn:active
{
    color: #ffffff;
    background-color: var(--accent);
    border-color: #000000;
}

.btn:first-child:active{
    color: #ffffff;
    background-color: var(--accent);
    border-color: #000000;
}

:not(.btn-check)+.btn:focus
{
    color: #ffffff;
    background-color: #1a1a1a;
    border: none;
    border-bottom: 4px solid var(--accent);
    border-color: var(--accent);
}

.btn:disabled{
    background: #37373782;
    border: none;
    border-bottom: 4px solid var(--accent);
}

/* Form controls */
.form-control:focus {
    background-color: #1a1a22;
    color: #ffffff;
    border-color: #66ea49;
    box-shadow: none;
}

/* Player names and theme names */
.player-name {
    color: var(--accent);
    font-size: 22px;
    font-weight: 900;
    font-size: clamp(1.1rem, 2.2vw, 2rem);
}

.theme-name {
    color: var(--accent);
    font-size: 22px;
    font-weight: 500;
    position: relative;
    display: inline-block;
    padding-bottom: 6px;
    line-height: 1.1;
}

.theme-name::after {
    content: "";
    position: absolute;
    left: -50%;
    right: -50%;
    bottom: -15px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--accent) 20%,
        var(--accent-weak) 50%,
        var(--accent) 80%,
        transparent 100%
    );
    pointer-events: none;
}

/* Card text */
.card-text {
    font-size: clamp(1.1rem, 2.2vw, 2rem);
}

.card-action-info {
    display: inline-block;
    margin-top: 8px;
    font-weight: 500;
    color: #aaabab;
    opacity: .95;
    font-style: italic;
}

/* Game wrapper */
.game-wrapper {
    margin-inline: auto;
}

.game-mode-info {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
}

.game-mode-name {
    font-size: 22px;
    font-weight: 200;
    color: #ffffff;
    font-style: italic;
}

/* Confetti */
#confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

/* Utility classes */
.no-select {
    -webkit-user-select: none;
    user-select: none;
}

.title-glow {
    text-shadow: 0 0 20px rgba(255,255,255,0.5);
}

/* Animations */
.virus-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.fade-slide-enter {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeSlideIn .25s ease forwards;
}

@keyframes fadeSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Drag and drop */
.card-draggable {
    will-change: transform, opacity;
    transition: transform .25s ease, opacity .25s ease;
    touch-action: none;
    cursor: grab;
}

.card-draggable.dragging {
    transition: none;
    cursor: grabbing;
}

/* Swipe badges */
.swipe-badge {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 800;
    font-size: 56px;
    line-height: 1;
    pointer-events: none;
    opacity: 0;
    text-shadow: 0 6px 20px rgba(0,0,0,0.35);
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.25));
}

.swipe-badge.left {
    left: 16px;
}

.swipe-badge.right {
    right: 16px;
}

/* Debug panel */
.debug-panel {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 10px;
    border-radius: 10px;
    font-family: monospace;
    font-size: 12px;
    z-index: 1000;
    max-width: 300px;
}

/* Overlay for virus card */
.virus-overlay {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(12px) saturate(110%);
    -webkit-backdrop-filter: blur(12px) saturate(110%); /* iOS/Safari */
}

.virus-overlay-card {
    width: min(800px, 92vw);
    height: clamp(320px, 60vh, 680px);
    border-radius: 20px;
}

.mode-stats{
    font-size: 10px;
}


/* Progress Bar */
.progress{
    background-color: var(--bg-center);
    --bs-progress-bar-bg : var(--accent);
}

.btn-timer-start, .btn-timer-start:hover, .btn-timer-start:active, .btn-timer-start:focus {
    background-color: var(--accent);
}

.btn-timer-start { touch-action: manipulation; }

/* le tap doit être franc, sans “gestes” */
[data-ref="timerWrap"],
[data-ref="timerStartWrap"],
.btn-timer-start { touch-action: manipulation; pointer-events: auto; }
/* Premium */
[data-bind="priceText"]{
    color: #d6b855;
}

[data-action="buyPremium"]{
    color: #43360c;
    background: linear-gradient(251deg, #FFE27A, #F2C94C);
    color: #1b1b1b;
    font-weight: 800;
    border: none;
    border-radius: 14px;
    padding: 14px 28px;
    min-width: 240px;
    box-shadow: 10px 15px 50px rgba(242, 201, 76, .35), inset 4px -5px 8px rgba(151, 115, 0, .35);
}


.link-legal{ color:#c9c9c9; font-size: 14px; text-decoration: none; }
.link-legal:hover{ text-decoration: underline; }



/* Overlay plein écran, centré, au-dessus de tout */
.virus-overlay {
    position: fixed;
    inset: 0;                 /* top/right/bottom/left: 0 */
    z-index: 9999;
    display: flex;            /* par défaut flex (le JS mettra display:none pour le cacher) */
    align-items: center;
    justify-content: center;
    padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 12px);
    pointer-events: auto;
}

/* Carte contenue : largeur max et hauteur contenue dans le viewport */
.virus-overlay .virus-overlay-card {
    width: min(720px, calc(100vw - 32px));
    max-height: min(86vh, 720px);
    overflow: auto; /* si le contenu est long */
    -webkit-overflow-scrolling: touch;
}

/* l'overlay doit être vraiment fixé au viewport */
[data-team-overlay-root] {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

/* pendant un overlay, neutraliser tout transform global qui ferait bouger le viewport apparent */
html.overlay-open .app-root,
html.overlay-open [data-game-root] {
    transform: none !important;
}