body {
    background: radial-gradient(circle at center, #111 0%, #000 100%);
}

.page-dialog {
    width: 610px;
    background: transparent;
    box-shadow: none;
    margin-top: -50px;
}

.dialog-header {
    padding: 0 4px;
    margin-bottom: 8px;
    border: none;
}

.dialog-header-title {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 0.5px;
}

.dialog-header-time {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.dialog-header-avatar {
    width: 52px;
    height: 52px;
    bottom: 0;
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    background: #000;
    padding: 0;
    z-index: 10;
}

.dialog-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Compose layout */
.compose-body {
    display: flex;
    border-top: 1px solid #aaa;
    min-height: 320px;
}

.compose-left {
    width: 50%;
    background: linear-gradient(180deg, #e8e8e8 0%, #ddd 100%);
    display: flex;
    flex-direction: column;
    border-right: 1px solid #bbb;
}

.compose-menu-item {
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #bbb;
    cursor: pointer;
    background: linear-gradient(180deg, #e8e8e8 0%, #ddd 100%);
    display: flex;
    align-items: center;
    gap: 12px;
}

.compose-menu-item:hover {
    background: linear-gradient(90deg, #7fba00 0%, #6aa000 100%);
    color: #fff;
}

.compose-menu-item.selected {
    background: linear-gradient(90deg, #7fba00 0%, #6aa000 100%);
    color: #fff;
}

.compose-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.compose-spacer {
    flex: 1;
}

.compose-right {
    width: 50%;
    background: linear-gradient(160deg, #8a8a9a 0%, #7a7a8a 30%, #6e6e7e 100%);
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.compose-brief {
    font-size: 15px;
    color: #ccc;
    line-height: 1.5;
    padding-top: 10px;
}

/* Text input popup */
.text-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 90;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
}

.text-overlay.show {
    display: flex;
}

.text-dialog {
    width: 700px;
    max-width: 90vw;
    background: transparent;
    animation: settingsIn 0.25s ease-out forwards;
}

.text-dialog.closing {
    animation: settingsOut 0.2s ease-in forwards;
}

.text-dialog-header {
    padding: 0 4px 4px;
    display: flex;
    align-items: flex-end;
    height: 44px;
    position: relative;
}

.text-dialog-header .dialog-header-title {
    font-size: 24px;
}

.text-body {
    background: linear-gradient(180deg, #e0e0e0 0%, #d4d4d4 100%);
    border-top: 1px solid #aaa;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.text-body-label {
    font-size: 16px;
    color: #555;
    margin-bottom: 80px;
}

.text-input-box {
    width: 100%;
    padding: 12px 14px;
    font-size: 18px;
    font-family: 'Segoe UI', sans-serif;
    border: 1px solid #999;
    background: #fff;
    color: #333;
    outline: none;
}

.text-input-box:focus {
    border-color: #7fba00;
}

/* Xbox keyboard */
.xbox-keyboard {
    display: flex;
    gap: 4px;
}

.kb-side {
    width: 80px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kb-side-btn {
    flex: 1;
    background: linear-gradient(180deg, #f0f0f0 0%, #ddd 100%);
    border: 1px solid #aaa;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    gap: 2px;
}

.kb-side-btn:hover {
    background: #eee;
}

.kb-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kb-row {
    display: flex;
    gap: 2px;
}

.kb-key {
    flex: 1;
    height: 38px;
    background: linear-gradient(180deg, #f4f4f4 0%, #e4e4e4 100%);
    border: 1px solid #bbb;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kb-key:hover {
    background: #eee;
    border-color: #999;
}

.kb-key.active {
    background: linear-gradient(180deg, #91c828 0%, #6fa010 100%);
    color: #fff;
    border-color: #5a8a00;
}

.kb-bottom-row {
    display: flex;
    gap: 2px;
}

.kb-action {
    flex: 1;
    height: 38px;
    background: linear-gradient(180deg, #f0f0f0 0%, #ddd 100%);
    border: 1px solid #aaa;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.kb-action:hover {
    background: #eee;
}

.kb-action .btn-circle {
    width: 18px;
    height: 18px;
    font-size: 9px;
    border-width: 2px;
}

/* Recorder popup */
.recorder-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 90;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
}

.recorder-overlay.show {
    display: flex;
}

.recorder-dialog {
    width: 610px;
    max-width: 90vw;
    background: transparent;
    box-shadow: none;
    animation: settingsIn 0.25s ease-out forwards;
}

.recorder-dialog.closing {
    animation: settingsOut 0.2s ease-in forwards;
}

.recorder-body {
    background: #fff;
    padding: 24px 30px 15px;
    border-top: 1px solid #aaa;
    position: relative;
    min-height: 220px;
    display: flex;
    flex-direction: column;
}

.recorder-body .vm-text {
    color: #333;
    font-size: 18px;
    margin-bottom: 60px;
}

.vm-text {
    font-size: 15px;
    color: #ddd;
    margin-bottom: 30px;
    line-height: 1.5;
    font-weight: 400;
}

.vm-player-box {
    background: #fff;
    border: none;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vm-progress {
    height: 26px;
    background: linear-gradient(180deg, #f4f4f4 0%, #b0b0b0 100%);
    overflow: hidden;
    position: relative;
    border: 1px solid #999;
}

.vm-progress-fill {
    height: 100%;
    background: linear-gradient(180deg, #374048 0%, #1e252e 100%);
    width: 0%;
    transition: width 0.1s linear;
    border-right: 1px solid #111;
}

.vm-controls {
    display: flex;
    border: 1px solid #999;
    background: #fff;
}

.vm-btn {
    flex: 0 0 auto;
    width: 65px;
    height: 48px;
    border: none;
    background: linear-gradient(180deg, #fff 0%, #ebebeb 100%);
    border-right: 1px solid #b3b3b3;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #888;
    line-height: 1;
    text-align: center;
    padding: 0;
}

.vm-btn:hover:not(.active) {
    background: linear-gradient(180deg, #fff 0%, #f4f4f4 100%);
    color: #555;
}

.vm-btn.active {
    background: linear-gradient(180deg, #91c828 0%, #6fa010 100%);
    color: #fff;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#recBtn {
    color: #777;
}

#stopBtn {
    color: #888;
}

#playBtn {
    color: #888;
}

#recBtn.recording {
    color: #fff;
}

#stopBtn.active {
    color: #fff;
}

#playBtn.active {
    color: #fff;
}

.vm-done {
    flex: 1;
    height: 48px;
    border: none;
    background: linear-gradient(180deg, #fff 0%, #ebebeb 100%);
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    font-size: 22px;
    font-weight: 400;
    color: #333;
}

.vm-done:hover {
    background: linear-gradient(180deg, #fff 0%, #f4f4f4 100%);
}

.footer-btns {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 15px;
    padding: 0 10px;
}

.footer-btns .bottom-btn {
    color: #f0f0f0;
    font-size: 18px;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.footer-btns .btn-circle {
    width: 26px;
    height: 26px;
    font-size: 14px;
    border-width: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.status-text {
    font-size: 13px;
    color: #888;
    text-align: center;
    margin-top: 5px;
    min-height: 16px;
    position: absolute;
    bottom: -25px;
    left: 0;
    width: 100%;
    text-shadow: 1px 1px 2px #000;
}

.status-text.active {
    color: #fff;
    font-weight: 600;
}

.status-text.error {
    color: #ff6060;
}

/* Welcome/About popup */
.welcome-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
}

.welcome-overlay.show {
    display: flex;
}

.welcome-dialog {
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    animation: settingsIn 0.25s ease-out forwards;
}

.welcome-dialog.closing {
    animation: settingsOut 0.2s ease-in forwards;
}

.welcome-header {
    background: linear-gradient(180deg, #888 0%, #666 100%);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #555;
}

.welcome-header-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    line-height: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, #fff176 0%, #ffd800 40%, #d4b000 80%, #b89800 100%);
    border: 2px solid rgba(212, 176, 0, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(255, 255, 255, 0.4), inset 0 -1px 3px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-header-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.welcome-body {
    background: linear-gradient(180deg, #f0f0f0 0%, #e4e4e4 100%);
    padding: 24px 20px;
    min-height: 180px;
}

.welcome-body p {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 14px;
}

.welcome-body p:last-child {
    margin-bottom: 0;
}

.welcome-ok {
    display: block;
    width: 100%;
    padding: 12px;
    background: linear-gradient(180deg, #b8cc28 0%, #9aaf10 40%, #8a9e08 100%);
    border: none;
    font-family: 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    text-align: left;
    padding-left: 20px;
}

.welcome-ok:hover {
    background: linear-gradient(180deg, #c8dc38 0%, #aabf20 40%, #9aae18 100%);
}

/* Settings popup */
.settings-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 80;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
}

.settings-overlay.show {
    display: flex;
}

@keyframes settingsIn {
    0% {
        transform: scale(0.7);
        opacity: 0;
    }

    60% {
        transform: scale(1.02);
        opacity: 1;
    }

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

@keyframes settingsOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0.7);
        opacity: 0;
    }
}

.settings-dialog {
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    animation: settingsIn 0.25s ease-out forwards;
}

.settings-dialog.closing {
    animation: settingsOut 0.2s ease-in forwards;
}

.settings-header {
    background: linear-gradient(180deg, #888 0%, #666 100%);
    padding: 8px 14px;
    font-size: 15px;
    color: #fff;
    border-bottom: 1px solid #555;
}

.settings-tabs {
    display: flex;
    background: linear-gradient(180deg, #d0d0d0 0%, #c0c0c0 100%);
    border-bottom: 1px solid #aaa;
}

.settings-tab {
    flex: 1;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    text-align: center;
    border-right: 1px solid #aaa;
}

.settings-tab:last-child {
    border-right: none;
}

.settings-tab:hover {
    background: linear-gradient(180deg, #ddd 0%, #ccc 100%);
}

.settings-tab.active {
    background: linear-gradient(180deg, #e4e4e4 0%, #d6d6d6 100%);
    color: #333;
}

.settings-body {
    background: linear-gradient(180deg, #e4e4e4 0%, #d6d6d6 100%);
    padding: 20px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.setting-row label {
    font-size: 13px;
    color: #333;
    min-width: 90px;
}

.setting-row input[type="range"] {
    flex: 1;
    margin: 0 12px;
    accent-color: #7fba00;
}

.setting-row span {
    font-size: 12px;
    color: #666;
    min-width: 28px;
    text-align: right;
}

.settings-bottom {
    background: linear-gradient(180deg, #c8c8c8 0%, #bbb 100%);
    border-top: 1px solid #aaa;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Background options */
.bg-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #ccc;
}

.bg-option:last-child {
    border-bottom: none;
}

.bg-option:hover {
    background: rgba(127, 186, 0, 0.15);
}

.bg-preview {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    overflow: hidden;
}

.bg-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.bg-preview-black {
    border: 2px solid #999;
    background: #000;
}

.bg-option span {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.bg-check {
    font-size: 18px;
    font-weight: 700;
    color: #7fba00;
}

/* Video background */
.video-bg {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    z-index: -2;
}

.video-bg.active {
    display: block;
}

.video-bg-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.87);
    z-index: -1;
}

.video-bg-overlay.active {
    display: block;
}

/* Mobile */
@media (max-width: 600px) {
    .vm-text {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .page-dialog {
        width: 95vw;
        margin-top: 0;
    }

    .compose-body {
        flex-direction: column;
        min-height: auto;
    }

    .compose-left,
    .compose-right {
        width: 100%;
        border-right: none;
    }

    .compose-left {
        border-bottom: 1px solid #bbb;
    }

    .compose-menu-item {
        padding: 10px 14px;
        font-size: 14px;
    }

    .text-dialog {
        width: 95vw;
    }

    .kb-key {
        height: 32px;
        font-size: 13px;
    }

    .kb-side {
        width: 60px;
    }

    .kb-side-btn {
        font-size: 10px;
    }
}