:root {
    --bg-darker: #202225;
    --bg-dark: #2f3136;
    --bg-light: #36393f;
    --text-normal: #dcddde;
    --text-muted: #72767d;
    --accent: #5865f2;
    --danger: #ed4245;
    --success: #3ba55d;
}

body {
    margin: 0;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-normal);
    height: 100vh;
    overflow: hidden;
}

#app {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view {
    width: 100%;
    height: 100%;
    display: flex;
}

.hidden { display: none !important; }

/* Join View */
#join-view {
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #23272a 0%, #2c2f33 100%);
}

.card {
    background: var(--bg-dark);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    text-align: center;
    width: 320px;
}

h1 { color: #fff; margin-bottom: 8px; }
.hint { color: var(--text-muted); font-size: 0.8em; margin-top: 20px; word-break: break-all; }

.input-group { margin-top: 30px; display: flex; flex-direction: column; gap: 15px; }

input {
    background: var(--bg-darker);
    border: none;
    padding: 12px;
    color: #fff;
    border-radius: 4px;
    outline: none;
}

button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}

button:hover { filter: brightness(1.2); }
.btn-danger { background: var(--danger); }

/* Room View */
#room-view {
    flex-direction: row;
}

.sidebar {
    width: 240px;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
}

.room-header {
    padding: 15px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
}

.user-list {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 2px;
    color: var(--text-muted);
}

.user-item.active { color: #fff; background: rgba(255,255,255,0.05); }

.controls {
    background: #292b2f;
    padding: 10px;
    display: flex;
    justify-content: space-around;
}

.control-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2f3136;
    color: #fff;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.control-btn:hover {
    background: #40444b;
}

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

.control-btn.btn-danger:hover {
    filter: brightness(1.1);
    background: var(--danger);
}

.control-btn svg {
    pointer-events: none; /* Prevent clicks on the icon itself */
}

.main-stage {
    flex: 1;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.avatar-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    align-content: center;
}

.avatar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 100px;
    height: 100px;
    background: var(--bg-darker);
    border-radius: 50%;
    border: 3px solid transparent; /* Prepare border space */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    transition: border-color 0.1s ease, box-shadow 0.1s ease, transform 0.1s ease;
    will-change: box-shadow, transform;
}

.avatar.speaking {
    border-color: var(--success);
    box-shadow: 0 0 0 4px rgba(59, 165, 93, 0.4);
    transform: scale(1.05);
}

.avatar.muted { opacity: 0.5; }

.avatar-name { font-weight: bold; }

.footer {
    padding: 20px;
    text-align: center;
}

#btn-copy { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
#btn-copy:hover { background: var(--accent); color: #fff; }
