@import url('/static/css/theme.css?v=9.0');

body {
    overflow: hidden;
    position: relative;
}

.overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.overlay.active {
    display: flex;
}

#screen-auth-overlay {
    background:
        radial-gradient(circle at 18% 20%, rgba(59, 130, 246, 0.18), transparent 45%),
        radial-gradient(circle at 82% 78%, rgba(168, 85, 247, 0.16), transparent 48%),
        radial-gradient(circle at 50% 50%, rgba(14, 165, 233, 0.08), transparent 60%),
        var(--bg-page);
}

.login-card, .settings-modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-md);
}

.settings-modal-card {
    max-width: 480px;
}

.login-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-card h2 {
    font-size: 18px;
    font-weight: 600;
}

.login-sub {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    text-align: left;
    line-height: 1.5;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.login-card input {
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 10px 12px;
    text-align: center;
    outline: none;
}

.login-card input:focus {
    border-color: var(--accent);
}

.login-card button {
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: var(--radius);
    padding: 10px;
    font-weight: 600;
    cursor: pointer;
}

.link-subtle {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
}

.error-msg {
    color: var(--danger);
    font-size: 13px;
    min-height: 18px;
}

/* Single Floating Settings Button */
.btn-floating-settings {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.2s;
    z-index: 120;
    box-shadow: var(--shadow-sm);
}

.btn-floating-settings:hover {
    opacity: 1;
    color: var(--text-primary);
}

/* Settings Modal */
.settings-modal-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.btn-icon-close {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.setting-row-col {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.setting-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.mode-toggle-group {
    display: inline-flex;
    gap: 4px;
    background: var(--bg-page);
    padding: 3px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.btn-ctrl-mode {
    padding: 5px 12px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
}

.btn-ctrl-mode.active {
    background: var(--accent);
    color: #ffffff;
}

.size-slider {
    width: 100%;
    accent-color: var(--accent);
    cursor: pointer;
}

.font-size-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.size-number-input {
    width: 64px;
    padding: 4px 6px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-page);
    color: var(--text-primary);
    font-size: 13px;
    text-align: center;
}

.wall-sort-select {
    padding: 6px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-page);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
}

.modal-actions-row {
    display: flex;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.btn-modal-action {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: var(--bg-page);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
}

.btn-modal-action.danger {
    color: var(--danger);
}

/* Minimal Clean Danmaku & Stream UI (Zero boxes/borders) */
#danmaku-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.danmaku {
    position: absolute;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
    font-size: var(--danmaku-font-size, 32px);
    font-weight: 600;
    will-change: transform;
    pointer-events: none;
}

.danmaku-nick {
    font-size: inherit;
    font-weight: 600;
}

.danmaku-content {
    font-size: inherit;
    color: var(--text-primary);
}

.animate-danmaku {
    animation-name: flyLeft;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

@keyframes flyLeft {
    from {
        transform: translateX(100vw);
    }
    to {
        transform: translateX(-120%);
    }
}

#chat-feed {
    position: absolute;
    inset: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding-bottom: 12px;
}

#chat-feed > :first-child {
    margin-top: auto;
}

.btn-scroll-bottom {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 60;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn-scroll-bottom:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.chat-message {
    display: block;
    max-width: 100%;
    font-size: var(--danmaku-font-size, 32px);
    font-weight: 500;
    line-height: 1.45;
    word-break: break-word;
    animation: slideUp 0.2s ease-out;
}

.chat-nick {
    font-size: inherit;
    font-weight: 600;
    margin-right: 8px;
}

.chat-content {
    font-size: inherit;
    word-break: break-word;
    color: var(--text-primary);
}

#chat-feed.is-song-wall {
    justify-content: center;
    align-items: center;
    gap: 14px;
}

#chat-feed.is-song-wall > :first-child {
    margin-top: 0;
}

.wall-song-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    max-width: min(760px, 100%);
    gap: 12px;
}

.wall-song-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 4px;
    font-size: var(--danmaku-font-size, 32px);
    line-height: 1.4;
    padding: 4px 0;
}

.wall-song-top {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 14px;
}

.wall-song-voters {
    font-size: 0.65em;
    color: var(--text-secondary);
}

.wall-song-votes {
    color: var(--accent);
    font-weight: 600;
    flex-shrink: 0;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.deleting {
    opacity: 0 !important;
    transition: opacity 0.2s;
}

.dm-emote {
    display: inline-block;
    height: 1.25em;
    width: auto;
    vertical-align: -0.22em;
    margin: 0 2px;
}

.src-tag-local {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px 6px;
    margin-right: 4px;
    border-radius: 4px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #ffffff;
    font-size: 0.72em;
    font-weight: 700;
    line-height: 1.25;
    vertical-align: 0.08em;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.35);
}

.src-tag-ext {
    opacity: 0.85;
}

.is-local-src {
    font-weight: 600;
}

.is-ext-src {
    opacity: 0.8;
}
