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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

@font-face {
	font-family: GILROY;
	src: url(https://cdn.fsksoft.com/fonts/gilroy/GILROY-300.TTF) format("truetype");
	font-weight: 300;
	font-style: normal;
	font-display: swap
}

@font-face {
	font-family: GILROY;
	src: url(https://cdn.fsksoft.com/fonts/gilroy/GILROY-400.TTF) format("truetype");
	font-weight: 400;
	font-style: normal;
	font-display: swap
}

@font-face {
	font-family: GILROY;
	src: url(https://cdn.fsksoft.com/fonts/gilroy/GILROY-500.TTF) format("truetype");
	font-weight: 500;
	font-style: normal;
	font-display: swap
}

@font-face {
	font-family: GILROY;
	src: url(https://cdn.fsksoft.com/fonts/gilroy/GILROY-600.TTF) format("truetype");
	font-weight: 600;
	font-style: normal;
	font-display: swap
}

@font-face {
	font-family: GILROY;
	src: url(https://cdn.fsksoft.com/fonts/gilroy/GILROY-700.TTF) format("truetype");
	font-weight: 700;
	font-style: normal;
	font-display: swap
}

@font-face {
	font-family: GILROY;
	src: url(https://cdn.fsksoft.com/fonts/gilroy/GILROY-800.TTF) format("truetype");
	font-weight: 800;
	font-style: normal;
	font-display: swap
}


body {
    font-family: GILROY, sans-serif;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tts-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 9999;
    align-items: flex-start;
}

.tts-modal.hidden {
    display: none;
}

.tts-modal.show {
    opacity: 1;
    display: flex;
}

.tts-modal.hide {
    opacity: 0;
    transform: scale(0.9);
}

.tts-container {
    background: #0d0d0d;
    border-radius: 20px;
    padding: 15px;
    backdrop-filter: blur(20px);
    max-width: 600px;
    margin-right: 10px;
    width: 100%;
}

.tts-header {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 16px);
    margin-bottom: clamp(10px, 2vw, 20px);
}

.tts-avatar {
    width: clamp(36px, 8vw, 60px);
    height: clamp(36px, 8vw, 60px);
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #53FC18;
    box-shadow: 0 0 20px #53fc1857;
    flex-shrink: 0;
}

.tts-user-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: clamp(6px, 1.5vw, 12px);
    flex-wrap: wrap;
    min-width: 0;
}

.tts-username {
    font-size: clamp(14px, 3vw, 20px);
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    word-break: break-word;
}

.tts-effect {
    font-size: clamp(9px, 1.5vw, 12px);
    font-weight: 600;
    padding: clamp(3px, 0.5vw, 5px) clamp(6px, 1vw, 12px);
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.tts-effect.effect-demon {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: #fff;
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.5);
}

.tts-effect.effect-echo {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}

.tts-effect.effect-chip {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
}

.tts-close {
    width: clamp(28px, 5vw, 40px);
    height: clamp(28px, 5vw, 40px);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #888;
    font-size: clamp(16px, 3vw, 24px);
    cursor: pointer;
    transition: all 0.2s;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tts-close:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.tts-content {
    margin-bottom: clamp(10px, 2vw, 20px);
    /* font-size: 16px !important; */
}

.tts-message {
    font-size: 16px;
    line-height: 1.5;
    color: #e0e0e0;
    word-wrap: break-word;
    max-height: clamp(80px, 20vh, 150px);
    overflow-y: auto;
    font-weight: 600;
}

.tts-waveform {
    height: clamp(30px, 8vw, 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.waveform-bars {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(2px, 1vw, 4px);
    height: 100%;
    width: 100%;
}

.waveform-bar {
    width: clamp(3px, 0.8vw, 5px);
    min-height: clamp(6px, 1.5vw, 10px);
    background: linear-gradient(180deg, #53FC18, #95ff70);
    border-radius: 10px;
    transition: height 0.1s ease;
    flex-shrink: 0;
}

.waveform-bar.playing {
    animation: waveformPulse 0.5s ease-in-out infinite alternate;
}

@keyframes waveformPulse {
    0% {
        transform: scaleY(0.3);
        opacity: 0.5;
    }

    100% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.tts-message::-webkit-scrollbar {
    width: 4px;
}

.tts-message::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.tts-message::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 2px;
}

.hidden {
    display: none !important;
}

@media (max-width: 480px) {
    .tts-container {
        padding: 12px;
    }

    .waveform-bars {
        gap: 2px;
    }

    .waveform-bar {
        width: 3px;
    }
}

@media (min-width: 1200px) {
    .tts-container {
        max-width: 650px;
    }
}

@media (min-width: 1600px) {
    .tts-container {
        max-width: 700px;
        padding: 28px;
    }

    .tts-username {
        font-size: 22px;
    }

    .tts-message {
        font-size: 20px;
    }
}

@media (min-width: 2000px) {
    .tts-container {
        max-width: 800px;
        padding: 32px;
    }

    .tts-avatar {
        width: 70px;
        height: 70px;
    }

    .tts-username {
        font-size: 24px;
    }

    .tts-message {
        font-size: 22px;
        max-height: 200px;
    }

    .tts-waveform {
        height: 70px;
    }
}