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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #f1f5f9;
    min-height: 100vh;
}

.app {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.app-header {
    text-align: center;
    margin-bottom: 28px;
}

.app-header h1 {
    font-size: 2.2rem;
}

.subtitle {
    color: #94a3b8;
    margin-top: 4px;
}

.stats-badge {
    display: inline-block;
    margin-top: 12px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
}

.app-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.input-panel, .player-panel {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 16px;
    padding: 20px;
}

.lang-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.lang-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s ease;
}

.lang-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.input-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#textInput {
    flex: 1;
    min-width: 200px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: #0f172a;
    color: white;
    font-size: 1rem;
}

.icon-btn, .primary-btn, .secondary-btn {
    padding: 12px 18px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
}

.icon-btn {
    background: #1e293b;
    color: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.icon-btn.listening {
    background: #ef4444;
    color: white;
}

.primary-btn {
    background: #3b82f6;
    color: white;
}

.primary-btn:hover {
    background: #2563eb;
}

.secondary-btn {
    background: transparent;
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.secondary-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.status {
    min-height: 24px;
    margin-top: 10px;
    font-size: 0.9rem;
}

.status.info { color: #93c5fd; }
.status.success { color: #4ade80; }
.status.error { color: #f87171; }

.phrase-chips {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.chip-label {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-right: 4px;
}

.phrase-chip {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    cursor: pointer;
}

.phrase-chip:hover {
    background: rgba(59, 130, 246, 0.25);
}

.video-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sign-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    pointer-events: none;
}

.sign-video.visible {
    opacity: 1;
}

.gloss-line {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
}

.gloss-line strong {
    color: #93c5fd;
    letter-spacing: 0.03em;
}

.signer-warning {
    margin-top: 8px;
    text-align: center;
    font-size: 0.8rem;
    color: #fbbf24;
}

.player-placeholder {
    text-align: center;
    color: #64748b;
}

.player-placeholder p:first-child {
    font-size: 3rem;
}

.pending-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
}

#pendingText {
    font-size: 1.4rem;
    font-weight: 600;
    text-transform: capitalize;
}

.pending-sub {
    color: #fbbf24;
    font-size: 0.9rem;
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
}

.progress-label {
    color: #94a3b8;
    font-size: 0.85rem;
}

.sequence-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.seq-item {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    text-transform: capitalize;
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #cbd5e1;
    cursor: pointer;
}

.seq-item.type-video {
    border-color: rgba(74, 222, 128, 0.4);
    color: #bbf7d0;
}

.seq-item.type-pending {
    border-color: rgba(251, 191, 36, 0.4);
    color: #fde68a;
}

.seq-item.type-unknown {
    border-color: rgba(148, 163, 184, 0.25);
    color: #94a3b8;
    font-style: italic;
}

.seq-item.active {
    outline: 2px solid #3b82f6;
}

.app-footer {
    text-align: center;
    margin-top: 40px;
    color: #64748b;
    font-size: 0.85rem;
}
