:root {
    --vc-bg: #1e1f22;
    --vc-card-bg: #2b2d31;
    --vc-accent: #5865f2;
    --vc-success: #23a55a;
    --vc-danger: #da373c;
    --vc-text: #dbdee1;
}

.vc-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: var(--vc-bg);
    position: relative;
    overflow: hidden;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease-in;
    border-radius: 12px;
}

.vc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    grid-auto-rows: auto;
    gap: 16px;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 90px;
}

.vc-card {
    background: var(--vc-card-bg);
    border-radius: 12px;
    position: relative;
    aspect-ratio: 16/9;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 3px solid transparent;
    transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out, background 0.15s ease-out;
    cursor: pointer;
}

.vc-card:hover {
    background: #33353b;
}

.vc-card.speaking {
    border-color: var(--vc-success);
    box-shadow: 0 0 20px rgba(35, 165, 90, 0.3);
}

.vc-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
    pointer-events: none;
}

.vc-card .avatar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.vc-card img.vc-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    background: #1e1f22;
    border: 4px solid #1e1f22;
}

.vc-card .username {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.75);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    pointer-events: none;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.vc-volwrap {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.12s ease, transform 0.12s ease;
    z-index: 3;
    backdrop-filter: blur(6px);
}

.vc-card:hover .vc-volwrap {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.vc-vol {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    outline: none;
}

.vc-vol::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: 0;
    cursor: pointer;
}

.vc-vol::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: 0;
    cursor: pointer;
}

.vc-vol::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.vc-volpct {
    min-width: 46px;
    text-align: right;
    font-weight: 800;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.2px;
}

#vc-fullscreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 500;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#vc-fullscreen video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#vc-fullscreen .fs-controls {
    position: absolute;
    bottom: 40px;
    display: flex;
    gap: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 12px 24px;
    border-radius: 40px;
    backdrop-filter: blur(10px);
}

.vc-controls {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    background: #111214;
    padding: 8px;
    border-radius: 50px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    border: 1px solid #333;
}

.vc-btn {
    width: 45px;
    height: 45px;
    padding: 8px;
    border-radius: 50%;
    border: none;
    background: #383a40;
    color: white;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: grayscale(100%);
}

.vc-btn:hover {
    background: #4e5058;
    transform: scale(1.05);
    filter: grayscale(0%);
}

.vc-btn:active {
    transform: scale(0.95);
}

.vc-btn.active {
    background: white;
    color: black;
}

.vc-btn.muted {
    background: var(--vc-danger);
    color: white;
}

.vc-btn.deafened {
    background: var(--vc-danger);
    color: white;
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.vc-btn.deafened::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
}

.vc-btn.danger {
    background: var(--vc-danger);
}

.vc-btn.danger.disconnect {
    background-color: white;
}

.vc-btn.danger.disconnect:hover {
    background-color: white;
    filter: grayscale(0%);
}

.vc-btn.danger:hover {
    background: #a1282c;
    color: black;
}

#vc-pip-overlay {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 300px;
    background: #000;
    border-radius: 14px;
    border: 1px solid #333;
    z-index: 99999;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.2s, border-color 0.2s;
    box-sizing: border-box;
}

#vc-pip-overlay:hover {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    border-color: #555;
}

#vc-pip-header {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0));
    position: absolute;
    top: 0;
    width: 100%;
    padding: 10px 14px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.7);
    cursor: grab;
    z-index: 10;
    pointer-events: auto;
}

#vc-pip-header:active {
    cursor: grabbing;
}

#vc-pip-content {
    height: 170px;
    background: #111;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#vc-pip-content video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vc-pip-actions {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 12px;
    background: #1e1f22;
    border-top: 1px solid #2b2d31;
}

.vc-pip-btn {
    background: #383a40;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.vc-pip-btn:hover {
    background: #404249;
}

.vc-pip-btn.muted {
    background: var(--vc-danger);
}

.vc-pip-btn.danger {
    background: white;
    color: black;
}

.vc-pip-btn.danger:hover {
    color: #a1282c;
    font-weight: bold;
}

#vc-pip-overlay, #vc-pip-overlay * {
    user-select: none;
}
