/* Multiplayer Lobby & Game Styles */

/* Lobby */
#lobby-view {
    padding-top: 20px;
    display: flex;
    flex-direction: column;
}

.lobby-content {
    flex: 1;
    overflow-y: auto;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding-bottom: 20px;
}

.room-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.room-item {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s;
    cursor: pointer;
    touch-action: manipulation; /* Improve touch handling */
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.room-item:active {
    transform: scale(0.98);
}

.room-info {
    flex: 1;
}

.room-name {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.room-lock-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
    color: var(--text-sub);
    font-size: 11px;
    line-height: 1;
}

.room-detail {
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 4px;
}

.room-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    background: #f0f0f0;
    color: #666;
}

.room-status.waiting {
    background: #e6f7ff;
    color: #1890ff;
}

.room-status.playing {
    background: #f6ffed;
    color: #52c41a;
}

.room-status.full {
    background: #fff1f0;
    color: #f5222d;
}

.empty-tip {
    text-align: center;
    color: #999;
    margin-top: 50px;
}

.lobby-footer {
    padding: 20px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.lobby-version {
    text-align: center;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.35);
    user-select: none;
}

.lobby-avatar-btn {
    padding: 2px;
    background: conic-gradient(from 0deg, #ff2d55, #ffcc00, #34c759, #0a84ff, #af52de, #ff2d55);
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    transition: transform 0.12s ease;
}

.lobby-avatar-btn:hover {
    background: conic-gradient(from 0deg, #ff2d55, #ffcc00, #34c759, #0a84ff, #af52de, #ff2d55);
}

.lobby-avatar-btn:active {
    transform: scale(0.96);
}

.lobby-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lobby-avatar-inner i {
    font-size: 18px;
    color: var(--text-sub);
}

.lobby-avatar-inner img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Room Waiting / Game Room */
#room-view {
    height: 100%;
    overflow: hidden;
}

#room-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: calc(100% - 120px);
    min-width: 0;
}

#room-title .room-title-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#room-title .room-title-password {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
    color: var(--text-sub);
    font-size: 12px;
    line-height: 1;
}

#room-title .room-title-password-icon {
    font-size: 12px;
    opacity: 0.85;
}

#room-title .room-title-password-code {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.08em;
}

.room-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    gap: 20px;
    height: 100%; /* Ensure layout takes full height */
    overflow: hidden; /* Prevent layout scroll */
}

.players-area {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.player-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 80px;
}

.player-card .avatar {
    width: 50px;
    height: 50px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    margin-bottom: 8px;
    overflow: hidden;
}

.player-card .avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.player-card.empty .avatar {
    color: #ccc;
    border: 2px dashed #ddd;
    background: transparent;
}

.player-card .name {
    font-size: 14px;
    color: var(--text-main);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.player-card .name .name-text {
    display: inline-block;
    white-space: nowrap;
    transform: translateX(0);
}

.player-card .name.name-scroll {
    text-overflow: clip;
}

.player-card .name.name-scroll .name-text {
    animation: playerNameScroll var(--name-scroll-duration, 4s) ease-in-out infinite;
}

.chat-input-area .icon-btn,
.chat-input-area .small-btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.chat-input-area input {
    min-width: 0;
}

.game-start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    transition: opacity 0.5s;
    padding: 16px;
}

.game-start-content {
    width: min(92vw, 560px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-start-loading {
    font-size: clamp(18px, 5vw, 28px);
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
}

.game-start-dice {
    display: inline-block;
    margin-right: 10px;
    transform-origin: 50% 50%;
    animation: gameStartDiceSpin 0.8s linear infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.35));
}

@keyframes gameStartDiceSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.game-start-players {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(12px, 6vw, 40px);
    margin-bottom: clamp(16px, 6vw, 30px);
}

.game-start-player {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 0;
}

.game-start-avatar {
    width: clamp(46px, 16vw, 80px);
    height: clamp(46px, 16vw, 80px);
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}

.game-start-name {
    font-size: clamp(18px, 5vw, 30px);
    font-weight: 700;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-start-color {
    font-size: clamp(14px, 4vw, 24px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.1);
    padding: 6px 14px;
    border-radius: 20px;
    max-width: 100%;
    white-space: nowrap;
}

.game-start-piece {
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.5));
}

.game-start-vs {
    position: relative;
    font-size: clamp(30px, 12vw, 60px);
    font-weight: 800;
    color: #ff6b6b;
    font-style: italic;
    flex: 0 0 auto;
    padding: 4px 12px;
    border-radius: 999px;
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.25),
        0 0 18px rgba(255, 215, 0, 0.18);
}

.game-start-vs::before {
    content: "";
    position: absolute;
    inset: -18px -22px;
    border-radius: 999px;
    background:
        radial-gradient(closest-side, rgba(255, 215, 0, 0.42), rgba(255, 215, 0, 0) 70%);
    filter: blur(2px);
    opacity: 0.75;
    animation: gameStartVsGlow 1.4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes gameStartVsGlow {
    0% { transform: scale(0.96); opacity: 0.55; }
    50% { transform: scale(1.08); opacity: 0.95; }
    100% { transform: scale(0.96); opacity: 0.55; }
}

.game-start-countdown {
    font-size: clamp(28px, 12vw, 48px);
    color: #52c41a;
    font-weight: 800;
    line-height: 1;
    padding: 0 12px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes playerNameScroll {
    0% { transform: translateX(0); }
    42% { transform: translateX(calc(-1 * var(--name-scroll-distance))); }
    58% { transform: translateX(calc(-1 * var(--name-scroll-distance))); }
    100% { transform: translateX(0); }
}
.status-badge {
    font-size: 10px;
    background: #52c41a;
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    margin-top: 4px;
}

.status-badge.not-ready {
    background: #ffaa00; /* Orange */
}

.status-badge.hidden {
    display: none;
}

.vs-divider {
    font-size: 20px;
    font-weight: bold;
    color: #ddd;
    font-style: italic;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
    min-height: 200px;
    height: 0; /* Important for flex scrolling */
    position: relative;
}

.chat-messages {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%; /* Fill container */
}

/* Custom Scrollbar for Chat */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ccc; 
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #999; 
}

.chat-msg {
    max-width: 100%;
    font-size: 13px;
    line-height: 1.4;
    position: relative;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.chat-msg.self {
    align-self: flex-end;
    color: #000;
}

.chat-msg.other {
    align-self: flex-start;
    color: #333;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 32px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 16px;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.chat-body {
    max-width: calc(100% - 40px);
    padding: 6px 10px;
    border-radius: 12px;
}

.chat-msg.self .chat-body {
    background: #e6f7ff;
    border-bottom-right-radius: 2px;
}

.chat-msg.other .chat-body {
    background: #fff;
    border-bottom-left-radius: 2px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.chat-sender {
    font-size: 10px;
    color: #999;
    margin-bottom: 2px;
    display: block;
}

.chat-text {
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-msg.emoji {
    font-size: 32px;
}

.chat-msg.emoji .chat-body {
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.chat-input-area {
    padding: 8px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input-area input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 14px;
    outline: none;
}

.emoji-picker {
    position: absolute;
    bottom: 60px;
    left: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    font-size: 24px;
    z-index: 100;
}

.emoji-picker span {
    cursor: pointer;
    transition: transform 0.1s;
}

.emoji-picker span:hover {
    transform: scale(1.2);
}

.room-actions {
    padding-top: 10px;
}

/* Modal Password Input */
.modal-input {
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.profile-avatar-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    height: 50vh;
    max-height: 50vh;
    overflow-y: auto;
    align-content: start;
}

.profile-avatar-btn {
    width: min(96px, 10vh);
    height: min(96px, 10vh);
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid rgba(0, 0, 0, 0.06);
    padding: 0;
    background: #f0f0f0;
    cursor: pointer;
    position: relative;
    display: inline-block;
}

.profile-avatar-btn img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.profile-avatar-edit {
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    padding: 6px 10px;
    border-radius: 999px;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
}

@media (max-width: 600px) {
    .profile-avatar-btn {
        width: min(96px, 25vw);
        height: min(96px, 25vw);
    }
}

.profile-avatar-item {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    background: #f0f0f0;
    cursor: pointer;
    position: relative;
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.profile-avatar-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.profile-avatar-item.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(74, 163, 255, 0.35), 0 10px 22px rgba(0, 0, 0, 0.18);
    transform: translateY(-1px);
}

.profile-avatar-check {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: var(--accent-color);
    color: #fff;
    z-index: 4;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.22);
    pointer-events: none;
}

.profile-avatar-item.active .profile-avatar-check {
    display: inline-flex;
}

.profile-avatar-item:focus-visible {
    outline: 3px solid rgba(74, 163, 255, 0.55);
    outline-offset: 2px;
}

.quick-chat-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-height: min(34vh, 160px);
    overflow-y: auto;
    align-content: start;
}

.quick-chat-item {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.quick-chat-text-item {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.quick-chat-text-list {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-height: min(24vh, 120px);
    overflow-y: auto;
}

#game-view .timer-badge {
    position: relative;
    overflow: visible;
}

#game-view .duration-badge {
    position: relative;
    overflow: visible;
}

.quick-bubble {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    opacity: 0.9;
    max-width: min(260px, 70vw);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.25s ease, transform 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.quick-bubble.desktop {
    background: rgba(255, 255, 255, 0.96);
    color: #222;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 26px rgba(0,0,0,0.14);
    max-width: 240px;
    white-space: normal;
}

.quick-bubble.desktop .bubble-sender {
    color: rgba(0, 0, 0, 0.55);
    opacity: 1;
}

.bubble-sender {
    font-size: 10px;
    opacity: 0.8;
    font-weight: 400;
    line-height: 1;
}

.bubble-content {
    font-size: 14px;
    font-weight: 700;
}

.quick-bubble.hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px);
}

/* Password Code Input Style */
.password-input-wrapper {
    position: relative;
    width: min(260px, 80vw);
    height: 56px;
    margin: 10px auto;
}

.real-password-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 100;
    cursor: text;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    /* font-size: 0; Removed to fix input issues on some devices */
}

.password-display {
    display: flex;
    justify-content: space-between;
    height: 100%;
    pointer-events: none; /* Let clicks pass to input */
    z-index: 1;
}

.password-display span {
    width: clamp(42px, 14vw, 54px);
    height: clamp(42px, 14vw, 54px);
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(22px, 7vw, 30px);
    font-weight: 800;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
    background: #fff;
    transition: all 0.2s;
}

.password-display span.filled {
    border-color: #1890ff;
    background: #e6f7ff;
}

.password-display span.active {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.password-input-wrapper.password-error {
    animation: passwordShake 0.5s ease-in-out;
}

.password-input-wrapper.password-error .password-display span {
    animation: passwordFlash 0.4s ease-in-out;
}

@keyframes passwordShake {
    0% { transform: translateX(0); }
    12.5% { transform: translateX(-8px); }
    25% { transform: translateX(8px); }
    37.5% { transform: translateX(-8px); }
    50% { transform: translateX(8px); }
    62.5% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
    87.5% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

@keyframes passwordFlash {
    0% { border-color: #ff4d4f; background: #fff1f0; }
    20% { border-color: #ff4d4f; background: #fff1f0; }
    30% { border-color: #ddd; background: #fff; }
    50% { border-color: #ff4d4f; background: #fff1f0; }
    70% { border-color: #ff4d4f; background: #fff1f0; }
    100% { border-color: #ddd; background: #fff; }
}

:root.theme-dark .room-item {
    background: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.45);
}

:root.theme-dark .room-lock-icon,
:root.theme-dark #room-title .room-title-password {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

:root.theme-dark .players-area {
    background: var(--card-bg);
    box-shadow: 0 10px 26px rgba(0,0,0,0.45);
}

:root.theme-dark .vs-divider {
    color: rgba(255, 255, 255, 0.22);
}

:root.theme-dark .chat-area {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

:root.theme-dark .chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
}

:root.theme-dark .chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
}

:root.theme-dark .chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

:root.theme-dark .chat-msg.self {
    color: rgba(230, 237, 243, 0.92);
}

:root.theme-dark .chat-msg.other {
    color: rgba(230, 237, 243, 0.92);
}

:root.theme-dark .chat-avatar {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(230, 237, 243, 0.65);
}

:root.theme-dark .chat-msg.self .chat-body {
    background: rgba(74, 163, 255, 0.18);
}

:root.theme-dark .chat-msg.other .chat-body {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: none;
}

:root.theme-dark .chat-sender {
    color: rgba(230, 237, 243, 0.55);
}

:root.theme-dark .chat-input-area {
    background: rgba(255, 255, 255, 0.04);
    border-top-color: rgba(255, 255, 255, 0.12);
}

:root.theme-dark .chat-input-area input {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--text-main);
}

:root.theme-dark .emoji-picker {
    background: var(--card-bg);
    box-shadow: 0 10px 26px rgba(0,0,0,0.55);
}

:root.theme-dark .modal-input {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.14);
    color: var(--text-main);
}

:root.theme-dark .profile-avatar-btn,
:root.theme-dark .profile-avatar-item {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

:root.theme-dark .quick-chat-item,
:root.theme-dark .quick-chat-text-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

:root.theme-dark .quick-bubble.desktop {
    background: rgba(11, 27, 45, 0.96);
    color: rgba(230, 237, 243, 0.92);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 26px rgba(0,0,0,0.55);
}

:root.theme-dark .quick-bubble.desktop .bubble-sender {
    color: rgba(230, 237, 243, 0.55);
}

:root.theme-dark .password-display span {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
}

:root.theme-dark .password-display span.filled {
    background: rgba(74, 163, 255, 0.16);
}

:root.theme-dark .lobby-avatar-inner,
:root.theme-dark .player-card .avatar,
:root.theme-dark .chat-avatar,
:root.theme-dark .profile-avatar-btn,
:root.theme-dark .profile-avatar-item {
    position: relative;
}

:root.theme-dark .lobby-avatar-inner img,
:root.theme-dark .player-card .avatar img,
:root.theme-dark .chat-avatar img,
:root.theme-dark .profile-avatar-btn img,
:root.theme-dark .profile-avatar-item img {
    position: relative;
    z-index: 1;
    filter: brightness(0.82) contrast(1.05);
}

:root.theme-dark .game-start-avatar {
    filter: brightness(0.82) contrast(1.05);
}

:root.theme-dark .lobby-avatar-inner::after,
:root.theme-dark .player-card .avatar::after,
:root.theme-dark .chat-avatar::after,
:root.theme-dark .profile-avatar-btn::after,
:root.theme-dark .profile-avatar-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    z-index: 2;
    pointer-events: none;
}

:root.theme-dark .profile-avatar-edit {
    z-index: 3;
}
